History

avfilter/drawutils: narrow variable scopes

Marvin Scholz committed 2 years ago

Commit 0ea83e61 parent d0bcf621 file · +39 −46Browse files

Unified · Split

libavfilter/drawutils.c+39−46
@@ -48,8 +48,7 @@ static int fill_map(const AVPixFmtDescriptor *desc, uint8_t *map) · 47 unmodified lines
48 } else {48 } else {
49 int had0 = 0;49 int had0 = 0;
50 unsigned depthb = 0;50 unsigned depthb = 0;
51 unsigned i;51 for (unsigned i = 0; i < desc->nb_components; i++) {
52 for (i = 0; i < desc->nb_components; i++) {
53 /* all components must have same depth in bytes */52 /* all components must have same depth in bytes */
54 unsigned db = (desc->comp[i].depth + 7) / 8;53 unsigned db = (desc->comp[i].depth + 7) / 8;
55 unsigned pos = desc->comp[i].offset / db;54 unsigned pos = desc->comp[i].offset / db;
@@ -100,7 +99,7 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp · 44 unmodified lines
100 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);99 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
101 const AVLumaCoefficients *luma = NULL;100 const AVLumaCoefficients *luma = NULL;
102 const AVComponentDescriptor *c;101 const AVComponentDescriptor *c;
103 unsigned i, nb_planes = 0;102 unsigned nb_planes = 0;
104 int pixelstep[MAX_PLANES] = { 0 };103 int pixelstep[MAX_PLANES] = { 0 };
105 int depthb = 0;104 int depthb = 0;
106 105
@@ -121,7 +120,7 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp · 14 unmodified lines
121 ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;120 ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
122 if (range != AVCOL_RANGE_JPEG && range != AVCOL_RANGE_MPEG)121 if (range != AVCOL_RANGE_JPEG && range != AVCOL_RANGE_MPEG)
123 return AVERROR(EINVAL);122 return AVERROR(EINVAL);
124 for (i = 0; i < desc->nb_components; i++) {123 for (unsigned i = 0; i < desc->nb_components; i++) {
125 int db;124 int db;
126 c = &desc->comp[i];125 c = &desc->comp[i];
127 /* for now, only 8-16 bits formats */126 /* for now, only 8-16 bits formats */
@@ -172,7 +171,6 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) · 44 unmodified lines
172 171
173void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])172void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
174{173{
175 unsigned i;
176 double yuvad[4];174 double yuvad[4];
177 double rgbad[4];175 double rgbad[4];
178 const AVPixFmtDescriptor *desc = draw->desc;176 const AVPixFmtDescriptor *desc = draw->desc;
@@ -206,7 +204,7 @@ void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4 · 27 unmodified lines
206 if (desc->nb_components <= 2)204 if (desc->nb_components <= 2)
207 yuvad[1] = yuvad[3];205 yuvad[1] = yuvad[3];
208 206
209 for (i = 0; i < desc->nb_components; i++) {207 for (unsigned i = 0; i < desc->nb_components; i++) {
210 unsigned val = yuvad[i] * ((1 << (draw->desc->comp[i].depth + draw->desc->comp[i].shift)) - 1) + 0.5;208 unsigned val = yuvad[i] * ((1 << (draw->desc->comp[i].depth + draw->desc->comp[i].shift)) - 1) + 0.5;
211 if (desc->comp[i].depth > 8)209 if (desc->comp[i].depth > 8)
212 color->comp[desc->comp[i].plane].u16[desc->comp[i].offset / 2] = val;210 color->comp[desc->comp[i].plane].u16[desc->comp[i].offset / 2] = val;
@@ -229,15 +227,15 @@ void ff_copy_rectangle2(FFDrawContext *draw, · 16 unmodified lines
229 int dst_x, int dst_y, int src_x, int src_y,227 int dst_x, int dst_y, int src_x, int src_y,
230 int w, int h)228 int w, int h)
231{229{
232 int plane, y, wp, hp;230 int wp, hp;
233 uint8_t *p, *q;231 uint8_t *p, *q;
234 232
235 for (plane = 0; plane < draw->nb_planes; plane++) {233 for (int plane = 0; plane < draw->nb_planes; plane++) {
236 p = pointer_at(draw, src, src_linesize, plane, src_x, src_y);234 p = pointer_at(draw, src, src_linesize, plane, src_x, src_y);
237 q = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);235 q = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);
238 wp = AV_CEIL_RSHIFT(w, draw->hsub[plane]) * draw->pixelstep[plane];236 wp = AV_CEIL_RSHIFT(w, draw->hsub[plane]) * draw->pixelstep[plane];
239 hp = AV_CEIL_RSHIFT(h, draw->vsub[plane]);237 hp = AV_CEIL_RSHIFT(h, draw->vsub[plane]);
240 for (y = 0; y < hp; y++) {238 for (int y = 0; y < hp; y++) {
241 memcpy(q, p, wp);239 memcpy(q, p, wp);
242 p += src_linesize[plane];240 p += src_linesize[plane];
243 q += dst_linesize[plane];241 q += dst_linesize[plane];
@@ -249,11 +247,11 @@ void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color, · 5 unmodified lines
249 uint8_t *dst[], int dst_linesize[],247 uint8_t *dst[], int dst_linesize[],
250 int dst_x, int dst_y, int w, int h)248 int dst_x, int dst_y, int w, int h)
251{249{
252 int plane, x, y, wp, hp;250 int wp, hp;
253 uint8_t *p0, *p;251 uint8_t *p0, *p;
254 FFDrawColor color_tmp = *color;252 FFDrawColor color_tmp = *color;
255 253
256 for (plane = 0; plane < draw->nb_planes; plane++) {254 for (int plane = 0; plane < draw->nb_planes; plane++) {
257 p0 = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);255 p0 = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);
258 wp = AV_CEIL_RSHIFT(w, draw->hsub[plane]);256 wp = AV_CEIL_RSHIFT(w, draw->hsub[plane]);
259 hp = AV_CEIL_RSHIFT(h, draw->vsub[plane]);257 hp = AV_CEIL_RSHIFT(h, draw->vsub[plane]);
@@ -262,19 +260,19 @@ void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color, · 2 unmodified lines
262 p = p0;260 p = p0;
263 261
264 if (HAVE_BIGENDIAN && draw->desc->comp[0].depth > 8) {262 if (HAVE_BIGENDIAN && draw->desc->comp[0].depth > 8) {
265 for (x = 0; 2*x < draw->pixelstep[plane]; x++)263 for (int x = 0; 2*x < draw->pixelstep[plane]; x++)
266 color_tmp.comp[plane].u16[x] = av_bswap16(color_tmp.comp[plane].u16[x]);264 color_tmp.comp[plane].u16[x] = av_bswap16(color_tmp.comp[plane].u16[x]);
267 }265 }
268 266
269 /* copy first line from color */267 /* copy first line from color */
270 for (x = 0; x < wp; x++) {268 for (int x = 0; x < wp; x++) {
271 memcpy(p, color_tmp.comp[plane].u8, draw->pixelstep[plane]);269 memcpy(p, color_tmp.comp[plane].u8, draw->pixelstep[plane]);
272 p += draw->pixelstep[plane];270 p += draw->pixelstep[plane];
273 }271 }
274 wp *= draw->pixelstep[plane];272 wp *= draw->pixelstep[plane];
275 /* copy next lines from first line */273 /* copy next lines from first line */
276 p = p0 + dst_linesize[plane];274 p = p0 + dst_linesize[plane];
277 for (y = 1; y < hp; y++) {275 for (int y = 1; y < hp; y++) {
278 memcpy(p, p0, wp);276 memcpy(p, p0, wp);
279 p += dst_linesize[plane];277 p += dst_linesize[plane];
280 }278 }
@@ -325,14 +323,13 @@ static void blend_line(uint8_t *dst, unsigned src, unsigned alpha, · 44 unmodified lines
325{323{
326 unsigned asrc = alpha * src;324 unsigned asrc = alpha * src;
327 unsigned tau = 0x1010101 - alpha;325 unsigned tau = 0x1010101 - alpha;
328 int x;
329 326
330 if (left) {327 if (left) {
331 unsigned suba = (left * alpha) >> hsub;328 unsigned suba = (left * alpha) >> hsub;
332 *dst = (*dst * (0x1010101 - suba) + src * suba) >> 24;329 *dst = (*dst * (0x1010101 - suba) + src * suba) >> 24;
333 dst += dx;330 dst += dx;
334 }331 }
335 for (x = 0; x < w; x++) {332 for (int x = 0; x < w; x++) {
336 *dst = (*dst * tau + asrc) >> 24;333 *dst = (*dst * tau + asrc) >> 24;
337 dst += dx;334 dst += dx;
338 }335 }
@@ -347,7 +344,6 @@ static void blend_line16(uint8_t *dst, unsigned src, unsigned alpha, · 8 unmodified lines
347{344{
348 unsigned asrc = alpha * src;345 unsigned asrc = alpha * src;
349 unsigned tau = 0x10001 - alpha;346 unsigned tau = 0x10001 - alpha;
350 int x;
351 347
352 if (left) {348 if (left) {
353 unsigned suba = (left * alpha) >> hsub;349 unsigned suba = (left * alpha) >> hsub;
@@ -355,7 +351,7 @@ static void blend_line16(uint8_t *dst, unsigned src, unsigned alpha, · 1 unmodified line
355 AV_WL16(dst, (value * (0x10001 - suba) + src * suba) >> 16);351 AV_WL16(dst, (value * (0x10001 - suba) + src * suba) >> 16);
356 dst += dx;352 dst += dx;
357 }353 }
358 for (x = 0; x < w; x++) {354 for (int x = 0; x < w; x++) {
359 uint16_t value = AV_RL16(dst);355 uint16_t value = AV_RL16(dst);
360 AV_WL16(dst, (value * tau + asrc) >> 16);356 AV_WL16(dst, (value * tau + asrc) >> 16);
361 dst += dx;357 dst += dx;
@@ -372,8 +368,8 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, · 10 unmodified lines
372 int dst_w, int dst_h,368 int dst_w, int dst_h,
373 int x0, int y0, int w, int h)369 int x0, int y0, int w, int h)
374{370{
375 unsigned alpha, nb_planes, nb_comp, plane, comp;371 unsigned alpha, nb_planes, nb_comp;
376 int w_sub, h_sub, x_sub, y_sub, left, right, top, bottom, y;372 int w_sub, h_sub, x_sub, y_sub, left, right, top, bottom;
377 uint8_t *p0, *p;373 uint8_t *p0, *p;
378 374
379 nb_comp = draw->desc->nb_components -375 nb_comp = draw->desc->nb_components -
@@ -393,7 +389,7 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, · 13 unmodified lines
393 }389 }
394 nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));390 nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));
395 nb_planes += !nb_planes;391 nb_planes += !nb_planes;
396 for (plane = 0; plane < nb_planes; plane++) {392 for (unsigned plane = 0; plane < nb_planes; plane++) {
397 p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);393 p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
398 w_sub = w;394 w_sub = w;
399 h_sub = h;395 h_sub = h;
@@ -401,7 +397,7 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, · 1 unmodified line
401 y_sub = y0;397 y_sub = y0;
402 subsampling_bounds(draw->hsub[plane], &x_sub, &w_sub, &left, &right);398 subsampling_bounds(draw->hsub[plane], &x_sub, &w_sub, &left, &right);
403 subsampling_bounds(draw->vsub[plane], &y_sub, &h_sub, &top, &bottom);399 subsampling_bounds(draw->vsub[plane], &y_sub, &h_sub, &top, &bottom);
404 for (comp = 0; comp < nb_comp; comp++) {400 for (unsigned comp = 0; comp < nb_comp; comp++) {
405 const int depth = draw->desc->comp[comp].depth;401 const int depth = draw->desc->comp[comp].depth;
406 const int offset = draw->desc->comp[comp].offset;402 const int offset = draw->desc->comp[comp].offset;
407 const int index = offset / ((depth + 7) / 8);403 const int index = offset / ((depth + 7) / 8);
@@ -422,14 +418,14 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, · 14 unmodified lines
422 p += dst_linesize[plane];418 p += dst_linesize[plane];
423 }419 }
424 if (depth <= 8) {420 if (depth <= 8) {
425 for (y = 0; y < h_sub; y++) {421 for (int y = 0; y < h_sub; y++) {
426 blend_line(p, color->comp[plane].u8[index], alpha,422 blend_line(p, color->comp[plane].u8[index], alpha,
427 draw->pixelstep[plane], w_sub,423 draw->pixelstep[plane], w_sub,
428 draw->hsub[plane], left, right);424 draw->hsub[plane], left, right);
429 p += dst_linesize[plane];425 p += dst_linesize[plane];
430 }426 }
431 } else {427 } else {
432 for (y = 0; y < h_sub; y++) {428 for (int y = 0; y < h_sub; y++) {
433 blend_line16(p, color->comp[plane].u16[index], alpha,429 blend_line16(p, color->comp[plane].u16[index], alpha,
434 draw->pixelstep[plane], w_sub,430 draw->pixelstep[plane], w_sub,
435 draw->hsub[plane], left, right);431 draw->hsub[plane], left, right);
@@ -455,16 +451,16 @@ static void blend_pixel16(uint8_t *dst, unsigned src, unsigned alpha, · 19 unmodified lines
455 const uint8_t *mask, int mask_linesize, int l2depth,451 const uint8_t *mask, int mask_linesize, int l2depth,
456 unsigned w, unsigned h, unsigned shift, unsigned xm0)452 unsigned w, unsigned h, unsigned shift, unsigned xm0)
457{453{
458 unsigned xm, x, y, t = 0;454 unsigned t = 0;
459 unsigned xmshf = 3 - l2depth;455 unsigned xmshf = 3 - l2depth;
460 unsigned xmmod = 7 >> l2depth;456 unsigned xmmod = 7 >> l2depth;
461 unsigned mbits = (1 << (1 << l2depth)) - 1;457 unsigned mbits = (1 << (1 << l2depth)) - 1;
462 unsigned mmult = 255 / mbits;458 unsigned mmult = 255 / mbits;
463 uint16_t value = AV_RL16(dst);459 uint16_t value = AV_RL16(dst);
464 460
465 for (y = 0; y < h; y++) {461 for (unsigned y = 0; y < h; y++) {
466 xm = xm0;462 unsigned xm = xm0;
467 for (x = 0; x < w; x++) {463 for (unsigned x = 0; x < w; x++) {
468 t += ((mask[xm >> xmshf] >> ((~xm & xmmod) << l2depth)) & mbits)464 t += ((mask[xm >> xmshf] >> ((~xm & xmmod) << l2depth)) & mbits)
469 * mmult;465 * mmult;
470 xm++;466 xm++;
@@ -479,15 +475,15 @@ static void blend_pixel(uint8_t *dst, unsigned src, unsigned alpha, · 8 unmodified lines
479 const uint8_t *mask, int mask_linesize, int l2depth,475 const uint8_t *mask, int mask_linesize, int l2depth,
480 unsigned w, unsigned h, unsigned shift, unsigned xm0)476 unsigned w, unsigned h, unsigned shift, unsigned xm0)
481{477{
482 unsigned xm, x, y, t = 0;478 unsigned t = 0;
483 unsigned xmshf = 3 - l2depth;479 unsigned xmshf = 3 - l2depth;
484 unsigned xmmod = 7 >> l2depth;480 unsigned xmmod = 7 >> l2depth;
485 unsigned mbits = (1 << (1 << l2depth)) - 1;481 unsigned mbits = (1 << (1 << l2depth)) - 1;
486 unsigned mmult = 255 / mbits;482 unsigned mmult = 255 / mbits;
487 483
488 for (y = 0; y < h; y++) {484 for (unsigned y = 0; y < h; y++) {
489 xm = xm0;485 unsigned xm = xm0;
490 for (x = 0; x < w; x++) {486 for (unsigned x = 0; x < w; x++) {
491 t += ((mask[xm >> xmshf] >> ((~xm & xmmod) << l2depth)) & mbits)487 t += ((mask[xm >> xmshf] >> ((~xm & xmmod) << l2depth)) & mbits)
492 * mmult;488 * mmult;
493 xm++;489 xm++;
@@ -504,7 +500,6 @@ static void blend_line_hv16(uint8_t *dst, int dst_delta, · 10 unmodified lines
504 unsigned hsub, unsigned vsub,500 unsigned hsub, unsigned vsub,
505 int xm, int left, int right, int hband)501 int xm, int left, int right, int hband)
506{502{
507 int x;
508 503
509 if (left) {504 if (left) {
510 blend_pixel16(dst, src, alpha, mask, mask_linesize, l2depth,505 blend_pixel16(dst, src, alpha, mask, mask_linesize, l2depth,
@@ -512,7 +507,7 @@ static void blend_line_hv16(uint8_t *dst, int dst_delta, · 1 unmodified line
512 dst += dst_delta;507 dst += dst_delta;
513 xm += left;508 xm += left;
514 }509 }
515 for (x = 0; x < w; x++) {510 for (int x = 0; x < w; x++) {
516 blend_pixel16(dst, src, alpha, mask, mask_linesize, l2depth,511 blend_pixel16(dst, src, alpha, mask, mask_linesize, l2depth,
517 1 << hsub, hband, hsub + vsub, xm);512 1 << hsub, hband, hsub + vsub, xm);
518 dst += dst_delta;513 dst += dst_delta;
@@ -529,7 +524,6 @@ static void blend_line_hv(uint8_t *dst, int dst_delta, · 10 unmodified lines
529 unsigned hsub, unsigned vsub,524 unsigned hsub, unsigned vsub,
530 int xm, int left, int right, int hband)525 int xm, int left, int right, int hband)
531{526{
532 int x;
533 527
534 if (left) {528 if (left) {
535 blend_pixel(dst, src, alpha, mask, mask_linesize, l2depth,529 blend_pixel(dst, src, alpha, mask, mask_linesize, l2depth,
@@ -537,7 +531,7 @@ static void blend_line_hv(uint8_t *dst, int dst_delta, · 1 unmodified line
537 dst += dst_delta;531 dst += dst_delta;
538 xm += left;532 xm += left;
539 }533 }
540 for (x = 0; x < w; x++) {534 for (int x = 0; x < w; x++) {
541 blend_pixel(dst, src, alpha, mask, mask_linesize, l2depth,535 blend_pixel(dst, src, alpha, mask, mask_linesize, l2depth,
542 1 << hsub, hband, hsub + vsub, xm);536 1 << hsub, hband, hsub + vsub, xm);
543 dst += dst_delta;537 dst += dst_delta;
@@ -553,9 +547,9 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, · 9 unmodified lines
553 const uint8_t *mask, int mask_linesize, int mask_w, int mask_h,547 const uint8_t *mask, int mask_linesize, int mask_w, int mask_h,
554 int l2depth, unsigned endianness, int x0, int y0)548 int l2depth, unsigned endianness, int x0, int y0)
555{549{
556 unsigned alpha, nb_planes, nb_comp, plane, comp;550 unsigned alpha, nb_planes, nb_comp;
557 int xm0, ym0, w_sub, h_sub, x_sub, y_sub, left, right, top, bottom, y;551 int xm0, ym0, w_sub, h_sub, x_sub, y_sub, left, right, top, bottom;
558 uint8_t *p0, *p;552 uint8_t *p;
559 const uint8_t *m;553 const uint8_t *m;
560 554
561 nb_comp = draw->desc->nb_components -555 nb_comp = draw->desc->nb_components -
@@ -575,15 +569,15 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, · 13 unmodified lines
575 }569 }
576 nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));570 nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));
577 nb_planes += !nb_planes;571 nb_planes += !nb_planes;
578 for (plane = 0; plane < nb_planes; plane++) {572 for (unsigned plane = 0; plane < nb_planes; plane++) {
579 p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);573 uint8_t *p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
580 w_sub = mask_w;574 w_sub = mask_w;
581 h_sub = mask_h;575 h_sub = mask_h;
582 x_sub = x0;576 x_sub = x0;
583 y_sub = y0;577 y_sub = y0;
584 subsampling_bounds(draw->hsub[plane], &x_sub, &w_sub, &left, &right);578 subsampling_bounds(draw->hsub[plane], &x_sub, &w_sub, &left, &right);
585 subsampling_bounds(draw->vsub[plane], &y_sub, &h_sub, &top, &bottom);579 subsampling_bounds(draw->vsub[plane], &y_sub, &h_sub, &top, &bottom);
586 for (comp = 0; comp < nb_comp; comp++) {580 for (unsigned comp = 0; comp < nb_comp; comp++) {
587 const int depth = draw->desc->comp[comp].depth;581 const int depth = draw->desc->comp[comp].depth;
588 const int offset = draw->desc->comp[comp].offset;582 const int offset = draw->desc->comp[comp].offset;
589 const int index = offset / ((depth + 7) / 8);583 const int index = offset / ((depth + 7) / 8);
@@ -610,7 +604,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, · 20 unmodified lines
610 m += top * mask_linesize;604 m += top * mask_linesize;
611 }605 }
612 if (depth <= 8) {606 if (depth <= 8) {
613 for (y = 0; y < h_sub; y++) {607 for (int y = 0; y < h_sub; y++) {
614 blend_line_hv(p, draw->pixelstep[plane],608 blend_line_hv(p, draw->pixelstep[plane],
615 color->comp[plane].u8[index], alpha,609 color->comp[plane].u8[index], alpha,
616 m, mask_linesize, l2depth, w_sub,610 m, mask_linesize, l2depth, w_sub,
@@ -620,7 +614,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, · 3 unmodified lines
620 m += mask_linesize << draw->vsub[plane];614 m += mask_linesize << draw->vsub[plane];
621 }615 }
622 } else {616 } else {
623 for (y = 0; y < h_sub; y++) {617 for (int y = 0; y < h_sub; y++) {
624 blend_line_hv16(p, draw->pixelstep[plane],618 blend_line_hv16(p, draw->pixelstep[plane],
625 color->comp[plane].u16[index], alpha,619 color->comp[plane].u16[index], alpha,
626 m, mask_linesize, l2depth, w_sub,620 m, mask_linesize, l2depth, w_sub,
@@ -663,12 +657,11 @@ int ff_draw_round_to_sub(FFDrawContext *draw, int sub_dir, int round_dir, · 36 unmodified lines
663 657
664AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags)658AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags)
665{659{
666 enum AVPixelFormat i;
667 FFDrawContext draw;660 FFDrawContext draw;
668 AVFilterFormats *fmts = NULL;661 AVFilterFormats *fmts = NULL;
669 int ret;662 int ret;
670 663
671 for (i = 0; av_pix_fmt_desc_get(i); i++)664 for (enum AVPixelFormat i = 0; av_pix_fmt_desc_get(i); i++)
672 if (ff_draw_init(&draw, i, flags) >= 0 &&665 if (ff_draw_init(&draw, i, flags) >= 0 &&
673 (ret = ff_add_format(&fmts, i)) < 0)666 (ret = ff_add_format(&fmts, i)) < 0)
674 return NULL;667 return NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t