diff mbox series

[FFmpeg-devel] avformat/gifdec: cleanup

Message ID CAPYw7P5VbtxY3dNYTqF7XciSxDerDiXqSXVvapT3sFHm-3QXhQ@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] avformat/gifdec: cleanup | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Paul B Mahol May 21, 2023, 9:38 a.m. UTC
Attached patches.

This finally removes giant hacks in gif demuxer and allows using gif
files via pipe reliably.

Comments

Anton Khirnov May 21, 2023, 10:05 a.m. UTC | #1
Quoting Paul B Mahol (2023-05-21 11:38:09)
> From cbc9c6ea4df153caece779b9052761f23d6d31a1 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Sun, 21 May 2023 02:14:35 +0200
> Subject: [PATCH 2/3] avcodec/gifdec: set frame time_base
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/gifdec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
> index 0835c5bdd0..d66e16105b 100644
> --- a/libavcodec/gifdec.c
> +++ b/libavcodec/gifdec.c
> @@ -454,6 +454,7 @@ static av_cold int gif_decode_init(AVCodecContext *avctx)
>  
>      s->avctx = avctx;
>  
> +    avctx->time_base = av_make_q(1, 100);

The meaning of this field is not defined for decoding, so you should not
set it.
Paul B Mahol May 21, 2023, 11:24 a.m. UTC | #2
On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> Attached patches.
>
> This finally removes giant hacks in gif demuxer and allows using gif
> files via pipe reliably.
>

Fixed version attached.
Michael Niedermayer May 21, 2023, 5:36 p.m. UTC | #3
On Sun, May 21, 2023 at 01:24:06PM +0200, Paul B Mahol wrote:
>  libavcodec/gifdec.c                    |   11 -
>  libavformat/gifdec.c                   |  245 +++++------------------
>  tests/ref/fate/gif-color               |  348 ++++++++++++++++-----------------
>  tests/ref/fate/gif-deal                |  314 +++++++++++++++++++++++++++--
>  tests/ref/fate/gif-disposal-background |   12 -
>  tests/ref/fate/gif-disposal-restore    |    6 
>  tests/ref/fate/gifenc-bgr4_byte        |  348 ++++++++++++++++-----------------
>  tests/ref/fate/gifenc-bgr8             |  348 ++++++++++++++++-----------------
>  tests/ref/fate/gifenc-gray             |  348 ++++++++++++++++-----------------
>  tests/ref/fate/gifenc-pal8             |  348 ++++++++++++++++-----------------
>  tests/ref/fate/gifenc-rgb4_byte        |  348 ++++++++++++++++-----------------
>  tests/ref/fate/gifenc-rgb8             |  348 ++++++++++++++++-----------------
>  12 files changed, 1585 insertions(+), 1439 deletions(-)
> a8f54d72293f55ac76ae2e004e57809d7e9b90c6  0003-avformat-gifdec-switch-to-using-gif-parser.patch
> From 866801d43a9cf4c90e86afde1963b8b684e92998 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Sat, 20 May 2023 14:13:27 +0200
> Subject: [PATCH 3/3] avformat/gifdec: switch to using gif parser
> 
> Update fate, more correct as timebase is not reduced.
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/gifdec.c                    |  11 +-
>  libavformat/gifdec.c                   | 245 +++++------------
>  tests/ref/fate/gif-color               | 348 ++++++++++++-------------
>  tests/ref/fate/gif-deal                | 314 ++++++++++++++++++++--
>  tests/ref/fate/gif-disposal-background |  12 +-
>  tests/ref/fate/gif-disposal-restore    |   6 +-
>  tests/ref/fate/gifenc-bgr4_byte        | 348 ++++++++++++-------------
>  tests/ref/fate/gifenc-bgr8             | 348 ++++++++++++-------------
>  tests/ref/fate/gifenc-gray             | 348 ++++++++++++-------------
>  tests/ref/fate/gifenc-pal8             | 348 ++++++++++++-------------
>  tests/ref/fate/gifenc-rgb4_byte        | 348 ++++++++++++-------------
>  tests/ref/fate/gifenc-rgb8             | 348 ++++++++++++-------------
>  12 files changed, 1585 insertions(+), 1439 deletions(-)

breaks:fate-fits-demux
...
+0,        242,        242,        1,    14320, 0xa34e7331
+0,        243,        243,        1,    14320, 0xa34e7331
+0,        244,        244,        1,    14320, 0xa34e7331
+0,        245,        245,        1,    14320, 0xa34e7331
+0,        246,        246,        1,    14320, 0xa34e7331
+0,        247,        247,        1,    14320, 0xa34e7331
+0,        248,        248,        1,    14320, 0xa34e7331
+0,        249,        249,        1,    14320, 0xa34e7331
Test fits-demux failed. Look at tests/data/fate/fits-demux.err for details.
tests/Makefile:307: recipe for target 'fate-fits-demux' failed
make: *** [fate-fits-demux] Error 1


[...]
Paul B Mahol May 21, 2023, 5:59 p.m. UTC | #4
On 5/21/23, Michael Niedermayer <michael@niedermayer.cc> wrote:
> On Sun, May 21, 2023 at 01:24:06PM +0200, Paul B Mahol wrote:
>>  libavcodec/gifdec.c                    |   11 -
>>  libavformat/gifdec.c                   |  245 +++++------------------
>>  tests/ref/fate/gif-color               |  348
>> ++++++++++++++++-----------------
>>  tests/ref/fate/gif-deal                |  314
>> +++++++++++++++++++++++++++--
>>  tests/ref/fate/gif-disposal-background |   12 -
>>  tests/ref/fate/gif-disposal-restore    |    6
>>  tests/ref/fate/gifenc-bgr4_byte        |  348
>> ++++++++++++++++-----------------
>>  tests/ref/fate/gifenc-bgr8             |  348
>> ++++++++++++++++-----------------
>>  tests/ref/fate/gifenc-gray             |  348
>> ++++++++++++++++-----------------
>>  tests/ref/fate/gifenc-pal8             |  348
>> ++++++++++++++++-----------------
>>  tests/ref/fate/gifenc-rgb4_byte        |  348
>> ++++++++++++++++-----------------
>>  tests/ref/fate/gifenc-rgb8             |  348
>> ++++++++++++++++-----------------
>>  12 files changed, 1585 insertions(+), 1439 deletions(-)
>> a8f54d72293f55ac76ae2e004e57809d7e9b90c6
>> 0003-avformat-gifdec-switch-to-using-gif-parser.patch
>> From 866801d43a9cf4c90e86afde1963b8b684e92998 Mon Sep 17 00:00:00 2001
>> From: Paul B Mahol <onemda@gmail.com>
>> Date: Sat, 20 May 2023 14:13:27 +0200
>> Subject: [PATCH 3/3] avformat/gifdec: switch to using gif parser
>>
>> Update fate, more correct as timebase is not reduced.
>>
>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> ---
>>  libavcodec/gifdec.c                    |  11 +-
>>  libavformat/gifdec.c                   | 245 +++++------------
>>  tests/ref/fate/gif-color               | 348 ++++++++++++-------------
>>  tests/ref/fate/gif-deal                | 314 ++++++++++++++++++++--
>>  tests/ref/fate/gif-disposal-background |  12 +-
>>  tests/ref/fate/gif-disposal-restore    |   6 +-
>>  tests/ref/fate/gifenc-bgr4_byte        | 348 ++++++++++++-------------
>>  tests/ref/fate/gifenc-bgr8             | 348 ++++++++++++-------------
>>  tests/ref/fate/gifenc-gray             | 348 ++++++++++++-------------
>>  tests/ref/fate/gifenc-pal8             | 348 ++++++++++++-------------
>>  tests/ref/fate/gifenc-rgb4_byte        | 348 ++++++++++++-------------
>>  tests/ref/fate/gifenc-rgb8             | 348 ++++++++++++-------------
>>  12 files changed, 1585 insertions(+), 1439 deletions(-)
>
> breaks:fate-fits-demux
> ...
> +0,        242,        242,        1,    14320, 0xa34e7331
> +0,        243,        243,        1,    14320, 0xa34e7331
> +0,        244,        244,        1,    14320, 0xa34e7331
> +0,        245,        245,        1,    14320, 0xa34e7331
> +0,        246,        246,        1,    14320, 0xa34e7331
> +0,        247,        247,        1,    14320, 0xa34e7331
> +0,        248,        248,        1,    14320, 0xa34e7331
> +0,        249,        249,        1,    14320, 0xa34e7331
> Test fits-demux failed. Look at tests/data/fate/fits-demux.err for details.
> tests/Makefile:307: recipe for target 'fate-fits-demux' failed
> make: *** [fate-fits-demux] Error 1
>
>

That is actually more correct output. Previously it would drop most of
the available frames.

> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Many that live deserve death. And some that die deserve life. Can you give
> it to them? Then do not be too eager to deal out death in judgement. For
> even the very wise cannot see all ends. -- Gandalf
>
Paul B Mahol May 21, 2023, 7:25 p.m. UTC | #5
On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> Attached patches.
>
> This finally removes giant hacks in gif demuxer and allows using gif
> files via pipe reliably.
>

Better patches attached, no more sets time_base in gif parser.
James Almer May 21, 2023, 7:37 p.m. UTC | #6
On 5/21/2023 4:25 PM, Paul B Mahol wrote:
> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>> Attached patches.
>>
>> This finally removes giant hacks in gif demuxer and allows using gif
>> files via pipe reliably.
>>
> 
> Better patches attached, no more sets time_base in gif parser.

Samples report 100fps now.
Paul B Mahol May 21, 2023, 8:02 p.m. UTC | #7
On 5/21/23, James Almer <jamrial@gmail.com> wrote:
> On 5/21/2023 4:25 PM, Paul B Mahol wrote:
>> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>>> Attached patches.
>>>
>>> This finally removes giant hacks in gif demuxer and allows using gif
>>> files via pipe reliably.
>>>
>>
>> Better patches attached, no more sets time_base in gif parser.
>
> Samples report 100fps now.

gif is VFR, and that is max fps it supports.
James Almer May 21, 2023, 8:06 p.m. UTC | #8
On 5/21/2023 5:02 PM, Paul B Mahol wrote:
> On 5/21/23, James Almer <jamrial@gmail.com> wrote:
>> On 5/21/2023 4:25 PM, Paul B Mahol wrote:
>>> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>>>> Attached patches.
>>>>
>>>> This finally removes giant hacks in gif demuxer and allows using gif
>>>> files via pipe reliably.
>>>>
>>>
>>> Better patches attached, no more sets time_base in gif parser.
>>
>> Samples report 100fps now.
> 
> gif is VFR, and that is max fps it supports.

But none of these samples are 100fps, and the fate ref changes look like 
you made them all CFR 100fps, with a lot of duplicated frames to achieve 
that where required.
Paul B Mahol May 21, 2023, 9:42 p.m. UTC | #9
On 5/21/23, James Almer <jamrial@gmail.com> wrote:
> On 5/21/2023 5:02 PM, Paul B Mahol wrote:
>> On 5/21/23, James Almer <jamrial@gmail.com> wrote:
>>> On 5/21/2023 4:25 PM, Paul B Mahol wrote:
>>>> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>>>>> Attached patches.
>>>>>
>>>>> This finally removes giant hacks in gif demuxer and allows using gif
>>>>> files via pipe reliably.
>>>>>
>>>>
>>>> Better patches attached, no more sets time_base in gif parser.
>>>
>>> Samples report 100fps now.
>>
>> gif is VFR, and that is max fps it supports.
>
> But none of these samples are 100fps, and the fate ref changes look like
> you made them all CFR 100fps, with a lot of duplicated frames to achieve
> that where required.

Because no muxer supports VFR.
And current demuxer even drops some frames.
Paul B Mahol May 22, 2023, 3:49 p.m. UTC | #10
On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> Attached patches.
>
> This finally removes giant hacks in gif demuxer and allows using gif
> files via pipe reliably.
>

Now with smaller diff.
James Almer May 22, 2023, 4:04 p.m. UTC | #11
On 5/22/2023 12:49 PM, Paul B Mahol wrote:
> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>> Attached patches.
>>
>> This finally removes giant hacks in gif demuxer and allows using gif
>> files via pipe reliably.
>>
> 
> Now with smaller diff.

[...]

> From 208d1e83ae9aef8e9b37007df16569cdd4cf25d2 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Sat, 20 May 2023 14:13:27 +0200
> Subject: [PATCH 2/2] avformat/gifdec: switch to using gif parser
> 
> Update fate tests, more correct as timebase is no more reduced.

This is not the case anymore.

> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/gifdec.c  |  11 +-
>  libavformat/gifdec.c | 244 +++++++++++--------------------------------
>  tests/ref/lavf/gif   |   2 +-
>  3 files changed, 70 insertions(+), 187 deletions(-)
> 
> diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
> index 0835c5bdd0..f2ab783ef0 100644
> --- a/libavcodec/gifdec.c
> +++ b/libavcodec/gifdec.c
> @@ -472,10 +472,6 @@ static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
>  
>      bytestream2_init(&s->gb, avpkt->data, avpkt->size);
>  
> -    s->frame->pts     = avpkt->pts;
> -    s->frame->pkt_dts = avpkt->dts;
> -    s->frame->duration = avpkt->duration;
> -
>      if (avpkt->size >= 6) {
>          s->keyframe = memcmp(avpkt->data, gif87a_sig, 6) == 0 ||
>                        memcmp(avpkt->data, gif89a_sig, 6) == 0;
> @@ -522,6 +518,13 @@ static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
>  
>      if ((ret = av_frame_ref(rframe, s->frame)) < 0)
>          return ret;
> +    if (s->keyframe) {
> +        rframe->pict_type = AV_PICTURE_TYPE_I;
> +        rframe->flags |= AV_FRAME_FLAG_KEY;
> +    } else {
> +        rframe->pict_type = AV_PICTURE_TYPE_P;
> +        rframe->flags &= ~AV_FRAME_FLAG_KEY;
> +    }
>      *got_frame = 1;
>  
>      return bytestream2_tell(&s->gb);
> diff --git a/libavformat/gifdec.c b/libavformat/gifdec.c
> index 1977f46e3a..11fcde36b7 100644
> --- a/libavformat/gifdec.c
> +++ b/libavformat/gifdec.c
> @@ -28,9 +28,12 @@
>  #include "libavutil/bprint.h"
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/opt.h"
> +#include "avio_internal.h"
>  #include "internal.h"
>  #include "libavcodec/gif.h"
>  
> +#define GIF_PACKET_SIZE 1024
> +
>  typedef struct GIFDemuxContext {
>      const AVClass *class;
>      /**
> @@ -53,9 +56,6 @@ typedef struct GIFDemuxContext {
>      int total_iter;
>      int iter_count;
>      int ignore_loop;
> -
> -    int nb_frames;
> -    int last_duration;
>  } GIFDemuxContext;
>  
>  /**
> @@ -84,8 +84,8 @@ static int gif_probe(const AVProbeData *p)
>  
>  static int resync(AVIOContext *pb)
>  {
> -    int i;
> -    for (i = 0; i < 6; i++) {
> +    ffio_ensure_seekback(pb, 13);
> +    for (int i = 0; i < 6; i++) {
>          int b = avio_r8(pb);
>          if (b != gif87a_sig[i] && b != gif89a_sig[i])
>              i = -(b != 'G');
> @@ -132,6 +132,9 @@ static int gif_read_header(AVFormatContext *s)
>      if (!st)
>          return AVERROR(ENOMEM);
>  
> +    if (!(pb->seekable & AVIO_SEEKABLE_NORMAL))
> +        goto skip;
> +
>      if (flags & 0x80)
>          avio_skip(pb, 3 * (1 << ((flags & 0x07) + 1)));
>  
> @@ -158,15 +161,37 @@ static int gif_read_header(AVFormatContext *s)
>  
>                      avio_skip(pb, 1);
>                      delay = avio_rl16(pb);
> -                    if (delay < gdc->min_delay)
> -                        delay = gdc->default_delay;
> -                    delay = FFMIN(delay, gdc->max_delay);
> +                    delay = delay ? delay : gdc->default_delay;
>                      duration += delay;
>                      avio_skip(pb, 1);
>                  } else {
>                      avio_skip(pb, block_size);
>                  }
>                  gif_skip_subblocks(pb);
> +            } else if (subtype == GIF_APP_EXT_LABEL) {
> +                uint8_t data[256];
> +                int sb_size;
> +
> +                sb_size = avio_r8(pb);
> +                ret = avio_read(pb, data, sb_size);
> +                if (ret < 0 || !sb_size)
> +                    break;
> +
> +                if (sb_size == strlen(NETSCAPE_EXT_STR)) {
> +                    sb_size = avio_r8(pb);
> +                    ret = avio_read(pb, data, sb_size);
> +                    if (ret < 0 || !sb_size)
> +                        break;
> +
> +                    if (sb_size == 3 && data[0] == 1) {
> +                        gdc->total_iter = AV_RL16(data+1);
> +                        av_log(s, AV_LOG_DEBUG, "Loop count is %d\n", gdc->total_iter);
> +
> +                        if (gdc->total_iter == 0)
> +                            gdc->total_iter = -1;
> +                    }
> +                }
> +                gif_skip_subblocks(pb);
>              } else {
>                  gif_skip_subblocks(pb);
>              }
> @@ -183,203 +208,57 @@ static int gif_read_header(AVFormatContext *s)
>          }
>      }
>  
> +skip:
> +    /* jump to start because gif decoder needs header data too */
> +    if (avio_seek(pb, 0, SEEK_SET) != 0)
> +        return AVERROR(EIO);
> +
>      /* GIF format operates with time in "hundredths of second",
>       * therefore timebase is 1/100 */
>      avpriv_set_pts_info(st, 64, 1, 100);
> +    ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
>      st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
>      st->codecpar->codec_id   = AV_CODEC_ID_GIF;
>      st->codecpar->width      = width;
>      st->codecpar->height     = height;
> +    if (nb_frames > 1) {
> +        av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
> +                  100, duration / nb_frames, INT_MAX);
> +    } else if (duration) {
> +        st->avg_frame_rate   = (AVRational) { 100, duration };
> +    }
>      st->start_time           = 0;
>      st->duration             = duration;
>      st->nb_frames            = nb_frames;
> -    if (n) {
> -        st->codecpar->sample_aspect_ratio.num = n + 15;
> -        st->codecpar->sample_aspect_ratio.den = 64;
> -    }
> -
> -    /* jump to start because gif decoder needs header data too */
> -    if (avio_seek(pb, 0, SEEK_SET) != 0)
> -        return AVERROR(EIO);
> +    if (n)
> +        st->codecpar->sample_aspect_ratio = av_make_q(n + 15, 64);
>  
>      return 0;
>  }
>  
> -static int gif_read_ext(AVFormatContext *s)
> +static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
>  {
>      GIFDemuxContext *gdc = s->priv_data;
>      AVIOContext *pb = s->pb;
> -    int sb_size, ext_label = avio_r8(pb);
>      int ret;
>  
> -    if (ext_label == GIF_GCE_EXT_LABEL) {
> -        if ((sb_size = avio_r8(pb)) < 4) {
> -            av_log(s, AV_LOG_FATAL, "Graphic Control Extension block's size less than 4.\n");
> -            return AVERROR_INVALIDDATA;
> -        }
> -
> -        /* skip packed fields */
> -        if ((ret = avio_skip(pb, 1)) < 0)
> -            return ret;
> -
> -        gdc->delay = avio_rl16(pb);
> -
> -        if (gdc->delay < gdc->min_delay)
> -            gdc->delay = gdc->default_delay;
> -        gdc->delay = FFMIN(gdc->delay, gdc->max_delay);
> -
> -        /* skip the rest of the Graphic Control Extension block */
> -        if ((ret = avio_skip(pb, sb_size - 3)) < 0 )
> -            return ret;
> -    } else if (ext_label == GIF_APP_EXT_LABEL) {
> -        uint8_t data[256];
> -
> -        sb_size = avio_r8(pb);
> -        ret = avio_read(pb, data, sb_size);
> -        if (ret < 0 || !sb_size)
> -            return ret;
> -
> -        if (sb_size == strlen(NETSCAPE_EXT_STR)) {
> -            sb_size = avio_r8(pb);
> -            ret = avio_read(pb, data, sb_size);
> -            if (ret < 0 || !sb_size)
> -                return ret;
> -
> -            if (sb_size == 3 && data[0] == 1) {
> -                gdc->total_iter = AV_RL16(data+1);
> -                av_log(s, AV_LOG_DEBUG, "Loop count is %d\n", gdc->total_iter);
> -
> -                if (gdc->total_iter == 0)
> -                    gdc->total_iter = -1;
> -            }
> -        }
> +    if ((pb->seekable & AVIO_SEEKABLE_NORMAL) &&
> +        !gdc->ignore_loop && avio_feof(pb) &&
> +        (gdc->total_iter < 0 || (++gdc->iter_count < gdc->total_iter))) {
> +        avio_seek(pb, 0, SEEK_SET);
>      }
> -
> -    if ((ret = gif_skip_subblocks(pb)) < 0)
> +    if ((ret = av_new_packet(pkt, GIF_PACKET_SIZE)) < 0)
>          return ret;
>  
> -    return 0;
> -}
> -
> -static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
> -{
> -    GIFDemuxContext *gdc = s->priv_data;
> -    AVIOContext *pb = s->pb;
> -    int packed_fields, block_label, ct_size,
> -        keyframe, frame_parsed = 0, ret;
> -    int64_t frame_start = avio_tell(pb), frame_end;
> -    unsigned char buf[6];
> -
> -    if ((ret = avio_read(pb, buf, 6)) == 6) {
> -        keyframe = memcmp(buf, gif87a_sig, 6) == 0 ||
> -                   memcmp(buf, gif89a_sig, 6) == 0;
> -    } else if (ret < 0) {
> +    pkt->pos = avio_tell(pb);
> +    pkt->stream_index = 0;
> +    ret = avio_read_partial(pb, pkt->data, GIF_PACKET_SIZE);
> +    if (ret < 0) {
> +        av_packet_unref(pkt);
>          return ret;
> -    } else {
> -        keyframe = 0;
> -    }
> -
> -    if (keyframe) {
> -parse_keyframe:
> -        /* skip 2 bytes of width and 2 of height */
> -        if ((ret = avio_skip(pb, 4)) < 0)
> -            return ret;
> -
> -        packed_fields = avio_r8(pb);
> -
> -        /* skip 1 byte of Background Color Index and 1 byte of Pixel Aspect Ratio */
> -        if ((ret = avio_skip(pb, 2)) < 0)
> -            return ret;
> -
> -        /* global color table presence */
> -        if (packed_fields & 0x80) {
> -            ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
> -
> -            if ((ret = avio_skip(pb, ct_size)) < 0)
> -                return ret;
> -        }
> -    } else {
> -        avio_seek(pb, -ret, SEEK_CUR);
> -        ret = AVERROR_EOF;
>      }
> -
> -    while (GIF_TRAILER != (block_label = avio_r8(pb)) && !avio_feof(pb)) {
> -        if (block_label == GIF_EXTENSION_INTRODUCER) {
> -            if ((ret = gif_read_ext (s)) < 0 )
> -                goto resync;
> -        } else if (block_label == GIF_IMAGE_SEPARATOR) {
> -            /* skip to last byte of Image Descriptor header */
> -            if ((ret = avio_skip(pb, 8)) < 0)
> -                return ret;
> -
> -            packed_fields = avio_r8(pb);
> -
> -            /* local color table presence */
> -            if (packed_fields & 0x80) {
> -                ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
> -
> -                if ((ret = avio_skip(pb, ct_size)) < 0)
> -                    return ret;
> -            }
> -
> -            /* read LZW Minimum Code Size */
> -            if (avio_r8(pb) < 1) {
> -                av_log(s, AV_LOG_ERROR, "lzw minimum code size must be >= 1\n");
> -                goto resync;
> -            }
> -
> -            if ((ret = gif_skip_subblocks(pb)) < 0)
> -                goto resync;
> -
> -            frame_end = avio_tell(pb);
> -
> -            if (avio_seek(pb, frame_start, SEEK_SET) != frame_start)
> -                return AVERROR(EIO);
> -
> -            ret = av_get_packet(pb, pkt, frame_end - frame_start);
> -            if (ret < 0)
> -                return ret;
> -
> -            if (keyframe)
> -                pkt->flags |= AV_PKT_FLAG_KEY;
> -
> -            pkt->stream_index = 0;
> -            pkt->duration = gdc->delay;
> -
> -            gdc->nb_frames ++;
> -            gdc->last_duration = pkt->duration;
> -
> -            /* Graphic Control Extension's scope is single frame.
> -             * Remove its influence. */
> -            gdc->delay = gdc->default_delay;
> -            frame_parsed = 1;
> -
> -            break;
> -        } else {
> -            av_log(s, AV_LOG_ERROR, "invalid block label\n");
> -resync:
> -            if (!keyframe)
> -                avio_seek(pb, frame_start, SEEK_SET);
> -            if ((ret = resync(pb)) < 0)
> -                return ret;
> -            frame_start = avio_tell(pb) - 6;
> -            keyframe = 1;
> -            goto parse_keyframe;
> -        }
> -    }
> -
> -    if ((ret >= 0 && !frame_parsed) || ret == AVERROR_EOF) {
> -        if (gdc->nb_frames == 1) {
> -            s->streams[0]->r_frame_rate = (AVRational) {100, gdc->last_duration};
> -        }
> -        /* This might happen when there is no image block
> -         * between extension blocks and GIF_TRAILER or EOF */
> -        if (!gdc->ignore_loop && (block_label == GIF_TRAILER || avio_feof(pb))
> -            && (gdc->total_iter < 0 || ++gdc->iter_count < gdc->total_iter))
> -            return avio_seek(pb, 0, SEEK_SET);
> -        return AVERROR_EOF;
> -    } else
> -        return ret;
> +    av_shrink_packet(pkt, ret);
> +    return ret;
>  }
>  
>  static const AVOption options[] = {
> @@ -405,6 +284,7 @@ const AVInputFormat ff_gif_demuxer = {
>      .read_probe     = gif_probe,
>      .read_header    = gif_read_header,
>      .read_packet    = gif_read_packet,
> -    .flags          = AVFMT_GENERIC_INDEX,
> +    .flags          = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS,
> +    .extensions     = "gif",
>      .priv_class     = &demuxer_class,
>  };
> diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif
> index fc94b9df3d..30eb85325a 100644
> --- a/tests/ref/lavf/gif
> +++ b/tests/ref/lavf/gif
> @@ -1,3 +1,3 @@
>  e35f5ea283bbcb249818e0078ec72664 *tests/data/lavf/lavf.gif
>  2011766 tests/data/lavf/lavf.gif
> -tests/data/lavf/lavf.gif CRC=0x2429faff
> +tests/data/lavf/lavf.gif CRC=0x563cec26
> -- 
> 2.39.1

TEST    gif-demux
--- /home/Ethaniel/FFmpeg/tests/ref/fate/gif-demux      2023-05-21 
22:13:04.358066200 -0300
+++ tests/data/fate/gif-demux   2023-05-22 13:00:37.259301700 -0300
@@ -38,4 +38,4 @@
  0,         74,         74,        2,     4633, 0x8f64fda7, F=0x0
  0,         76,         76,        2,     4700, 0x45f40805, F=0x0
  0,         78,         78,        2,     5117, 0x4eb4c5fb, F=0x0
-0,         80,         80,        2,     5370, 0xb10c6910, F=0x0
+0,         80,         80,        2,     5371, 0x1a66694b, F=0x0
Test gif-demux failed. Look at tests/data/fate/gif-demux.err for details.

And

TEST    lavf-gif
--- /home/Ethaniel/FFmpeg/tests/ref/lavf/gif    2023-05-22 
13:00:14.259590500 -0300
+++ tests/data/fate/lavf-gif    2023-05-22 13:01:19.316371100 -0300
@@ -1,3 +1,3 @@
  e35f5ea283bbcb249818e0078ec72664 *tests/data/lavf/lavf.gif
  2011766 tests/data/lavf/lavf.gif
-tests/data/lavf/lavf.gif CRC=0x563cec26
+tests/data/lavf/lavf.gif CRC=0x2429faff
Test lavf-gif failed. Look at tests/data/fate/lavf-gif.err for details.

This one giving the same result as pre-patch. Are you sure you ran fate 
on a clean tree and build folder?
James Almer May 22, 2023, 4:07 p.m. UTC | #12
On 5/22/2023 12:49 PM, Paul B Mahol wrote:
> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>> Attached patches.
>>
>> This finally removes giant hacks in gif demuxer and allows using gif
>> files via pipe reliably.
>>
> 
> Now with smaller diff.

[...]

> From f3d6eea43df686b4211601b194fac81f032eb273 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Sun, 21 May 2023 02:15:26 +0200
> Subject: [PATCH 1/2] avformat/demux: add support to derive timestamps from
>  packet durations for video
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavformat/demux.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavformat/demux.c b/libavformat/demux.c
> index dec02a1a6b..b3f563ccc7 100644
> --- a/libavformat/demux.c
> +++ b/libavformat/demux.c
> @@ -1195,6 +1195,11 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
>                                       st->time_base,
>                                       AV_ROUND_DOWN);
>              }
> +        } else if ((s->iformat->flags & AVFMT_NOTIMESTAMPS) && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {

Why only for AVFMT_NOTIMESTAMPS formats? Same as the audio check above, 
the parser could set duration regardless of where the packet came from.

> +            if (st->time_base.num > 0 && st->time_base.den > 0 &&
> +                sti->parser->duration) {
> +                out_pkt->duration = sti->parser->duration;
> +            }
>          }
>  
>          out_pkt->stream_index = st->index;
> -- 
> 2.39.1
>
Anton Khirnov May 22, 2023, 4:10 p.m. UTC | #13
Quoting James Almer (2023-05-22 18:07:50)
> On 5/22/2023 12:49 PM, Paul B Mahol wrote:
> > On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> >> Attached patches.
> >>
> >> This finally removes giant hacks in gif demuxer and allows using gif
> >> files via pipe reliably.
> >>
> > 
> > Now with smaller diff.
> 
> [...]
> 
> > From f3d6eea43df686b4211601b194fac81f032eb273 Mon Sep 17 00:00:00 2001
> > From: Paul B Mahol <onemda@gmail.com>
> > Date: Sun, 21 May 2023 02:15:26 +0200
> > Subject: [PATCH 1/2] avformat/demux: add support to derive timestamps from
> >  packet durations for video
> > 
> > Signed-off-by: Paul B Mahol <onemda@gmail.com>
> > ---
> >  libavformat/demux.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/libavformat/demux.c b/libavformat/demux.c
> > index dec02a1a6b..b3f563ccc7 100644
> > --- a/libavformat/demux.c
> > +++ b/libavformat/demux.c
> > @@ -1195,6 +1195,11 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
> >                                       st->time_base,
> >                                       AV_ROUND_DOWN);
> >              }
> > +        } else if ((s->iformat->flags & AVFMT_NOTIMESTAMPS) && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
> 
> Why only for AVFMT_NOTIMESTAMPS formats? Same as the audio check above, 
> the parser could set duration regardless of where the packet came from.

I suggested that on IRC.

The idea is that container durations are authoritative for video, so
parser duration should only be used when we do not have container
timing.
Paul B Mahol May 22, 2023, 4:19 p.m. UTC | #14
On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> Attached patches.
>
> This finally removes giant hacks in gif demuxer and allows using gif
> files via pipe reliably.
>

Hopefully final version.
James Almer May 22, 2023, 8:01 p.m. UTC | #15
On 5/22/2023 1:19 PM, Paul B Mahol wrote:
> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
>> Attached patches.
>>
>> This finally removes giant hacks in gif demuxer and allows using gif
>> files via pipe reliably.
>>
> 
> Hopefully final version.

Should be ok.
Michael Niedermayer May 23, 2023, 9:51 p.m. UTC | #16
On Mon, May 22, 2023 at 06:19:09PM +0200, Paul B Mahol wrote:
> On 5/21/23, Paul B Mahol <onemda@gmail.com> wrote:
> > Attached patches.
> >
> > This finally removes giant hacks in gif demuxer and allows using gif
> > files via pipe reliably.
> >
> 
> Hopefully final version.

[...]

>  libavcodec/gifdec.c      |   11 +-
>  libavformat/gifdec.c     |  244 +++++++++++------------------------------------
>  tests/ref/fate/gif-demux |    2 
>  3 files changed, 70 insertions(+), 187 deletions(-)
> 8624c021a27e9ac3d18db4e560179c3fe359953f  0002-avformat-gifdec-switch-to-using-gif-parser.patch
> From 899afe00bf969b8c47c6fb5afbde3a8f9be1536d Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Sat, 20 May 2023 14:13:27 +0200
> Subject: [PATCH 2/2] avformat/gifdec: switch to using gif parser
> 
> Update fate test, more correct as last packet is not truncated.
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/gifdec.c      |  11 +-
>  libavformat/gifdec.c     | 244 ++++++++++-----------------------------
>  tests/ref/fate/gif-demux |   2 +-
>  3 files changed, 70 insertions(+), 187 deletions(-)

seems to break resyncing

./ffmpeg -y  -f gif -i resync.gif -bitexact resync.nut

file at:
https://samples.ffmpeg.org/image-samples/GIF/resync.gif


[...]
diff mbox series

Patch

From 34d5798c924d9ac2da21f3a729af497950106ab2 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 20 May 2023 14:13:27 +0200
Subject: [PATCH 3/3] avformat/gifdec: switch to using gif parser

Update fate, more correct as timebase is not reduced.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/gifdec.c                    |  11 +-
 libavformat/gifdec.c                   | 243 +++++------------
 tests/ref/fate/gif-color               | 348 ++++++++++++-------------
 tests/ref/fate/gif-deal                | 314 ++++++++++++++++++++--
 tests/ref/fate/gif-disposal-background |  12 +-
 tests/ref/fate/gif-disposal-restore    |   6 +-
 tests/ref/fate/gifenc-bgr4_byte        | 348 ++++++++++++-------------
 tests/ref/fate/gifenc-bgr8             | 348 ++++++++++++-------------
 tests/ref/fate/gifenc-gray             | 348 ++++++++++++-------------
 tests/ref/fate/gifenc-pal8             | 348 ++++++++++++-------------
 tests/ref/fate/gifenc-rgb4_byte        | 348 ++++++++++++-------------
 tests/ref/fate/gifenc-rgb8             | 348 ++++++++++++-------------
 12 files changed, 1584 insertions(+), 1438 deletions(-)

diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index d66e16105b..33d8210ef4 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -473,10 +473,6 @@  static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
 
     bytestream2_init(&s->gb, avpkt->data, avpkt->size);
 
-    s->frame->pts     = avpkt->pts;
-    s->frame->pkt_dts = avpkt->dts;
-    s->frame->duration = avpkt->duration;
-
     if (avpkt->size >= 6) {
         s->keyframe = memcmp(avpkt->data, gif87a_sig, 6) == 0 ||
                       memcmp(avpkt->data, gif89a_sig, 6) == 0;
@@ -523,6 +519,13 @@  static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
 
     if ((ret = av_frame_ref(rframe, s->frame)) < 0)
         return ret;
+    if (s->keyframe) {
+        rframe->pict_type = AV_PICTURE_TYPE_I;
+        rframe->flags |= AV_FRAME_FLAG_KEY;
+    } else {
+        rframe->pict_type = AV_PICTURE_TYPE_P;
+        rframe->flags &= ~AV_FRAME_FLAG_KEY;
+    }
     *got_frame = 1;
 
     return bytestream2_tell(&s->gb);
diff --git a/libavformat/gifdec.c b/libavformat/gifdec.c
index 1977f46e3a..9ed8084344 100644
--- a/libavformat/gifdec.c
+++ b/libavformat/gifdec.c
@@ -28,9 +28,12 @@ 
 #include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/opt.h"
+#include "avio_internal.h"
 #include "internal.h"
 #include "libavcodec/gif.h"
 
+#define GIF_PACKET_SIZE 1024
+
 typedef struct GIFDemuxContext {
     const AVClass *class;
     /**
@@ -53,9 +56,6 @@  typedef struct GIFDemuxContext {
     int total_iter;
     int iter_count;
     int ignore_loop;
-
-    int nb_frames;
-    int last_duration;
 } GIFDemuxContext;
 
 /**
@@ -84,8 +84,8 @@  static int gif_probe(const AVProbeData *p)
 
 static int resync(AVIOContext *pb)
 {
-    int i;
-    for (i = 0; i < 6; i++) {
+    ffio_ensure_seekback(pb, 13);
+    for (int i = 0; i < 6; i++) {
         int b = avio_r8(pb);
         if (b != gif87a_sig[i] && b != gif89a_sig[i])
             i = -(b != 'G');
@@ -132,6 +132,9 @@  static int gif_read_header(AVFormatContext *s)
     if (!st)
         return AVERROR(ENOMEM);
 
+    if (!(pb->seekable & AVIO_SEEKABLE_NORMAL))
+        goto skip;
+
     if (flags & 0x80)
         avio_skip(pb, 3 * (1 << ((flags & 0x07) + 1)));
 
@@ -158,15 +161,37 @@  static int gif_read_header(AVFormatContext *s)
 
                     avio_skip(pb, 1);
                     delay = avio_rl16(pb);
-                    if (delay < gdc->min_delay)
-                        delay = gdc->default_delay;
-                    delay = FFMIN(delay, gdc->max_delay);
+                    delay = delay ? delay : gdc->default_delay;
                     duration += delay;
                     avio_skip(pb, 1);
                 } else {
                     avio_skip(pb, block_size);
                 }
                 gif_skip_subblocks(pb);
+            } else if (subtype == GIF_APP_EXT_LABEL) {
+                uint8_t data[256];
+                int sb_size;
+
+                sb_size = avio_r8(pb);
+                ret = avio_read(pb, data, sb_size);
+                if (ret < 0 || !sb_size)
+                    break;
+
+                if (sb_size == strlen(NETSCAPE_EXT_STR)) {
+                    sb_size = avio_r8(pb);
+                    ret = avio_read(pb, data, sb_size);
+                    if (ret < 0 || !sb_size)
+                        break;
+
+                    if (sb_size == 3 && data[0] == 1) {
+                        gdc->total_iter = AV_RL16(data+1);
+                        av_log(s, AV_LOG_DEBUG, "Loop count is %d\n", gdc->total_iter);
+
+                        if (gdc->total_iter == 0)
+                            gdc->total_iter = -1;
+                    }
+                }
+                gif_skip_subblocks(pb);
             } else {
                 gif_skip_subblocks(pb);
             }
@@ -183,203 +208,58 @@  static int gif_read_header(AVFormatContext *s)
         }
     }
 
+skip:
+    /* jump to start because gif decoder needs header data too */
+    if (avio_seek(pb, 0, SEEK_SET) != 0)
+        return AVERROR(EIO);
+
     /* GIF format operates with time in "hundredths of second",
      * therefore timebase is 1/100 */
     avpriv_set_pts_info(st, 64, 1, 100);
+    ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
     st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codecpar->codec_id   = AV_CODEC_ID_GIF;
     st->codecpar->width      = width;
     st->codecpar->height     = height;
+    if (nb_frames != 1) {
+        st->avg_frame_rate   =
+        st->r_frame_rate     = av_inv_q(st->time_base);
+    } else {
+        st->avg_frame_rate   =
+        st->r_frame_rate     = (AVRational) {100, duration};
+    }
     st->start_time           = 0;
     st->duration             = duration;
     st->nb_frames            = nb_frames;
-    if (n) {
-        st->codecpar->sample_aspect_ratio.num = n + 15;
-        st->codecpar->sample_aspect_ratio.den = 64;
-    }
-
-    /* jump to start because gif decoder needs header data too */
-    if (avio_seek(pb, 0, SEEK_SET) != 0)
-        return AVERROR(EIO);
+    if (n)
+        st->codecpar->sample_aspect_ratio = av_make_q(n + 15, 64);
 
     return 0;
 }
 
-static int gif_read_ext(AVFormatContext *s)
+static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     GIFDemuxContext *gdc = s->priv_data;
     AVIOContext *pb = s->pb;
-    int sb_size, ext_label = avio_r8(pb);
     int ret;
 
-    if (ext_label == GIF_GCE_EXT_LABEL) {
-        if ((sb_size = avio_r8(pb)) < 4) {
-            av_log(s, AV_LOG_FATAL, "Graphic Control Extension block's size less than 4.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* skip packed fields */
-        if ((ret = avio_skip(pb, 1)) < 0)
-            return ret;
-
-        gdc->delay = avio_rl16(pb);
-
-        if (gdc->delay < gdc->min_delay)
-            gdc->delay = gdc->default_delay;
-        gdc->delay = FFMIN(gdc->delay, gdc->max_delay);
-
-        /* skip the rest of the Graphic Control Extension block */
-        if ((ret = avio_skip(pb, sb_size - 3)) < 0 )
-            return ret;
-    } else if (ext_label == GIF_APP_EXT_LABEL) {
-        uint8_t data[256];
-
-        sb_size = avio_r8(pb);
-        ret = avio_read(pb, data, sb_size);
-        if (ret < 0 || !sb_size)
-            return ret;
-
-        if (sb_size == strlen(NETSCAPE_EXT_STR)) {
-            sb_size = avio_r8(pb);
-            ret = avio_read(pb, data, sb_size);
-            if (ret < 0 || !sb_size)
-                return ret;
-
-            if (sb_size == 3 && data[0] == 1) {
-                gdc->total_iter = AV_RL16(data+1);
-                av_log(s, AV_LOG_DEBUG, "Loop count is %d\n", gdc->total_iter);
-
-                if (gdc->total_iter == 0)
-                    gdc->total_iter = -1;
-            }
-        }
+    if ((pb->seekable & AVIO_SEEKABLE_NORMAL) &&
+        !gdc->ignore_loop && avio_feof(pb) &&
+        (gdc->total_iter < 0 || (++gdc->iter_count < gdc->total_iter))) {
+        avio_seek(pb, 0, SEEK_SET);
     }
-
-    if ((ret = gif_skip_subblocks(pb)) < 0)
+    if ((ret = av_new_packet(pkt, GIF_PACKET_SIZE)) < 0)
         return ret;
 
-    return 0;
-}
-
-static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    GIFDemuxContext *gdc = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int packed_fields, block_label, ct_size,
-        keyframe, frame_parsed = 0, ret;
-    int64_t frame_start = avio_tell(pb), frame_end;
-    unsigned char buf[6];
-
-    if ((ret = avio_read(pb, buf, 6)) == 6) {
-        keyframe = memcmp(buf, gif87a_sig, 6) == 0 ||
-                   memcmp(buf, gif89a_sig, 6) == 0;
-    } else if (ret < 0) {
+    pkt->pos = avio_tell(pb);
+    pkt->stream_index = 0;
+    ret = avio_read_partial(pb, pkt->data, GIF_PACKET_SIZE);
+    if (ret < 0) {
+        av_packet_unref(pkt);
         return ret;
-    } else {
-        keyframe = 0;
     }
-
-    if (keyframe) {
-parse_keyframe:
-        /* skip 2 bytes of width and 2 of height */
-        if ((ret = avio_skip(pb, 4)) < 0)
-            return ret;
-
-        packed_fields = avio_r8(pb);
-
-        /* skip 1 byte of Background Color Index and 1 byte of Pixel Aspect Ratio */
-        if ((ret = avio_skip(pb, 2)) < 0)
-            return ret;
-
-        /* global color table presence */
-        if (packed_fields & 0x80) {
-            ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
-
-            if ((ret = avio_skip(pb, ct_size)) < 0)
-                return ret;
-        }
-    } else {
-        avio_seek(pb, -ret, SEEK_CUR);
-        ret = AVERROR_EOF;
-    }
-
-    while (GIF_TRAILER != (block_label = avio_r8(pb)) && !avio_feof(pb)) {
-        if (block_label == GIF_EXTENSION_INTRODUCER) {
-            if ((ret = gif_read_ext (s)) < 0 )
-                goto resync;
-        } else if (block_label == GIF_IMAGE_SEPARATOR) {
-            /* skip to last byte of Image Descriptor header */
-            if ((ret = avio_skip(pb, 8)) < 0)
-                return ret;
-
-            packed_fields = avio_r8(pb);
-
-            /* local color table presence */
-            if (packed_fields & 0x80) {
-                ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
-
-                if ((ret = avio_skip(pb, ct_size)) < 0)
-                    return ret;
-            }
-
-            /* read LZW Minimum Code Size */
-            if (avio_r8(pb) < 1) {
-                av_log(s, AV_LOG_ERROR, "lzw minimum code size must be >= 1\n");
-                goto resync;
-            }
-
-            if ((ret = gif_skip_subblocks(pb)) < 0)
-                goto resync;
-
-            frame_end = avio_tell(pb);
-
-            if (avio_seek(pb, frame_start, SEEK_SET) != frame_start)
-                return AVERROR(EIO);
-
-            ret = av_get_packet(pb, pkt, frame_end - frame_start);
-            if (ret < 0)
-                return ret;
-
-            if (keyframe)
-                pkt->flags |= AV_PKT_FLAG_KEY;
-
-            pkt->stream_index = 0;
-            pkt->duration = gdc->delay;
-
-            gdc->nb_frames ++;
-            gdc->last_duration = pkt->duration;
-
-            /* Graphic Control Extension's scope is single frame.
-             * Remove its influence. */
-            gdc->delay = gdc->default_delay;
-            frame_parsed = 1;
-
-            break;
-        } else {
-            av_log(s, AV_LOG_ERROR, "invalid block label\n");
-resync:
-            if (!keyframe)
-                avio_seek(pb, frame_start, SEEK_SET);
-            if ((ret = resync(pb)) < 0)
-                return ret;
-            frame_start = avio_tell(pb) - 6;
-            keyframe = 1;
-            goto parse_keyframe;
-        }
-    }
-
-    if ((ret >= 0 && !frame_parsed) || ret == AVERROR_EOF) {
-        if (gdc->nb_frames == 1) {
-            s->streams[0]->r_frame_rate = (AVRational) {100, gdc->last_duration};
-        }
-        /* This might happen when there is no image block
-         * between extension blocks and GIF_TRAILER or EOF */
-        if (!gdc->ignore_loop && (block_label == GIF_TRAILER || avio_feof(pb))
-            && (gdc->total_iter < 0 || ++gdc->iter_count < gdc->total_iter))
-            return avio_seek(pb, 0, SEEK_SET);
-        return AVERROR_EOF;
-    } else
-        return ret;
+    av_shrink_packet(pkt, ret);
+    return ret;
 }
 
 static const AVOption options[] = {
@@ -406,5 +286,6 @@  const AVInputFormat ff_gif_demuxer = {
     .read_header    = gif_read_header,
     .read_packet    = gif_read_packet,
     .flags          = AVFMT_GENERIC_INDEX,
+    .extensions     = "gif",
     .priv_class     = &demuxer_class,
 };
diff --git a/tests/ref/fate/gif-color b/tests/ref/fate/gif-color
index c88a05deee..0db0ad1a3a 100644
--- a/tests/ref/fate/gif-color
+++ b/tests/ref/fate/gif-color
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,   188356, 0xf0944065
-0,          1,          1,        1,   188356, 0x146ed4c4
-0,          2,          2,        1,   188356, 0x96866a6f
-0,          3,          3,        1,   188356, 0xe15e1f1c
-0,          4,          4,        1,   188356, 0x0662c1d0
-0,          5,          5,        1,   188356, 0x88fa6cc4
-0,          6,          6,        1,   188356, 0x3cce2f71
-0,          7,          7,        1,   188356, 0x1510f9f3
-0,          8,          8,        1,   188356, 0xf27e9fa8
-0,          9,          9,        1,   188356, 0x0f4b64a2
-0,         10,         10,        1,   188356, 0x3d2714a5
-0,         11,         11,        1,   188356, 0x392ce45d
-0,         12,         12,        1,   188356, 0x2eadb79f
-0,         13,         13,        1,   188356, 0x68109314
-0,         14,         14,        1,   188356, 0x4eca71ac
-0,         15,         15,        1,   188356, 0xa9aa5907
-0,         16,         16,        1,   188356, 0x2a5d08c0
-0,         17,         17,        1,   188356, 0x942bba84
-0,         18,         18,        1,   188356, 0xbee38983
-0,         19,         19,        1,   188356, 0xa0d65a5a
-0,         20,         20,        1,   188356, 0x47270bee
-0,         21,         21,        1,   188356, 0xc020dc40
-0,         22,         22,        1,   188356, 0x978dbc8f
-0,         23,         23,        1,   188356, 0x6b1e9f1b
-0,         24,         24,        1,   188356, 0xd8078bf4
-0,         25,         25,        1,   188356, 0x94ca7bd7
-0,         26,         26,        1,   188356, 0xac745e77
-0,         27,         27,        1,   188356, 0x73154f2c
-0,         28,         28,        1,   188356, 0x31200601
-0,         29,         29,        1,   188356, 0x6525dd42
-0,         30,         30,        1,   188356, 0xa29b985a
-0,         31,         31,        1,   188356, 0xe3e074d8
-0,         32,         32,        1,   188356, 0xb87b3222
-0,         33,         33,        1,   188356, 0x5b9a11f2
-0,         34,         34,        1,   188356, 0x25f7f8c9
-0,         35,         35,        1,   188356, 0x0235e93c
-0,         36,         36,        1,   188356, 0x2a42d643
-0,         37,         37,        1,   188356, 0xfb7acddb
-0,         38,         38,        1,   188356, 0xecbbbf5e
-0,         39,         39,        1,   188356, 0xeba4bc9a
-0,         40,         40,        1,   188356, 0x4317b36b
-0,         41,         41,        1,   188356, 0x7316ae1a
-0,         42,         42,        1,   188356, 0xb5ccad05
-0,         43,         43,        1,   188356, 0x38afb0dc
-0,         44,         44,        1,   188356, 0xf11cad55
-0,         45,         45,        1,   188356, 0x3d77b400
-0,         46,         46,        1,   188356, 0xf084b9b9
-0,         47,         47,        1,   188356, 0x02a4c584
-0,         48,         48,        1,   188356, 0x14f4d52e
-0,         49,         49,        1,   188356, 0x55118432
-0,         50,         50,        1,   188356, 0x4ad82e9f
-0,         51,         51,        1,   188356, 0xc6eafc52
-0,         52,         52,        1,   188356, 0xf4bdc575
-0,         53,         53,        1,   188356, 0x8429689e
-0,         54,         54,        1,   188356, 0xaa23019e
-0,         55,         55,        1,   188356, 0xaf52c3a5
-0,         56,         56,        1,   188356, 0x1d387c32
-0,         57,         57,        1,   188356, 0x543d5cd2
-0,         58,         58,        1,   188356, 0x8cdb399c
-0,         59,         59,        1,   188356, 0xcceb292f
-0,         60,         60,        1,   188356, 0xa87115e8
-0,         61,         61,        1,   188356, 0x9665ec8f
-0,         62,         62,        1,   188356, 0xad99baf4
-0,         63,         63,        1,   188356, 0xc6e5a2b5
-0,         64,         64,        1,   188356, 0xe2a48359
-0,         65,         65,        1,   188356, 0x3a270df0
-0,         66,         66,        1,   188356, 0xcc34826b
-0,         67,         67,        1,   188356, 0x15ec2dcc
-0,         68,         68,        1,   188356, 0x8874c5f9
-0,         69,         69,        1,   188356, 0x829966e8
-0,         70,         70,        1,   188356, 0x691f1ebb
-0,         71,         71,        1,   188356, 0x00e3e184
-0,         72,         72,        1,   188356, 0x97739332
-0,         73,         73,        1,   188356, 0x507769aa
-0,         74,         74,        1,   188356, 0xddfb3069
-0,         75,         75,        1,   188356, 0x7296f749
-0,         76,         76,        1,   188356, 0x0555ca32
-0,         77,         77,        1,   188356, 0x4554c683
-0,         78,         78,        1,   188356, 0x2398c10f
-0,         79,         79,        1,   188356, 0x1c5ccfa0
-0,         80,         80,        1,   188356, 0xa580f3c8
-0,         81,         81,        1,   188356, 0x4fadea78
-0,         82,         82,        1,   188356, 0x4a57db38
-0,         83,         83,        1,   188356, 0x9e98df6d
-0,         84,         84,        1,   188356, 0xfeb3dec9
-0,         85,         85,        1,   188356, 0xbf16ef7a
-0,         86,         86,        1,   188356, 0xdc23fc48
-0,         87,         87,        1,   188356, 0x3bf2e401
-0,         88,         88,        1,   188356, 0xc832bcf4
-0,         89,         89,        1,   188356, 0x977db44f
-0,         90,         90,        1,   188356, 0x18d39d96
-0,         91,         91,        1,   188356, 0x9adf60d8
-0,         92,         92,        1,   188356, 0x567b667a
-0,         93,         93,        1,   188356, 0xd4a45e8e
-0,         94,         94,        1,   188356, 0x94a24cc7
-0,         95,         95,        1,   188356, 0x086f0a53
-0,         96,         96,        1,   188356, 0xcbf3ebcb
-0,         97,         97,        1,   188356, 0x1a40a7b9
-0,         98,         98,        1,   188356, 0xe16d8964
-0,         99,         99,        1,   188356, 0x3edd7dfa
-0,        100,        100,        1,   188356, 0xba417fa5
-0,        101,        101,        1,   188356, 0x734a7611
-0,        102,        102,        1,   188356, 0xfa1e7b1e
-0,        103,        103,        1,   188356, 0x1af23355
-0,        104,        104,        1,   188356, 0x28d41390
-0,        105,        105,        1,   188356, 0x2838c58d
-0,        106,        106,        1,   188356, 0x4e2ba2a8
-0,        107,        107,        1,   188356, 0xcedc99ae
-0,        108,        108,        1,   188356, 0xb06ba12d
-0,        109,        109,        1,   188356, 0x38c997b6
-0,        110,        110,        1,   188356, 0x12dba0dc
-0,        111,        111,        1,   188356, 0x5f86496a
-0,        112,        112,        1,   188356, 0x0b74216d
-0,        113,        113,        1,   188356, 0xdbddbada
-0,        114,        114,        1,   188356, 0x7d168af2
-0,        115,        115,        1,   188356, 0x22d4462b
-0,        116,        116,        1,   188356, 0xc248265d
-0,        117,        117,        1,   188356, 0x37a41b0d
-0,        118,        118,        1,   188356, 0x9ebd24f1
-0,        119,        119,        1,   188356, 0xf21f1633
-0,        120,        120,        1,   188356, 0x1db62004
-0,        121,        121,        1,   188356, 0xcc241ac1
-0,        122,        122,        1,   188356, 0x224d2637
-0,        123,        123,        1,   188356, 0x1bd8390c
-0,        124,        124,        1,   188356, 0xd8e64966
-0,        125,        125,        1,   188356, 0x96e66287
-0,        126,        126,        1,   188356, 0xa83c9a32
-0,        127,        127,        1,   188356, 0x3a5faeba
-0,        128,        128,        1,   188356, 0x8200cd87
-0,        129,        129,        1,   188356, 0x6326e591
-0,        130,        130,        1,   188356, 0xb5d70993
-0,        131,        131,        1,   188356, 0x954d5da2
-0,        132,        132,        1,   188356, 0x38b1788b
-0,        133,        133,        1,   188356, 0x4aafa131
-0,        134,        134,        1,   188356, 0xaff2be78
-0,        135,        135,        1,   188356, 0x9bd7eb69
-0,        136,        136,        1,   188356, 0x0d2b17c9
-0,        137,        137,        1,   188356, 0xf5d8a764
-0,        138,        138,        1,   188356, 0xa302dfb2
-0,        139,        139,        1,   188356, 0xe8a32ac1
-0,        140,        140,        1,   188356, 0x50a8470d
-0,        141,        141,        1,   188356, 0x52826061
-0,        142,        142,        1,   188356, 0x26e88798
-0,        143,        143,        1,   188356, 0x1448acb8
-0,        144,        144,        1,   188356, 0xfb380972
-0,        145,        145,        1,   188356, 0x184976e8
-0,        146,        146,        1,   188356, 0xa349a871
-0,        147,        147,        1,   188356, 0x617ed8b1
-0,        148,        148,        1,   188356, 0xb6bc1425
-0,        149,        149,        1,   188356, 0xafe74efd
-0,        150,        150,        1,   188356, 0x0b8b61e5
-0,        151,        151,        1,   188356, 0xc6ad67a7
-0,        152,        152,        1,   188356, 0x4da186fe
-0,        153,        153,        1,   188356, 0xe08f9975
-0,        154,        154,        1,   188356, 0xa43f8ba4
-0,        155,        155,        1,   188356, 0xcad4b6b5
-0,        156,        156,        1,   188356, 0x7e70d51e
-0,        157,        157,        1,   188356, 0x429b0b5b
-0,        158,        158,        1,   188356, 0xea92350d
-0,        159,        159,        1,   188356, 0x9a7440f8
-0,        160,        160,        1,   188356, 0x63a2be6e
-0,        161,        161,        1,   188356, 0x59b64b50
-0,        162,        162,        1,   188356, 0x63c4a10e
-0,        163,        163,        1,   188356, 0x6146e5e0
-0,        164,        164,        1,   188356, 0x603b2ae5
-0,        165,        165,        1,   188356, 0x818bc774
-0,        166,        166,        1,   188356, 0xa5ce278f
-0,        167,        167,        1,   188356, 0x4d85684d
-0,        168,        168,        1,   188356, 0xbbda9cad
-0,        169,        169,        1,   188356, 0xfee2e78e
-0,        170,        170,        1,   188356, 0x681d2635
-0,        171,        171,        1,   188356, 0x05354903
-0,        172,        172,        1,   188356, 0x8eecac99
+0,          0,          0,        9,   188356, 0xf0944065
+0,         10,         10,       10,   188356, 0x146ed4c4
+0,         20,         20,       10,   188356, 0x96866a6f
+0,         30,         30,       10,   188356, 0xe15e1f1c
+0,         40,         40,       10,   188356, 0x0662c1d0
+0,         50,         50,       10,   188356, 0x88fa6cc4
+0,         60,         60,       10,   188356, 0x3cce2f71
+0,         70,         70,       10,   188356, 0x1510f9f3
+0,         80,         80,       10,   188356, 0xf27e9fa8
+0,         90,         90,       10,   188356, 0x0f4b64a2
+0,        100,        100,       10,   188356, 0x3d2714a5
+0,        110,        110,       10,   188356, 0x392ce45d
+0,        120,        120,       10,   188356, 0x2eadb79f
+0,        130,        130,       10,   188356, 0x68109314
+0,        140,        140,       10,   188356, 0x4eca71ac
+0,        150,        150,       10,   188356, 0xa9aa5907
+0,        160,        160,       10,   188356, 0x2a5d08c0
+0,        170,        170,       10,   188356, 0x942bba84
+0,        180,        180,       10,   188356, 0xbee38983
+0,        190,        190,       10,   188356, 0xa0d65a5a
+0,        200,        200,       10,   188356, 0x47270bee
+0,        210,        210,       10,   188356, 0xc020dc40
+0,        220,        220,       10,   188356, 0x978dbc8f
+0,        230,        230,       10,   188356, 0x6b1e9f1b
+0,        240,        240,       10,   188356, 0xd8078bf4
+0,        250,        250,       10,   188356, 0x94ca7bd7
+0,        260,        260,       10,   188356, 0xac745e77
+0,        270,        270,       10,   188356, 0x73154f2c
+0,        280,        280,       10,   188356, 0x31200601
+0,        290,        290,       10,   188356, 0x6525dd42
+0,        300,        300,       10,   188356, 0xa29b985a
+0,        310,        310,       10,   188356, 0xe3e074d8
+0,        320,        320,       10,   188356, 0xb87b3222
+0,        330,        330,       10,   188356, 0x5b9a11f2
+0,        340,        340,       10,   188356, 0x25f7f8c9
+0,        350,        350,       10,   188356, 0x0235e93c
+0,        360,        360,       10,   188356, 0x2a42d643
+0,        370,        370,       10,   188356, 0xfb7acddb
+0,        380,        380,       10,   188356, 0xecbbbf5e
+0,        390,        390,       10,   188356, 0xeba4bc9a
+0,        400,        400,       10,   188356, 0x4317b36b
+0,        410,        410,       10,   188356, 0x7316ae1a
+0,        420,        420,       10,   188356, 0xb5ccad05
+0,        430,        430,       10,   188356, 0x38afb0dc
+0,        440,        440,       10,   188356, 0xf11cad55
+0,        450,        450,       10,   188356, 0x3d77b400
+0,        460,        460,       10,   188356, 0xf084b9b9
+0,        470,        470,       10,   188356, 0x02a4c584
+0,        480,        480,       10,   188356, 0x14f4d52e
+0,        490,        490,       10,   188356, 0x55118432
+0,        500,        500,       10,   188356, 0x4ad82e9f
+0,        510,        510,       10,   188356, 0xc6eafc52
+0,        520,        520,       10,   188356, 0xf4bdc575
+0,        530,        530,       10,   188356, 0x8429689e
+0,        540,        540,       10,   188356, 0xaa23019e
+0,        550,        550,       10,   188356, 0xaf52c3a5
+0,        560,        560,       10,   188356, 0x1d387c32
+0,        570,        570,       10,   188356, 0x543d5cd2
+0,        580,        580,       10,   188356, 0x8cdb399c
+0,        590,        590,       10,   188356, 0xcceb292f
+0,        600,        600,       10,   188356, 0xa87115e8
+0,        610,        610,       10,   188356, 0x9665ec8f
+0,        620,        620,       10,   188356, 0xad99baf4
+0,        630,        630,       10,   188356, 0xc6e5a2b5
+0,        640,        640,       10,   188356, 0xe2a48359
+0,        650,        650,       10,   188356, 0x3a270df0
+0,        660,        660,       10,   188356, 0xcc34826b
+0,        670,        670,       10,   188356, 0x15ec2dcc
+0,        680,        680,       10,   188356, 0x8874c5f9
+0,        690,        690,       10,   188356, 0x829966e8
+0,        700,        700,       10,   188356, 0x691f1ebb
+0,        710,        710,       10,   188356, 0x00e3e184
+0,        720,        720,       10,   188356, 0x97739332
+0,        730,        730,       10,   188356, 0x507769aa
+0,        740,        740,       10,   188356, 0xddfb3069
+0,        750,        750,       10,   188356, 0x7296f749
+0,        760,        760,       10,   188356, 0x0555ca32
+0,        770,        770,       10,   188356, 0x4554c683
+0,        780,        780,       10,   188356, 0x2398c10f
+0,        790,        790,       10,   188356, 0x1c5ccfa0
+0,        800,        800,       10,   188356, 0xa580f3c8
+0,        810,        810,       10,   188356, 0x4fadea78
+0,        820,        820,       10,   188356, 0x4a57db38
+0,        830,        830,       10,   188356, 0x9e98df6d
+0,        840,        840,       10,   188356, 0xfeb3dec9
+0,        850,        850,       10,   188356, 0xbf16ef7a
+0,        860,        860,       10,   188356, 0xdc23fc48
+0,        870,        870,       10,   188356, 0x3bf2e401
+0,        880,        880,       10,   188356, 0xc832bcf4
+0,        890,        890,       10,   188356, 0x977db44f
+0,        900,        900,       10,   188356, 0x18d39d96
+0,        910,        910,       10,   188356, 0x9adf60d8
+0,        920,        920,       10,   188356, 0x567b667a
+0,        930,        930,       10,   188356, 0xd4a45e8e
+0,        940,        940,       10,   188356, 0x94a24cc7
+0,        950,        950,       10,   188356, 0x086f0a53
+0,        960,        960,       10,   188356, 0xcbf3ebcb
+0,        970,        970,       10,   188356, 0x1a40a7b9
+0,        980,        980,       10,   188356, 0xe16d8964
+0,        990,        990,       10,   188356, 0x3edd7dfa
+0,       1000,       1000,       10,   188356, 0xba417fa5
+0,       1010,       1010,       10,   188356, 0x734a7611
+0,       1020,       1020,       10,   188356, 0xfa1e7b1e
+0,       1030,       1030,       10,   188356, 0x1af23355
+0,       1040,       1040,       10,   188356, 0x28d41390
+0,       1050,       1050,       10,   188356, 0x2838c58d
+0,       1060,       1060,       10,   188356, 0x4e2ba2a8
+0,       1070,       1070,       10,   188356, 0xcedc99ae
+0,       1080,       1080,       10,   188356, 0xb06ba12d
+0,       1090,       1090,       10,   188356, 0x38c997b6
+0,       1100,       1100,       10,   188356, 0x12dba0dc
+0,       1110,       1110,       10,   188356, 0x5f86496a
+0,       1120,       1120,       10,   188356, 0x0b74216d
+0,       1130,       1130,       10,   188356, 0xdbddbada
+0,       1140,       1140,       10,   188356, 0x7d168af2
+0,       1150,       1150,       10,   188356, 0x22d4462b
+0,       1160,       1160,       10,   188356, 0xc248265d
+0,       1170,       1170,       10,   188356, 0x37a41b0d
+0,       1180,       1180,       10,   188356, 0x9ebd24f1
+0,       1190,       1190,       10,   188356, 0xf21f1633
+0,       1200,       1200,       10,   188356, 0x1db62004
+0,       1210,       1210,       10,   188356, 0xcc241ac1
+0,       1220,       1220,       10,   188356, 0x224d2637
+0,       1230,       1230,       10,   188356, 0x1bd8390c
+0,       1240,       1240,       10,   188356, 0xd8e64966
+0,       1250,       1250,       10,   188356, 0x96e66287
+0,       1260,       1260,       10,   188356, 0xa83c9a32
+0,       1270,       1270,       10,   188356, 0x3a5faeba
+0,       1280,       1280,       10,   188356, 0x8200cd87
+0,       1290,       1290,       10,   188356, 0x6326e591
+0,       1300,       1300,       10,   188356, 0xb5d70993
+0,       1310,       1310,       10,   188356, 0x954d5da2
+0,       1320,       1320,       10,   188356, 0x38b1788b
+0,       1330,       1330,       10,   188356, 0x4aafa131
+0,       1340,       1340,       10,   188356, 0xaff2be78
+0,       1350,       1350,       10,   188356, 0x9bd7eb69
+0,       1360,       1360,       10,   188356, 0x0d2b17c9
+0,       1370,       1370,       10,   188356, 0xf5d8a764
+0,       1380,       1380,       10,   188356, 0xa302dfb2
+0,       1390,       1390,       10,   188356, 0xe8a32ac1
+0,       1400,       1400,       10,   188356, 0x50a8470d
+0,       1410,       1410,       10,   188356, 0x52826061
+0,       1420,       1420,       10,   188356, 0x26e88798
+0,       1430,       1430,       10,   188356, 0x1448acb8
+0,       1440,       1440,       10,   188356, 0xfb380972
+0,       1450,       1450,       10,   188356, 0x184976e8
+0,       1460,       1460,       10,   188356, 0xa349a871
+0,       1470,       1470,       10,   188356, 0x617ed8b1
+0,       1480,       1480,       10,   188356, 0xb6bc1425
+0,       1490,       1490,       10,   188356, 0xafe74efd
+0,       1500,       1500,       10,   188356, 0x0b8b61e5
+0,       1510,       1510,       10,   188356, 0xc6ad67a7
+0,       1520,       1520,       10,   188356, 0x4da186fe
+0,       1530,       1530,       10,   188356, 0xe08f9975
+0,       1540,       1540,       10,   188356, 0xa43f8ba4
+0,       1550,       1550,       10,   188356, 0xcad4b6b5
+0,       1560,       1560,       10,   188356, 0x7e70d51e
+0,       1570,       1570,       10,   188356, 0x429b0b5b
+0,       1580,       1580,       10,   188356, 0xea92350d
+0,       1590,       1590,       10,   188356, 0x9a7440f8
+0,       1600,       1600,       10,   188356, 0x63a2be6e
+0,       1610,       1610,       10,   188356, 0x59b64b50
+0,       1620,       1620,       10,   188356, 0x63c4a10e
+0,       1630,       1630,       10,   188356, 0x6146e5e0
+0,       1640,       1640,       10,   188356, 0x603b2ae5
+0,       1650,       1650,       10,   188356, 0x818bc774
+0,       1660,       1660,       10,   188356, 0xa5ce278f
+0,       1670,       1670,       10,   188356, 0x4d85684d
+0,       1680,       1680,       10,   188356, 0xbbda9cad
+0,       1690,       1690,       10,   188356, 0xfee2e78e
+0,       1700,       1700,       10,   188356, 0x681d2635
+0,       1710,       1710,       10,   188356, 0x05354903
+0,       1720,       1720,       10,   188356, 0x8eecac99
diff --git a/tests/ref/fate/gif-deal b/tests/ref/fate/gif-deal
index 96b7723c1d..b2824399da 100644
--- a/tests/ref/fate/gif-deal
+++ b/tests/ref/fate/gif-deal
@@ -1,31 +1,293 @@ 
-#tb 0: 12/109
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 430x181
 #sar 0: 0/1
 0,          0,          0,        1,   311320, 0x71905396
-0,          1,          1,        1,   311320, 0xed46b01e
-0,          2,          2,        1,   311320, 0xcbb56aa8
-0,          3,          3,        1,   311320, 0xafaab599
-0,          4,          4,        1,   311320, 0x43133abf
-0,          5,          5,        1,   311320, 0xd9677d13
-0,          6,          6,        1,   311320, 0x78abea28
-0,          7,          7,        1,   311320, 0xcb6ca011
-0,          8,          8,        1,   311320, 0x8fd40670
-0,          9,          9,        1,   311320, 0x8fd40670
-0,         10,         10,        1,   311320, 0x8fd40670
-0,         11,         11,        1,   311320, 0x8fd40670
-0,         12,         12,        1,   311320, 0x8fd40670
-0,         13,         13,        1,   311320, 0x8fd40670
-0,         14,         14,        1,   311320, 0x8fd40670
-0,         15,         15,        1,   311320, 0x8fd40670
-0,         16,         16,        1,   311320, 0x8fd40670
-0,         17,         17,        1,   311320, 0x8fd40670
-0,         18,         18,        1,   311320, 0x8fd40670
-0,         19,         19,        1,   311320, 0x8fd40670
-0,         20,         20,        1,   311320, 0x8fd40670
-0,         21,         21,        1,   311320, 0x8fd40670
-0,         22,         22,        1,   311320, 0x8fd40670
-0,         23,         23,        1,   311320, 0x8fd40670
-0,         24,         24,        1,   311320, 0x8fd40670
-0,         25,         25,        1,   311320, 0x8fd40670
+0,          1,          1,        1,   311320, 0x71905396
+0,          2,          2,        1,   311320, 0x71905396
+0,          3,          3,        1,   311320, 0x71905396
+0,          4,          4,        1,   311320, 0x71905396
+0,          5,          5,        1,   311320, 0x71905396
+0,          6,          6,        1,   311320, 0x71905396
+0,          7,          7,        1,   311320, 0x71905396
+0,          8,          8,        1,   311320, 0x71905396
+0,          9,          9,        1,   311320, 0x71905396
+0,         10,         10,        1,   311320, 0x71905396
+0,         11,         11,        1,   311320, 0xed46b01e
+0,         12,         12,        1,   311320, 0xed46b01e
+0,         13,         13,        1,   311320, 0xed46b01e
+0,         14,         14,        1,   311320, 0xed46b01e
+0,         15,         15,        1,   311320, 0xed46b01e
+0,         16,         16,        1,   311320, 0xed46b01e
+0,         17,         17,        1,   311320, 0xed46b01e
+0,         18,         18,        1,   311320, 0xed46b01e
+0,         19,         19,        1,   311320, 0xed46b01e
+0,         20,         20,        1,   311320, 0xed46b01e
+0,         21,         21,        1,   311320, 0xed46b01e
+0,         22,         22,        1,   311320, 0xcbb56aa8
+0,         23,         23,        1,   311320, 0xcbb56aa8
+0,         24,         24,        1,   311320, 0xcbb56aa8
+0,         25,         25,        1,   311320, 0xcbb56aa8
+0,         26,         26,        1,   311320, 0xcbb56aa8
+0,         27,         27,        1,   311320, 0xcbb56aa8
+0,         28,         28,        1,   311320, 0xcbb56aa8
+0,         29,         29,        1,   311320, 0xcbb56aa8
+0,         30,         30,        1,   311320, 0xcbb56aa8
+0,         31,         31,        1,   311320, 0xcbb56aa8
+0,         32,         32,        1,   311320, 0xcbb56aa8
+0,         33,         33,        1,   311320, 0xafaab599
+0,         34,         34,        1,   311320, 0xafaab599
+0,         35,         35,        1,   311320, 0xafaab599
+0,         36,         36,        1,   311320, 0xafaab599
+0,         37,         37,        1,   311320, 0xafaab599
+0,         38,         38,        1,   311320, 0xafaab599
+0,         39,         39,        1,   311320, 0xafaab599
+0,         40,         40,        1,   311320, 0xafaab599
+0,         41,         41,        1,   311320, 0xafaab599
+0,         42,         42,        1,   311320, 0xafaab599
+0,         43,         43,        1,   311320, 0xafaab599
+0,         44,         44,        1,   311320, 0x43133abf
+0,         45,         45,        1,   311320, 0x43133abf
+0,         46,         46,        1,   311320, 0x43133abf
+0,         47,         47,        1,   311320, 0x43133abf
+0,         48,         48,        1,   311320, 0x43133abf
+0,         49,         49,        1,   311320, 0x43133abf
+0,         50,         50,        1,   311320, 0x43133abf
+0,         51,         51,        1,   311320, 0x43133abf
+0,         52,         52,        1,   311320, 0x43133abf
+0,         53,         53,        1,   311320, 0x43133abf
+0,         54,         54,        1,   311320, 0x43133abf
+0,         55,         55,        1,   311320, 0xd9677d13
+0,         56,         56,        1,   311320, 0xd9677d13
+0,         57,         57,        1,   311320, 0xd9677d13
+0,         58,         58,        1,   311320, 0xd9677d13
+0,         59,         59,        1,   311320, 0xd9677d13
+0,         60,         60,        1,   311320, 0xd9677d13
+0,         61,         61,        1,   311320, 0xd9677d13
+0,         62,         62,        1,   311320, 0xd9677d13
+0,         63,         63,        1,   311320, 0xd9677d13
+0,         64,         64,        1,   311320, 0xd9677d13
+0,         65,         65,        1,   311320, 0xd9677d13
+0,         66,         66,        1,   311320, 0x78abea28
+0,         67,         67,        1,   311320, 0x78abea28
+0,         68,         68,        1,   311320, 0x78abea28
+0,         69,         69,        1,   311320, 0x78abea28
+0,         70,         70,        1,   311320, 0x78abea28
+0,         71,         71,        1,   311320, 0x78abea28
+0,         72,         72,        1,   311320, 0x78abea28
+0,         73,         73,        1,   311320, 0x78abea28
+0,         74,         74,        1,   311320, 0x78abea28
+0,         75,         75,        1,   311320, 0x78abea28
+0,         76,         76,        1,   311320, 0x78abea28
+0,         77,         77,        1,   311320, 0xcb6ca011
+0,         78,         78,        1,   311320, 0xcb6ca011
+0,         79,         79,        1,   311320, 0xcb6ca011
+0,         80,         80,        1,   311320, 0xcb6ca011
+0,         81,         81,        1,   311320, 0xcb6ca011
+0,         82,         82,        1,   311320, 0xcb6ca011
+0,         83,         83,        1,   311320, 0xcb6ca011
+0,         84,         84,        1,   311320, 0xcb6ca011
+0,         85,         85,        1,   311320, 0xcb6ca011
+0,         86,         86,        1,   311320, 0xcb6ca011
+0,         87,         87,        1,   311320, 0xcb6ca011
+0,         88,         88,        1,   311320, 0x8fd40670
+0,         89,         89,        1,   311320, 0x8fd40670
+0,         90,         90,        1,   311320, 0x8fd40670
+0,         91,         91,        1,   311320, 0x8fd40670
+0,         92,         92,        1,   311320, 0x8fd40670
+0,         93,         93,        1,   311320, 0x8fd40670
+0,         94,         94,        1,   311320, 0x8fd40670
+0,         95,         95,        1,   311320, 0x8fd40670
+0,         96,         96,        1,   311320, 0x8fd40670
+0,         97,         97,        1,   311320, 0x8fd40670
+0,         98,         98,        1,   311320, 0x8fd40670
+0,         99,         99,        1,   311320, 0x8fd40670
+0,        100,        100,        1,   311320, 0x8fd40670
+0,        101,        101,        1,   311320, 0x8fd40670
+0,        102,        102,        1,   311320, 0x8fd40670
+0,        103,        103,        1,   311320, 0x8fd40670
+0,        104,        104,        1,   311320, 0x8fd40670
+0,        105,        105,        1,   311320, 0x8fd40670
+0,        106,        106,        1,   311320, 0x8fd40670
+0,        107,        107,        1,   311320, 0x8fd40670
+0,        108,        108,        1,   311320, 0x8fd40670
+0,        109,        109,        1,   311320, 0x8fd40670
+0,        110,        110,        1,   311320, 0x8fd40670
+0,        111,        111,        1,   311320, 0x8fd40670
+0,        112,        112,        1,   311320, 0x8fd40670
+0,        113,        113,        1,   311320, 0x8fd40670
+0,        114,        114,        1,   311320, 0x8fd40670
+0,        115,        115,        1,   311320, 0x8fd40670
+0,        116,        116,        1,   311320, 0x8fd40670
+0,        117,        117,        1,   311320, 0x8fd40670
+0,        118,        118,        1,   311320, 0x8fd40670
+0,        119,        119,        1,   311320, 0x8fd40670
+0,        120,        120,        1,   311320, 0x8fd40670
+0,        121,        121,        1,   311320, 0x8fd40670
+0,        122,        122,        1,   311320, 0x8fd40670
+0,        123,        123,        1,   311320, 0x8fd40670
+0,        124,        124,        1,   311320, 0x8fd40670
+0,        125,        125,        1,   311320, 0x8fd40670
+0,        126,        126,        1,   311320, 0x8fd40670
+0,        127,        127,        1,   311320, 0x8fd40670
+0,        128,        128,        1,   311320, 0x8fd40670
+0,        129,        129,        1,   311320, 0x8fd40670
+0,        130,        130,        1,   311320, 0x8fd40670
+0,        131,        131,        1,   311320, 0x8fd40670
+0,        132,        132,        1,   311320, 0x8fd40670
+0,        133,        133,        1,   311320, 0x8fd40670
+0,        134,        134,        1,   311320, 0x8fd40670
+0,        135,        135,        1,   311320, 0x8fd40670
+0,        136,        136,        1,   311320, 0x8fd40670
+0,        137,        137,        1,   311320, 0x8fd40670
+0,        138,        138,        1,   311320, 0x8fd40670
+0,        139,        139,        1,   311320, 0x8fd40670
+0,        140,        140,        1,   311320, 0x8fd40670
+0,        141,        141,        1,   311320, 0x8fd40670
+0,        142,        142,        1,   311320, 0x8fd40670
+0,        143,        143,        1,   311320, 0x8fd40670
+0,        144,        144,        1,   311320, 0x8fd40670
+0,        145,        145,        1,   311320, 0x8fd40670
+0,        146,        146,        1,   311320, 0x8fd40670
+0,        147,        147,        1,   311320, 0x8fd40670
+0,        148,        148,        1,   311320, 0x8fd40670
+0,        149,        149,        1,   311320, 0x8fd40670
+0,        150,        150,        1,   311320, 0x8fd40670
+0,        151,        151,        1,   311320, 0x8fd40670
+0,        152,        152,        1,   311320, 0x8fd40670
+0,        153,        153,        1,   311320, 0x8fd40670
+0,        154,        154,        1,   311320, 0x8fd40670
+0,        155,        155,        1,   311320, 0x8fd40670
+0,        156,        156,        1,   311320, 0x8fd40670
+0,        157,        157,        1,   311320, 0x8fd40670
+0,        158,        158,        1,   311320, 0x8fd40670
+0,        159,        159,        1,   311320, 0x8fd40670
+0,        160,        160,        1,   311320, 0x8fd40670
+0,        161,        161,        1,   311320, 0x8fd40670
+0,        162,        162,        1,   311320, 0x8fd40670
+0,        163,        163,        1,   311320, 0x8fd40670
+0,        164,        164,        1,   311320, 0x8fd40670
+0,        165,        165,        1,   311320, 0x8fd40670
+0,        166,        166,        1,   311320, 0x8fd40670
+0,        167,        167,        1,   311320, 0x8fd40670
+0,        168,        168,        1,   311320, 0x8fd40670
+0,        169,        169,        1,   311320, 0x8fd40670
+0,        170,        170,        1,   311320, 0x8fd40670
+0,        171,        171,        1,   311320, 0x8fd40670
+0,        172,        172,        1,   311320, 0x8fd40670
+0,        173,        173,        1,   311320, 0x8fd40670
+0,        174,        174,        1,   311320, 0x8fd40670
+0,        175,        175,        1,   311320, 0x8fd40670
+0,        176,        176,        1,   311320, 0x8fd40670
+0,        177,        177,        1,   311320, 0x8fd40670
+0,        178,        178,        1,   311320, 0x8fd40670
+0,        179,        179,        1,   311320, 0x8fd40670
+0,        180,        180,        1,   311320, 0x8fd40670
+0,        181,        181,        1,   311320, 0x8fd40670
+0,        182,        182,        1,   311320, 0x8fd40670
+0,        183,        183,        1,   311320, 0x8fd40670
+0,        184,        184,        1,   311320, 0x8fd40670
+0,        185,        185,        1,   311320, 0x8fd40670
+0,        186,        186,        1,   311320, 0x8fd40670
+0,        187,        187,        1,   311320, 0x8fd40670
+0,        188,        188,        1,   311320, 0x8fd40670
+0,        189,        189,        1,   311320, 0x8fd40670
+0,        190,        190,        1,   311320, 0x8fd40670
+0,        191,        191,        1,   311320, 0x8fd40670
+0,        192,        192,        1,   311320, 0x8fd40670
+0,        193,        193,        1,   311320, 0x8fd40670
+0,        194,        194,        1,   311320, 0x8fd40670
+0,        195,        195,        1,   311320, 0x8fd40670
+0,        196,        196,        1,   311320, 0x8fd40670
+0,        197,        197,        1,   311320, 0x8fd40670
+0,        198,        198,        1,   311320, 0x8fd40670
+0,        199,        199,        1,   311320, 0x8fd40670
+0,        200,        200,        1,   311320, 0x8fd40670
+0,        201,        201,        1,   311320, 0x8fd40670
+0,        202,        202,        1,   311320, 0x8fd40670
+0,        203,        203,        1,   311320, 0x8fd40670
+0,        204,        204,        1,   311320, 0x8fd40670
+0,        205,        205,        1,   311320, 0x8fd40670
+0,        206,        206,        1,   311320, 0x8fd40670
+0,        207,        207,        1,   311320, 0x8fd40670
+0,        208,        208,        1,   311320, 0x8fd40670
+0,        209,        209,        1,   311320, 0x8fd40670
+0,        210,        210,        1,   311320, 0x8fd40670
+0,        211,        211,        1,   311320, 0x8fd40670
+0,        212,        212,        1,   311320, 0x8fd40670
+0,        213,        213,        1,   311320, 0x8fd40670
+0,        214,        214,        1,   311320, 0x8fd40670
+0,        215,        215,        1,   311320, 0x8fd40670
+0,        216,        216,        1,   311320, 0x8fd40670
+0,        217,        217,        1,   311320, 0x8fd40670
+0,        218,        218,        1,   311320, 0x8fd40670
+0,        219,        219,        1,   311320, 0x8fd40670
+0,        220,        220,        1,   311320, 0x8fd40670
+0,        221,        221,        1,   311320, 0x8fd40670
+0,        222,        222,        1,   311320, 0x8fd40670
+0,        223,        223,        1,   311320, 0x8fd40670
+0,        224,        224,        1,   311320, 0x8fd40670
+0,        225,        225,        1,   311320, 0x8fd40670
+0,        226,        226,        1,   311320, 0x8fd40670
+0,        227,        227,        1,   311320, 0x8fd40670
+0,        228,        228,        1,   311320, 0x8fd40670
+0,        229,        229,        1,   311320, 0x8fd40670
+0,        230,        230,        1,   311320, 0x8fd40670
+0,        231,        231,        1,   311320, 0x8fd40670
+0,        232,        232,        1,   311320, 0x8fd40670
+0,        233,        233,        1,   311320, 0x8fd40670
+0,        234,        234,        1,   311320, 0x8fd40670
+0,        235,        235,        1,   311320, 0x8fd40670
+0,        236,        236,        1,   311320, 0x8fd40670
+0,        237,        237,        1,   311320, 0x8fd40670
+0,        238,        238,        1,   311320, 0x8fd40670
+0,        239,        239,        1,   311320, 0x8fd40670
+0,        240,        240,        1,   311320, 0x8fd40670
+0,        241,        241,        1,   311320, 0x8fd40670
+0,        242,        242,        1,   311320, 0x8fd40670
+0,        243,        243,        1,   311320, 0x8fd40670
+0,        244,        244,        1,   311320, 0x8fd40670
+0,        245,        245,        1,   311320, 0x8fd40670
+0,        246,        246,        1,   311320, 0x8fd40670
+0,        247,        247,        1,   311320, 0x8fd40670
+0,        248,        248,        1,   311320, 0x8fd40670
+0,        249,        249,        1,   311320, 0x8fd40670
+0,        250,        250,        1,   311320, 0x8fd40670
+0,        251,        251,        1,   311320, 0x8fd40670
+0,        252,        252,        1,   311320, 0x8fd40670
+0,        253,        253,        1,   311320, 0x8fd40670
+0,        254,        254,        1,   311320, 0x8fd40670
+0,        255,        255,        1,   311320, 0x8fd40670
+0,        256,        256,        1,   311320, 0x8fd40670
+0,        257,        257,        1,   311320, 0x8fd40670
+0,        258,        258,        1,   311320, 0x8fd40670
+0,        259,        259,        1,   311320, 0x8fd40670
+0,        260,        260,        1,   311320, 0x8fd40670
+0,        261,        261,        1,   311320, 0x8fd40670
+0,        262,        262,        1,   311320, 0x8fd40670
+0,        263,        263,        1,   311320, 0x8fd40670
+0,        264,        264,        1,   311320, 0x8fd40670
+0,        265,        265,        1,   311320, 0x8fd40670
+0,        266,        266,        1,   311320, 0x8fd40670
+0,        267,        267,        1,   311320, 0x8fd40670
+0,        268,        268,        1,   311320, 0x8fd40670
+0,        269,        269,        1,   311320, 0x8fd40670
+0,        270,        270,        1,   311320, 0x8fd40670
+0,        271,        271,        1,   311320, 0x8fd40670
+0,        272,        272,        1,   311320, 0x8fd40670
+0,        273,        273,        1,   311320, 0x8fd40670
+0,        274,        274,        1,   311320, 0x8fd40670
+0,        275,        275,        1,   311320, 0x8fd40670
+0,        276,        276,        1,   311320, 0x8fd40670
+0,        277,        277,        1,   311320, 0x8fd40670
+0,        278,        278,        1,   311320, 0x8fd40670
+0,        279,        279,        1,   311320, 0x8fd40670
+0,        280,        280,        1,   311320, 0x8fd40670
+0,        281,        281,        1,   311320, 0x8fd40670
+0,        282,        282,        1,   311320, 0x8fd40670
+0,        283,        283,        1,   311320, 0x8fd40670
+0,        284,        284,        1,   311320, 0x8fd40670
+0,        285,        285,        1,   311320, 0x8fd40670
+0,        286,        286,        1,   311320, 0x8fd40670
+0,        287,        287,        1,   311320, 0x8fd40670
diff --git a/tests/ref/fate/gif-disposal-background b/tests/ref/fate/gif-disposal-background
index cd0d827b46..14386e6c4d 100644
--- a/tests/ref/fate/gif-disposal-background
+++ b/tests/ref/fate/gif-disposal-background
@@ -1,10 +1,10 @@ 
-#tb 0: 1/2
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 72x36
 #sar 0: 0/1
-0,          0,          0,        1,    10368, 0x8b200cc8
-0,          1,          1,        1,    10368, 0x4e208e4f
-0,          2,          2,        1,    10368, 0x044dba8b
-0,          3,          3,        1,    10368, 0x1d617e09
-0,          4,          4,        1,    10368, 0xae38a6d2
+0,          0,          0,       49,    10368, 0x8b200cc8
+0,         50,         50,       50,    10368, 0x4e208e4f
+0,        100,        100,       50,    10368, 0x044dba8b
+0,        150,        150,       50,    10368, 0x1d617e09
+0,        200,        200,       50,    10368, 0xae38a6d2
diff --git a/tests/ref/fate/gif-disposal-restore b/tests/ref/fate/gif-disposal-restore
index aca80c5e6d..86f8f30f07 100644
--- a/tests/ref/fate/gif-disposal-restore
+++ b/tests/ref/fate/gif-disposal-restore
@@ -1,8 +1,8 @@ 
-#tb 0: 1/1
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 468x60
 #sar 0: 0/1
 0,          0,          0,        1,   112320, 0xb8afe429
-0,          1,          1,        2,   112320, 0xae588a4b
-0,          3,          3,        1,   112320, 0xccdd27b7
+0,          1,          1,      300,   112320, 0xae588a4b
+0,        301,        301,      100,   112320, 0xccdd27b7
diff --git a/tests/ref/fate/gifenc-bgr4_byte b/tests/ref/fate/gifenc-bgr4_byte
index 2ec314edf2..c6a8863128 100644
--- a/tests/ref/fate/gifenc-bgr4_byte
+++ b/tests/ref/fate/gifenc-bgr4_byte
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,     1297, 0x53e8b1c1
-0,          1,          1,        1,      158, 0xe1873465, F=0x0
-0,          2,          2,        1,      143, 0x56992b17, F=0x0
-0,          3,          3,        1,      169, 0x4f0434c7, F=0x0
-0,          4,          4,        1,      254, 0xb4845bf3, F=0x0
-0,          5,          5,        1,      221, 0xa02a4ae2, F=0x0
-0,          6,          6,        1,      176, 0xdcfc3a8b, F=0x0
-0,          7,          7,        1,      189, 0xb45f3f8d, F=0x0
-0,          8,          8,        1,      139, 0xf2622fc0, F=0x0
-0,          9,          9,        1,      160, 0xf77b327d, F=0x0
-0,         10,         10,        1,      149, 0x56b62de9, F=0x0
-0,         11,         11,        1,      190, 0x1eca3f72, F=0x0
-0,         12,         12,        1,      308, 0xfc7373fc, F=0x0
-0,         13,         13,        1,      193, 0x94304232, F=0x0
-0,         14,         14,        1,      191, 0x82e84504, F=0x0
-0,         15,         15,        1,      198, 0xd31944a2, F=0x0
-0,         16,         16,        1,      417, 0x9547ac22, F=0x0
-0,         17,         17,        1,      163, 0xb55537d0, F=0x0
-0,         18,         18,        1,      383, 0x634f9f88, F=0x0
-0,         19,         19,        1,      193, 0xf6d24046, F=0x0
-0,         20,         20,        1,      337, 0x45d6916f, F=0x0
-0,         21,         21,        1,      199, 0xabb34a72, F=0x0
-0,         22,         22,        1,      308, 0x097f7e58, F=0x0
-0,         23,         23,        1,      186, 0x369b41cc, F=0x0
-0,         24,         24,        1,      199, 0xa93c4113, F=0x0
-0,         25,         25,        1,      163, 0x16823904, F=0x0
-0,         26,         26,        1,      302, 0xaf1d78da, F=0x0
-0,         27,         27,        1,      189, 0x3f7a3bde, F=0x0
-0,         28,         28,        1,      157, 0x45e23500, F=0x0
-0,         29,         29,        1,      205, 0x797b4510, F=0x0
-0,         30,         30,        1,      160, 0x20e533d1, F=0x0
-0,         31,         31,        1,      202, 0xd3b748b3, F=0x0
-0,         32,         32,        1,      160, 0x207c371f, F=0x0
-0,         33,         33,        1,      215, 0x079951b6, F=0x0
-0,         34,         34,        1,      422, 0xbb9db080, F=0x0
-0,         35,         35,        1,      184, 0x3a044098, F=0x0
-0,         36,         36,        1,      289, 0xf2757206, F=0x0
-0,         37,         37,        1,      190, 0xc3264203, F=0x0
-0,         38,         38,        1,      195, 0x28544262, F=0x0
-0,         39,         39,        1,      199, 0x32db4bba, F=0x0
-0,         40,         40,        1,      448, 0x64a8bfe8, F=0x0
-0,         41,         41,        1,      170, 0x62a536d7, F=0x0
-0,         42,         42,        1,      279, 0xe1df6ff6, F=0x0
-0,         43,         43,        1,      180, 0x762f3aac, F=0x0
-0,         44,         44,        1,      303, 0x73727c79, F=0x0
-0,         45,         45,        1,      209, 0xf4a8515c, F=0x0
-0,         46,         46,        1,      198, 0xe09f451e, F=0x0
-0,         47,         47,        1,      194, 0x301e4b04, F=0x0
-0,         48,         48,        1,      186, 0x7c66421b, F=0x0
-0,         49,         49,        1,     1200, 0xe55e34e7, F=0x0
-0,         50,         50,        1,      204, 0x25534779, F=0x0
-0,         51,         51,        1,     1066, 0x9792efa8, F=0x0
-0,         52,         52,        1,      187, 0xd82e41f0, F=0x0
-0,         53,         53,        1,      323, 0x0f9d8485, F=0x0
-0,         54,         54,        1,      205, 0x86ef4c75, F=0x0
-0,         55,         55,        1,      213, 0x6e515113, F=0x0
-0,         56,         56,        1,      208, 0x1ac84bed, F=0x0
-0,         57,         57,        1,      737, 0x68a047be, F=0x0
-0,         58,         58,        1,      181, 0x84353a71, F=0x0
-0,         59,         59,        1,      614, 0x3c9a142a, F=0x0
-0,         60,         60,        1,      215, 0xacaf535d, F=0x0
-0,         61,         61,        1,      291, 0x4dab7020, F=0x0
-0,         62,         62,        1,      208, 0x3dd84d1f, F=0x0
-0,         63,         63,        1,      208, 0x8ccb45cc, F=0x0
-0,         64,         64,        1,      203, 0xa905456b, F=0x0
-0,         65,         65,        1,      531, 0x6b32eaf4, F=0x0
-0,         66,         66,        1,      178, 0xd30b3bff, F=0x0
-0,         67,         67,        1,      446, 0x881abe2a, F=0x0
-0,         68,         68,        1,      188, 0xb5a43e6b, F=0x0
-0,         69,         69,        1,      177, 0x9255436c, F=0x0
-0,         70,         70,        1,      112, 0x2990213a, F=0x0
-0,         71,         71,        1,      296, 0x7d6e7183, F=0x0
-0,         72,         72,        1,      153, 0x35053313, F=0x0
-0,         73,         73,        1,      218, 0xcf105015, F=0x0
-0,         74,         74,        1,      202, 0xb4634837, F=0x0
-0,         75,         75,        1,      239, 0x0a4b5b7b, F=0x0
-0,         76,         76,        1,      139, 0x18d92e35, F=0x0
-0,         77,         77,        1,      467, 0x784dc79e, F=0x0
-0,         78,         78,        1,      274, 0x1e9b78ef, F=0x0
-0,         79,         79,        1,      404, 0xb5c6ab9b, F=0x0
-0,         80,         80,        1,      257, 0x7aaa66ce, F=0x0
-0,         81,         81,        1,      419, 0xcb62b6cb, F=0x0
-0,         82,         82,        1,      208, 0xcbba506d, F=0x0
-0,         83,         83,        1,      294, 0x031a76f9, F=0x0
-0,         84,         84,        1,      191, 0x5ba83f77, F=0x0
-0,         85,         85,        1,      181, 0xfc454323, F=0x0
-0,         86,         86,        1,      218, 0xcd7e540e, F=0x0
-0,         87,         87,        1,      423, 0xdcebc01f, F=0x0
-0,         88,         88,        1,      202, 0x160a4ab6, F=0x0
-0,         89,         89,        1,      317, 0xff2b8104, F=0x0
-0,         90,         90,        1,      172, 0x68753e2d, F=0x0
-0,         91,         91,        1,      275, 0x7f766cd1, F=0x0
-0,         92,         92,        1,      214, 0xf37e5043, F=0x0
-0,         93,         93,        1,      182, 0x5e5544f6, F=0x0
-0,         94,         94,        1,      151, 0xf74532b7, F=0x0
-0,         95,         95,        1,      157, 0xe99b33b0, F=0x0
-0,         96,         96,        1,      202, 0x77994327, F=0x0
-0,         97,         97,        1,      162, 0x93f235fc, F=0x0
-0,         98,         98,        1,      186, 0xc25d3f3f, F=0x0
-0,         99,         99,        1,      318, 0xdf547809, F=0x0
-0,        100,        100,        1,      225, 0xf8074f18, F=0x0
-0,        101,        101,        1,      207, 0x12204757, F=0x0
-0,        102,        102,        1,      212, 0xd2ec4c59, F=0x0
-0,        103,        103,        1,      153, 0x0e1c33cd, F=0x0
-0,        104,        104,        1,      196, 0x45d4455d, F=0x0
-0,        105,        105,        1,      146, 0x5dba32b0, F=0x0
-0,        106,        106,        1,      194, 0x13a8490b, F=0x0
-0,        107,        107,        1,      304, 0xcf73832f, F=0x0
-0,        108,        108,        1,      194, 0x68fd43c9, F=0x0
-0,        109,        109,        1,      190, 0xdbc64442, F=0x0
-0,        110,        110,        1,      204, 0x8eb94b27, F=0x0
-0,        111,        111,        1,      136, 0xd0162d03, F=0x0
-0,        112,        112,        1,      171, 0xbb8b3d15, F=0x0
-0,        113,        113,        1,      140, 0x4cb930a9, F=0x0
-0,        114,        114,        1,      158, 0xdebb32d2, F=0x0
-0,        115,        115,        1,       94, 0x16a71c65, F=0x0
-0,        116,        116,        1,      110, 0x358d20bf, F=0x0
-0,        117,        117,        1,      256, 0x49a469b7, F=0x0
-0,        118,        118,        1,      220, 0x08b95486, F=0x0
-0,        119,        119,        1,      221, 0xe0af4f92, F=0x0
-0,        120,        120,        1,      205, 0x7ac444a5, F=0x0
-0,        121,        121,        1,      169, 0x62c039d3, F=0x0
-0,        122,        122,        1,      970, 0xc8f6c8a6, F=0x0
-0,        123,        123,        1,      181, 0x0d9c42ba, F=0x0
-0,        124,        124,        1,      955, 0xdf5dba5e, F=0x0
-0,        125,        125,        1,      158, 0xa01833fd, F=0x0
-0,        126,        126,        1,      344, 0xd17989f3, F=0x0
-0,        127,        127,        1,      627, 0x8c611977, F=0x0
-0,        128,        128,        1,      172, 0x7cf83c63, F=0x0
-0,        129,        129,        1,      494, 0xadccdc2b, F=0x0
-0,        130,        130,        1,      184, 0x4e784407, F=0x0
-0,        131,        131,        1,      352, 0x852f992b, F=0x0
-0,        132,        132,        1,      351, 0x99e78bb8, F=0x0
-0,        133,        133,        1,      170, 0x9f4b3869, F=0x0
-0,        134,        134,        1,      275, 0x29b96b3c, F=0x0
-0,        135,        135,        1,      168, 0x98d0399b, F=0x0
-0,        136,        136,        1,      169, 0x015039aa, F=0x0
-0,        137,        137,        1,      521, 0x3c33db57, F=0x0
-0,        138,        138,        1,     1262, 0x9cf44321, F=0x0
-0,        139,        139,        1,      994, 0x5ea8bcd4, F=0x0
-0,        140,        140,        1,      290, 0xf24f72b0, F=0x0
-0,        141,        141,        1,      188, 0x36cb408f, F=0x0
-0,        142,        142,        1,      164, 0x6c813b02, F=0x0
-0,        143,        143,        1,      212, 0x1dfb463e, F=0x0
-0,        144,        144,        1,      870, 0xd89e94ed, F=0x0
-0,        145,        145,        1,      635, 0x87bf1ae2, F=0x0
-0,        146,        146,        1,      290, 0x34ff78fe, F=0x0
-0,        147,        147,        1,      211, 0x9f755207, F=0x0
-0,        148,        148,        1,      177, 0x3f003c44, F=0x0
-0,        149,        149,        1,      182, 0xe8c23eea, F=0x0
-0,        150,        150,        1,      588, 0xb4b9fc5d, F=0x0
-0,        151,        151,        1,      163, 0x3078356b, F=0x0
-0,        152,        152,        1,      407, 0x4161b245, F=0x0
-0,        153,        153,        1,      204, 0xe2a64478, F=0x0
-0,        154,        154,        1,      290, 0x5cc079af, F=0x0
-0,        155,        155,        1,      308, 0xf5958253, F=0x0
-0,        156,        156,        1,      196, 0xb1cb46f0, F=0x0
-0,        157,        157,        1,      181, 0x0aee4103, F=0x0
-0,        158,        158,        1,      203, 0x36784ee0, F=0x0
-0,        159,        159,        1,      227, 0x23fd5b71, F=0x0
-0,        160,        160,        1,      524, 0x18a6e404, F=0x0
-0,        161,        161,        1,      377, 0x1f5697de, F=0x0
-0,        162,        162,        1,      196, 0x72304538, F=0x0
-0,        163,        163,        1,      250, 0xb8e46580, F=0x0
-0,        164,        164,        1,      214, 0xe9df51b6, F=0x0
-0,        165,        165,        1,      323, 0xacbb9067, F=0x0
-0,        166,        166,        1,      176, 0xa12a410c, F=0x0
-0,        167,        167,        1,      305, 0x21227d7a, F=0x0
-0,        168,        168,        1,      179, 0x3dac422b, F=0x0
-0,        169,        169,        1,      245, 0x948963cd, F=0x0
-0,        170,        170,        1,      181, 0x407140fb, F=0x0
-0,        171,        171,        1,      241, 0xd2a35a7a, F=0x0
-0,        172,        172,        1,      172, 0x9fa83e96, F=0x0
+0,          0,          0,        9,     1297, 0x53e8b1c1
+0,         10,         10,       10,      158, 0xe1873465, F=0x0
+0,         20,         20,       10,      143, 0x56992b17, F=0x0
+0,         30,         30,       10,      169, 0x4f0434c7, F=0x0
+0,         40,         40,       10,      254, 0xb4845bf3, F=0x0
+0,         50,         50,       10,      221, 0xa02a4ae2, F=0x0
+0,         60,         60,       10,      176, 0xdcfc3a8b, F=0x0
+0,         70,         70,       10,      189, 0xb45f3f8d, F=0x0
+0,         80,         80,       10,      139, 0xf2622fc0, F=0x0
+0,         90,         90,       10,      160, 0xf77b327d, F=0x0
+0,        100,        100,       10,      149, 0x56b62de9, F=0x0
+0,        110,        110,       10,      190, 0x1eca3f72, F=0x0
+0,        120,        120,       10,      308, 0xfc7373fc, F=0x0
+0,        130,        130,       10,      193, 0x94304232, F=0x0
+0,        140,        140,       10,      191, 0x82e84504, F=0x0
+0,        150,        150,       10,      198, 0xd31944a2, F=0x0
+0,        160,        160,       10,      417, 0x9547ac22, F=0x0
+0,        170,        170,       10,      163, 0xb55537d0, F=0x0
+0,        180,        180,       10,      383, 0x634f9f88, F=0x0
+0,        190,        190,       10,      193, 0xf6d24046, F=0x0
+0,        200,        200,       10,      337, 0x45d6916f, F=0x0
+0,        210,        210,       10,      199, 0xabb34a72, F=0x0
+0,        220,        220,       10,      308, 0x097f7e58, F=0x0
+0,        230,        230,       10,      186, 0x369b41cc, F=0x0
+0,        240,        240,       10,      199, 0xa93c4113, F=0x0
+0,        250,        250,       10,      163, 0x16823904, F=0x0
+0,        260,        260,       10,      302, 0xaf1d78da, F=0x0
+0,        270,        270,       10,      189, 0x3f7a3bde, F=0x0
+0,        280,        280,       10,      157, 0x45e23500, F=0x0
+0,        290,        290,       10,      205, 0x797b4510, F=0x0
+0,        300,        300,       10,      160, 0x20e533d1, F=0x0
+0,        310,        310,       10,      202, 0xd3b748b3, F=0x0
+0,        320,        320,       10,      160, 0x207c371f, F=0x0
+0,        330,        330,       10,      215, 0x079951b6, F=0x0
+0,        340,        340,       10,      422, 0xbb9db080, F=0x0
+0,        350,        350,       10,      184, 0x3a044098, F=0x0
+0,        360,        360,       10,      289, 0xf2757206, F=0x0
+0,        370,        370,       10,      190, 0xc3264203, F=0x0
+0,        380,        380,       10,      195, 0x28544262, F=0x0
+0,        390,        390,       10,      199, 0x32db4bba, F=0x0
+0,        400,        400,       10,      448, 0x64a8bfe8, F=0x0
+0,        410,        410,       10,      170, 0x62a536d7, F=0x0
+0,        420,        420,       10,      279, 0xe1df6ff6, F=0x0
+0,        430,        430,       10,      180, 0x762f3aac, F=0x0
+0,        440,        440,       10,      303, 0x73727c79, F=0x0
+0,        450,        450,       10,      209, 0xf4a8515c, F=0x0
+0,        460,        460,       10,      198, 0xe09f451e, F=0x0
+0,        470,        470,       10,      194, 0x301e4b04, F=0x0
+0,        480,        480,       10,      186, 0x7c66421b, F=0x0
+0,        490,        490,       10,     1200, 0xe55e34e7, F=0x0
+0,        500,        500,       10,      204, 0x25534779, F=0x0
+0,        510,        510,       10,     1066, 0x9792efa8, F=0x0
+0,        520,        520,       10,      187, 0xd82e41f0, F=0x0
+0,        530,        530,       10,      323, 0x0f9d8485, F=0x0
+0,        540,        540,       10,      205, 0x86ef4c75, F=0x0
+0,        550,        550,       10,      213, 0x6e515113, F=0x0
+0,        560,        560,       10,      208, 0x1ac84bed, F=0x0
+0,        570,        570,       10,      737, 0x68a047be, F=0x0
+0,        580,        580,       10,      181, 0x84353a71, F=0x0
+0,        590,        590,       10,      614, 0x3c9a142a, F=0x0
+0,        600,        600,       10,      215, 0xacaf535d, F=0x0
+0,        610,        610,       10,      291, 0x4dab7020, F=0x0
+0,        620,        620,       10,      208, 0x3dd84d1f, F=0x0
+0,        630,        630,       10,      208, 0x8ccb45cc, F=0x0
+0,        640,        640,       10,      203, 0xa905456b, F=0x0
+0,        650,        650,       10,      531, 0x6b32eaf4, F=0x0
+0,        660,        660,       10,      178, 0xd30b3bff, F=0x0
+0,        670,        670,       10,      446, 0x881abe2a, F=0x0
+0,        680,        680,       10,      188, 0xb5a43e6b, F=0x0
+0,        690,        690,       10,      177, 0x9255436c, F=0x0
+0,        700,        700,       10,      112, 0x2990213a, F=0x0
+0,        710,        710,       10,      296, 0x7d6e7183, F=0x0
+0,        720,        720,       10,      153, 0x35053313, F=0x0
+0,        730,        730,       10,      218, 0xcf105015, F=0x0
+0,        740,        740,       10,      202, 0xb4634837, F=0x0
+0,        750,        750,       10,      239, 0x0a4b5b7b, F=0x0
+0,        760,        760,       10,      139, 0x18d92e35, F=0x0
+0,        770,        770,       10,      467, 0x784dc79e, F=0x0
+0,        780,        780,       10,      274, 0x1e9b78ef, F=0x0
+0,        790,        790,       10,      404, 0xb5c6ab9b, F=0x0
+0,        800,        800,       10,      257, 0x7aaa66ce, F=0x0
+0,        810,        810,       10,      419, 0xcb62b6cb, F=0x0
+0,        820,        820,       10,      208, 0xcbba506d, F=0x0
+0,        830,        830,       10,      294, 0x031a76f9, F=0x0
+0,        840,        840,       10,      191, 0x5ba83f77, F=0x0
+0,        850,        850,       10,      181, 0xfc454323, F=0x0
+0,        860,        860,       10,      218, 0xcd7e540e, F=0x0
+0,        870,        870,       10,      423, 0xdcebc01f, F=0x0
+0,        880,        880,       10,      202, 0x160a4ab6, F=0x0
+0,        890,        890,       10,      317, 0xff2b8104, F=0x0
+0,        900,        900,       10,      172, 0x68753e2d, F=0x0
+0,        910,        910,       10,      275, 0x7f766cd1, F=0x0
+0,        920,        920,       10,      214, 0xf37e5043, F=0x0
+0,        930,        930,       10,      182, 0x5e5544f6, F=0x0
+0,        940,        940,       10,      151, 0xf74532b7, F=0x0
+0,        950,        950,       10,      157, 0xe99b33b0, F=0x0
+0,        960,        960,       10,      202, 0x77994327, F=0x0
+0,        970,        970,       10,      162, 0x93f235fc, F=0x0
+0,        980,        980,       10,      186, 0xc25d3f3f, F=0x0
+0,        990,        990,       10,      318, 0xdf547809, F=0x0
+0,       1000,       1000,       10,      225, 0xf8074f18, F=0x0
+0,       1010,       1010,       10,      207, 0x12204757, F=0x0
+0,       1020,       1020,       10,      212, 0xd2ec4c59, F=0x0
+0,       1030,       1030,       10,      153, 0x0e1c33cd, F=0x0
+0,       1040,       1040,       10,      196, 0x45d4455d, F=0x0
+0,       1050,       1050,       10,      146, 0x5dba32b0, F=0x0
+0,       1060,       1060,       10,      194, 0x13a8490b, F=0x0
+0,       1070,       1070,       10,      304, 0xcf73832f, F=0x0
+0,       1080,       1080,       10,      194, 0x68fd43c9, F=0x0
+0,       1090,       1090,       10,      190, 0xdbc64442, F=0x0
+0,       1100,       1100,       10,      204, 0x8eb94b27, F=0x0
+0,       1110,       1110,       10,      136, 0xd0162d03, F=0x0
+0,       1120,       1120,       10,      171, 0xbb8b3d15, F=0x0
+0,       1130,       1130,       10,      140, 0x4cb930a9, F=0x0
+0,       1140,       1140,       10,      158, 0xdebb32d2, F=0x0
+0,       1150,       1150,       10,       94, 0x16a71c65, F=0x0
+0,       1160,       1160,       10,      110, 0x358d20bf, F=0x0
+0,       1170,       1170,       10,      256, 0x49a469b7, F=0x0
+0,       1180,       1180,       10,      220, 0x08b95486, F=0x0
+0,       1190,       1190,       10,      221, 0xe0af4f92, F=0x0
+0,       1200,       1200,       10,      205, 0x7ac444a5, F=0x0
+0,       1210,       1210,       10,      169, 0x62c039d3, F=0x0
+0,       1220,       1220,       10,      970, 0xc8f6c8a6, F=0x0
+0,       1230,       1230,       10,      181, 0x0d9c42ba, F=0x0
+0,       1240,       1240,       10,      955, 0xdf5dba5e, F=0x0
+0,       1250,       1250,       10,      158, 0xa01833fd, F=0x0
+0,       1260,       1260,       10,      344, 0xd17989f3, F=0x0
+0,       1270,       1270,       10,      627, 0x8c611977, F=0x0
+0,       1280,       1280,       10,      172, 0x7cf83c63, F=0x0
+0,       1290,       1290,       10,      494, 0xadccdc2b, F=0x0
+0,       1300,       1300,       10,      184, 0x4e784407, F=0x0
+0,       1310,       1310,       10,      352, 0x852f992b, F=0x0
+0,       1320,       1320,       10,      351, 0x99e78bb8, F=0x0
+0,       1330,       1330,       10,      170, 0x9f4b3869, F=0x0
+0,       1340,       1340,       10,      275, 0x29b96b3c, F=0x0
+0,       1350,       1350,       10,      168, 0x98d0399b, F=0x0
+0,       1360,       1360,       10,      169, 0x015039aa, F=0x0
+0,       1370,       1370,       10,      521, 0x3c33db57, F=0x0
+0,       1380,       1380,       10,     1262, 0x9cf44321, F=0x0
+0,       1390,       1390,       10,      994, 0x5ea8bcd4, F=0x0
+0,       1400,       1400,       10,      290, 0xf24f72b0, F=0x0
+0,       1410,       1410,       10,      188, 0x36cb408f, F=0x0
+0,       1420,       1420,       10,      164, 0x6c813b02, F=0x0
+0,       1430,       1430,       10,      212, 0x1dfb463e, F=0x0
+0,       1440,       1440,       10,      870, 0xd89e94ed, F=0x0
+0,       1450,       1450,       10,      635, 0x87bf1ae2, F=0x0
+0,       1460,       1460,       10,      290, 0x34ff78fe, F=0x0
+0,       1470,       1470,       10,      211, 0x9f755207, F=0x0
+0,       1480,       1480,       10,      177, 0x3f003c44, F=0x0
+0,       1490,       1490,       10,      182, 0xe8c23eea, F=0x0
+0,       1500,       1500,       10,      588, 0xb4b9fc5d, F=0x0
+0,       1510,       1510,       10,      163, 0x3078356b, F=0x0
+0,       1520,       1520,       10,      407, 0x4161b245, F=0x0
+0,       1530,       1530,       10,      204, 0xe2a64478, F=0x0
+0,       1540,       1540,       10,      290, 0x5cc079af, F=0x0
+0,       1550,       1550,       10,      308, 0xf5958253, F=0x0
+0,       1560,       1560,       10,      196, 0xb1cb46f0, F=0x0
+0,       1570,       1570,       10,      181, 0x0aee4103, F=0x0
+0,       1580,       1580,       10,      203, 0x36784ee0, F=0x0
+0,       1590,       1590,       10,      227, 0x23fd5b71, F=0x0
+0,       1600,       1600,       10,      524, 0x18a6e404, F=0x0
+0,       1610,       1610,       10,      377, 0x1f5697de, F=0x0
+0,       1620,       1620,       10,      196, 0x72304538, F=0x0
+0,       1630,       1630,       10,      250, 0xb8e46580, F=0x0
+0,       1640,       1640,       10,      214, 0xe9df51b6, F=0x0
+0,       1650,       1650,       10,      323, 0xacbb9067, F=0x0
+0,       1660,       1660,       10,      176, 0xa12a410c, F=0x0
+0,       1670,       1670,       10,      305, 0x21227d7a, F=0x0
+0,       1680,       1680,       10,      179, 0x3dac422b, F=0x0
+0,       1690,       1690,       10,      245, 0x948963cd, F=0x0
+0,       1700,       1700,       10,      181, 0x407140fb, F=0x0
+0,       1710,       1710,       10,      241, 0xd2a35a7a, F=0x0
+0,       1720,       1720,       10,      172, 0x9fa83e96, F=0x0
diff --git a/tests/ref/fate/gifenc-bgr8 b/tests/ref/fate/gifenc-bgr8
index d4a42b03b2..8755877d87 100644
--- a/tests/ref/fate/gifenc-bgr8
+++ b/tests/ref/fate/gifenc-bgr8
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-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
-0,          4,          4,        1,      282, 0x98e8825d, F=0x0
-0,          5,          5,        1,      209, 0x4cc15280, F=0x0
-0,          6,          6,        1,      225, 0xf8785d6c, F=0x0
-0,          7,          7,        1,      204, 0x322754b4, F=0x0
-0,          8,          8,        1,      181, 0x9f4f4d10, F=0x0
-0,          9,          9,        1,      200, 0x64a453a1, F=0x0
-0,         10,         10,        1,      184, 0x79c344d3, F=0x0
-0,         11,         11,        1,      191, 0x7097487b, F=0x0
-0,         12,         12,        1,      290, 0x1f998186, F=0x0
-0,         13,         13,        1,      153, 0xfe4c3a7c, F=0x0
-0,         14,         14,        1,      175, 0xfdf442e0, F=0x0
-0,         15,         15,        1,      187, 0x393845f2, F=0x0
-0,         16,         16,        1,      418, 0xe94bc757, F=0x0
-0,         17,         17,        1,      200, 0x8dab52be, F=0x0
-0,         18,         18,        1,      347, 0xae379838, F=0x0
-0,         19,         19,        1,      176, 0x868742d2, F=0x0
-0,         20,         20,        1,      294, 0xb1fb8365, F=0x0
-0,         21,         21,        1,      166, 0x06e44260, F=0x0
-0,         22,         22,        1,      306, 0x29e983b7, F=0x0
-0,         23,         23,        1,      180, 0xfa4a44eb, F=0x0
-0,         24,         24,        1,      207, 0x99de52c8, F=0x0
-0,         25,         25,        1,      204, 0x73944c35, F=0x0
-0,         26,         26,        1,      259, 0xa0637375, F=0x0
-0,         27,         27,        1,      181, 0x130f4b9a, F=0x0
-0,         28,         28,        1,      152, 0x4be93cae, F=0x0
-0,         29,         29,        1,      194, 0x81e34e1d, F=0x0
-0,         30,         30,        1,      159, 0x5913380b, F=0x0
-0,         31,         31,        1,      162, 0xf0683bb1, F=0x0
-0,         32,         32,        1,      178, 0xce32498c, F=0x0
-0,         33,         33,        1,      187, 0x5d61509f, F=0x0
-0,         34,         34,        1,      336, 0xe5569440, F=0x0
-0,         35,         35,        1,      184, 0x3fa349ea, F=0x0
-0,         36,         36,        1,      227, 0x7cad5f66, F=0x0
-0,         37,         37,        1,      182, 0xf23a4522, F=0x0
-0,         38,         38,        1,      162, 0x2a053dcc, F=0x0
-0,         39,         39,        1,      187, 0xc18a4686, F=0x0
-0,         40,         40,        1,      503, 0xa5a7e669, F=0x0
-0,         41,         41,        1,      167, 0xa28a43e8, F=0x0
-0,         42,         42,        1,      289, 0xf1968090, F=0x0
-0,         43,         43,        1,      194, 0xedbb4eb7, F=0x0
-0,         44,         44,        1,      285, 0x82e7818b, F=0x0
-0,         45,         45,        1,      199, 0x5e725190, F=0x0
-0,         46,         46,        1,      197, 0x0c6a4fb9, F=0x0
-0,         47,         47,        1,      203, 0x05684b96, F=0x0
-0,         48,         48,        1,      208, 0xd33457ad, F=0x0
-0,         49,         49,        1,     1198, 0x029f5f1b, F=0x0
-0,         50,         50,        1,      175, 0xf4e94c40, F=0x0
-0,         51,         51,        1,      740, 0x6e096787, F=0x0
-0,         52,         52,        1,      180, 0xf34f45be, F=0x0
-0,         53,         53,        1,      238, 0xfbed6adb, F=0x0
-0,         54,         54,        1,      198, 0x6f3a5344, F=0x0
-0,         55,         55,        1,      196, 0x8bbb4b02, F=0x0
-0,         56,         56,        1,      224, 0x92c55d92, F=0x0
-0,         57,         57,        1,      765, 0xd16e6d65, F=0x0
-0,         58,         58,        1,      149, 0x97aa38d2, F=0x0
-0,         59,         59,        1,      479, 0x1030d73b, F=0x0
-0,         60,         60,        1,      179, 0x441e493a, F=0x0
-0,         61,         61,        1,      217, 0x16c259b7, F=0x0
-0,         62,         62,        1,      190, 0x5b2349ca, F=0x0
-0,         63,         63,        1,      155, 0x422f39ff, F=0x0
-0,         64,         64,        1,      167, 0x28444898, F=0x0
-0,         65,         65,        1,      649, 0x57b331e2, F=0x0
-0,         66,         66,        1,      196, 0x99a1574f, F=0x0
-0,         67,         67,        1,      427, 0xfd45d548, F=0x0
-0,         68,         68,        1,      175, 0x90cc42ce, F=0x0
-0,         69,         69,        1,      284, 0x49398208, F=0x0
-0,         70,         70,        1,      131, 0x18e42fc2, F=0x0
-0,         71,         71,        1,      256, 0xac896bbe, F=0x0
-0,         72,         72,        1,      186, 0x522d4974, F=0x0
-0,         73,         73,        1,      190, 0x5e064e04, F=0x0
-0,         74,         74,        1,      216, 0x863f53fa, F=0x0
-0,         75,         75,        1,      154, 0x17f1383f, F=0x0
-0,         76,         76,        1,      113, 0x20f827ee, F=0x0
-0,         77,         77,        1,      402, 0xce2caf45, F=0x0
-0,         78,         78,        1,      198, 0x0bc851ae, F=0x0
-0,         79,         79,        1,      466, 0xb31ad387, F=0x0
-0,         80,         80,        1,      322, 0x20018e02, F=0x0
-0,         81,         81,        1,      387, 0x5038b1b8, F=0x0
-0,         82,         82,        1,      158, 0xc6ac3feb, F=0x0
-0,         83,         83,        1,      278, 0x59f17c03, F=0x0
-0,         84,         84,        1,      190, 0xd7665022, F=0x0
-0,         85,         85,        1,      175, 0x1a6e4225, F=0x0
-0,         86,         86,        1,      206, 0xc3f44e3a, F=0x0
-0,         87,         87,        1,      379, 0xb1e6b77e, F=0x0
-0,         88,         88,        1,      202, 0x17975145, F=0x0
-0,         89,         89,        1,      225, 0x96985fd2, F=0x0
-0,         90,         90,        1,      175, 0x71b1497a, F=0x0
-0,         91,         91,        1,      235, 0x2bdc5faa, F=0x0
-0,         92,         92,        1,      185, 0x68124958, F=0x0
-0,         93,         93,        1,      182, 0x120c4c63, F=0x0
-0,         94,         94,        1,      114, 0xdd9b2b02, F=0x0
-0,         95,         95,        1,      176, 0x0d5b4b46, F=0x0
-0,         96,         96,        1,      214, 0xfb5e5b47, F=0x0
-0,         97,         97,        1,      182, 0xf4c54860, F=0x0
-0,         98,         98,        1,      195, 0x6e075188, F=0x0
-0,         99,         99,        1,      303, 0x4c158465, F=0x0
-0,        100,        100,        1,      191, 0x12005055, F=0x0
-0,        101,        101,        1,      177, 0x01ed4929, F=0x0
-0,        102,        102,        1,      172, 0x86984280, F=0x0
-0,        103,        103,        1,      179, 0xb854481c, F=0x0
-0,        104,        104,        1,      188, 0xeacd47ed, F=0x0
-0,        105,        105,        1,      177, 0x36be4889, F=0x0
-0,        106,        106,        1,      215, 0x6aa65c99, F=0x0
-0,        107,        107,        1,      339, 0x1af496b2, F=0x0
-0,        108,        108,        1,      189, 0x941045fa, F=0x0
-0,        109,        109,        1,      209, 0x37445651, F=0x0
-0,        110,        110,        1,      205, 0x9cf85222, F=0x0
-0,        111,        111,        1,      185, 0x8b964cb5, F=0x0
-0,        112,        112,        1,      211, 0xd03d59ce, F=0x0
-0,        113,        113,        1,      178, 0xe40e4c08, F=0x0
-0,        114,        114,        1,      195, 0x971d4d92, F=0x0
-0,        115,        115,        1,      116, 0x5f9a2d3f, F=0x0
-0,        116,        116,        1,      116, 0x5c4e2d06, F=0x0
-0,        117,        117,        1,      427, 0x6128c7da, F=0x0
-0,        118,        118,        1,      182, 0x8a9a4a85, F=0x0
-0,        119,        119,        1,      267, 0x94e16d98, F=0x0
-0,        120,        120,        1,      191, 0x8cd6499b, F=0x0
-0,        121,        121,        1,      195, 0x2955524a, F=0x0
-0,        122,        122,        1,      755, 0x21115eef, F=0x0
-0,        123,        123,        1,      179, 0x89ff45fd, F=0x0
-0,        124,        124,        1,      522, 0x1b1cf19d, F=0x0
-0,        125,        125,        1,      171, 0x48034194, F=0x0
-0,        126,        126,        1,      379, 0x3914a793, F=0x0
-0,        127,        127,        1,      539, 0x7155fc34, F=0x0
-0,        128,        128,        1,      199, 0xb8674f8a, F=0x0
-0,        129,        129,        1,      458, 0x0a87ce97, F=0x0
-0,        130,        130,        1,      177, 0xac704b44, F=0x0
-0,        131,        131,        1,      299, 0x49318aa9, F=0x0
-0,        132,        132,        1,      333, 0xa188949d, F=0x0
-0,        133,        133,        1,      179, 0x2474436d, F=0x0
-0,        134,        134,        1,      263, 0x84e871f8, F=0x0
-0,        135,        135,        1,      177, 0xf7904597, F=0x0
-0,        136,        136,        1,      184, 0xb053486d, F=0x0
-0,        137,        137,        1,      433, 0xd3c0c5a1, F=0x0
-0,        138,        138,        1,     1138, 0xd5af3462, F=0x0
-0,        139,        139,        1,      863, 0xdce99f4f, F=0x0
-0,        140,        140,        1,      328, 0x608a949d, F=0x0
-0,        141,        141,        1,      222, 0xecb75a19, F=0x0
-0,        142,        142,        1,      171, 0x6cf94548, F=0x0
-0,        143,        143,        1,      222, 0xcf8d5778, F=0x0
-0,        144,        144,        1,      738, 0x9cf358a2, F=0x0
-0,        145,        145,        1,      444, 0x3798cdf6, F=0x0
-0,        146,        146,        1,      267, 0x8ca87717, F=0x0
-0,        147,        147,        1,      187, 0x4d734c80, F=0x0
-0,        148,        148,        1,      186, 0x9def4fb6, F=0x0
-0,        149,        149,        1,      196, 0x49214f94, F=0x0
-0,        150,        150,        1,      589, 0x02e2142f, F=0x0
-0,        151,        151,        1,      188, 0x285c4dad, F=0x0
-0,        152,        152,        1,      339, 0x8a0fa092, F=0x0
-0,        153,        153,        1,      179, 0x775543d4, F=0x0
-0,        154,        154,        1,      294, 0x0c8885eb, F=0x0
-0,        155,        155,        1,      291, 0xd78084b1, F=0x0
-0,        156,        156,        1,      144, 0xd7323963, F=0x0
-0,        157,        157,        1,      182, 0x97194ede, F=0x0
-0,        158,        158,        1,      195, 0x410f50a6, F=0x0
-0,        159,        159,        1,      268, 0xb878789a, F=0x0
-0,        160,        160,        1,      526, 0x6e13fb3e, F=0x0
-0,        161,        161,        1,      372, 0xf1fca999, F=0x0
-0,        162,        162,        1,      171, 0x86033fb7, F=0x0
-0,        163,        163,        1,      344, 0x8db8a374, F=0x0
-0,        164,        164,        1,      159, 0xa3463fb6, F=0x0
-0,        165,        165,        1,      391, 0x6ab1aa7d, F=0x0
-0,        166,        166,        1,      180, 0x55d04d01, F=0x0
-0,        167,        167,        1,      303, 0xac779365, F=0x0
-0,        168,        168,        1,      180, 0x54e94840, F=0x0
-0,        169,        169,        1,      269, 0x56e57720, F=0x0
-0,        170,        170,        1,      199, 0x510b5589, F=0x0
-0,        171,        171,        1,      287, 0xd70d8529, F=0x0
-0,        172,        172,        1,      217, 0x04a0649e, F=0x0
+0,          0,          0,        9,     1341, 0xe4e2af18
+0,         10,         10,       10,      236, 0x332769fd, F=0x0
+0,         20,         20,       10,      186, 0x770d5061, F=0x0
+0,         30,         30,       10,      208, 0x55784c8f, F=0x0
+0,         40,         40,       10,      282, 0x98e8825d, F=0x0
+0,         50,         50,       10,      209, 0x4cc15280, F=0x0
+0,         60,         60,       10,      225, 0xf8785d6c, F=0x0
+0,         70,         70,       10,      204, 0x322754b4, F=0x0
+0,         80,         80,       10,      181, 0x9f4f4d10, F=0x0
+0,         90,         90,       10,      200, 0x64a453a1, F=0x0
+0,        100,        100,       10,      184, 0x79c344d3, F=0x0
+0,        110,        110,       10,      191, 0x7097487b, F=0x0
+0,        120,        120,       10,      290, 0x1f998186, F=0x0
+0,        130,        130,       10,      153, 0xfe4c3a7c, F=0x0
+0,        140,        140,       10,      175, 0xfdf442e0, F=0x0
+0,        150,        150,       10,      187, 0x393845f2, F=0x0
+0,        160,        160,       10,      418, 0xe94bc757, F=0x0
+0,        170,        170,       10,      200, 0x8dab52be, F=0x0
+0,        180,        180,       10,      347, 0xae379838, F=0x0
+0,        190,        190,       10,      176, 0x868742d2, F=0x0
+0,        200,        200,       10,      294, 0xb1fb8365, F=0x0
+0,        210,        210,       10,      166, 0x06e44260, F=0x0
+0,        220,        220,       10,      306, 0x29e983b7, F=0x0
+0,        230,        230,       10,      180, 0xfa4a44eb, F=0x0
+0,        240,        240,       10,      207, 0x99de52c8, F=0x0
+0,        250,        250,       10,      204, 0x73944c35, F=0x0
+0,        260,        260,       10,      259, 0xa0637375, F=0x0
+0,        270,        270,       10,      181, 0x130f4b9a, F=0x0
+0,        280,        280,       10,      152, 0x4be93cae, F=0x0
+0,        290,        290,       10,      194, 0x81e34e1d, F=0x0
+0,        300,        300,       10,      159, 0x5913380b, F=0x0
+0,        310,        310,       10,      162, 0xf0683bb1, F=0x0
+0,        320,        320,       10,      178, 0xce32498c, F=0x0
+0,        330,        330,       10,      187, 0x5d61509f, F=0x0
+0,        340,        340,       10,      336, 0xe5569440, F=0x0
+0,        350,        350,       10,      184, 0x3fa349ea, F=0x0
+0,        360,        360,       10,      227, 0x7cad5f66, F=0x0
+0,        370,        370,       10,      182, 0xf23a4522, F=0x0
+0,        380,        380,       10,      162, 0x2a053dcc, F=0x0
+0,        390,        390,       10,      187, 0xc18a4686, F=0x0
+0,        400,        400,       10,      503, 0xa5a7e669, F=0x0
+0,        410,        410,       10,      167, 0xa28a43e8, F=0x0
+0,        420,        420,       10,      289, 0xf1968090, F=0x0
+0,        430,        430,       10,      194, 0xedbb4eb7, F=0x0
+0,        440,        440,       10,      285, 0x82e7818b, F=0x0
+0,        450,        450,       10,      199, 0x5e725190, F=0x0
+0,        460,        460,       10,      197, 0x0c6a4fb9, F=0x0
+0,        470,        470,       10,      203, 0x05684b96, F=0x0
+0,        480,        480,       10,      208, 0xd33457ad, F=0x0
+0,        490,        490,       10,     1198, 0x029f5f1b, F=0x0
+0,        500,        500,       10,      175, 0xf4e94c40, F=0x0
+0,        510,        510,       10,      740, 0x6e096787, F=0x0
+0,        520,        520,       10,      180, 0xf34f45be, F=0x0
+0,        530,        530,       10,      238, 0xfbed6adb, F=0x0
+0,        540,        540,       10,      198, 0x6f3a5344, F=0x0
+0,        550,        550,       10,      196, 0x8bbb4b02, F=0x0
+0,        560,        560,       10,      224, 0x92c55d92, F=0x0
+0,        570,        570,       10,      765, 0xd16e6d65, F=0x0
+0,        580,        580,       10,      149, 0x97aa38d2, F=0x0
+0,        590,        590,       10,      479, 0x1030d73b, F=0x0
+0,        600,        600,       10,      179, 0x441e493a, F=0x0
+0,        610,        610,       10,      217, 0x16c259b7, F=0x0
+0,        620,        620,       10,      190, 0x5b2349ca, F=0x0
+0,        630,        630,       10,      155, 0x422f39ff, F=0x0
+0,        640,        640,       10,      167, 0x28444898, F=0x0
+0,        650,        650,       10,      649, 0x57b331e2, F=0x0
+0,        660,        660,       10,      196, 0x99a1574f, F=0x0
+0,        670,        670,       10,      427, 0xfd45d548, F=0x0
+0,        680,        680,       10,      175, 0x90cc42ce, F=0x0
+0,        690,        690,       10,      284, 0x49398208, F=0x0
+0,        700,        700,       10,      131, 0x18e42fc2, F=0x0
+0,        710,        710,       10,      256, 0xac896bbe, F=0x0
+0,        720,        720,       10,      186, 0x522d4974, F=0x0
+0,        730,        730,       10,      190, 0x5e064e04, F=0x0
+0,        740,        740,       10,      216, 0x863f53fa, F=0x0
+0,        750,        750,       10,      154, 0x17f1383f, F=0x0
+0,        760,        760,       10,      113, 0x20f827ee, F=0x0
+0,        770,        770,       10,      402, 0xce2caf45, F=0x0
+0,        780,        780,       10,      198, 0x0bc851ae, F=0x0
+0,        790,        790,       10,      466, 0xb31ad387, F=0x0
+0,        800,        800,       10,      322, 0x20018e02, F=0x0
+0,        810,        810,       10,      387, 0x5038b1b8, F=0x0
+0,        820,        820,       10,      158, 0xc6ac3feb, F=0x0
+0,        830,        830,       10,      278, 0x59f17c03, F=0x0
+0,        840,        840,       10,      190, 0xd7665022, F=0x0
+0,        850,        850,       10,      175, 0x1a6e4225, F=0x0
+0,        860,        860,       10,      206, 0xc3f44e3a, F=0x0
+0,        870,        870,       10,      379, 0xb1e6b77e, F=0x0
+0,        880,        880,       10,      202, 0x17975145, F=0x0
+0,        890,        890,       10,      225, 0x96985fd2, F=0x0
+0,        900,        900,       10,      175, 0x71b1497a, F=0x0
+0,        910,        910,       10,      235, 0x2bdc5faa, F=0x0
+0,        920,        920,       10,      185, 0x68124958, F=0x0
+0,        930,        930,       10,      182, 0x120c4c63, F=0x0
+0,        940,        940,       10,      114, 0xdd9b2b02, F=0x0
+0,        950,        950,       10,      176, 0x0d5b4b46, F=0x0
+0,        960,        960,       10,      214, 0xfb5e5b47, F=0x0
+0,        970,        970,       10,      182, 0xf4c54860, F=0x0
+0,        980,        980,       10,      195, 0x6e075188, F=0x0
+0,        990,        990,       10,      303, 0x4c158465, F=0x0
+0,       1000,       1000,       10,      191, 0x12005055, F=0x0
+0,       1010,       1010,       10,      177, 0x01ed4929, F=0x0
+0,       1020,       1020,       10,      172, 0x86984280, F=0x0
+0,       1030,       1030,       10,      179, 0xb854481c, F=0x0
+0,       1040,       1040,       10,      188, 0xeacd47ed, F=0x0
+0,       1050,       1050,       10,      177, 0x36be4889, F=0x0
+0,       1060,       1060,       10,      215, 0x6aa65c99, F=0x0
+0,       1070,       1070,       10,      339, 0x1af496b2, F=0x0
+0,       1080,       1080,       10,      189, 0x941045fa, F=0x0
+0,       1090,       1090,       10,      209, 0x37445651, F=0x0
+0,       1100,       1100,       10,      205, 0x9cf85222, F=0x0
+0,       1110,       1110,       10,      185, 0x8b964cb5, F=0x0
+0,       1120,       1120,       10,      211, 0xd03d59ce, F=0x0
+0,       1130,       1130,       10,      178, 0xe40e4c08, F=0x0
+0,       1140,       1140,       10,      195, 0x971d4d92, F=0x0
+0,       1150,       1150,       10,      116, 0x5f9a2d3f, F=0x0
+0,       1160,       1160,       10,      116, 0x5c4e2d06, F=0x0
+0,       1170,       1170,       10,      427, 0x6128c7da, F=0x0
+0,       1180,       1180,       10,      182, 0x8a9a4a85, F=0x0
+0,       1190,       1190,       10,      267, 0x94e16d98, F=0x0
+0,       1200,       1200,       10,      191, 0x8cd6499b, F=0x0
+0,       1210,       1210,       10,      195, 0x2955524a, F=0x0
+0,       1220,       1220,       10,      755, 0x21115eef, F=0x0
+0,       1230,       1230,       10,      179, 0x89ff45fd, F=0x0
+0,       1240,       1240,       10,      522, 0x1b1cf19d, F=0x0
+0,       1250,       1250,       10,      171, 0x48034194, F=0x0
+0,       1260,       1260,       10,      379, 0x3914a793, F=0x0
+0,       1270,       1270,       10,      539, 0x7155fc34, F=0x0
+0,       1280,       1280,       10,      199, 0xb8674f8a, F=0x0
+0,       1290,       1290,       10,      458, 0x0a87ce97, F=0x0
+0,       1300,       1300,       10,      177, 0xac704b44, F=0x0
+0,       1310,       1310,       10,      299, 0x49318aa9, F=0x0
+0,       1320,       1320,       10,      333, 0xa188949d, F=0x0
+0,       1330,       1330,       10,      179, 0x2474436d, F=0x0
+0,       1340,       1340,       10,      263, 0x84e871f8, F=0x0
+0,       1350,       1350,       10,      177, 0xf7904597, F=0x0
+0,       1360,       1360,       10,      184, 0xb053486d, F=0x0
+0,       1370,       1370,       10,      433, 0xd3c0c5a1, F=0x0
+0,       1380,       1380,       10,     1138, 0xd5af3462, F=0x0
+0,       1390,       1390,       10,      863, 0xdce99f4f, F=0x0
+0,       1400,       1400,       10,      328, 0x608a949d, F=0x0
+0,       1410,       1410,       10,      222, 0xecb75a19, F=0x0
+0,       1420,       1420,       10,      171, 0x6cf94548, F=0x0
+0,       1430,       1430,       10,      222, 0xcf8d5778, F=0x0
+0,       1440,       1440,       10,      738, 0x9cf358a2, F=0x0
+0,       1450,       1450,       10,      444, 0x3798cdf6, F=0x0
+0,       1460,       1460,       10,      267, 0x8ca87717, F=0x0
+0,       1470,       1470,       10,      187, 0x4d734c80, F=0x0
+0,       1480,       1480,       10,      186, 0x9def4fb6, F=0x0
+0,       1490,       1490,       10,      196, 0x49214f94, F=0x0
+0,       1500,       1500,       10,      589, 0x02e2142f, F=0x0
+0,       1510,       1510,       10,      188, 0x285c4dad, F=0x0
+0,       1520,       1520,       10,      339, 0x8a0fa092, F=0x0
+0,       1530,       1530,       10,      179, 0x775543d4, F=0x0
+0,       1540,       1540,       10,      294, 0x0c8885eb, F=0x0
+0,       1550,       1550,       10,      291, 0xd78084b1, F=0x0
+0,       1560,       1560,       10,      144, 0xd7323963, F=0x0
+0,       1570,       1570,       10,      182, 0x97194ede, F=0x0
+0,       1580,       1580,       10,      195, 0x410f50a6, F=0x0
+0,       1590,       1590,       10,      268, 0xb878789a, F=0x0
+0,       1600,       1600,       10,      526, 0x6e13fb3e, F=0x0
+0,       1610,       1610,       10,      372, 0xf1fca999, F=0x0
+0,       1620,       1620,       10,      171, 0x86033fb7, F=0x0
+0,       1630,       1630,       10,      344, 0x8db8a374, F=0x0
+0,       1640,       1640,       10,      159, 0xa3463fb6, F=0x0
+0,       1650,       1650,       10,      391, 0x6ab1aa7d, F=0x0
+0,       1660,       1660,       10,      180, 0x55d04d01, F=0x0
+0,       1670,       1670,       10,      303, 0xac779365, F=0x0
+0,       1680,       1680,       10,      180, 0x54e94840, F=0x0
+0,       1690,       1690,       10,      269, 0x56e57720, F=0x0
+0,       1700,       1700,       10,      199, 0x510b5589, F=0x0
+0,       1710,       1710,       10,      287, 0xd70d8529, F=0x0
+0,       1720,       1720,       10,      217, 0x04a0649e, F=0x0
diff --git a/tests/ref/fate/gifenc-gray b/tests/ref/fate/gifenc-gray
index 324aff49bd..df0011c43f 100644
--- a/tests/ref/fate/gifenc-gray
+++ b/tests/ref/fate/gifenc-gray
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,     1368, 0x6cf0befd
-0,          1,          1,        1,      158, 0xcd173bb4, F=0x0
-0,          2,          2,        1,      163, 0x4f7a451d, F=0x0
-0,          3,          3,        1,      152, 0x17723839, F=0x0
-0,          4,          4,        1,      160, 0x67854056, F=0x0
-0,          5,          5,        1,      144, 0x0dc43ead, F=0x0
-0,          6,          6,        1,      142, 0xb0d73867, F=0x0
-0,          7,          7,        1,      137, 0xd8f333a1, F=0x0
-0,          8,          8,        1,      131, 0x32f93270, F=0x0
-0,          9,          9,        1,      131, 0xf27b2e93, F=0x0
-0,         10,         10,        1,      158, 0x152842d2, F=0x0
-0,         11,         11,        1,      142, 0x12733116, F=0x0
-0,         12,         12,        1,      142, 0x28f03160, F=0x0
-0,         13,         13,        1,      131, 0x038d2dda, F=0x0
-0,         14,         14,        1,      135, 0xb96c33a3, F=0x0
-0,         15,         15,        1,      127, 0x4cbf2d59, F=0x0
-0,         16,         16,        1,      146, 0xff013760, F=0x0
-0,         17,         17,        1,      148, 0xa14d3c03, F=0x0
-0,         18,         18,        1,      130, 0x139430b3, F=0x0
-0,         19,         19,        1,      131, 0x40e03264, F=0x0
-0,         20,         20,        1,      148, 0xf9d23c5c, F=0x0
-0,         21,         21,        1,      131, 0xfdc9328b, F=0x0
-0,         22,         22,        1,      131, 0x986d326f, F=0x0
-0,         23,         23,        1,      132, 0x3fdc3311, F=0x0
-0,         24,         24,        1,      130, 0x84c2330a, F=0x0
-0,         25,         25,        1,      130, 0x9c0033f1, F=0x0
-0,         26,         26,        1,      131, 0x62eb32f5, F=0x0
-0,         27,         27,        1,      126, 0x326e328e, F=0x0
-0,         28,         28,        1,      167, 0x8c8f4674, F=0x0
-0,         29,         29,        1,      148, 0x340d32d5, F=0x0
-0,         30,         30,        1,      171, 0xac2549fa, F=0x0
-0,         31,         31,        1,      150, 0xe77535b1, F=0x0
-0,         32,         32,        1,      178, 0x2c0b4c3a, F=0x0
-0,         33,         33,        1,      154, 0xe99137bb, F=0x0
-0,         34,         34,        1,      140, 0x525535c1, F=0x0
-0,         35,         35,        1,      121, 0xdfdc2d02, F=0x0
-0,         36,         36,        1,      140, 0x4db8345b, F=0x0
-0,         37,         37,        1,      128, 0x32e92f77, F=0x0
-0,         38,         38,        1,      143, 0x06663646, F=0x0
-0,         39,         39,        1,      131, 0xbcef3180, F=0x0
-0,         40,         40,        1,      127, 0xa8b92f17, F=0x0
-0,         41,         41,        1,      127, 0xc88e300a, F=0x0
-0,         42,         42,        1,      128, 0x2b3932e6, F=0x0
-0,         43,         43,        1,      122, 0x89332dc5, F=0x0
-0,         44,         44,        1,      133, 0x2b1d37ee, F=0x0
-0,         45,         45,        1,      125, 0x4c5e32ab, F=0x0
-0,         46,         46,        1,      124, 0x83122eaa, F=0x0
-0,         47,         47,        1,      132, 0xa3953564, F=0x0
-0,         48,         48,        1,      125, 0xae672fd9, F=0x0
-0,         49,         49,        1,      143, 0xd5d8390e, F=0x0
-0,         50,         50,        1,      139, 0xebab3726, F=0x0
-0,         51,         51,        1,      130, 0x4c9b358b, F=0x0
-0,         52,         52,        1,      130, 0x14993609, F=0x0
-0,         53,         53,        1,      132, 0x2ced3637, F=0x0
-0,         54,         54,        1,      134, 0xb27f3881, F=0x0
-0,         55,         55,        1,      125, 0x0402336b, F=0x0
-0,         56,         56,        1,      117, 0xf8a7310f, F=0x0
-0,         57,         57,        1,      128, 0x07752f60, F=0x0
-0,         58,         58,        1,      128, 0xf4d430da, F=0x0
-0,         59,         59,        1,      130, 0xbf9733aa, F=0x0
-0,         60,         60,        1,      124, 0x199f2f0e, F=0x0
-0,         61,         61,        1,      127, 0x84ff32b6, F=0x0
-0,         62,         62,        1,      124, 0x8d63305e, F=0x0
-0,         63,         63,        1,      127, 0x7d6130f4, F=0x0
-0,         64,         64,        1,      126, 0x78c83176, F=0x0
-0,         65,         65,        1,      145, 0x3ec33e58, F=0x0
-0,         66,         66,        1,      157, 0xb5764127, F=0x0
-0,         67,         67,        1,      123, 0xd9bd309d, F=0x0
-0,         68,         68,        1,      139, 0x93bc3ce8, F=0x0
-0,         69,         69,        1,      123, 0x67813058, F=0x0
-0,         70,         70,        1,      108, 0x176e2b80, F=0x0
-0,         71,         71,        1,      117, 0x2ab12db9, F=0x0
-0,         72,         72,        1,      128, 0xb52130fe, F=0x0
-0,         73,         73,        1,      124, 0x62102d4e, F=0x0
-0,         74,         74,        1,      114, 0x186f2dc7, F=0x0
-0,         75,         75,        1,      104, 0x74ec2761, F=0x0
-0,         76,         76,        1,      107, 0x9ba32643, F=0x0
-0,         77,         77,        1,      127, 0xa8ef3544, F=0x0
-0,         78,         78,        1,      127, 0xcd7e3051, F=0x0
-0,         79,         79,        1,      221, 0x9d035e74, F=0x0
-0,         80,         80,        1,      217, 0x99d45fbc, F=0x0
-0,         81,         81,        1,      128, 0xc9522cfc, F=0x0
-0,         82,         82,        1,      127, 0x934f3004, F=0x0
-0,         83,         83,        1,      132, 0xb899320f, F=0x0
-0,         84,         84,        1,      133, 0xec2b3427, F=0x0
-0,         85,         85,        1,      131, 0xbedb31b2, F=0x0
-0,         86,         86,        1,      127, 0x11bc321c, F=0x0
-0,         87,         87,        1,      127, 0x36cf2f3e, F=0x0
-0,         88,         88,        1,      115, 0x22b32e12, F=0x0
-0,         89,         89,        1,      127, 0x53f73452, F=0x0
-0,         90,         90,        1,      123, 0xc54931ba, F=0x0
-0,         91,         91,        1,      170, 0x3055476c, F=0x0
-0,         92,         92,        1,      132, 0xc6e431a9, F=0x0
-0,         93,         93,        1,      124, 0x00e02e2c, F=0x0
-0,         94,         94,        1,       92, 0x838f2429, F=0x0
-0,         95,         95,        1,      184, 0xcee75528, F=0x0
-0,         96,         96,        1,      145, 0xcbb533f9, F=0x0
-0,         97,         97,        1,      187, 0x025b53b3, F=0x0
-0,         98,         98,        1,      158, 0x73dc3de6, F=0x0
-0,         99,         99,        1,      148, 0x489e3a52, F=0x0
-0,        100,        100,        1,      137, 0xf4c23446, F=0x0
-0,        101,        101,        1,      154, 0xc7eb3a4c, F=0x0
-0,        102,        102,        1,      141, 0x175d328b, F=0x0
-0,        103,        103,        1,      198, 0x22615c9f, F=0x0
-0,        104,        104,        1,      167, 0x9f3c40f0, F=0x0
-0,        105,        105,        1,      196, 0x66495290, F=0x0
-0,        106,        106,        1,      171, 0x10b14318, F=0x0
-0,        107,        107,        1,      152, 0x0e8538ba, F=0x0
-0,        108,        108,        1,      144, 0xa7e83928, F=0x0
-0,        109,        109,        1,      158, 0x2b6f3bb5, F=0x0
-0,        110,        110,        1,      142, 0x242d3ac1, F=0x0
-0,        111,        111,        1,      206, 0xf7935cd2, F=0x0
-0,        112,        112,        1,      177, 0xc96a46b4, F=0x0
-0,        113,        113,        1,      218, 0x96145d0c, F=0x0
-0,        114,        114,        1,      182, 0xdb8e4b9e, F=0x0
-0,        115,        115,        1,      145, 0x58483725, F=0x0
-0,        116,        116,        1,      130, 0xe26b33a3, F=0x0
-0,        117,        117,        1,      160, 0x162d3c34, F=0x0
-0,        118,        118,        1,      145, 0x77cd3b1f, F=0x0
-0,        119,        119,        1,      164, 0xfd024449, F=0x0
-0,        120,        120,        1,      148, 0x68293a64, F=0x0
-0,        121,        121,        1,      187, 0x8643475d, F=0x0
-0,        122,        122,        1,      124, 0xe904324b, F=0x0
-0,        123,        123,        1,      126, 0xb3482fed, F=0x0
-0,        124,        124,        1,      131, 0x60183155, F=0x0
-0,        125,        125,        1,      133, 0xf592319f, F=0x0
-0,        126,        126,        1,      202, 0xb53c5af2, F=0x0
-0,        127,        127,        1,      130, 0xe2503351, F=0x0
-0,        128,        128,        1,      132, 0x2c1a3433, F=0x0
-0,        129,        129,        1,      141, 0x772f36f2, F=0x0
-0,        130,        130,        1,      134, 0x5f2f3838, F=0x0
-0,        131,        131,        1,      216, 0x659c5fca, F=0x0
-0,        132,        132,        1,      139, 0x4876362d, F=0x0
-0,        133,        133,        1,      122, 0x96d13129, F=0x0
-0,        134,        134,        1,      137, 0x875238ec, F=0x0
-0,        135,        135,        1,      128, 0x953e3481, F=0x0
-0,        136,        136,        1,      172, 0x6390470d, F=0x0
-0,        137,        137,        1,      253, 0xe4e37282, F=0x0
-0,        138,        138,        1,      223, 0xca0060e6, F=0x0
-0,        139,        139,        1,      233, 0x20d96471, F=0x0
-0,        140,        140,        1,      131, 0x07302c8c, F=0x0
-0,        141,        141,        1,      132, 0x808b30dd, F=0x0
-0,        142,        142,        1,      133, 0xa91231c3, F=0x0
-0,        143,        143,        1,      130, 0x9a3a33d8, F=0x0
-0,        144,        144,        1,      232, 0x00826277, F=0x0
-0,        145,        145,        1,      247, 0x2edf6c06, F=0x0
-0,        146,        146,        1,      135, 0xd47b35de, F=0x0
-0,        147,        147,        1,      134, 0xc9c0330d, F=0x0
-0,        148,        148,        1,      132, 0x2d0e3263, F=0x0
-0,        149,        149,        1,      134, 0x5bd737ba, F=0x0
-0,        150,        150,        1,      131, 0x67223298, F=0x0
-0,        151,        151,        1,      125, 0xf483315a, F=0x0
-0,        152,        152,        1,      127, 0xb83e31a0, F=0x0
-0,        153,        153,        1,      125, 0x2dc033ab, F=0x0
-0,        154,        154,        1,      157, 0x438344e2, F=0x0
-0,        155,        155,        1,      135, 0xd01739e4, F=0x0
-0,        156,        156,        1,      121, 0x834a3276, F=0x0
-0,        157,        157,        1,      136, 0x243b3b8a, F=0x0
-0,        158,        158,        1,      119, 0x47893201, F=0x0
-0,        159,        159,        1,      154, 0xc688461f, F=0x0
-0,        160,        160,        1,      245, 0x68786756, F=0x0
-0,        161,        161,        1,      241, 0xa531647c, F=0x0
-0,        162,        162,        1,      168, 0x5d6a4447, F=0x0
-0,        163,        163,        1,      133, 0x55de34ee, F=0x0
-0,        164,        164,        1,      139, 0xde613ccd, F=0x0
-0,        165,        165,        1,      239, 0xf26b6ede, F=0x0
-0,        166,        166,        1,      161, 0x6fed41b5, F=0x0
-0,        167,        167,        1,      134, 0x011c3786, F=0x0
-0,        168,        168,        1,      121, 0xf0532db8, F=0x0
-0,        169,        169,        1,      133, 0x58b63448, F=0x0
-0,        170,        170,        1,      130, 0x78c52ed9, F=0x0
-0,        171,        171,        1,      153, 0xd99a3fab, F=0x0
-0,        172,        172,        1,      179, 0x8ec74c98, F=0x0
+0,          0,          0,        9,     1368, 0x6cf0befd
+0,         10,         10,       10,      158, 0xcd173bb4, F=0x0
+0,         20,         20,       10,      163, 0x4f7a451d, F=0x0
+0,         30,         30,       10,      152, 0x17723839, F=0x0
+0,         40,         40,       10,      160, 0x67854056, F=0x0
+0,         50,         50,       10,      144, 0x0dc43ead, F=0x0
+0,         60,         60,       10,      142, 0xb0d73867, F=0x0
+0,         70,         70,       10,      137, 0xd8f333a1, F=0x0
+0,         80,         80,       10,      131, 0x32f93270, F=0x0
+0,         90,         90,       10,      131, 0xf27b2e93, F=0x0
+0,        100,        100,       10,      158, 0x152842d2, F=0x0
+0,        110,        110,       10,      142, 0x12733116, F=0x0
+0,        120,        120,       10,      142, 0x28f03160, F=0x0
+0,        130,        130,       10,      131, 0x038d2dda, F=0x0
+0,        140,        140,       10,      135, 0xb96c33a3, F=0x0
+0,        150,        150,       10,      127, 0x4cbf2d59, F=0x0
+0,        160,        160,       10,      146, 0xff013760, F=0x0
+0,        170,        170,       10,      148, 0xa14d3c03, F=0x0
+0,        180,        180,       10,      130, 0x139430b3, F=0x0
+0,        190,        190,       10,      131, 0x40e03264, F=0x0
+0,        200,        200,       10,      148, 0xf9d23c5c, F=0x0
+0,        210,        210,       10,      131, 0xfdc9328b, F=0x0
+0,        220,        220,       10,      131, 0x986d326f, F=0x0
+0,        230,        230,       10,      132, 0x3fdc3311, F=0x0
+0,        240,        240,       10,      130, 0x84c2330a, F=0x0
+0,        250,        250,       10,      130, 0x9c0033f1, F=0x0
+0,        260,        260,       10,      131, 0x62eb32f5, F=0x0
+0,        270,        270,       10,      126, 0x326e328e, F=0x0
+0,        280,        280,       10,      167, 0x8c8f4674, F=0x0
+0,        290,        290,       10,      148, 0x340d32d5, F=0x0
+0,        300,        300,       10,      171, 0xac2549fa, F=0x0
+0,        310,        310,       10,      150, 0xe77535b1, F=0x0
+0,        320,        320,       10,      178, 0x2c0b4c3a, F=0x0
+0,        330,        330,       10,      154, 0xe99137bb, F=0x0
+0,        340,        340,       10,      140, 0x525535c1, F=0x0
+0,        350,        350,       10,      121, 0xdfdc2d02, F=0x0
+0,        360,        360,       10,      140, 0x4db8345b, F=0x0
+0,        370,        370,       10,      128, 0x32e92f77, F=0x0
+0,        380,        380,       10,      143, 0x06663646, F=0x0
+0,        390,        390,       10,      131, 0xbcef3180, F=0x0
+0,        400,        400,       10,      127, 0xa8b92f17, F=0x0
+0,        410,        410,       10,      127, 0xc88e300a, F=0x0
+0,        420,        420,       10,      128, 0x2b3932e6, F=0x0
+0,        430,        430,       10,      122, 0x89332dc5, F=0x0
+0,        440,        440,       10,      133, 0x2b1d37ee, F=0x0
+0,        450,        450,       10,      125, 0x4c5e32ab, F=0x0
+0,        460,        460,       10,      124, 0x83122eaa, F=0x0
+0,        470,        470,       10,      132, 0xa3953564, F=0x0
+0,        480,        480,       10,      125, 0xae672fd9, F=0x0
+0,        490,        490,       10,      143, 0xd5d8390e, F=0x0
+0,        500,        500,       10,      139, 0xebab3726, F=0x0
+0,        510,        510,       10,      130, 0x4c9b358b, F=0x0
+0,        520,        520,       10,      130, 0x14993609, F=0x0
+0,        530,        530,       10,      132, 0x2ced3637, F=0x0
+0,        540,        540,       10,      134, 0xb27f3881, F=0x0
+0,        550,        550,       10,      125, 0x0402336b, F=0x0
+0,        560,        560,       10,      117, 0xf8a7310f, F=0x0
+0,        570,        570,       10,      128, 0x07752f60, F=0x0
+0,        580,        580,       10,      128, 0xf4d430da, F=0x0
+0,        590,        590,       10,      130, 0xbf9733aa, F=0x0
+0,        600,        600,       10,      124, 0x199f2f0e, F=0x0
+0,        610,        610,       10,      127, 0x84ff32b6, F=0x0
+0,        620,        620,       10,      124, 0x8d63305e, F=0x0
+0,        630,        630,       10,      127, 0x7d6130f4, F=0x0
+0,        640,        640,       10,      126, 0x78c83176, F=0x0
+0,        650,        650,       10,      145, 0x3ec33e58, F=0x0
+0,        660,        660,       10,      157, 0xb5764127, F=0x0
+0,        670,        670,       10,      123, 0xd9bd309d, F=0x0
+0,        680,        680,       10,      139, 0x93bc3ce8, F=0x0
+0,        690,        690,       10,      123, 0x67813058, F=0x0
+0,        700,        700,       10,      108, 0x176e2b80, F=0x0
+0,        710,        710,       10,      117, 0x2ab12db9, F=0x0
+0,        720,        720,       10,      128, 0xb52130fe, F=0x0
+0,        730,        730,       10,      124, 0x62102d4e, F=0x0
+0,        740,        740,       10,      114, 0x186f2dc7, F=0x0
+0,        750,        750,       10,      104, 0x74ec2761, F=0x0
+0,        760,        760,       10,      107, 0x9ba32643, F=0x0
+0,        770,        770,       10,      127, 0xa8ef3544, F=0x0
+0,        780,        780,       10,      127, 0xcd7e3051, F=0x0
+0,        790,        790,       10,      221, 0x9d035e74, F=0x0
+0,        800,        800,       10,      217, 0x99d45fbc, F=0x0
+0,        810,        810,       10,      128, 0xc9522cfc, F=0x0
+0,        820,        820,       10,      127, 0x934f3004, F=0x0
+0,        830,        830,       10,      132, 0xb899320f, F=0x0
+0,        840,        840,       10,      133, 0xec2b3427, F=0x0
+0,        850,        850,       10,      131, 0xbedb31b2, F=0x0
+0,        860,        860,       10,      127, 0x11bc321c, F=0x0
+0,        870,        870,       10,      127, 0x36cf2f3e, F=0x0
+0,        880,        880,       10,      115, 0x22b32e12, F=0x0
+0,        890,        890,       10,      127, 0x53f73452, F=0x0
+0,        900,        900,       10,      123, 0xc54931ba, F=0x0
+0,        910,        910,       10,      170, 0x3055476c, F=0x0
+0,        920,        920,       10,      132, 0xc6e431a9, F=0x0
+0,        930,        930,       10,      124, 0x00e02e2c, F=0x0
+0,        940,        940,       10,       92, 0x838f2429, F=0x0
+0,        950,        950,       10,      184, 0xcee75528, F=0x0
+0,        960,        960,       10,      145, 0xcbb533f9, F=0x0
+0,        970,        970,       10,      187, 0x025b53b3, F=0x0
+0,        980,        980,       10,      158, 0x73dc3de6, F=0x0
+0,        990,        990,       10,      148, 0x489e3a52, F=0x0
+0,       1000,       1000,       10,      137, 0xf4c23446, F=0x0
+0,       1010,       1010,       10,      154, 0xc7eb3a4c, F=0x0
+0,       1020,       1020,       10,      141, 0x175d328b, F=0x0
+0,       1030,       1030,       10,      198, 0x22615c9f, F=0x0
+0,       1040,       1040,       10,      167, 0x9f3c40f0, F=0x0
+0,       1050,       1050,       10,      196, 0x66495290, F=0x0
+0,       1060,       1060,       10,      171, 0x10b14318, F=0x0
+0,       1070,       1070,       10,      152, 0x0e8538ba, F=0x0
+0,       1080,       1080,       10,      144, 0xa7e83928, F=0x0
+0,       1090,       1090,       10,      158, 0x2b6f3bb5, F=0x0
+0,       1100,       1100,       10,      142, 0x242d3ac1, F=0x0
+0,       1110,       1110,       10,      206, 0xf7935cd2, F=0x0
+0,       1120,       1120,       10,      177, 0xc96a46b4, F=0x0
+0,       1130,       1130,       10,      218, 0x96145d0c, F=0x0
+0,       1140,       1140,       10,      182, 0xdb8e4b9e, F=0x0
+0,       1150,       1150,       10,      145, 0x58483725, F=0x0
+0,       1160,       1160,       10,      130, 0xe26b33a3, F=0x0
+0,       1170,       1170,       10,      160, 0x162d3c34, F=0x0
+0,       1180,       1180,       10,      145, 0x77cd3b1f, F=0x0
+0,       1190,       1190,       10,      164, 0xfd024449, F=0x0
+0,       1200,       1200,       10,      148, 0x68293a64, F=0x0
+0,       1210,       1210,       10,      187, 0x8643475d, F=0x0
+0,       1220,       1220,       10,      124, 0xe904324b, F=0x0
+0,       1230,       1230,       10,      126, 0xb3482fed, F=0x0
+0,       1240,       1240,       10,      131, 0x60183155, F=0x0
+0,       1250,       1250,       10,      133, 0xf592319f, F=0x0
+0,       1260,       1260,       10,      202, 0xb53c5af2, F=0x0
+0,       1270,       1270,       10,      130, 0xe2503351, F=0x0
+0,       1280,       1280,       10,      132, 0x2c1a3433, F=0x0
+0,       1290,       1290,       10,      141, 0x772f36f2, F=0x0
+0,       1300,       1300,       10,      134, 0x5f2f3838, F=0x0
+0,       1310,       1310,       10,      216, 0x659c5fca, F=0x0
+0,       1320,       1320,       10,      139, 0x4876362d, F=0x0
+0,       1330,       1330,       10,      122, 0x96d13129, F=0x0
+0,       1340,       1340,       10,      137, 0x875238ec, F=0x0
+0,       1350,       1350,       10,      128, 0x953e3481, F=0x0
+0,       1360,       1360,       10,      172, 0x6390470d, F=0x0
+0,       1370,       1370,       10,      253, 0xe4e37282, F=0x0
+0,       1380,       1380,       10,      223, 0xca0060e6, F=0x0
+0,       1390,       1390,       10,      233, 0x20d96471, F=0x0
+0,       1400,       1400,       10,      131, 0x07302c8c, F=0x0
+0,       1410,       1410,       10,      132, 0x808b30dd, F=0x0
+0,       1420,       1420,       10,      133, 0xa91231c3, F=0x0
+0,       1430,       1430,       10,      130, 0x9a3a33d8, F=0x0
+0,       1440,       1440,       10,      232, 0x00826277, F=0x0
+0,       1450,       1450,       10,      247, 0x2edf6c06, F=0x0
+0,       1460,       1460,       10,      135, 0xd47b35de, F=0x0
+0,       1470,       1470,       10,      134, 0xc9c0330d, F=0x0
+0,       1480,       1480,       10,      132, 0x2d0e3263, F=0x0
+0,       1490,       1490,       10,      134, 0x5bd737ba, F=0x0
+0,       1500,       1500,       10,      131, 0x67223298, F=0x0
+0,       1510,       1510,       10,      125, 0xf483315a, F=0x0
+0,       1520,       1520,       10,      127, 0xb83e31a0, F=0x0
+0,       1530,       1530,       10,      125, 0x2dc033ab, F=0x0
+0,       1540,       1540,       10,      157, 0x438344e2, F=0x0
+0,       1550,       1550,       10,      135, 0xd01739e4, F=0x0
+0,       1560,       1560,       10,      121, 0x834a3276, F=0x0
+0,       1570,       1570,       10,      136, 0x243b3b8a, F=0x0
+0,       1580,       1580,       10,      119, 0x47893201, F=0x0
+0,       1590,       1590,       10,      154, 0xc688461f, F=0x0
+0,       1600,       1600,       10,      245, 0x68786756, F=0x0
+0,       1610,       1610,       10,      241, 0xa531647c, F=0x0
+0,       1620,       1620,       10,      168, 0x5d6a4447, F=0x0
+0,       1630,       1630,       10,      133, 0x55de34ee, F=0x0
+0,       1640,       1640,       10,      139, 0xde613ccd, F=0x0
+0,       1650,       1650,       10,      239, 0xf26b6ede, F=0x0
+0,       1660,       1660,       10,      161, 0x6fed41b5, F=0x0
+0,       1670,       1670,       10,      134, 0x011c3786, F=0x0
+0,       1680,       1680,       10,      121, 0xf0532db8, F=0x0
+0,       1690,       1690,       10,      133, 0x58b63448, F=0x0
+0,       1700,       1700,       10,      130, 0x78c52ed9, F=0x0
+0,       1710,       1710,       10,      153, 0xd99a3fab, F=0x0
+0,       1720,       1720,       10,      179, 0x8ec74c98, F=0x0
diff --git a/tests/ref/fate/gifenc-pal8 b/tests/ref/fate/gifenc-pal8
index 1a074b8fd8..20e180dfac 100644
--- a/tests/ref/fate/gifenc-pal8
+++ b/tests/ref/fate/gifenc-pal8
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,     2109, 0x39642b3d
-0,          1,          1,        1,      236, 0x332769fd, F=0x0
-0,          2,          2,        1,      186, 0x770d5061, F=0x0
-0,          3,          3,        1,      208, 0x55784c8f, F=0x0
-0,          4,          4,        1,      282, 0x98e8825d, F=0x0
-0,          5,          5,        1,      209, 0x4cc15280, F=0x0
-0,          6,          6,        1,      225, 0xf8785d6c, F=0x0
-0,          7,          7,        1,      204, 0x322754b4, F=0x0
-0,          8,          8,        1,      181, 0x9f4f4d10, F=0x0
-0,          9,          9,        1,      200, 0x64a453a1, F=0x0
-0,         10,         10,        1,      184, 0x79c344d3, F=0x0
-0,         11,         11,        1,      191, 0x7097487b, F=0x0
-0,         12,         12,        1,      290, 0x1f998186, F=0x0
-0,         13,         13,        1,      153, 0xfe4c3a7c, F=0x0
-0,         14,         14,        1,      175, 0xfdf442e0, F=0x0
-0,         15,         15,        1,      187, 0x393845f2, F=0x0
-0,         16,         16,        1,      418, 0xe94bc757, F=0x0
-0,         17,         17,        1,      200, 0x8dab52be, F=0x0
-0,         18,         18,        1,      347, 0xae379838, F=0x0
-0,         19,         19,        1,      176, 0x868742d2, F=0x0
-0,         20,         20,        1,      294, 0xb1fb8365, F=0x0
-0,         21,         21,        1,      166, 0x06e44260, F=0x0
-0,         22,         22,        1,      306, 0x29e983b7, F=0x0
-0,         23,         23,        1,      180, 0xfa4a44eb, F=0x0
-0,         24,         24,        1,      207, 0x99de52c8, F=0x0
-0,         25,         25,        1,      204, 0x73944c35, F=0x0
-0,         26,         26,        1,      259, 0xa0637375, F=0x0
-0,         27,         27,        1,      181, 0x130f4b9a, F=0x0
-0,         28,         28,        1,      152, 0x4be93cae, F=0x0
-0,         29,         29,        1,      194, 0x81e34e1d, F=0x0
-0,         30,         30,        1,      159, 0x5913380b, F=0x0
-0,         31,         31,        1,      162, 0xf0683bb1, F=0x0
-0,         32,         32,        1,      178, 0xce32498c, F=0x0
-0,         33,         33,        1,      187, 0x5d61509f, F=0x0
-0,         34,         34,        1,      336, 0xe5569440, F=0x0
-0,         35,         35,        1,      184, 0x3fa349ea, F=0x0
-0,         36,         36,        1,      227, 0x7cad5f66, F=0x0
-0,         37,         37,        1,      182, 0xf23a4522, F=0x0
-0,         38,         38,        1,      162, 0x2a053dcc, F=0x0
-0,         39,         39,        1,      187, 0xc18a4686, F=0x0
-0,         40,         40,        1,      503, 0xa5a7e669, F=0x0
-0,         41,         41,        1,      167, 0xa28a43e8, F=0x0
-0,         42,         42,        1,      289, 0xf1968090, F=0x0
-0,         43,         43,        1,      194, 0xedbb4eb7, F=0x0
-0,         44,         44,        1,      285, 0x82e7818b, F=0x0
-0,         45,         45,        1,      199, 0x5e725190, F=0x0
-0,         46,         46,        1,      197, 0x0c6a4fb9, F=0x0
-0,         47,         47,        1,      203, 0x05684b96, F=0x0
-0,         48,         48,        1,      208, 0xd33457ad, F=0x0
-0,         49,         49,        1,     1198, 0x029f5f1b, F=0x0
-0,         50,         50,        1,      175, 0xf4e94c40, F=0x0
-0,         51,         51,        1,      740, 0x6e096787, F=0x0
-0,         52,         52,        1,      180, 0xf34f45be, F=0x0
-0,         53,         53,        1,      238, 0xfbed6adb, F=0x0
-0,         54,         54,        1,      198, 0x6f3a5344, F=0x0
-0,         55,         55,        1,      196, 0x8bbb4b02, F=0x0
-0,         56,         56,        1,      224, 0x92c55d92, F=0x0
-0,         57,         57,        1,      765, 0xd16e6d65, F=0x0
-0,         58,         58,        1,      149, 0x97aa38d2, F=0x0
-0,         59,         59,        1,      479, 0x1030d73b, F=0x0
-0,         60,         60,        1,      179, 0x441e493a, F=0x0
-0,         61,         61,        1,      217, 0x16c259b7, F=0x0
-0,         62,         62,        1,      190, 0x5b2349ca, F=0x0
-0,         63,         63,        1,      155, 0x422f39ff, F=0x0
-0,         64,         64,        1,      167, 0x28444898, F=0x0
-0,         65,         65,        1,      649, 0x57b331e2, F=0x0
-0,         66,         66,        1,      196, 0x99a1574f, F=0x0
-0,         67,         67,        1,      427, 0xfd45d548, F=0x0
-0,         68,         68,        1,      175, 0x90cc42ce, F=0x0
-0,         69,         69,        1,      284, 0x49398208, F=0x0
-0,         70,         70,        1,      131, 0x18e42fc2, F=0x0
-0,         71,         71,        1,      256, 0xac896bbe, F=0x0
-0,         72,         72,        1,      186, 0x522d4974, F=0x0
-0,         73,         73,        1,      190, 0x5e064e04, F=0x0
-0,         74,         74,        1,      216, 0x863f53fa, F=0x0
-0,         75,         75,        1,      154, 0x17f1383f, F=0x0
-0,         76,         76,        1,      113, 0x20f827ee, F=0x0
-0,         77,         77,        1,      402, 0xce2caf45, F=0x0
-0,         78,         78,        1,      198, 0x0bc851ae, F=0x0
-0,         79,         79,        1,      466, 0xb31ad387, F=0x0
-0,         80,         80,        1,      322, 0x20018e02, F=0x0
-0,         81,         81,        1,      387, 0x5038b1b8, F=0x0
-0,         82,         82,        1,      158, 0xc6ac3feb, F=0x0
-0,         83,         83,        1,      278, 0x59f17c03, F=0x0
-0,         84,         84,        1,      190, 0xd7665022, F=0x0
-0,         85,         85,        1,      175, 0x1a6e4225, F=0x0
-0,         86,         86,        1,      206, 0xc3f44e3a, F=0x0
-0,         87,         87,        1,      379, 0xb1e6b77e, F=0x0
-0,         88,         88,        1,      202, 0x17975145, F=0x0
-0,         89,         89,        1,      225, 0x96985fd2, F=0x0
-0,         90,         90,        1,      175, 0x71b1497a, F=0x0
-0,         91,         91,        1,      235, 0x2bdc5faa, F=0x0
-0,         92,         92,        1,      185, 0x68124958, F=0x0
-0,         93,         93,        1,      182, 0x120c4c63, F=0x0
-0,         94,         94,        1,      114, 0xdd9b2b02, F=0x0
-0,         95,         95,        1,      176, 0x0d5b4b46, F=0x0
-0,         96,         96,        1,      214, 0xfb5e5b47, F=0x0
-0,         97,         97,        1,      182, 0xf4c54860, F=0x0
-0,         98,         98,        1,      195, 0x6e075188, F=0x0
-0,         99,         99,        1,      303, 0x4c158465, F=0x0
-0,        100,        100,        1,      191, 0x12005055, F=0x0
-0,        101,        101,        1,      177, 0x01ed4929, F=0x0
-0,        102,        102,        1,      172, 0x86984280, F=0x0
-0,        103,        103,        1,      179, 0xb854481c, F=0x0
-0,        104,        104,        1,      188, 0xeacd47ed, F=0x0
-0,        105,        105,        1,      177, 0x36be4889, F=0x0
-0,        106,        106,        1,      215, 0x6aa65c99, F=0x0
-0,        107,        107,        1,      339, 0x1af496b2, F=0x0
-0,        108,        108,        1,      189, 0x941045fa, F=0x0
-0,        109,        109,        1,      209, 0x37445651, F=0x0
-0,        110,        110,        1,      205, 0x9cf85222, F=0x0
-0,        111,        111,        1,      185, 0x8b964cb5, F=0x0
-0,        112,        112,        1,      211, 0xd03d59ce, F=0x0
-0,        113,        113,        1,      178, 0xe40e4c08, F=0x0
-0,        114,        114,        1,      195, 0x971d4d92, F=0x0
-0,        115,        115,        1,      116, 0x5f9a2d3f, F=0x0
-0,        116,        116,        1,      116, 0x5c4e2d06, F=0x0
-0,        117,        117,        1,      427, 0x6128c7da, F=0x0
-0,        118,        118,        1,      182, 0x8a9a4a85, F=0x0
-0,        119,        119,        1,      267, 0x94e16d98, F=0x0
-0,        120,        120,        1,      191, 0x8cd6499b, F=0x0
-0,        121,        121,        1,      195, 0x2955524a, F=0x0
-0,        122,        122,        1,      755, 0x21115eef, F=0x0
-0,        123,        123,        1,      179, 0x89ff45fd, F=0x0
-0,        124,        124,        1,      522, 0x1b1cf19d, F=0x0
-0,        125,        125,        1,      171, 0x48034194, F=0x0
-0,        126,        126,        1,      379, 0x3914a793, F=0x0
-0,        127,        127,        1,      539, 0x7155fc34, F=0x0
-0,        128,        128,        1,      199, 0xb8674f8a, F=0x0
-0,        129,        129,        1,      458, 0x0a87ce97, F=0x0
-0,        130,        130,        1,      177, 0xac704b44, F=0x0
-0,        131,        131,        1,      299, 0x49318aa9, F=0x0
-0,        132,        132,        1,      333, 0xa188949d, F=0x0
-0,        133,        133,        1,      179, 0x2474436d, F=0x0
-0,        134,        134,        1,      263, 0x84e871f8, F=0x0
-0,        135,        135,        1,      177, 0xf7904597, F=0x0
-0,        136,        136,        1,      184, 0xb053486d, F=0x0
-0,        137,        137,        1,      433, 0xd3c0c5a1, F=0x0
-0,        138,        138,        1,     1138, 0xd5af3462, F=0x0
-0,        139,        139,        1,      863, 0xdce99f4f, F=0x0
-0,        140,        140,        1,      328, 0x608a949d, F=0x0
-0,        141,        141,        1,      222, 0xecb75a19, F=0x0
-0,        142,        142,        1,      171, 0x6cf94548, F=0x0
-0,        143,        143,        1,      222, 0xcf8d5778, F=0x0
-0,        144,        144,        1,      738, 0x9cf358a2, F=0x0
-0,        145,        145,        1,      444, 0x3798cdf6, F=0x0
-0,        146,        146,        1,      267, 0x8ca87717, F=0x0
-0,        147,        147,        1,      187, 0x4d734c80, F=0x0
-0,        148,        148,        1,      186, 0x9def4fb6, F=0x0
-0,        149,        149,        1,      196, 0x49214f94, F=0x0
-0,        150,        150,        1,      589, 0x02e2142f, F=0x0
-0,        151,        151,        1,      188, 0x285c4dad, F=0x0
-0,        152,        152,        1,      339, 0x8a0fa092, F=0x0
-0,        153,        153,        1,      179, 0x775543d4, F=0x0
-0,        154,        154,        1,      294, 0x0c8885eb, F=0x0
-0,        155,        155,        1,      291, 0xd78084b1, F=0x0
-0,        156,        156,        1,      144, 0xd7323963, F=0x0
-0,        157,        157,        1,      182, 0x97194ede, F=0x0
-0,        158,        158,        1,      195, 0x410f50a6, F=0x0
-0,        159,        159,        1,      268, 0xb878789a, F=0x0
-0,        160,        160,        1,      526, 0x6e13fb3e, F=0x0
-0,        161,        161,        1,      372, 0xf1fca999, F=0x0
-0,        162,        162,        1,      171, 0x86033fb7, F=0x0
-0,        163,        163,        1,      344, 0x8db8a374, F=0x0
-0,        164,        164,        1,      159, 0xa3463fb6, F=0x0
-0,        165,        165,        1,      391, 0x6ab1aa7d, F=0x0
-0,        166,        166,        1,      180, 0x55d04d01, F=0x0
-0,        167,        167,        1,      303, 0xac779365, F=0x0
-0,        168,        168,        1,      180, 0x54e94840, F=0x0
-0,        169,        169,        1,      269, 0x56e57720, F=0x0
-0,        170,        170,        1,      199, 0x510b5589, F=0x0
-0,        171,        171,        1,      287, 0xd70d8529, F=0x0
-0,        172,        172,        1,      217, 0x04a0649e, F=0x0
+0,          0,          0,        9,     2109, 0x39642b3d
+0,         10,         10,       10,      236, 0x332769fd, F=0x0
+0,         20,         20,       10,      186, 0x770d5061, F=0x0
+0,         30,         30,       10,      208, 0x55784c8f, F=0x0
+0,         40,         40,       10,      282, 0x98e8825d, F=0x0
+0,         50,         50,       10,      209, 0x4cc15280, F=0x0
+0,         60,         60,       10,      225, 0xf8785d6c, F=0x0
+0,         70,         70,       10,      204, 0x322754b4, F=0x0
+0,         80,         80,       10,      181, 0x9f4f4d10, F=0x0
+0,         90,         90,       10,      200, 0x64a453a1, F=0x0
+0,        100,        100,       10,      184, 0x79c344d3, F=0x0
+0,        110,        110,       10,      191, 0x7097487b, F=0x0
+0,        120,        120,       10,      290, 0x1f998186, F=0x0
+0,        130,        130,       10,      153, 0xfe4c3a7c, F=0x0
+0,        140,        140,       10,      175, 0xfdf442e0, F=0x0
+0,        150,        150,       10,      187, 0x393845f2, F=0x0
+0,        160,        160,       10,      418, 0xe94bc757, F=0x0
+0,        170,        170,       10,      200, 0x8dab52be, F=0x0
+0,        180,        180,       10,      347, 0xae379838, F=0x0
+0,        190,        190,       10,      176, 0x868742d2, F=0x0
+0,        200,        200,       10,      294, 0xb1fb8365, F=0x0
+0,        210,        210,       10,      166, 0x06e44260, F=0x0
+0,        220,        220,       10,      306, 0x29e983b7, F=0x0
+0,        230,        230,       10,      180, 0xfa4a44eb, F=0x0
+0,        240,        240,       10,      207, 0x99de52c8, F=0x0
+0,        250,        250,       10,      204, 0x73944c35, F=0x0
+0,        260,        260,       10,      259, 0xa0637375, F=0x0
+0,        270,        270,       10,      181, 0x130f4b9a, F=0x0
+0,        280,        280,       10,      152, 0x4be93cae, F=0x0
+0,        290,        290,       10,      194, 0x81e34e1d, F=0x0
+0,        300,        300,       10,      159, 0x5913380b, F=0x0
+0,        310,        310,       10,      162, 0xf0683bb1, F=0x0
+0,        320,        320,       10,      178, 0xce32498c, F=0x0
+0,        330,        330,       10,      187, 0x5d61509f, F=0x0
+0,        340,        340,       10,      336, 0xe5569440, F=0x0
+0,        350,        350,       10,      184, 0x3fa349ea, F=0x0
+0,        360,        360,       10,      227, 0x7cad5f66, F=0x0
+0,        370,        370,       10,      182, 0xf23a4522, F=0x0
+0,        380,        380,       10,      162, 0x2a053dcc, F=0x0
+0,        390,        390,       10,      187, 0xc18a4686, F=0x0
+0,        400,        400,       10,      503, 0xa5a7e669, F=0x0
+0,        410,        410,       10,      167, 0xa28a43e8, F=0x0
+0,        420,        420,       10,      289, 0xf1968090, F=0x0
+0,        430,        430,       10,      194, 0xedbb4eb7, F=0x0
+0,        440,        440,       10,      285, 0x82e7818b, F=0x0
+0,        450,        450,       10,      199, 0x5e725190, F=0x0
+0,        460,        460,       10,      197, 0x0c6a4fb9, F=0x0
+0,        470,        470,       10,      203, 0x05684b96, F=0x0
+0,        480,        480,       10,      208, 0xd33457ad, F=0x0
+0,        490,        490,       10,     1198, 0x029f5f1b, F=0x0
+0,        500,        500,       10,      175, 0xf4e94c40, F=0x0
+0,        510,        510,       10,      740, 0x6e096787, F=0x0
+0,        520,        520,       10,      180, 0xf34f45be, F=0x0
+0,        530,        530,       10,      238, 0xfbed6adb, F=0x0
+0,        540,        540,       10,      198, 0x6f3a5344, F=0x0
+0,        550,        550,       10,      196, 0x8bbb4b02, F=0x0
+0,        560,        560,       10,      224, 0x92c55d92, F=0x0
+0,        570,        570,       10,      765, 0xd16e6d65, F=0x0
+0,        580,        580,       10,      149, 0x97aa38d2, F=0x0
+0,        590,        590,       10,      479, 0x1030d73b, F=0x0
+0,        600,        600,       10,      179, 0x441e493a, F=0x0
+0,        610,        610,       10,      217, 0x16c259b7, F=0x0
+0,        620,        620,       10,      190, 0x5b2349ca, F=0x0
+0,        630,        630,       10,      155, 0x422f39ff, F=0x0
+0,        640,        640,       10,      167, 0x28444898, F=0x0
+0,        650,        650,       10,      649, 0x57b331e2, F=0x0
+0,        660,        660,       10,      196, 0x99a1574f, F=0x0
+0,        670,        670,       10,      427, 0xfd45d548, F=0x0
+0,        680,        680,       10,      175, 0x90cc42ce, F=0x0
+0,        690,        690,       10,      284, 0x49398208, F=0x0
+0,        700,        700,       10,      131, 0x18e42fc2, F=0x0
+0,        710,        710,       10,      256, 0xac896bbe, F=0x0
+0,        720,        720,       10,      186, 0x522d4974, F=0x0
+0,        730,        730,       10,      190, 0x5e064e04, F=0x0
+0,        740,        740,       10,      216, 0x863f53fa, F=0x0
+0,        750,        750,       10,      154, 0x17f1383f, F=0x0
+0,        760,        760,       10,      113, 0x20f827ee, F=0x0
+0,        770,        770,       10,      402, 0xce2caf45, F=0x0
+0,        780,        780,       10,      198, 0x0bc851ae, F=0x0
+0,        790,        790,       10,      466, 0xb31ad387, F=0x0
+0,        800,        800,       10,      322, 0x20018e02, F=0x0
+0,        810,        810,       10,      387, 0x5038b1b8, F=0x0
+0,        820,        820,       10,      158, 0xc6ac3feb, F=0x0
+0,        830,        830,       10,      278, 0x59f17c03, F=0x0
+0,        840,        840,       10,      190, 0xd7665022, F=0x0
+0,        850,        850,       10,      175, 0x1a6e4225, F=0x0
+0,        860,        860,       10,      206, 0xc3f44e3a, F=0x0
+0,        870,        870,       10,      379, 0xb1e6b77e, F=0x0
+0,        880,        880,       10,      202, 0x17975145, F=0x0
+0,        890,        890,       10,      225, 0x96985fd2, F=0x0
+0,        900,        900,       10,      175, 0x71b1497a, F=0x0
+0,        910,        910,       10,      235, 0x2bdc5faa, F=0x0
+0,        920,        920,       10,      185, 0x68124958, F=0x0
+0,        930,        930,       10,      182, 0x120c4c63, F=0x0
+0,        940,        940,       10,      114, 0xdd9b2b02, F=0x0
+0,        950,        950,       10,      176, 0x0d5b4b46, F=0x0
+0,        960,        960,       10,      214, 0xfb5e5b47, F=0x0
+0,        970,        970,       10,      182, 0xf4c54860, F=0x0
+0,        980,        980,       10,      195, 0x6e075188, F=0x0
+0,        990,        990,       10,      303, 0x4c158465, F=0x0
+0,       1000,       1000,       10,      191, 0x12005055, F=0x0
+0,       1010,       1010,       10,      177, 0x01ed4929, F=0x0
+0,       1020,       1020,       10,      172, 0x86984280, F=0x0
+0,       1030,       1030,       10,      179, 0xb854481c, F=0x0
+0,       1040,       1040,       10,      188, 0xeacd47ed, F=0x0
+0,       1050,       1050,       10,      177, 0x36be4889, F=0x0
+0,       1060,       1060,       10,      215, 0x6aa65c99, F=0x0
+0,       1070,       1070,       10,      339, 0x1af496b2, F=0x0
+0,       1080,       1080,       10,      189, 0x941045fa, F=0x0
+0,       1090,       1090,       10,      209, 0x37445651, F=0x0
+0,       1100,       1100,       10,      205, 0x9cf85222, F=0x0
+0,       1110,       1110,       10,      185, 0x8b964cb5, F=0x0
+0,       1120,       1120,       10,      211, 0xd03d59ce, F=0x0
+0,       1130,       1130,       10,      178, 0xe40e4c08, F=0x0
+0,       1140,       1140,       10,      195, 0x971d4d92, F=0x0
+0,       1150,       1150,       10,      116, 0x5f9a2d3f, F=0x0
+0,       1160,       1160,       10,      116, 0x5c4e2d06, F=0x0
+0,       1170,       1170,       10,      427, 0x6128c7da, F=0x0
+0,       1180,       1180,       10,      182, 0x8a9a4a85, F=0x0
+0,       1190,       1190,       10,      267, 0x94e16d98, F=0x0
+0,       1200,       1200,       10,      191, 0x8cd6499b, F=0x0
+0,       1210,       1210,       10,      195, 0x2955524a, F=0x0
+0,       1220,       1220,       10,      755, 0x21115eef, F=0x0
+0,       1230,       1230,       10,      179, 0x89ff45fd, F=0x0
+0,       1240,       1240,       10,      522, 0x1b1cf19d, F=0x0
+0,       1250,       1250,       10,      171, 0x48034194, F=0x0
+0,       1260,       1260,       10,      379, 0x3914a793, F=0x0
+0,       1270,       1270,       10,      539, 0x7155fc34, F=0x0
+0,       1280,       1280,       10,      199, 0xb8674f8a, F=0x0
+0,       1290,       1290,       10,      458, 0x0a87ce97, F=0x0
+0,       1300,       1300,       10,      177, 0xac704b44, F=0x0
+0,       1310,       1310,       10,      299, 0x49318aa9, F=0x0
+0,       1320,       1320,       10,      333, 0xa188949d, F=0x0
+0,       1330,       1330,       10,      179, 0x2474436d, F=0x0
+0,       1340,       1340,       10,      263, 0x84e871f8, F=0x0
+0,       1350,       1350,       10,      177, 0xf7904597, F=0x0
+0,       1360,       1360,       10,      184, 0xb053486d, F=0x0
+0,       1370,       1370,       10,      433, 0xd3c0c5a1, F=0x0
+0,       1380,       1380,       10,     1138, 0xd5af3462, F=0x0
+0,       1390,       1390,       10,      863, 0xdce99f4f, F=0x0
+0,       1400,       1400,       10,      328, 0x608a949d, F=0x0
+0,       1410,       1410,       10,      222, 0xecb75a19, F=0x0
+0,       1420,       1420,       10,      171, 0x6cf94548, F=0x0
+0,       1430,       1430,       10,      222, 0xcf8d5778, F=0x0
+0,       1440,       1440,       10,      738, 0x9cf358a2, F=0x0
+0,       1450,       1450,       10,      444, 0x3798cdf6, F=0x0
+0,       1460,       1460,       10,      267, 0x8ca87717, F=0x0
+0,       1470,       1470,       10,      187, 0x4d734c80, F=0x0
+0,       1480,       1480,       10,      186, 0x9def4fb6, F=0x0
+0,       1490,       1490,       10,      196, 0x49214f94, F=0x0
+0,       1500,       1500,       10,      589, 0x02e2142f, F=0x0
+0,       1510,       1510,       10,      188, 0x285c4dad, F=0x0
+0,       1520,       1520,       10,      339, 0x8a0fa092, F=0x0
+0,       1530,       1530,       10,      179, 0x775543d4, F=0x0
+0,       1540,       1540,       10,      294, 0x0c8885eb, F=0x0
+0,       1550,       1550,       10,      291, 0xd78084b1, F=0x0
+0,       1560,       1560,       10,      144, 0xd7323963, F=0x0
+0,       1570,       1570,       10,      182, 0x97194ede, F=0x0
+0,       1580,       1580,       10,      195, 0x410f50a6, F=0x0
+0,       1590,       1590,       10,      268, 0xb878789a, F=0x0
+0,       1600,       1600,       10,      526, 0x6e13fb3e, F=0x0
+0,       1610,       1610,       10,      372, 0xf1fca999, F=0x0
+0,       1620,       1620,       10,      171, 0x86033fb7, F=0x0
+0,       1630,       1630,       10,      344, 0x8db8a374, F=0x0
+0,       1640,       1640,       10,      159, 0xa3463fb6, F=0x0
+0,       1650,       1650,       10,      391, 0x6ab1aa7d, F=0x0
+0,       1660,       1660,       10,      180, 0x55d04d01, F=0x0
+0,       1670,       1670,       10,      303, 0xac779365, F=0x0
+0,       1680,       1680,       10,      180, 0x54e94840, F=0x0
+0,       1690,       1690,       10,      269, 0x56e57720, F=0x0
+0,       1700,       1700,       10,      199, 0x510b5589, F=0x0
+0,       1710,       1710,       10,      287, 0xd70d8529, F=0x0
+0,       1720,       1720,       10,      217, 0x04a0649e, F=0x0
diff --git a/tests/ref/fate/gifenc-rgb4_byte b/tests/ref/fate/gifenc-rgb4_byte
index 25e9fc7dcf..f9dd97d458 100644
--- a/tests/ref/fate/gifenc-rgb4_byte
+++ b/tests/ref/fate/gifenc-rgb4_byte
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,     1297, 0x5618fe71
-0,          1,          1,        1,      158, 0xfa673468, F=0x0
-0,          2,          2,        1,      143, 0x61cf2b35, F=0x0
-0,          3,          3,        1,      169, 0x152a369a, F=0x0
-0,          4,          4,        1,      254, 0x22935c08, F=0x0
-0,          5,          5,        1,      221, 0x9972496f, F=0x0
-0,          6,          6,        1,      176, 0xf6af3ab2, F=0x0
-0,          7,          7,        1,      189, 0xcdc23f20, F=0x0
-0,          8,          8,        1,      139, 0x081e3020, F=0x0
-0,          9,          9,        1,      160, 0x9153335f, F=0x0
-0,         10,         10,        1,      149, 0x8fa12e7d, F=0x0
-0,         11,         11,        1,      190, 0x43ef3de1, F=0x0
-0,         12,         12,        1,      308, 0x95c77160, F=0x0
-0,         13,         13,        1,      193, 0xf9084196, F=0x0
-0,         14,         14,        1,      191, 0x07784447, F=0x0
-0,         15,         15,        1,      198, 0x7d72420a, F=0x0
-0,         16,         16,        1,      417, 0xbf40acdc, F=0x0
-0,         17,         17,        1,      163, 0xf7df3842, F=0x0
-0,         18,         18,        1,      383, 0xadcf9e8e, F=0x0
-0,         19,         19,        1,      193, 0xba544052, F=0x0
-0,         20,         20,        1,      337, 0x1510922f, F=0x0
-0,         21,         21,        1,      199, 0x11d64936, F=0x0
-0,         22,         22,        1,      308, 0x79597dbc, F=0x0
-0,         23,         23,        1,      186, 0x25d04175, F=0x0
-0,         24,         24,        1,      199, 0x8b65402f, F=0x0
-0,         25,         25,        1,      163, 0x128e38b6, F=0x0
-0,         26,         26,        1,      302, 0xacc979b2, F=0x0
-0,         27,         27,        1,      189, 0x491f3c5c, F=0x0
-0,         28,         28,        1,      157, 0x50783600, F=0x0
-0,         29,         29,        1,      205, 0xad9045b3, F=0x0
-0,         30,         30,        1,      160, 0xcbf332f8, F=0x0
-0,         31,         31,        1,      202, 0xc72c48bf, F=0x0
-0,         32,         32,        1,      160, 0xe6c436dd, F=0x0
-0,         33,         33,        1,      215, 0x4f705072, F=0x0
-0,         34,         34,        1,      422, 0xed27b0b0, F=0x0
-0,         35,         35,        1,      184, 0x6ba8415a, F=0x0
-0,         36,         36,        1,      289, 0x0b5f73a3, F=0x0
-0,         37,         37,        1,      190, 0xea5b4316, F=0x0
-0,         38,         38,        1,      195, 0xd9f2441d, F=0x0
-0,         39,         39,        1,      199, 0x47e34e05, F=0x0
-0,         40,         40,        1,      448, 0xec8bbf56, F=0x0
-0,         41,         41,        1,      170, 0x42fb3755, F=0x0
-0,         42,         42,        1,      279, 0x87cc6f54, F=0x0
-0,         43,         43,        1,      180, 0x085f398a, F=0x0
-0,         44,         44,        1,      303, 0x46fe7c55, F=0x0
-0,         45,         45,        1,      209, 0xc60b5116, F=0x0
-0,         46,         46,        1,      198, 0x795f4655, F=0x0
-0,         47,         47,        1,      194, 0xeb1b4abe, F=0x0
-0,         48,         48,        1,      186, 0x97b44251, F=0x0
-0,         49,         49,        1,     1200, 0xeb5a36ba, F=0x0
-0,         50,         50,        1,      204, 0x00bc4594, F=0x0
-0,         51,         51,        1,     1066, 0xdc39eee0, F=0x0
-0,         52,         52,        1,      187, 0x344b4304, F=0x0
-0,         53,         53,        1,      323, 0x899f8522, F=0x0
-0,         54,         54,        1,      205, 0x48af49da, F=0x0
-0,         55,         55,        1,      213, 0xf2534ff5, F=0x0
-0,         56,         56,        1,      208, 0x8fba4b25, F=0x0
-0,         57,         57,        1,      737, 0x1612477c, F=0x0
-0,         58,         58,        1,      181, 0x903b38ad, F=0x0
-0,         59,         59,        1,      614, 0xb154157d, F=0x0
-0,         60,         60,        1,      215, 0x4e82532e, F=0x0
-0,         61,         61,        1,      291, 0x69476efd, F=0x0
-0,         62,         62,        1,      208, 0x471d4ea1, F=0x0
-0,         63,         63,        1,      208, 0xa2b04628, F=0x0
-0,         64,         64,        1,      203, 0x96d646b2, F=0x0
-0,         65,         65,        1,      531, 0xd085ea85, F=0x0
-0,         66,         66,        1,      178, 0x51663ad1, F=0x0
-0,         67,         67,        1,      446, 0x00adbe2d, F=0x0
-0,         68,         68,        1,      188, 0x7ccb3dda, F=0x0
-0,         69,         69,        1,      177, 0xd881441a, F=0x0
-0,         70,         70,        1,      112, 0x44cc2135, F=0x0
-0,         71,         71,        1,      296, 0x717d7172, F=0x0
-0,         72,         72,        1,      153, 0xbd403424, F=0x0
-0,         73,         73,        1,      218, 0x1d9a4f26, F=0x0
-0,         74,         74,        1,      202, 0x6ee647eb, F=0x0
-0,         75,         75,        1,      239, 0x71245ad2, F=0x0
-0,         76,         76,        1,      139, 0xbbdd2d23, F=0x0
-0,         77,         77,        1,      467, 0x6e1cc838, F=0x0
-0,         78,         78,        1,      274, 0xea1079c5, F=0x0
-0,         79,         79,        1,      404, 0xbf5caaa0, F=0x0
-0,         80,         80,        1,      257, 0xac4865e5, F=0x0
-0,         81,         81,        1,      419, 0xa45ab5fc, F=0x0
-0,         82,         82,        1,      208, 0xb5dd4fc3, F=0x0
-0,         83,         83,        1,      294, 0xcf5176ee, F=0x0
-0,         84,         84,        1,      191, 0xed7e3e98, F=0x0
-0,         85,         85,        1,      181, 0x9105450e, F=0x0
-0,         86,         86,        1,      218, 0x445c54ae, F=0x0
-0,         87,         87,        1,      423, 0x5dc9bec5, F=0x0
-0,         88,         88,        1,      202, 0xdfde4a35, F=0x0
-0,         89,         89,        1,      317, 0x9a918033, F=0x0
-0,         90,         90,        1,      172, 0x081e3d8c, F=0x0
-0,         91,         91,        1,      275, 0x37536b50, F=0x0
-0,         92,         92,        1,      214, 0xecfc4e8f, F=0x0
-0,         93,         93,        1,      182, 0x85bf44e5, F=0x0
-0,         94,         94,        1,      151, 0x4c8230ae, F=0x0
-0,         95,         95,        1,      157, 0xa02a32eb, F=0x0
-0,         96,         96,        1,      202, 0xb24a4355, F=0x0
-0,         97,         97,        1,      162, 0x632d3576, F=0x0
-0,         98,         98,        1,      186, 0x6f9c407c, F=0x0
-0,         99,         99,        1,      318, 0xade078ca, F=0x0
-0,        100,        100,        1,      225, 0xd2754eee, F=0x0
-0,        101,        101,        1,      207, 0xdedb4552, F=0x0
-0,        102,        102,        1,      212, 0x25384cd1, F=0x0
-0,        103,        103,        1,      153, 0x489434d3, F=0x0
-0,        104,        104,        1,      196, 0x659145f9, F=0x0
-0,        105,        105,        1,      146, 0x8b223366, F=0x0
-0,        106,        106,        1,      194, 0x0bc14890, F=0x0
-0,        107,        107,        1,      304, 0xdece8235, F=0x0
-0,        108,        108,        1,      194, 0x7737464d, F=0x0
-0,        109,        109,        1,      190, 0x945e43a4, F=0x0
-0,        110,        110,        1,      204, 0x8de14af3, F=0x0
-0,        111,        111,        1,      136, 0xd0862cb1, F=0x0
-0,        112,        112,        1,      171, 0xff6f3da8, F=0x0
-0,        113,        113,        1,      140, 0x3475307b, F=0x0
-0,        114,        114,        1,      158, 0x8f31321e, F=0x0
-0,        115,        115,        1,       94, 0xf6691c01, F=0x0
-0,        116,        116,        1,      110, 0x66e52218, F=0x0
-0,        117,        117,        1,      256, 0x4b086864, F=0x0
-0,        118,        118,        1,      220, 0x6fb75337, F=0x0
-0,        119,        119,        1,      221, 0x69a94e72, F=0x0
-0,        120,        120,        1,      205, 0xbae94509, F=0x0
-0,        121,        121,        1,      169, 0xdd3c388b, F=0x0
-0,        122,        122,        1,      970, 0x9771c82f, F=0x0
-0,        123,        123,        1,      181, 0xec794298, F=0x0
-0,        124,        124,        1,      955, 0x23edba10, F=0x0
-0,        125,        125,        1,      158, 0x3ad83314, F=0x0
-0,        126,        126,        1,      344, 0x29aa8843, F=0x0
-0,        127,        127,        1,      627, 0x6d3f18dc, F=0x0
-0,        128,        128,        1,      172, 0x985d3cc5, F=0x0
-0,        129,        129,        1,      494, 0x591cdcc3, F=0x0
-0,        130,        130,        1,      184, 0x83ca42c1, F=0x0
-0,        131,        131,        1,      352, 0x68169925, F=0x0
-0,        132,        132,        1,      351, 0x06998cfa, F=0x0
-0,        133,        133,        1,      170, 0xaec83809, F=0x0
-0,        134,        134,        1,      275, 0xd1ea6a74, F=0x0
-0,        135,        135,        1,      168, 0xe9b93a2e, F=0x0
-0,        136,        136,        1,      169, 0xa27f3870, F=0x0
-0,        137,        137,        1,      521, 0xf195dc2e, F=0x0
-0,        138,        138,        1,     1262, 0x52b34497, F=0x0
-0,        139,        139,        1,      994, 0x9d72bc25, F=0x0
-0,        140,        140,        1,      290, 0xb2c17360, F=0x0
-0,        141,        141,        1,      188, 0x2c30402b, F=0x0
-0,        142,        142,        1,      164, 0x8bb13b7a, F=0x0
-0,        143,        143,        1,      212, 0x69af44ca, F=0x0
-0,        144,        144,        1,      870, 0xebc09472, F=0x0
-0,        145,        145,        1,      635, 0x1f781aee, F=0x0
-0,        146,        146,        1,      290, 0x01a5786c, F=0x0
-0,        147,        147,        1,      211, 0xec4d5052, F=0x0
-0,        148,        148,        1,      177, 0x56db3c7b, F=0x0
-0,        149,        149,        1,      182, 0x312c3f58, F=0x0
-0,        150,        150,        1,      588, 0x9924fcca, F=0x0
-0,        151,        151,        1,      163, 0xe23a370e, F=0x0
-0,        152,        152,        1,      407, 0x525ab1a8, F=0x0
-0,        153,        153,        1,      204, 0x0b84449d, F=0x0
-0,        154,        154,        1,      290, 0xa97e7886, F=0x0
-0,        155,        155,        1,      308, 0xac988116, F=0x0
-0,        156,        156,        1,      196, 0x6d6c47fa, F=0x0
-0,        157,        157,        1,      181, 0x7a413f71, F=0x0
-0,        158,        158,        1,      203, 0xb03b4fa8, F=0x0
-0,        159,        159,        1,      227, 0xb3d55aeb, F=0x0
-0,        160,        160,        1,      524, 0xa731e285, F=0x0
-0,        161,        161,        1,      377, 0x4ac097de, F=0x0
-0,        162,        162,        1,      196, 0x78264511, F=0x0
-0,        163,        163,        1,      250, 0x6d4f65a1, F=0x0
-0,        164,        164,        1,      214, 0x31534ffe, F=0x0
-0,        165,        165,        1,      323, 0xd4d78fa2, F=0x0
-0,        166,        166,        1,      176, 0x642e40ab, F=0x0
-0,        167,        167,        1,      305, 0x63db7e18, F=0x0
-0,        168,        168,        1,      179, 0x4c4042da, F=0x0
-0,        169,        169,        1,      245, 0x645264fb, F=0x0
-0,        170,        170,        1,      181, 0x0a3e403e, F=0x0
-0,        171,        171,        1,      241, 0x592e57b1, F=0x0
-0,        172,        172,        1,      172, 0xf5cb3f7f, F=0x0
+0,          0,          0,        9,     1297, 0x5618fe71
+0,         10,         10,       10,      158, 0xfa673468, F=0x0
+0,         20,         20,       10,      143, 0x61cf2b35, F=0x0
+0,         30,         30,       10,      169, 0x152a369a, F=0x0
+0,         40,         40,       10,      254, 0x22935c08, F=0x0
+0,         50,         50,       10,      221, 0x9972496f, F=0x0
+0,         60,         60,       10,      176, 0xf6af3ab2, F=0x0
+0,         70,         70,       10,      189, 0xcdc23f20, F=0x0
+0,         80,         80,       10,      139, 0x081e3020, F=0x0
+0,         90,         90,       10,      160, 0x9153335f, F=0x0
+0,        100,        100,       10,      149, 0x8fa12e7d, F=0x0
+0,        110,        110,       10,      190, 0x43ef3de1, F=0x0
+0,        120,        120,       10,      308, 0x95c77160, F=0x0
+0,        130,        130,       10,      193, 0xf9084196, F=0x0
+0,        140,        140,       10,      191, 0x07784447, F=0x0
+0,        150,        150,       10,      198, 0x7d72420a, F=0x0
+0,        160,        160,       10,      417, 0xbf40acdc, F=0x0
+0,        170,        170,       10,      163, 0xf7df3842, F=0x0
+0,        180,        180,       10,      383, 0xadcf9e8e, F=0x0
+0,        190,        190,       10,      193, 0xba544052, F=0x0
+0,        200,        200,       10,      337, 0x1510922f, F=0x0
+0,        210,        210,       10,      199, 0x11d64936, F=0x0
+0,        220,        220,       10,      308, 0x79597dbc, F=0x0
+0,        230,        230,       10,      186, 0x25d04175, F=0x0
+0,        240,        240,       10,      199, 0x8b65402f, F=0x0
+0,        250,        250,       10,      163, 0x128e38b6, F=0x0
+0,        260,        260,       10,      302, 0xacc979b2, F=0x0
+0,        270,        270,       10,      189, 0x491f3c5c, F=0x0
+0,        280,        280,       10,      157, 0x50783600, F=0x0
+0,        290,        290,       10,      205, 0xad9045b3, F=0x0
+0,        300,        300,       10,      160, 0xcbf332f8, F=0x0
+0,        310,        310,       10,      202, 0xc72c48bf, F=0x0
+0,        320,        320,       10,      160, 0xe6c436dd, F=0x0
+0,        330,        330,       10,      215, 0x4f705072, F=0x0
+0,        340,        340,       10,      422, 0xed27b0b0, F=0x0
+0,        350,        350,       10,      184, 0x6ba8415a, F=0x0
+0,        360,        360,       10,      289, 0x0b5f73a3, F=0x0
+0,        370,        370,       10,      190, 0xea5b4316, F=0x0
+0,        380,        380,       10,      195, 0xd9f2441d, F=0x0
+0,        390,        390,       10,      199, 0x47e34e05, F=0x0
+0,        400,        400,       10,      448, 0xec8bbf56, F=0x0
+0,        410,        410,       10,      170, 0x42fb3755, F=0x0
+0,        420,        420,       10,      279, 0x87cc6f54, F=0x0
+0,        430,        430,       10,      180, 0x085f398a, F=0x0
+0,        440,        440,       10,      303, 0x46fe7c55, F=0x0
+0,        450,        450,       10,      209, 0xc60b5116, F=0x0
+0,        460,        460,       10,      198, 0x795f4655, F=0x0
+0,        470,        470,       10,      194, 0xeb1b4abe, F=0x0
+0,        480,        480,       10,      186, 0x97b44251, F=0x0
+0,        490,        490,       10,     1200, 0xeb5a36ba, F=0x0
+0,        500,        500,       10,      204, 0x00bc4594, F=0x0
+0,        510,        510,       10,     1066, 0xdc39eee0, F=0x0
+0,        520,        520,       10,      187, 0x344b4304, F=0x0
+0,        530,        530,       10,      323, 0x899f8522, F=0x0
+0,        540,        540,       10,      205, 0x48af49da, F=0x0
+0,        550,        550,       10,      213, 0xf2534ff5, F=0x0
+0,        560,        560,       10,      208, 0x8fba4b25, F=0x0
+0,        570,        570,       10,      737, 0x1612477c, F=0x0
+0,        580,        580,       10,      181, 0x903b38ad, F=0x0
+0,        590,        590,       10,      614, 0xb154157d, F=0x0
+0,        600,        600,       10,      215, 0x4e82532e, F=0x0
+0,        610,        610,       10,      291, 0x69476efd, F=0x0
+0,        620,        620,       10,      208, 0x471d4ea1, F=0x0
+0,        630,        630,       10,      208, 0xa2b04628, F=0x0
+0,        640,        640,       10,      203, 0x96d646b2, F=0x0
+0,        650,        650,       10,      531, 0xd085ea85, F=0x0
+0,        660,        660,       10,      178, 0x51663ad1, F=0x0
+0,        670,        670,       10,      446, 0x00adbe2d, F=0x0
+0,        680,        680,       10,      188, 0x7ccb3dda, F=0x0
+0,        690,        690,       10,      177, 0xd881441a, F=0x0
+0,        700,        700,       10,      112, 0x44cc2135, F=0x0
+0,        710,        710,       10,      296, 0x717d7172, F=0x0
+0,        720,        720,       10,      153, 0xbd403424, F=0x0
+0,        730,        730,       10,      218, 0x1d9a4f26, F=0x0
+0,        740,        740,       10,      202, 0x6ee647eb, F=0x0
+0,        750,        750,       10,      239, 0x71245ad2, F=0x0
+0,        760,        760,       10,      139, 0xbbdd2d23, F=0x0
+0,        770,        770,       10,      467, 0x6e1cc838, F=0x0
+0,        780,        780,       10,      274, 0xea1079c5, F=0x0
+0,        790,        790,       10,      404, 0xbf5caaa0, F=0x0
+0,        800,        800,       10,      257, 0xac4865e5, F=0x0
+0,        810,        810,       10,      419, 0xa45ab5fc, F=0x0
+0,        820,        820,       10,      208, 0xb5dd4fc3, F=0x0
+0,        830,        830,       10,      294, 0xcf5176ee, F=0x0
+0,        840,        840,       10,      191, 0xed7e3e98, F=0x0
+0,        850,        850,       10,      181, 0x9105450e, F=0x0
+0,        860,        860,       10,      218, 0x445c54ae, F=0x0
+0,        870,        870,       10,      423, 0x5dc9bec5, F=0x0
+0,        880,        880,       10,      202, 0xdfde4a35, F=0x0
+0,        890,        890,       10,      317, 0x9a918033, F=0x0
+0,        900,        900,       10,      172, 0x081e3d8c, F=0x0
+0,        910,        910,       10,      275, 0x37536b50, F=0x0
+0,        920,        920,       10,      214, 0xecfc4e8f, F=0x0
+0,        930,        930,       10,      182, 0x85bf44e5, F=0x0
+0,        940,        940,       10,      151, 0x4c8230ae, F=0x0
+0,        950,        950,       10,      157, 0xa02a32eb, F=0x0
+0,        960,        960,       10,      202, 0xb24a4355, F=0x0
+0,        970,        970,       10,      162, 0x632d3576, F=0x0
+0,        980,        980,       10,      186, 0x6f9c407c, F=0x0
+0,        990,        990,       10,      318, 0xade078ca, F=0x0
+0,       1000,       1000,       10,      225, 0xd2754eee, F=0x0
+0,       1010,       1010,       10,      207, 0xdedb4552, F=0x0
+0,       1020,       1020,       10,      212, 0x25384cd1, F=0x0
+0,       1030,       1030,       10,      153, 0x489434d3, F=0x0
+0,       1040,       1040,       10,      196, 0x659145f9, F=0x0
+0,       1050,       1050,       10,      146, 0x8b223366, F=0x0
+0,       1060,       1060,       10,      194, 0x0bc14890, F=0x0
+0,       1070,       1070,       10,      304, 0xdece8235, F=0x0
+0,       1080,       1080,       10,      194, 0x7737464d, F=0x0
+0,       1090,       1090,       10,      190, 0x945e43a4, F=0x0
+0,       1100,       1100,       10,      204, 0x8de14af3, F=0x0
+0,       1110,       1110,       10,      136, 0xd0862cb1, F=0x0
+0,       1120,       1120,       10,      171, 0xff6f3da8, F=0x0
+0,       1130,       1130,       10,      140, 0x3475307b, F=0x0
+0,       1140,       1140,       10,      158, 0x8f31321e, F=0x0
+0,       1150,       1150,       10,       94, 0xf6691c01, F=0x0
+0,       1160,       1160,       10,      110, 0x66e52218, F=0x0
+0,       1170,       1170,       10,      256, 0x4b086864, F=0x0
+0,       1180,       1180,       10,      220, 0x6fb75337, F=0x0
+0,       1190,       1190,       10,      221, 0x69a94e72, F=0x0
+0,       1200,       1200,       10,      205, 0xbae94509, F=0x0
+0,       1210,       1210,       10,      169, 0xdd3c388b, F=0x0
+0,       1220,       1220,       10,      970, 0x9771c82f, F=0x0
+0,       1230,       1230,       10,      181, 0xec794298, F=0x0
+0,       1240,       1240,       10,      955, 0x23edba10, F=0x0
+0,       1250,       1250,       10,      158, 0x3ad83314, F=0x0
+0,       1260,       1260,       10,      344, 0x29aa8843, F=0x0
+0,       1270,       1270,       10,      627, 0x6d3f18dc, F=0x0
+0,       1280,       1280,       10,      172, 0x985d3cc5, F=0x0
+0,       1290,       1290,       10,      494, 0x591cdcc3, F=0x0
+0,       1300,       1300,       10,      184, 0x83ca42c1, F=0x0
+0,       1310,       1310,       10,      352, 0x68169925, F=0x0
+0,       1320,       1320,       10,      351, 0x06998cfa, F=0x0
+0,       1330,       1330,       10,      170, 0xaec83809, F=0x0
+0,       1340,       1340,       10,      275, 0xd1ea6a74, F=0x0
+0,       1350,       1350,       10,      168, 0xe9b93a2e, F=0x0
+0,       1360,       1360,       10,      169, 0xa27f3870, F=0x0
+0,       1370,       1370,       10,      521, 0xf195dc2e, F=0x0
+0,       1380,       1380,       10,     1262, 0x52b34497, F=0x0
+0,       1390,       1390,       10,      994, 0x9d72bc25, F=0x0
+0,       1400,       1400,       10,      290, 0xb2c17360, F=0x0
+0,       1410,       1410,       10,      188, 0x2c30402b, F=0x0
+0,       1420,       1420,       10,      164, 0x8bb13b7a, F=0x0
+0,       1430,       1430,       10,      212, 0x69af44ca, F=0x0
+0,       1440,       1440,       10,      870, 0xebc09472, F=0x0
+0,       1450,       1450,       10,      635, 0x1f781aee, F=0x0
+0,       1460,       1460,       10,      290, 0x01a5786c, F=0x0
+0,       1470,       1470,       10,      211, 0xec4d5052, F=0x0
+0,       1480,       1480,       10,      177, 0x56db3c7b, F=0x0
+0,       1490,       1490,       10,      182, 0x312c3f58, F=0x0
+0,       1500,       1500,       10,      588, 0x9924fcca, F=0x0
+0,       1510,       1510,       10,      163, 0xe23a370e, F=0x0
+0,       1520,       1520,       10,      407, 0x525ab1a8, F=0x0
+0,       1530,       1530,       10,      204, 0x0b84449d, F=0x0
+0,       1540,       1540,       10,      290, 0xa97e7886, F=0x0
+0,       1550,       1550,       10,      308, 0xac988116, F=0x0
+0,       1560,       1560,       10,      196, 0x6d6c47fa, F=0x0
+0,       1570,       1570,       10,      181, 0x7a413f71, F=0x0
+0,       1580,       1580,       10,      203, 0xb03b4fa8, F=0x0
+0,       1590,       1590,       10,      227, 0xb3d55aeb, F=0x0
+0,       1600,       1600,       10,      524, 0xa731e285, F=0x0
+0,       1610,       1610,       10,      377, 0x4ac097de, F=0x0
+0,       1620,       1620,       10,      196, 0x78264511, F=0x0
+0,       1630,       1630,       10,      250, 0x6d4f65a1, F=0x0
+0,       1640,       1640,       10,      214, 0x31534ffe, F=0x0
+0,       1650,       1650,       10,      323, 0xd4d78fa2, F=0x0
+0,       1660,       1660,       10,      176, 0x642e40ab, F=0x0
+0,       1670,       1670,       10,      305, 0x63db7e18, F=0x0
+0,       1680,       1680,       10,      179, 0x4c4042da, F=0x0
+0,       1690,       1690,       10,      245, 0x645264fb, F=0x0
+0,       1700,       1700,       10,      181, 0x0a3e403e, F=0x0
+0,       1710,       1710,       10,      241, 0x592e57b1, F=0x0
+0,       1720,       1720,       10,      172, 0xf5cb3f7f, F=0x0
diff --git a/tests/ref/fate/gifenc-rgb8 b/tests/ref/fate/gifenc-rgb8
index dd1648e776..1c3d6e2266 100644
--- a/tests/ref/fate/gifenc-rgb8
+++ b/tests/ref/fate/gifenc-rgb8
@@ -1,178 +1,178 @@ 
-#tb 0: 1/10
+#tb 0: 1/100
 #media_type 0: video
 #codec_id 0: gif
 #dimensions 0: 217x217
 #sar 0: 0/1
-0,          0,          0,        1,     1341, 0xaa85adb1
-0,          1,          1,        1,      236, 0xa46f676e, F=0x0
-0,          2,          2,        1,      186, 0xd99b4ec2, F=0x0
-0,          3,          3,        1,      208, 0xb9be5007, F=0x0
-0,          4,          4,        1,      282, 0xe43d8422, F=0x0
-0,          5,          5,        1,      209, 0xda215145, F=0x0
-0,          6,          6,        1,      225, 0xc6375b19, F=0x0
-0,          7,          7,        1,      204, 0x467a54c1, F=0x0
-0,          8,          8,        1,      181, 0x1c0e4dae, F=0x0
-0,          9,          9,        1,      200, 0xc55e53c1, F=0x0
-0,         10,         10,        1,      184, 0x87644454, F=0x0
-0,         11,         11,        1,      191, 0x3847484a, F=0x0
-0,         12,         12,        1,      290, 0x9ce37f1f, F=0x0
-0,         13,         13,        1,      153, 0x7ab03afc, F=0x0
-0,         14,         14,        1,      175, 0x64bc4621, F=0x0
-0,         15,         15,        1,      187, 0x9284451d, F=0x0
-0,         16,         16,        1,      418, 0x7b18c8a5, F=0x0
-0,         17,         17,        1,      200, 0xf8e5527f, F=0x0
-0,         18,         18,        1,      347, 0xbc6494eb, F=0x0
-0,         19,         19,        1,      176, 0x8d1842e5, F=0x0
-0,         20,         20,        1,      294, 0x52fe8678, F=0x0
-0,         21,         21,        1,      166, 0x614142a1, F=0x0
-0,         22,         22,        1,      306, 0xafe8850d, F=0x0
-0,         23,         23,        1,      180, 0xa2cc44a0, F=0x0
-0,         24,         24,        1,      207, 0x91e25233, F=0x0
-0,         25,         25,        1,      204, 0x0f174cb7, F=0x0
-0,         26,         26,        1,      259, 0x629071c3, F=0x0
-0,         27,         27,        1,      181, 0x950e4a15, F=0x0
-0,         28,         28,        1,      152, 0x77023d8a, F=0x0
-0,         29,         29,        1,      194, 0x890b4d08, F=0x0
-0,         30,         30,        1,      159, 0xaa5a397d, F=0x0
-0,         31,         31,        1,      162, 0x8ae73c95, F=0x0
-0,         32,         32,        1,      178, 0x7fba4974, F=0x0
-0,         33,         33,        1,      187, 0x41fd52cc, F=0x0
-0,         34,         34,        1,      336, 0xd8139332, F=0x0
-0,         35,         35,        1,      184, 0x61b3484a, F=0x0
-0,         36,         36,        1,      227, 0x8be2607e, F=0x0
-0,         37,         37,        1,      182, 0x9bc84478, F=0x0
-0,         38,         38,        1,      162, 0x33423e3c, F=0x0
-0,         39,         39,        1,      187, 0x62fd4805, F=0x0
-0,         40,         40,        1,      503, 0xfc0ce5c8, F=0x0
-0,         41,         41,        1,      167, 0x40bd40d7, F=0x0
-0,         42,         42,        1,      289, 0xe5ad805c, F=0x0
-0,         43,         43,        1,      194, 0xc0174c24, F=0x0
-0,         44,         44,        1,      285, 0x48f38060, F=0x0
-0,         45,         45,        1,      199, 0x62bd52dc, F=0x0
-0,         46,         46,        1,      197, 0xcc1f4d1d, F=0x0
-0,         47,         47,        1,      203, 0xa0cb4c90, F=0x0
-0,         48,         48,        1,      208, 0x460155cd, F=0x0
-0,         49,         49,        1,     1198, 0x0b795bb1, F=0x0
-0,         50,         50,        1,      175, 0x36cc4a76, F=0x0
-0,         51,         51,        1,      740, 0xeb6f68b9, F=0x0
-0,         52,         52,        1,      180, 0xa22544ba, F=0x0
-0,         53,         53,        1,      238, 0x08ff6b12, F=0x0
-0,         54,         54,        1,      198, 0x3d4d50dd, F=0x0
-0,         55,         55,        1,      196, 0xbef74ccd, F=0x0
-0,         56,         56,        1,      224, 0x47c05ea9, F=0x0
-0,         57,         57,        1,      765, 0xb89e6f01, F=0x0
-0,         58,         58,        1,      149, 0x26bb3969, F=0x0
-0,         59,         59,        1,      479, 0xcdd6d6bf, F=0x0
-0,         60,         60,        1,      179, 0x537948eb, F=0x0
-0,         61,         61,        1,      217, 0x6b9b5b06, F=0x0
-0,         62,         62,        1,      190, 0x56b54a3a, F=0x0
-0,         63,         63,        1,      155, 0x487439ef, F=0x0
-0,         64,         64,        1,      167, 0x1bb947ba, F=0x0
-0,         65,         65,        1,      649, 0xb44a3058, F=0x0
-0,         66,         66,        1,      196, 0x66ae5688, F=0x0
-0,         67,         67,        1,      427, 0x8b0bd38d, F=0x0
-0,         68,         68,        1,      175, 0xbb9d4294, F=0x0
-0,         69,         69,        1,      284, 0x9f768221, F=0x0
-0,         70,         70,        1,      131, 0x612d2e14, F=0x0
-0,         71,         71,        1,      256, 0x701a69b4, F=0x0
-0,         72,         72,        1,      186, 0xf7114a80, F=0x0
-0,         73,         73,        1,      190, 0x53144c4d, F=0x0
-0,         74,         74,        1,      216, 0xc67b53e5, F=0x0
-0,         75,         75,        1,      154, 0xc04e39ba, F=0x0
-0,         76,         76,        1,      113, 0x4800284b, F=0x0
-0,         77,         77,        1,      402, 0xee43b0dd, F=0x0
-0,         78,         78,        1,      198, 0x55e451cc, F=0x0
-0,         79,         79,        1,      466, 0xb3c8cff3, F=0x0
-0,         80,         80,        1,      322, 0x5ade8d02, F=0x0
-0,         81,         81,        1,      387, 0x72edb2f7, F=0x0
-0,         82,         82,        1,      158, 0x12a5402c, F=0x0
-0,         83,         83,        1,      278, 0xd6727a4a, F=0x0
-0,         84,         84,        1,      190, 0x58205087, F=0x0
-0,         85,         85,        1,      175, 0x9a58432a, F=0x0
-0,         86,         86,        1,      206, 0x85954c9e, F=0x0
-0,         87,         87,        1,      379, 0x4f1db56a, F=0x0
-0,         88,         88,        1,      202, 0x19b05154, F=0x0
-0,         89,         89,        1,      225, 0xf4166005, F=0x0
-0,         90,         90,        1,      175, 0x44414761, F=0x0
-0,         91,         91,        1,      235, 0xe01c603f, F=0x0
-0,         92,         92,        1,      185, 0xfab74905, F=0x0
-0,         93,         93,        1,      182, 0x9c5f4ae7, F=0x0
-0,         94,         94,        1,      114, 0xe0542abd, F=0x0
-0,         95,         95,        1,      176, 0x6e274c2e, F=0x0
-0,         96,         96,        1,      214, 0x44725ac3, F=0x0
-0,         97,         97,        1,      182, 0x54e9482e, F=0x0
-0,         98,         98,        1,      195, 0x6231525e, F=0x0
-0,         99,         99,        1,      303, 0xf63c84a1, F=0x0
-0,        100,        100,        1,      191, 0x4aa84e6f, F=0x0
-0,        101,        101,        1,      177, 0xfd82496d, F=0x0
-0,        102,        102,        1,      172, 0x13d041cb, F=0x0
-0,        103,        103,        1,      179, 0x89f54866, F=0x0
-0,        104,        104,        1,      188, 0xf39d4d8d, F=0x0
-0,        105,        105,        1,      177, 0x4d0e4882, F=0x0
-0,        106,        106,        1,      215, 0xca7b5a6f, F=0x0
-0,        107,        107,        1,      339, 0x1dd598fe, F=0x0
-0,        108,        108,        1,      189, 0xe2d94497, F=0x0
-0,        109,        109,        1,      209, 0x682356be, F=0x0
-0,        110,        110,        1,      205, 0xa5af51b7, F=0x0
-0,        111,        111,        1,      185, 0xa1224e22, F=0x0
-0,        112,        112,        1,      211, 0x09a95a00, F=0x0
-0,        113,        113,        1,      178, 0x31ab47cc, F=0x0
-0,        114,        114,        1,      195, 0x960f4c9c, F=0x0
-0,        115,        115,        1,      116, 0x8f8b2da3, F=0x0
-0,        116,        116,        1,      116, 0xf30c2b3d, F=0x0
-0,        117,        117,        1,      427, 0xa3dcc81b, F=0x0
-0,        118,        118,        1,      182, 0xce37489b, F=0x0
-0,        119,        119,        1,      267, 0x516c6f3e, F=0x0
-0,        120,        120,        1,      191, 0xff5c4af7, F=0x0
-0,        121,        121,        1,      195, 0x49cd5178, F=0x0
-0,        122,        122,        1,      755, 0xb9b4608d, F=0x0
-0,        123,        123,        1,      179, 0x6d0c4600, F=0x0
-0,        124,        124,        1,      522, 0xffe5f236, F=0x0
-0,        125,        125,        1,      171, 0xea4c40b8, F=0x0
-0,        126,        126,        1,      379, 0xbf2fa98b, F=0x0
-0,        127,        127,        1,      539, 0xace2f7b5, F=0x0
-0,        128,        128,        1,      199, 0xe0534e3d, F=0x0
-0,        129,        129,        1,      458, 0x2b54d13e, F=0x0
-0,        130,        130,        1,      177, 0x6ff04b91, F=0x0
-0,        131,        131,        1,      299, 0x51d1893e, F=0x0
-0,        132,        132,        1,      333, 0x5cba941f, F=0x0
-0,        133,        133,        1,      179, 0x2381453b, F=0x0
-0,        134,        134,        1,      263, 0xac907176, F=0x0
-0,        135,        135,        1,      177, 0xb87546d9, F=0x0
-0,        136,        136,        1,      184, 0x761c4765, F=0x0
-0,        137,        137,        1,      433, 0x55f0c2d6, F=0x0
-0,        138,        138,        1,     1138, 0x3b7137a0, F=0x0
-0,        139,        139,        1,      863, 0x5afd9dae, F=0x0
-0,        140,        140,        1,      328, 0x4537973f, F=0x0
-0,        141,        141,        1,      222, 0xadb859e4, F=0x0
-0,        142,        142,        1,      171, 0x7ce844b6, F=0x0
-0,        143,        143,        1,      222, 0xa5815a1f, F=0x0
-0,        144,        144,        1,      738, 0x3fe75c6a, F=0x0
-0,        145,        145,        1,      444, 0x320fd03e, F=0x0
-0,        146,        146,        1,      267, 0x288273f3, F=0x0
-0,        147,        147,        1,      187, 0x07594c67, F=0x0
-0,        148,        148,        1,      186, 0xbd1c50de, F=0x0
-0,        149,        149,        1,      196, 0xf3e14fdb, F=0x0
-0,        150,        150,        1,      589, 0x127314a0, F=0x0
-0,        151,        151,        1,      188, 0x22d74d85, F=0x0
-0,        152,        152,        1,      339, 0xcadaa1b6, F=0x0
-0,        153,        153,        1,      179, 0x6a1843a7, F=0x0
-0,        154,        154,        1,      294, 0xe04184fa, F=0x0
-0,        155,        155,        1,      291, 0x4b018587, F=0x0
-0,        156,        156,        1,      144, 0x470f3737, F=0x0
-0,        157,        157,        1,      182, 0x3b994dcd, F=0x0
-0,        158,        158,        1,      195, 0x7f884fd3, F=0x0
-0,        159,        159,        1,      268, 0xb6097b3b, F=0x0
-0,        160,        160,        1,      526, 0x40e0fd27, F=0x0
-0,        161,        161,        1,      372, 0x9dffaa6d, F=0x0
-0,        162,        162,        1,      171, 0xc06841eb, F=0x0
-0,        163,        163,        1,      344, 0xc47da473, F=0x0
-0,        164,        164,        1,      159, 0xacf64002, F=0x0
-0,        165,        165,        1,      391, 0x520cad43, F=0x0
-0,        166,        166,        1,      180, 0x05c04cac, F=0x0
-0,        167,        167,        1,      303, 0x748493c3, F=0x0
-0,        168,        168,        1,      180, 0x3fc54928, F=0x0
-0,        169,        169,        1,      269, 0xcd227967, F=0x0
-0,        170,        170,        1,      199, 0x3a3053e8, F=0x0
-0,        171,        171,        1,      287, 0x3c37840b, F=0x0
-0,        172,        172,        1,      217, 0xabd063fc, F=0x0
+0,          0,          0,        9,     1341, 0xaa85adb1
+0,         10,         10,       10,      236, 0xa46f676e, F=0x0
+0,         20,         20,       10,      186, 0xd99b4ec2, F=0x0
+0,         30,         30,       10,      208, 0xb9be5007, F=0x0
+0,         40,         40,       10,      282, 0xe43d8422, F=0x0
+0,         50,         50,       10,      209, 0xda215145, F=0x0
+0,         60,         60,       10,      225, 0xc6375b19, F=0x0
+0,         70,         70,       10,      204, 0x467a54c1, F=0x0
+0,         80,         80,       10,      181, 0x1c0e4dae, F=0x0
+0,         90,         90,       10,      200, 0xc55e53c1, F=0x0
+0,        100,        100,       10,      184, 0x87644454, F=0x0
+0,        110,        110,       10,      191, 0x3847484a, F=0x0
+0,        120,        120,       10,      290, 0x9ce37f1f, F=0x0
+0,        130,        130,       10,      153, 0x7ab03afc, F=0x0
+0,        140,        140,       10,      175, 0x64bc4621, F=0x0
+0,        150,        150,       10,      187, 0x9284451d, F=0x0
+0,        160,        160,       10,      418, 0x7b18c8a5, F=0x0
+0,        170,        170,       10,      200, 0xf8e5527f, F=0x0
+0,        180,        180,       10,      347, 0xbc6494eb, F=0x0
+0,        190,        190,       10,      176, 0x8d1842e5, F=0x0
+0,        200,        200,       10,      294, 0x52fe8678, F=0x0
+0,        210,        210,       10,      166, 0x614142a1, F=0x0
+0,        220,        220,       10,      306, 0xafe8850d, F=0x0
+0,        230,        230,       10,      180, 0xa2cc44a0, F=0x0
+0,        240,        240,       10,      207, 0x91e25233, F=0x0
+0,        250,        250,       10,      204, 0x0f174cb7, F=0x0
+0,        260,        260,       10,      259, 0x629071c3, F=0x0
+0,        270,        270,       10,      181, 0x950e4a15, F=0x0
+0,        280,        280,       10,      152, 0x77023d8a, F=0x0
+0,        290,        290,       10,      194, 0x890b4d08, F=0x0
+0,        300,        300,       10,      159, 0xaa5a397d, F=0x0
+0,        310,        310,       10,      162, 0x8ae73c95, F=0x0
+0,        320,        320,       10,      178, 0x7fba4974, F=0x0
+0,        330,        330,       10,      187, 0x41fd52cc, F=0x0
+0,        340,        340,       10,      336, 0xd8139332, F=0x0
+0,        350,        350,       10,      184, 0x61b3484a, F=0x0
+0,        360,        360,       10,      227, 0x8be2607e, F=0x0
+0,        370,        370,       10,      182, 0x9bc84478, F=0x0
+0,        380,        380,       10,      162, 0x33423e3c, F=0x0
+0,        390,        390,       10,      187, 0x62fd4805, F=0x0
+0,        400,        400,       10,      503, 0xfc0ce5c8, F=0x0
+0,        410,        410,       10,      167, 0x40bd40d7, F=0x0
+0,        420,        420,       10,      289, 0xe5ad805c, F=0x0
+0,        430,        430,       10,      194, 0xc0174c24, F=0x0
+0,        440,        440,       10,      285, 0x48f38060, F=0x0
+0,        450,        450,       10,      199, 0x62bd52dc, F=0x0
+0,        460,        460,       10,      197, 0xcc1f4d1d, F=0x0
+0,        470,        470,       10,      203, 0xa0cb4c90, F=0x0
+0,        480,        480,       10,      208, 0x460155cd, F=0x0
+0,        490,        490,       10,     1198, 0x0b795bb1, F=0x0
+0,        500,        500,       10,      175, 0x36cc4a76, F=0x0
+0,        510,        510,       10,      740, 0xeb6f68b9, F=0x0
+0,        520,        520,       10,      180, 0xa22544ba, F=0x0
+0,        530,        530,       10,      238, 0x08ff6b12, F=0x0
+0,        540,        540,       10,      198, 0x3d4d50dd, F=0x0
+0,        550,        550,       10,      196, 0xbef74ccd, F=0x0
+0,        560,        560,       10,      224, 0x47c05ea9, F=0x0
+0,        570,        570,       10,      765, 0xb89e6f01, F=0x0
+0,        580,        580,       10,      149, 0x26bb3969, F=0x0
+0,        590,        590,       10,      479, 0xcdd6d6bf, F=0x0
+0,        600,        600,       10,      179, 0x537948eb, F=0x0
+0,        610,        610,       10,      217, 0x6b9b5b06, F=0x0
+0,        620,        620,       10,      190, 0x56b54a3a, F=0x0
+0,        630,        630,       10,      155, 0x487439ef, F=0x0
+0,        640,        640,       10,      167, 0x1bb947ba, F=0x0
+0,        650,        650,       10,      649, 0xb44a3058, F=0x0
+0,        660,        660,       10,      196, 0x66ae5688, F=0x0
+0,        670,        670,       10,      427, 0x8b0bd38d, F=0x0
+0,        680,        680,       10,      175, 0xbb9d4294, F=0x0
+0,        690,        690,       10,      284, 0x9f768221, F=0x0
+0,        700,        700,       10,      131, 0x612d2e14, F=0x0
+0,        710,        710,       10,      256, 0x701a69b4, F=0x0
+0,        720,        720,       10,      186, 0xf7114a80, F=0x0
+0,        730,        730,       10,      190, 0x53144c4d, F=0x0
+0,        740,        740,       10,      216, 0xc67b53e5, F=0x0
+0,        750,        750,       10,      154, 0xc04e39ba, F=0x0
+0,        760,        760,       10,      113, 0x4800284b, F=0x0
+0,        770,        770,       10,      402, 0xee43b0dd, F=0x0
+0,        780,        780,       10,      198, 0x55e451cc, F=0x0
+0,        790,        790,       10,      466, 0xb3c8cff3, F=0x0
+0,        800,        800,       10,      322, 0x5ade8d02, F=0x0
+0,        810,        810,       10,      387, 0x72edb2f7, F=0x0
+0,        820,        820,       10,      158, 0x12a5402c, F=0x0
+0,        830,        830,       10,      278, 0xd6727a4a, F=0x0
+0,        840,        840,       10,      190, 0x58205087, F=0x0
+0,        850,        850,       10,      175, 0x9a58432a, F=0x0
+0,        860,        860,       10,      206, 0x85954c9e, F=0x0
+0,        870,        870,       10,      379, 0x4f1db56a, F=0x0
+0,        880,        880,       10,      202, 0x19b05154, F=0x0
+0,        890,        890,       10,      225, 0xf4166005, F=0x0
+0,        900,        900,       10,      175, 0x44414761, F=0x0
+0,        910,        910,       10,      235, 0xe01c603f, F=0x0
+0,        920,        920,       10,      185, 0xfab74905, F=0x0
+0,        930,        930,       10,      182, 0x9c5f4ae7, F=0x0
+0,        940,        940,       10,      114, 0xe0542abd, F=0x0
+0,        950,        950,       10,      176, 0x6e274c2e, F=0x0
+0,        960,        960,       10,      214, 0x44725ac3, F=0x0
+0,        970,        970,       10,      182, 0x54e9482e, F=0x0
+0,        980,        980,       10,      195, 0x6231525e, F=0x0
+0,        990,        990,       10,      303, 0xf63c84a1, F=0x0
+0,       1000,       1000,       10,      191, 0x4aa84e6f, F=0x0
+0,       1010,       1010,       10,      177, 0xfd82496d, F=0x0
+0,       1020,       1020,       10,      172, 0x13d041cb, F=0x0
+0,       1030,       1030,       10,      179, 0x89f54866, F=0x0
+0,       1040,       1040,       10,      188, 0xf39d4d8d, F=0x0
+0,       1050,       1050,       10,      177, 0x4d0e4882, F=0x0
+0,       1060,       1060,       10,      215, 0xca7b5a6f, F=0x0
+0,       1070,       1070,       10,      339, 0x1dd598fe, F=0x0
+0,       1080,       1080,       10,      189, 0xe2d94497, F=0x0
+0,       1090,       1090,       10,      209, 0x682356be, F=0x0
+0,       1100,       1100,       10,      205, 0xa5af51b7, F=0x0
+0,       1110,       1110,       10,      185, 0xa1224e22, F=0x0
+0,       1120,       1120,       10,      211, 0x09a95a00, F=0x0
+0,       1130,       1130,       10,      178, 0x31ab47cc, F=0x0
+0,       1140,       1140,       10,      195, 0x960f4c9c, F=0x0
+0,       1150,       1150,       10,      116, 0x8f8b2da3, F=0x0
+0,       1160,       1160,       10,      116, 0xf30c2b3d, F=0x0
+0,       1170,       1170,       10,      427, 0xa3dcc81b, F=0x0
+0,       1180,       1180,       10,      182, 0xce37489b, F=0x0
+0,       1190,       1190,       10,      267, 0x516c6f3e, F=0x0
+0,       1200,       1200,       10,      191, 0xff5c4af7, F=0x0
+0,       1210,       1210,       10,      195, 0x49cd5178, F=0x0
+0,       1220,       1220,       10,      755, 0xb9b4608d, F=0x0
+0,       1230,       1230,       10,      179, 0x6d0c4600, F=0x0
+0,       1240,       1240,       10,      522, 0xffe5f236, F=0x0
+0,       1250,       1250,       10,      171, 0xea4c40b8, F=0x0
+0,       1260,       1260,       10,      379, 0xbf2fa98b, F=0x0
+0,       1270,       1270,       10,      539, 0xace2f7b5, F=0x0
+0,       1280,       1280,       10,      199, 0xe0534e3d, F=0x0
+0,       1290,       1290,       10,      458, 0x2b54d13e, F=0x0
+0,       1300,       1300,       10,      177, 0x6ff04b91, F=0x0
+0,       1310,       1310,       10,      299, 0x51d1893e, F=0x0
+0,       1320,       1320,       10,      333, 0x5cba941f, F=0x0
+0,       1330,       1330,       10,      179, 0x2381453b, F=0x0
+0,       1340,       1340,       10,      263, 0xac907176, F=0x0
+0,       1350,       1350,       10,      177, 0xb87546d9, F=0x0
+0,       1360,       1360,       10,      184, 0x761c4765, F=0x0
+0,       1370,       1370,       10,      433, 0x55f0c2d6, F=0x0
+0,       1380,       1380,       10,     1138, 0x3b7137a0, F=0x0
+0,       1390,       1390,       10,      863, 0x5afd9dae, F=0x0
+0,       1400,       1400,       10,      328, 0x4537973f, F=0x0
+0,       1410,       1410,       10,      222, 0xadb859e4, F=0x0
+0,       1420,       1420,       10,      171, 0x7ce844b6, F=0x0
+0,       1430,       1430,       10,      222, 0xa5815a1f, F=0x0
+0,       1440,       1440,       10,      738, 0x3fe75c6a, F=0x0
+0,       1450,       1450,       10,      444, 0x320fd03e, F=0x0
+0,       1460,       1460,       10,      267, 0x288273f3, F=0x0
+0,       1470,       1470,       10,      187, 0x07594c67, F=0x0
+0,       1480,       1480,       10,      186, 0xbd1c50de, F=0x0
+0,       1490,       1490,       10,      196, 0xf3e14fdb, F=0x0
+0,       1500,       1500,       10,      589, 0x127314a0, F=0x0
+0,       1510,       1510,       10,      188, 0x22d74d85, F=0x0
+0,       1520,       1520,       10,      339, 0xcadaa1b6, F=0x0
+0,       1530,       1530,       10,      179, 0x6a1843a7, F=0x0
+0,       1540,       1540,       10,      294, 0xe04184fa, F=0x0
+0,       1550,       1550,       10,      291, 0x4b018587, F=0x0
+0,       1560,       1560,       10,      144, 0x470f3737, F=0x0
+0,       1570,       1570,       10,      182, 0x3b994dcd, F=0x0
+0,       1580,       1580,       10,      195, 0x7f884fd3, F=0x0
+0,       1590,       1590,       10,      268, 0xb6097b3b, F=0x0
+0,       1600,       1600,       10,      526, 0x40e0fd27, F=0x0
+0,       1610,       1610,       10,      372, 0x9dffaa6d, F=0x0
+0,       1620,       1620,       10,      171, 0xc06841eb, F=0x0
+0,       1630,       1630,       10,      344, 0xc47da473, F=0x0
+0,       1640,       1640,       10,      159, 0xacf64002, F=0x0
+0,       1650,       1650,       10,      391, 0x520cad43, F=0x0
+0,       1660,       1660,       10,      180, 0x05c04cac, F=0x0
+0,       1670,       1670,       10,      303, 0x748493c3, F=0x0
+0,       1680,       1680,       10,      180, 0x3fc54928, F=0x0
+0,       1690,       1690,       10,      269, 0xcd227967, F=0x0
+0,       1700,       1700,       10,      199, 0x3a3053e8, F=0x0
+0,       1710,       1710,       10,      287, 0x3c37840b, F=0x0
+0,       1720,       1720,       10,      217, 0xabd063fc, F=0x0
-- 
2.39.1