]> granicus.if.org Git - libass/commitdiff
cosmetic: fix codestyle
authorDr.Smile <vabnick@gmail.com>
Sat, 8 Apr 2017 17:57:42 +0000 (20:57 +0300)
committerDr.Smile <vabnick@gmail.com>
Mon, 31 Jul 2017 03:27:24 +0000 (06:27 +0300)
libass/ass_blur.c
libass/ass_outline.c
libass/ass_rasterizer.c
libass/ass_rasterizer_c.c

index 109c24d06cb2b8459db1a3a8b0c0a80dbda4adfa..aa0489b9a90f64d1f206eb0c66f762951f3bf109 100644 (file)
@@ -83,7 +83,7 @@ void ass_stripe_unpack_c(int16_t *dst, const uint8_t *src, ptrdiff_t src_stride,
         int16_t *ptr = dst;
         for (uintptr_t x = 0; x < width; x += STRIPE_WIDTH) {
             for (int k = 0; k < STRIPE_WIDTH; ++k)
-                ptr[k] = (uint16_t)(((src[x + k] << 7) | (src[x + k] >> 1)) + 1) >> 1;
+                ptr[k] = (uint16_t) (((src[x + k] << 7) | (src[x + k] >> 1)) + 1) >> 1;
                 //ptr[k] = (0x4000 * src[x + k] + 127) / 255;
             ptr += STRIPE_WIDTH * height;
         }
@@ -100,7 +100,7 @@ void ass_stripe_pack_c(uint8_t *dst, ptrdiff_t dst_stride, const int16_t *src,
         for (uintptr_t y = 0; y < height; ++y) {
             const int16_t *dither = dither_line + (y & 1) * STRIPE_WIDTH;
             for (int k = 0; k < STRIPE_WIDTH; ++k)
-                ptr[k] = (uint16_t)(src[k] - (src[k] >> 8) + dither[k]) >> 6;
+                ptr[k] = (uint16_t) (src[k] - (src[k] >> 8) + dither[k]) >> 6;
                 //ptr[k] = (255 * src[k] + 0x1FFF) / 0x4000;
             ptr += dst_stride;
             src += STRIPE_WIDTH;
@@ -197,9 +197,9 @@ static inline void expand_func(int16_t *rp, int16_t *rn,
     *rp = (5 * p1 + 10 * z0 + 1 * n1 + 8) >> 4;
     *rn = (1 * p1 + 10 * z0 + 5 * n1 + 8) >> 4;
     */
-    uint16_t r = (uint16_t)(((uint16_t)(p1 + n1) >> 1) + z0) >> 1;
-    *rp = (uint16_t)(((uint16_t)(r + p1) >> 1) + z0 + 1) >> 1;
-    *rn = (uint16_t)(((uint16_t)(r + n1) >> 1) + z0 + 1) >> 1;
+    uint16_t r = (uint16_t) (((uint16_t) (p1 + n1) >> 1) + z0) >> 1;
+    *rp = (uint16_t) (((uint16_t) (r + p1) >> 1) + z0 + 1) >> 1;
+    *rn = (uint16_t) (((uint16_t) (r + n1) >> 1) + z0 + 1) >> 1;
 }
 
 void ass_expand_horz_c(int16_t *dst, const int16_t *src,
@@ -275,7 +275,7 @@ static inline int16_t pre_blur1_func(int16_t p1, int16_t z0, int16_t n1)
     /*
     return (1 * p1 + 2 * z0 + 1 * n1 + 2) >> 2;
     */
-    return (uint16_t)(((uint16_t)(p1 + n1) >> 1) + z0 + 1) >> 1;
+    return (uint16_t) (((uint16_t) (p1 + n1) >> 1) + z0 + 1) >> 1;
 }
 
 void ass_pre_blur1_horz_c(int16_t *dst, const int16_t *src,
@@ -333,10 +333,10 @@ static inline int16_t pre_blur2_func(int16_t p2, int16_t p1, int16_t z0,
     /*
     return (1 * p2 + 4 * p1 + 6 * z0 + 4 * n1 + 1 * n2 + 8) >> 4;
     */
-    uint16_t r1 = ((uint16_t)(((uint16_t)(p2 + n2) >> 1) + z0) >> 1) + z0;
+    uint16_t r1 = ((uint16_t) (((uint16_t) (p2 + n2) >> 1) + z0) >> 1) + z0;
     uint16_t r2 = p1 + n1;
-    uint16_t r = ((uint16_t)(r1 + r2) >> 1) | (0x8000 & r1 & r2);
-    return (uint16_t)(r + 1) >> 1;
+    uint16_t r = ((uint16_t) (r1 + r2) >> 1) | (0x8000 & r1 & r2);
+    return (uint16_t) (r + 1) >> 1;
 }
 
 void ass_pre_blur2_horz_c(int16_t *dst, const int16_t *src,
@@ -396,10 +396,10 @@ static inline int16_t pre_blur3_func(int16_t p3, int16_t p2, int16_t p1, int16_t
     /*
     return (1 * p3 + 6 * p2 + 15 * p1 + 20 * z0 + 15 * n1 + 6 * n2 + 1 * n3 + 32) >> 6;
     */
-    return (20 * (uint16_t)z0 +
-            15 * (uint16_t)(p1 + n1) +
-             6 * (uint16_t)(p2 + n2) +
-             1 * (uint16_t)(p3 + n3) + 32) >> 6;
+    return (20 * (uint16_t) z0 +
+            15 * (uint16_t) (p1 + n1) +
+             6 * (uint16_t) (p2 + n2) +
+             1 * (uint16_t) (p3 + n3) + 32) >> 6;
 }
 
 void ass_pre_blur3_horz_c(int16_t *dst, const int16_t *src,
@@ -832,7 +832,7 @@ static void find_best_method(BlurMethod *blur, double r2)
     }
 
     for (int i = 1; i <= 4; ++i)
-        blur->coeff[i - 1] = (int)(0x10000 * mu[i] + 0.5);
+        blur->coeff[i - 1] = (int) (0x10000 * mu[i] + 0.5);
 }
 
 /**
index 60bb7ee096f0266454fcea3a698fa380315b0868..e8c5e537092651287de06f49d0e56ed155396042 100644 (file)
@@ -234,8 +234,8 @@ static inline double vec_len(Vector vec)
 static bool emit_point(StrokerState *str, OutlinePoint pt,
                        Vector offs, char tag, int dir)
 {
-    int32_t dx = (int32_t)(str->xbord * offs.x);
-    int32_t dy = (int32_t)(str->ybord * offs.y);
+    int32_t dx = (int32_t) (str->xbord * offs.x);
+    int32_t dy = (int32_t) (str->ybord * offs.y);
 
     if (dir & 1) {
         FT_Vector res = { pt.x + dx, pt.y + dy };
@@ -255,8 +255,8 @@ static bool emit_point(StrokerState *str, OutlinePoint pt,
 static void fix_first_point(StrokerState *str, OutlinePoint pt,
                             Vector offs, int dir)
 {
-    int32_t dx = (int32_t)(str->xbord * offs.x);
-    int32_t dy = (int32_t)(str->ybord * offs.y);
+    int32_t dx = (int32_t) (str->xbord * offs.x);
+    int32_t dy = (int32_t) (str->ybord * offs.y);
 
     if (dir & 1) {
         FT_Vector res = { pt.x + dx, pt.y + dy };
@@ -998,7 +998,7 @@ bool outline_stroke(ASS_Outline *result, ASS_Outline *result1,
     str.eps = eps;
 
     str.contour_start = true;
-    double rel_err = (double)eps / rad;
+    double rel_err = (double) eps / rad;
     str.merge_cos = 1 - rel_err;
     double e = sqrt(2 * rel_err);
     str.split_cos = 1 + 8 * rel_err - 4 * (1 + rel_err) * e;
index 41cb075449f86b91ff7997f6ecf2545f5e84a193..735627c90ba103883fb05af09dcef447d890365c 100644 (file)
@@ -42,7 +42,7 @@ static inline int ilog2(uint32_t n)
 #else
     int res = 0;
     for (int ord = 16; ord; ord /= 2)
-        if (n >= ((uint32_t)1 << ord)) {
+        if (n >= ((uint32_t) 1 << ord)) {
             res += ord;
             n >>= ord;
         }
@@ -82,7 +82,7 @@ static inline bool check_capacity(RasterizerData *rst, int index, size_t delta)
     if (!ptr)
         return false;
 
-    rst->linebuf[index] = (struct segment *)ptr;
+    rst->linebuf[index] = (struct segment *) ptr;
     rst->capacity[index] = capacity;
     return true;
 }
@@ -138,8 +138,8 @@ static inline void segment_init(OutlineSegment *seg,
 
     seg->r.x = x;
     seg->r.y = y;
-    seg->r2 = x * (int64_t)x + y * (int64_t)y;
-    seg->er = outline_error * (int64_t)FFMAX(abs_x, abs_y);
+    seg->r2 = x * (int64_t) x + y * (int64_t) y;
+    seg->er = outline_error * (int64_t) FFMAX(abs_x, abs_y);
 }
 
 static inline bool segment_subdivide(const OutlineSegment *seg,
@@ -147,8 +147,8 @@ static inline bool segment_subdivide(const OutlineSegment *seg,
 {
     int32_t x = pt.x - beg.x;
     int32_t y = pt.y - beg.y;
-    int64_t pdr = seg->r.x * (int64_t)x + seg->r.y * (int64_t)y;
-    int64_t pcr = seg->r.x * (int64_t)y - seg->r.y * (int64_t)x;
+    int64_t pdr = seg->r.x * (int64_t) x + seg->r.y * (int64_t) y;
+    int64_t pcr = seg->r.x * (int64_t) y - seg->r.y * (int64_t) x;
     return pdr < -seg->er || pdr > seg->r2 + seg->er ||
         (pcr < 0 ? -pcr : pcr) > seg->er;
 }
@@ -182,7 +182,7 @@ static bool add_line(RasterizerData *rst, OutlinePoint pt0, OutlinePoint pt1)
 
     line->a = y;
     line->b = -x;
-    line->c = y * (int64_t)pt0.x - x * (int64_t)pt0.y;
+    line->c = y * (int64_t) pt0.x - x * (int64_t) pt0.y;
 
     // halfplane normalization
     int32_t abs_x = x < 0 ? -x : x;
@@ -193,9 +193,9 @@ static bool add_line(RasterizerData *rst, OutlinePoint pt0, OutlinePoint pt1)
     line->a *= 1 << shift;
     line->b *= 1 << shift;
     line->c *= 1 << shift;
-    line->scale = (uint64_t)0x53333333 * (uint32_t)(max_ab * (uint64_t)max_ab >> 32) >> 32;
-    line->scale += 0x8810624D - (0xBBC6A7EF * (uint64_t)max_ab >> 32);
-    //line->scale = ((uint64_t)1 << 61) / max_ab;
+    line->scale = (uint64_t) 0x53333333 * (uint32_t) (max_ab * (uint64_t) max_ab >> 32) >> 32;
+    line->scale += 0x8810624D - (0xBBC6A7EF * (uint64_t) max_ab >> 32);
+    //line->scale = ((uint64_t) 1 << 61) / max_ab;
     return true;
 }
 
@@ -457,7 +457,7 @@ static void segment_move_x(struct segment *line, int32_t x)
     line->x_min -= x;
     line->x_max -= x;
     line->x_min = FFMAX(line->x_min, 0);
-    line->c -= line->a * (int64_t)x;
+    line->c -= line->a * (int64_t) x;
 
     static const int test = SEGFLAG_EXACT_LEFT | SEGFLAG_UL_DR;
     if (!line->x_min && (line->flags & test) == test)
@@ -469,7 +469,7 @@ static void segment_move_y(struct segment *line, int32_t y)
     line->y_min -= y;
     line->y_max -= y;
     line->y_min = FFMAX(line->y_min, 0);
-    line->c -= line->b * (int64_t)y;
+    line->c -= line->b * (int64_t) y;
 
     static const int test = SEGFLAG_EXACT_TOP | SEGFLAG_UL_DR;
     if (!line->y_min && (line->flags & test) == test)
@@ -481,7 +481,7 @@ static void segment_split_horz(struct segment *line, struct segment *next, int32
     assert(x > line->x_min && x < line->x_max);
 
     *next = *line;
-    next->c -= line->a * (int64_t)x;
+    next->c -= line->a * (int64_t) x;
     next->x_min = 0;
     next->x_max -= x;
     line->x_max = x;
@@ -502,7 +502,7 @@ static void segment_split_vert(struct segment *line, struct segment *next, int32
     assert(y > line->y_min && y < line->y_max);
 
     *next = *line;
-    next->c -= line->b * (int64_t)y;
+    next->c -= line->b * (int64_t) y;
     next->y_min = 0;
     next->y_max -= y;
     line->y_max = y;
@@ -522,8 +522,8 @@ static inline int segment_check_left(const struct segment *line, int32_t x)
 {
     if (line->flags & SEGFLAG_EXACT_LEFT)
         return line->x_min >= x;
-    int64_t cc = line->c - line->a * (int64_t)x -
-        line->b * (int64_t)(line->flags & SEGFLAG_UL_DR ? line->y_min : line->y_max);
+    int64_t cc = line->c - line->a * (int64_t) x -
+        line->b * (int64_t) (line->flags & SEGFLAG_UL_DR ? line->y_min : line->y_max);
     if (line->a < 0)
         cc = -cc;
     return cc >= 0;
@@ -533,8 +533,8 @@ static inline int segment_check_right(const struct segment *line, int32_t x)
 {
     if (line->flags & SEGFLAG_EXACT_RIGHT)
         return line->x_max <= x;
-    int64_t cc = line->c - line->a * (int64_t)x -
-        line->b * (int64_t)(line->flags & SEGFLAG_UL_DR ? line->y_max : line->y_min);
+    int64_t cc = line->c - line->a * (int64_t) x -
+        line->b * (int64_t) (line->flags & SEGFLAG_UL_DR ? line->y_max : line->y_min);
     if (line->a > 0)
         cc = -cc;
     return cc >= 0;
@@ -544,8 +544,8 @@ static inline int segment_check_top(const struct segment *line, int32_t y)
 {
     if (line->flags & SEGFLAG_EXACT_TOP)
         return line->y_min >= y;
-    int64_t cc = line->c - line->b * (int64_t)y -
-        line->a * (int64_t)(line->flags & SEGFLAG_UL_DR ? line->x_min : line->x_max);
+    int64_t cc = line->c - line->b * (int64_t) y -
+        line->a * (int64_t) (line->flags & SEGFLAG_UL_DR ? line->x_min : line->x_max);
     if (line->b < 0)
         cc = -cc;
     return cc >= 0;
@@ -555,8 +555,8 @@ static inline int segment_check_bottom(const struct segment *line, int32_t y)
 {
     if (line->flags & SEGFLAG_EXACT_BOTTOM)
         return line->y_max <= y;
-    int64_t cc = line->c - line->b * (int64_t)y -
-        line->a * (int64_t)(line->flags & SEGFLAG_UL_DR ? line->x_max : line->x_min);
+    int64_t cc = line->c - line->b * (int64_t) y -
+        line->a * (int64_t) (line->flags & SEGFLAG_UL_DR ? line->x_max : line->x_min);
     if (line->b > 0)
         cc = -cc;
     return cc >= 0;
@@ -692,8 +692,8 @@ static inline void rasterizer_fill_halfplane(const BitmapEngine *engine,
 
     uint32_t abs_a = a < 0 ? -a : a;
     uint32_t abs_b = b < 0 ? -b : b;
-    int64_t size = (int64_t)(abs_a + abs_b) << (engine->tile_order + 5);
-    int64_t offs = ((int64_t)a + b) * (1 << (engine->tile_order + 5));
+    int64_t size = (int64_t) (abs_a + abs_b) << (engine->tile_order + 5);
+    int64_t offs = ((int64_t) a + b) * (1 << (engine->tile_order + 5));
 
     ptrdiff_t step = 1 << engine->tile_order;
     ptrdiff_t tile_stride = stride * (1 << engine->tile_order);
@@ -701,14 +701,14 @@ static inline void rasterizer_fill_halfplane(const BitmapEngine *engine,
     height >>= engine->tile_order;
     for (int y = 0; y < height; y++) {
         for (int x = 0; x < width; x++) {
-            int64_t cc = c - (a * (int64_t)x + b * (int64_t)y) * (1 << (engine->tile_order + 6));
+            int64_t cc = c - (a * (int64_t) x + b * (int64_t) y) * (1 << (engine->tile_order + 6));
             int64_t offs_c = offs - cc;
             int64_t abs_c = offs_c < 0 ? -offs_c : offs_c;
             if (abs_c < size)
                 engine->fill_halfplane(buf + x * step, stride, a, b, cc, scale);
             else
                 engine->fill_solid(buf + x * step, stride,
-                                   ((uint32_t)(offs_c >> 32) ^ scale) & 0x80000000);
+                                   ((uint32_t) (offs_c >> 32) ^ scale) & 0x80000000);
         }
         buf += tile_stride;
     }
@@ -756,7 +756,7 @@ static bool rasterizer_fill_level(const BitmapEngine *engine, RasterizerData *rs
                                   int index, const size_t n_lines[2], const int winding[2])
 {
     assert(width > 0 && height > 0);
-    assert((unsigned)index < 2u && n_lines[0] + n_lines[1] <= rst->size[index]);
+    assert((unsigned) index < 2u && n_lines[0] + n_lines[1] <= rst->size[index]);
     assert(!(width  & ((1 << engine->tile_order) - 1)));
     assert(!(height & ((1 << engine->tile_order) - 1)));
 
@@ -823,14 +823,14 @@ static bool rasterizer_fill_level(const BitmapEngine *engine, RasterizerData *rs
         buf1 += width;
         polyline_split_horz(line, n_lines,
                             dst0, n_next0, dst1, n_next1,
-                            winding1, (int32_t)width << 6);
+                            winding1, (int32_t) width << 6);
     } else {
         height = 1 << ilog2(height - 1);
         height1 -= height;
         buf1 += height * stride;
         polyline_split_vert(line, n_lines,
                             dst0, n_next0, dst1, n_next1,
-                            winding1, (int32_t)height << 6);
+                            winding1, (int32_t) height << 6);
     }
     rst->size[index ^ 0] = offs  + n_next0[0] + n_next0[1];
     rst->size[index ^ 1] = offs1 + n_next1[0] + n_next1[1];
@@ -860,7 +860,7 @@ bool rasterizer_fill(const BitmapEngine *engine, RasterizerData *rst,
         line->x_max -= x0;
         line->y_min -= y0;
         line->y_max -= y0;
-        line->c -= line->a * (int64_t)x0 + line->b * (int64_t)y0;
+        line->c -= line->a * (int64_t) x0 + line->b * (int64_t) y0;
     }
     rst->x_min -= x0;
     rst->x_max -= x0;
@@ -874,8 +874,8 @@ bool rasterizer_fill(const BitmapEngine *engine, RasterizerData *rst,
     size_t n_lines[2] = { rst->n_first, rst->size[0] - rst->n_first };
     int winding[2] = { 0, 0 };
 
-    int32_t size_x = (int32_t)width << 6;
-    int32_t size_y = (int32_t)height << 6;
+    int32_t size_x = (int32_t) width << 6;
+    int32_t size_y = (int32_t) height << 6;
     if (rst->x_max >= size_x) {
         polyline_split_horz(rst->linebuf[0], n_lines,
                             rst->linebuf[0], n_lines,
index 832d266dd7a2cecac710f9d9a35b53efc3c32393..99cea6f9bec0970978b1e7f7849040ea81ab2e25 100644 (file)
@@ -71,9 +71,9 @@ void ass_fill_solid_tile32_c(uint8_t *buf, ptrdiff_t stride, int set)
 void ass_fill_halfplane_tile16_c(uint8_t *buf, ptrdiff_t stride,
                                  int32_t a, int32_t b, int64_t c, int32_t scale)
 {
-    int16_t aa = (a * (int64_t)scale + ((int64_t)1 << 49)) >> 50;
-    int16_t bb = (b * (int64_t)scale + ((int64_t)1 << 49)) >> 50;
-    int16_t cc = ((int32_t)(c >> 11) * (int64_t)scale + ((int64_t)1 << 44)) >> 45;
+    int16_t aa = (a * (int64_t) scale + ((int64_t) 1 << 49)) >> 50;
+    int16_t bb = (b * (int64_t) scale + ((int64_t) 1 << 49)) >> 50;
+    int16_t cc = ((int32_t) (c >> 11) * (int64_t) scale + ((int64_t) 1 << 44)) >> 45;
     cc += (1 << 9) - ((aa + bb) >> 1);
 
     int16_t abs_a = aa < 0 ? -aa : aa;
@@ -103,9 +103,9 @@ void ass_fill_halfplane_tile16_c(uint8_t *buf, ptrdiff_t stride,
 void ass_fill_halfplane_tile32_c(uint8_t *buf, ptrdiff_t stride,
                                  int32_t a, int32_t b, int64_t c, int32_t scale)
 {
-    int16_t aa = (a * (int64_t)scale + ((int64_t)1 << 50)) >> 51;
-    int16_t bb = (b * (int64_t)scale + ((int64_t)1 << 50)) >> 51;
-    int16_t cc = ((int32_t)(c >> 12) * (int64_t)scale + ((int64_t)1 << 44)) >> 45;
+    int16_t aa = (a * (int64_t) scale + ((int64_t) 1 << 50)) >> 51;
+    int16_t bb = (b * (int64_t) scale + ((int64_t) 1 << 50)) >> 51;
+    int16_t cc = ((int32_t) (c >> 12) * (int64_t) scale + ((int64_t) 1 << 44)) >> 45;
     cc += (1 << 8) - ((aa + bb) >> 1);
 
     int16_t abs_a = aa < 0 ? -aa : aa;
@@ -152,16 +152,16 @@ static inline void update_border_line16(int16_t res[16],
     int16_t w = (1 << 10) + (size << 4) - abs_a;
     w = FFMIN(w, 1 << 10) << 3;
 
-    int16_t dc_b = abs_b * (int32_t)size >> 6;
+    int16_t dc_b = abs_b * (int32_t) size >> 6;
     int16_t dc = (FFMIN(abs_a, dc_b) + 2) >> 2;
 
-    int16_t base = (int32_t)b * (int16_t)(up + dn) >> 7;
-    int16_t offs1 = size - ((base + dc) * (int32_t)w >> 16);
-    int16_t offs2 = size - ((base - dc) * (int32_t)w >> 16);
+    int16_t base = (int32_t) b * (int16_t) (up + dn) >> 7;
+    int16_t offs1 = size - ((base + dc) * (int32_t) w >> 16);
+    int16_t offs2 = size - ((base - dc) * (int32_t) w >> 16);
 
     size <<= 1;
     for (int x = 0; x < 16; x++) {
-        int16_t cw = (c - va[x]) * (int32_t)w >> 16;
+        int16_t cw = (c - va[x]) * (int32_t) w >> 16;
         int16_t c1 = cw + offs1;
         int16_t c2 = cw + offs2;
         c1 = FFMINMAX(c1, 0, size);
@@ -190,7 +190,7 @@ void ass_fill_generic_tile16_c(uint8_t *buf, ptrdiff_t stride,
 
         int16_t up_delta = line->flags & SEGFLAG_DN ? 4 : 0;
         int16_t dn_delta = up_delta;
-        if (!line->x_min && (line->flags & SEGFLAG_EXACT_LEFT))dn_delta ^= 4;
+        if (!line->x_min && (line->flags & SEGFLAG_EXACT_LEFT)) dn_delta ^= 4;
         if (line->flags & SEGFLAG_UL_DR) {
             int16_t tmp = up_delta;
             up_delta = dn_delta;
@@ -209,9 +209,9 @@ void ass_fill_generic_tile16_c(uint8_t *buf, ptrdiff_t stride,
         if (line->y_min == line->y_max)
             continue;
 
-        int16_t a = (line->a * (int64_t)line->scale + ((int64_t)1 << 49)) >> 50;
-        int16_t b = (line->b * (int64_t)line->scale + ((int64_t)1 << 49)) >> 50;
-        int16_t c = ((int32_t)(line->c >> 11) * (int64_t)line->scale + ((int64_t)1 << 44)) >> 45;
+        int16_t a = (line->a * (int64_t) line->scale + ((int64_t) 1 << 49)) >> 50;
+        int16_t b = (line->b * (int64_t) line->scale + ((int64_t) 1 << 49)) >> 50;
+        int16_t c = ((int32_t) (line->c >> 11) * (int64_t) line->scale + ((int64_t) 1 << 44)) >> 45;
         c -= (a >> 1) + b * up;
 
         int16_t va[16];
@@ -269,16 +269,16 @@ static inline void update_border_line32(int16_t res[32],
     int16_t w = (1 << 9) + (size << 3) - abs_a;
     w = FFMIN(w, 1 << 9) << 5;
 
-    int16_t dc_b = abs_b * (int32_t)size >> 6;
+    int16_t dc_b = abs_b * (int32_t) size >> 6;
     int16_t dc = (FFMIN(abs_a, dc_b) + 2) >> 2;
 
-    int16_t base = (int32_t)b * (int16_t)(up + dn) >> 7;
-    int16_t offs1 = size - ((base + dc) * (int32_t)w >> 16);
-    int16_t offs2 = size - ((base - dc) * (int32_t)w >> 16);
+    int16_t base = (int32_t) b * (int16_t) (up + dn) >> 7;
+    int16_t offs1 = size - ((base + dc) * (int32_t) w >> 16);
+    int16_t offs2 = size - ((base - dc) * (int32_t) w >> 16);
 
     size <<= 1;
     for (int x = 0; x < 32; x++) {
-        int16_t cw = (c - va[x]) * (int32_t)w >> 16;
+        int16_t cw = (c - va[x]) * (int32_t) w >> 16;
         int16_t c1 = cw + offs1;
         int16_t c2 = cw + offs2;
         c1 = FFMINMAX(c1, 0, size);
@@ -307,7 +307,7 @@ void ass_fill_generic_tile32_c(uint8_t *buf, ptrdiff_t stride,
 
         int16_t up_delta = line->flags & SEGFLAG_DN ? 4 : 0;
         int16_t dn_delta = up_delta;
-        if (!line->x_min && (line->flags & SEGFLAG_EXACT_LEFT))dn_delta ^= 4;
+        if (!line->x_min && (line->flags & SEGFLAG_EXACT_LEFT)) dn_delta ^= 4;
         if (line->flags & SEGFLAG_UL_DR) {
             int16_t tmp = up_delta;
             up_delta = dn_delta;
@@ -326,9 +326,9 @@ void ass_fill_generic_tile32_c(uint8_t *buf, ptrdiff_t stride,
         if (line->y_min == line->y_max)
             continue;
 
-        int16_t a = (line->a * (int64_t)line->scale + ((int64_t)1 << 50)) >> 51;
-        int16_t b = (line->b * (int64_t)line->scale + ((int64_t)1 << 50)) >> 51;
-        int16_t c = ((int32_t)(line->c >> 12) * (int64_t)line->scale + ((int64_t)1 << 44)) >> 45;
+        int16_t a = (line->a * (int64_t) line->scale + ((int64_t) 1 << 50)) >> 51;
+        int16_t b = (line->b * (int64_t) line->scale + ((int64_t) 1 << 50)) >> 51;
+        int16_t c = ((int32_t) (line->c >> 12) * (int64_t) line->scale + ((int64_t) 1 << 44)) >> 45;
         c -= (a >> 1) + b * up;
 
         int16_t va[32];