summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Härdin <tjoppen@acc.umu.se>2019-01-16 13:07:48 +0100
committerTomas Härdin <tjoppen@acc.umu.se>2019-02-19 21:29:03 +0100
commitabc5ac3cf5176189f43062f6a3e29fd012134613 (patch)
tree44a1e290a774daa64d8efdbd16dbfb1b735d9e6d
parentf2e89fe4d34a7f53711ccea952331d2c77f04f19 (diff)
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.
-rw-r--r--libavfilter/vf_palettegen.c2
-rw-r--r--tests/ref/fate/filter-palettegen-22
2 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c
index 5ff73e6b2b..44323782d2 100644
--- a/libavfilter/vf_palettegen.c
+++ b/libavfilter/vf_palettegen.c
@@ -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;
diff --git a/tests/ref/fate/filter-palettegen-2 b/tests/ref/fate/filter-palettegen-2
index aa07b6cb93..9abec0fe8e 100644
--- a/tests/ref/fate/filter-palettegen-2
+++ b/tests/ref/fate/filter-palettegen-2
@@ -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