[FFmpeg-devel] [PATCH] fix interlaced gif

Baptiste Coudurier baptiste.coudurier
Mon Mar 3 14:34:16 CET 2008


Reimar D?ffinger wrote:
> On Mon, Mar 03, 2008 at 01:39:49PM +0100, Baptiste Coudurier wrote:
>> Hi Reimar,
>> Reimar D?ffinger wrote:
>>> Hello,
>>> attached patch fixes decoding of http://samples.mplayerhq.hu/GIF/7up.gif
>>> If there are no objections I will apply soon.
>>>
>>> Greetings,
>>> Reimar D?ffinger
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Index: libavformat/gifdec.c
>>> ===================================================================
>>> --- libavformat/gifdec.c	(revision 12287)
>>> +++ libavformat/gifdec.c	(working copy)
>>> @@ -364,11 +364,8 @@
>>>                  y1 += 8;
>>>                  ptr += linesize * 8;
>>>                  if (y1 >= height) {
>>> -                    y1 = 4;
>>> -                    if (pass == 0)
>>> -                        ptr = ptr1 + linesize * 4;
>>> -                    else
>>> -                        ptr = ptr1 + linesize * 2;
>>> +                    y1 = pass == 0 ? 4 : 2;
>>> +                    ptr = ptr1 + linesize * y1;
>>>                      pass++;
>>>                  }
>>>                  break;
>>>
>> Patch ok.
> 
> Good, applied.
> As I think this will imply quite a performance cost, would it be
> desirable to split this properly into a gif demuxer and decoder?
> 

Im not sure to correctly understand what you mean: gif was a demuxer,
and was made a decoder to use image2 mechanism.

If you mean splitting animated gifs in seperate gif pictures, then a
parser should be implemented I think, though it's not that easy to split
independant gif picture since pictures share some data.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312





More information about the ffmpeg-devel mailing list