This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new bb769d9d90 avcodec/gifenc: avoid redundant local color table when 
global palette is used
bb769d9d90 is described below

commit bb769d9d901315087f2a7c06b251f27f14b8266f
Author:     Damitha Gunawardena <[email protected]>
AuthorDate: Wed Nov 12 15:12:07 2025 +1100
Commit:     Ramiro Polla <[email protected]>
CommitDate: Tue Dec 23 14:34:13 2025 +0000

    avcodec/gifenc: avoid redundant local color table when global palette is 
used
    
    Addressing the fact that first frame has a LCT when global pallette is used 
for pal8.
    issue: #20896
---
 libavcodec/gif.c           | 2 ++
 tests/ref/fate/gifenc-pal8 | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index c11cad8d38..132ce07e6c 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -492,6 +492,8 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
             memcpy(s->palette, palette, AVPALETTE_SIZE);
             s->transparent_index = get_palette_transparency_index(palette);
             s->palette_loaded = 1;
+            if (s->use_global_palette)
+                palette = NULL;
         } else if (!memcmp(s->palette, palette, AVPALETTE_SIZE)) {
             palette = NULL;
         }
diff --git a/tests/ref/fate/gifenc-pal8 b/tests/ref/fate/gifenc-pal8
index 1a074b8fd8..d4a42b03b2 100644
--- a/tests/ref/fate/gifenc-pal8
+++ b/tests/ref/fate/gifenc-pal8
@@ -3,7 +3,7 @@
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,     2109, 0x39642b3d
+0,          0,          0,        1,     1341, 0xe4e2af18
 0,          1,          1,        1,      236, 0x332769fd, F=0x0
 0,          2,          2,        1,      186, 0x770d5061, F=0x0
 0,          3,          3,        1,      208, 0x55784c8f, F=0x0

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to