| @@ -231,7 +231,6 @@ struct stack_node { · 230 unmodified lines |
| 231 | 231 | */ |
| 232 | 232 | static av_always_inline int color_get(PaletteUseContext *s, uint32_t color) |
| 233 | 233 | { |
| 234 | | − int i; |
| 235 | 234 | struct color_info clrinfo; |
| 236 | 235 | const uint32_t hash = ff_lowbias32(color) & (CACHE_SIZE - 1); |
| 237 | 236 | struct cache_node *node = &s->cache[hash]; |
| @@ -242,7 +241,7 @@ static av_always_inline int color_get(PaletteUseContext *s, uint32_t color) · 4 unmodified lines |
| 242 | 241 | return s->transparency_index; |
| 243 | 242 | } |
| 244 | 243 | |
| 245 | | − for (i = 0; i < node->nb_entries; i++) { |
| 244 | + for (int i = 0; i < node->nb_entries; i++) { |
| 246 | 245 | e = &node->entries[i]; |
| 247 | 246 | if (e->color == color) |
| 248 | 247 | return e->pal_entry; |
| @@ -284,7 +283,6 @@ static av_always_inline int set_frame(PaletteUseContext *s, AVFrame *out, AVFram · 35 unmodified lines |
| 284 | 283 | int x_start, int y_start, int w, int h, |
| 285 | 284 | enum dithering_mode dither) |
| 286 | 285 | { |
| 287 | | − int x, y; |
| 288 | 286 | const int src_linesize = in ->linesize[0] >> 2; |
| 289 | 287 | const int dst_linesize = out->linesize[0]; |
| 290 | 288 | uint32_t *src = ((uint32_t *)in ->data[0]) + y_start*src_linesize; |
| @@ -293,8 +291,8 @@ static av_always_inline int set_frame(PaletteUseContext *s, AVFrame *out, AVFram · 2 unmodified lines |
| 293 | 291 | w += x_start; |
| 294 | 292 | h += y_start; |
| 295 | 293 | |
| 296 | | − for (y = y_start; y < h; y++) { |
| 297 | | − for (x = x_start; x < w; x++) { |
| 294 | + for (int y = y_start; y < h; y++) { |
| 295 | + for (int x = x_start; x < w; x++) { |
| 298 | 296 | int er, eg, eb; |
| 299 | 297 | |
| 300 | 298 | if (dither == DITHERING_BAYER) { |
| @@ -467,7 +465,7 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette, · 166 unmodified lines |
| 467 | 465 | int *component, const struct color_rect *box) |
| 468 | 466 | { |
| 469 | 467 | int wL, wa, wb; |
| 470 | | − int i, longest = 0; |
| 468 | + int longest = 0; |
| 471 | 469 | unsigned nb_color = 0; |
| 472 | 470 | struct color_rect ranges; |
| 473 | 471 | struct color tmp_pal[256]; |
| @@ -476,7 +474,7 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette, · 2 unmodified lines |
| 476 | 474 | ranges.min[0] = ranges.min[1] = ranges.min[2] = 0xffff; |
| 477 | 475 | ranges.max[0] = ranges.max[1] = ranges.max[2] = -0xffff; |
| 478 | 476 | |
| 479 | | − for (i = 0; i < AVPALETTE_COUNT; i++) { |
| 477 | + for (int i = 0; i < AVPALETTE_COUNT; i++) { |
| 480 | 478 | const uint32_t c = palette[i]; |
| 481 | 479 | const uint8_t a = c >> 24; |
| 482 | 480 | const struct Lab lab = ff_srgb_u8_to_oklab_int(c); |
| @@ -571,7 +569,7 @@ static int cmp_pal_entry(const void *a, const void *b) · 88 unmodified lines |
| 571 | 569 | |
| 572 | 570 | static void load_colormap(PaletteUseContext *s) |
| 573 | 571 | { |
| 574 | | − int i, nb_used = 0; |
| 572 | + int nb_used = 0; |
| 575 | 573 | uint8_t color_used[AVPALETTE_COUNT] = {0}; |
| 576 | 574 | uint32_t last_color = 0; |
| 577 | 575 | struct color_rect box; |
| @@ -583,7 +581,7 @@ static void load_colormap(PaletteUseContext *s) · 5 unmodified lines |
| 583 | 581 | /* disable transparent colors and dups */ |
| 584 | 582 | qsort(s->palette, AVPALETTE_COUNT-(s->transparency_index >= 0), sizeof(*s->palette), cmp_pal_entry); |
| 585 | 583 | |
| 586 | | − for (i = 0; i < AVPALETTE_COUNT; i++) { |
| 584 | + for (int i = 0; i < AVPALETTE_COUNT; i++) { |
| 587 | 585 | const uint32_t c = s->palette[i]; |
| 588 | 586 | if (i != 0 && c == last_color) { |
| 589 | 587 | color_used[i] = 1; |
| @@ -874,10 +872,9 @@ static av_cold int init(AVFilterContext *ctx) · 284 unmodified lines |
| 874 | 872 | s->set_frame = set_frame_lut[s->dither]; |
| 875 | 873 | |
| 876 | 874 | if (s->dither == DITHERING_BAYER) { |
| 877 | | − int i; |
| 878 | 875 | const int delta = 1 << (5 - s->bayer_scale); // to avoid too much luma |
| 879 | 876 | |
| 880 | | − for (i = 0; i < FF_ARRAY_ELEMS(s->ordered_dither); i++) |
| 877 | + for (int i = 0; i < FF_ARRAY_ELEMS(s->ordered_dither); i++) |
| 881 | 878 | s->ordered_dither[i] = (dither_value(i) >> s->bayer_scale) - delta; |
| 882 | 879 | } |
| 883 | 880 | |
| @@ -892,11 +889,10 @@ static int activate(AVFilterContext *ctx) · 8 unmodified lines |
| 892 | 889 | |
| 893 | 890 | static av_cold void uninit(AVFilterContext *ctx) |
| 894 | 891 | { |
| 895 | | − int i; |
| 896 | 892 | PaletteUseContext *s = ctx->priv; |
| 897 | 893 | |
| 898 | 894 | ff_framesync_uninit(&s->fs); |
| 899 | | − for (i = 0; i < CACHE_SIZE; i++) |
| 895 | + for (int i = 0; i < CACHE_SIZE; i++) |
| 900 | 896 | av_freep(&s->cache[i].entries); |
| 901 | 897 | av_frame_free(&s->last_in); |
| 902 | 898 | av_frame_free(&s->last_out); |