static int msvideo1_decode_frame(AVCodecContext *avctx,

                                void *data, int *got_frame,

                                AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    Msvideo1Context *s = avctx->priv_data;

    int ret;



    s->buf = buf;

    s->size = buf_size;



    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)

        return ret;



    if (s->mode_8bit) {

        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);



        if (pal) {

            memcpy(s->pal, pal, AVPALETTE_SIZE);

            s->frame->palette_has_changed = 1;

        }

    }



    if (s->mode_8bit)

        msvideo1_decode_8bit(s);

    else

        msvideo1_decode_16bit(s);



    if ((ret = av_frame_ref(data, s->frame)) < 0)

        return ret;



    *got_frame      = 1;



    /* report that the buffer was completely consumed */

    return buf_size;

}

static int msvideo1_decode_frame(AVCodecContext *avctx,

                                void *data, int *got_frame,

                                AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    Msvideo1Context *s = avctx->priv_data;

    int ret;



    s->buf = buf;

    s->size = buf_size;



    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)

        return ret;



    if (s->mode_8bit) {

        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);



        if (pal) {

            memcpy(s->pal, pal, AVPALETTE_SIZE);

            s->frame->palette_has_changed = 1;

        }

    }



    if (s->mode_8bit)

        msvideo1_decode_8bit(s);

    else

        msvideo1_decode_16bit(s);



    if ((ret = av_frame_ref(data, s->frame)) < 0)

        return ret;



    *got_frame      = 1;



    

    return buf_size;

}

static int FUNC_0(AVCodecContext *VAR_0,

                                void *VAR_1, int *VAR_2,

                                AVPacket *VAR_3)

{

    const uint8_t *VAR_4 = VAR_3->VAR_1;

    int VAR_5 = VAR_3->size;

    Msvideo1Context *s = VAR_0->priv_data;

    int VAR_6;



    s->VAR_4 = VAR_4;

    s->size = VAR_5;



    if ((VAR_6 = ff_reget_buffer(VAR_0, s->frame)) < 0)

        return VAR_6;



    if (s->mode_8bit) {

        const uint8_t *VAR_7 = av_packet_get_side_data(VAR_3, AV_PKT_DATA_PALETTE, NULL);



        if (VAR_7) {

            memcpy(s->VAR_7, VAR_7, AVPALETTE_SIZE);

            s->frame->palette_has_changed = 1;

        }

    }



    if (s->mode_8bit)

        msvideo1_decode_8bit(s);

    else

        msvideo1_decode_16bit(s);



    if ((VAR_6 = av_frame_ref(VAR_1, s->frame)) < 0)

        return VAR_6;



    *VAR_2      = 1;



    

    return VAR_5;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
AVPacket *VAR_3)
{ const uint8_t *VAR_4 = VAR_3->VAR_1; int VAR_5 = VAR_3->size; Msvideo1Context *s = VAR_0->priv_data; int VAR_6; s->VAR_4 = VAR_4; s->size = VAR_5; if ((VAR_6 = ff_reget_buffer(VAR_0, s->frame)) < 0)
return VAR_6; if (s->mode_8bit) { const uint8_t *VAR_7 = av_packet_get_side_data(VAR_3, AV_PKT_DATA_PALETTE, NULL); if (VAR_7) { memcpy(s->VAR_7, VAR_7, AVPALETTE_SIZE); s->frame->palette_has_changed = 1; } } if (s->mode_8bit)
msvideo1_decode_8bit(s); else
msvideo1_decode_16bit(s); if ((VAR_6 = av_frame_ref(VAR_1, s->frame)) < 0)
return VAR_6; *VAR_2      = 1; return VAR_5; }