mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/gifenc: Actually use the shrunk palette
I have no idea how nobody, including myself, noticed this. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
parent
99042c2bf6
commit
e690aa6a8d
|
@ -383,13 +383,12 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||||
bytestream_put_le16(bytestream, height);
|
bytestream_put_le16(bytestream, height);
|
||||||
|
|
||||||
if (palette || !s->use_global_palette) {
|
if (palette || !s->use_global_palette) {
|
||||||
const uint32_t *pal = palette ? palette : s->palette;
|
|
||||||
unsigned pow2_count = av_log2(shrunk_palette_count - 1);
|
unsigned pow2_count = av_log2(shrunk_palette_count - 1);
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
bytestream_put_byte(bytestream, 1<<7 | pow2_count); /* flags */
|
bytestream_put_byte(bytestream, 1<<7 | pow2_count); /* flags */
|
||||||
for (i = 0; i < 1 << (pow2_count + 1); i++) {
|
for (i = 0; i < 1 << (pow2_count + 1); i++) {
|
||||||
const uint32_t v = pal[i];
|
const uint32_t v = shrunk_palette[i];
|
||||||
bytestream_put_be24(bytestream, v);
|
bytestream_put_be24(bytestream, v);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue