static int gif_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data)

{

    GIFContext *s = avctx->priv_data;

    AVFrame *pict = data;

    AVFrame *const p = (AVFrame *)&s->picture;

    uint8_t *outbuf_ptr = outbuf;



    *p = *pict;

    p->pict_type = FF_I_TYPE;

    p->key_frame = 1;

    gif_image_write_header(&outbuf_ptr, avctx->width, avctx->height, -1, (uint32_t *)pict->data[1]);

    gif_image_write_image(&outbuf_ptr, 0, 0, avctx->width, avctx->height, pict->data[0], pict->linesize[0], PIX_FMT_PAL8);

    return outbuf_ptr - outbuf;

}

static int gif_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data)

{

    GIFContext *s = avctx->priv_data;

    AVFrame *pict = data;

    AVFrame *const p = (AVFrame *)&s->picture;

    uint8_t *outbuf_ptr = outbuf;



    *p = *pict;

    p->pict_type = FF_I_TYPE;

    p->key_frame = 1;

    gif_image_write_header(&outbuf_ptr, avctx->width, avctx->height, -1, (uint32_t *)pict->data[1]);

    gif_image_write_image(&outbuf_ptr, 0, 0, avctx->width, avctx->height, pict->data[0], pict->linesize[0], PIX_FMT_PAL8);

    return outbuf_ptr - outbuf;

}

static int FUNC_0(AVCodecContext *VAR_0, unsigned char *VAR_1, int VAR_2, void *VAR_3)

{

    GIFContext *s = VAR_0->priv_data;

    AVFrame *pict = VAR_3;

    AVFrame *const p = (AVFrame *)&s->picture;

    uint8_t *outbuf_ptr = VAR_1;



    *p = *pict;

    p->pict_type = FF_I_TYPE;

    p->key_frame = 1;

    gif_image_write_header(&outbuf_ptr, VAR_0->width, VAR_0->height, -1, (uint32_t *)pict->VAR_3[1]);

    gif_image_write_image(&outbuf_ptr, 0, 0, VAR_0->width, VAR_0->height, pict->VAR_3[0], pict->linesize[0], PIX_FMT_PAL8);

    return outbuf_ptr - VAR_1;

}

static int FUNC_0(AVCodecContext *VAR_0, unsigned char *VAR_1, int VAR_2, void *VAR_3)
{ GIFContext *s = VAR_0->priv_data; AVFrame *pict = VAR_3; AVFrame *const p = (AVFrame *)&s->picture; uint8_t *outbuf_ptr = VAR_1; *p = *pict; p->pict_type = FF_I_TYPE; p->key_frame = 1; gif_image_write_header(&outbuf_ptr, VAR_0->width, VAR_0->height, -1, (uint32_t *)pict->VAR_3[1]); gif_image_write_image(&outbuf_ptr, 0, 0, VAR_0->width, VAR_0->height, pict->VAR_3[0], pict->linesize[0], PIX_FMT_PAL8); return outbuf_ptr - VAR_1; }