Browse Source

palettegen: Fill with last color, not black

If we fill with black then the generated palette will have one color more
than what the user requested. This also resulted in unwanted black specks in
the output of paletteuse, especially when generating small palettes.
tags/n4.2
Tomas Härdin 7 years ago
parent
commit
abc5ac3cf5
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      libavfilter/vf_palettegen.c
  2. +1
    -1
      tests/ref/fate/filter-palettegen-2

+ 1
- 1
libavfilter/vf_palettegen.c View File

@@ -245,7 +245,7 @@ static void write_palette(AVFilterContext *ctx, AVFrame *out)
av_log(ctx, AV_LOG_WARNING, "Dupped color: %08"PRIX32"\n", pal[x]);
last_color = pal[x];
} else {
pal[x] = 0xff000000; // pad with black
pal[x] = last_color; // pad with last color
}
}
pal += pal_linesize;


+ 1
- 1
tests/ref/fate/filter-palettegen-2 View File

@@ -3,4 +3,4 @@
#codec_id 0: rawvideo
#dimensions 0: 16x16
#sar 0: 1/1
0, 0, 0, 1, 1024, 0x906ff5aa
0, 0, 0, 1, 1024, 0x23e072c8

Loading…
Cancel
Save