static int idcin_decode_frame(AVCodecContext *avctx,

                              void *data, int *got_frame,

                              AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    IdcinContext *s = avctx->priv_data;

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

    AVFrame *frame = data;

    int ret;



    s->buf = buf;

    s->size = buf_size;



    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)

        return ret;



    if (idcin_decode_vlcs(s, frame))

        return AVERROR_INVALIDDATA;



    if (pal) {

        frame->palette_has_changed = 1;

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

    }

    /* make the palette available on the way out */

    memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);



    *got_frame = 1;



    /* report that the buffer was completely consumed */

    return buf_size;

}

static int idcin_decode_frame(AVCodecContext *avctx,

                              void *data, int *got_frame,

                              AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    IdcinContext *s = avctx->priv_data;

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

    AVFrame *frame = data;

    int ret;



    s->buf = buf;

    s->size = buf_size;



    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)

        return ret;



    if (idcin_decode_vlcs(s, frame))

        return AVERROR_INVALIDDATA;



    if (pal) {

        frame->palette_has_changed = 1;

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

    }

    

    memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);



    *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;

    IdcinContext *s = VAR_0->priv_data;

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

    AVFrame *frame = VAR_1;

    int VAR_7;



    s->VAR_4 = VAR_4;

    s->size = VAR_5;



    if ((VAR_7 = ff_get_buffer(VAR_0, frame, 0)) < 0)

        return VAR_7;



    if (idcin_decode_vlcs(s, frame))

        return AVERROR_INVALIDDATA;



    if (VAR_6) {

        frame->palette_has_changed = 1;

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

    }

    

    memcpy(frame->VAR_1[1], s->VAR_6, AVPALETTE_SIZE);



    *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; IdcinContext *s = VAR_0->priv_data; const uint8_t *VAR_6 = av_packet_get_side_data(VAR_3, AV_PKT_DATA_PALETTE, NULL); AVFrame *frame = VAR_1; int VAR_7; s->VAR_4 = VAR_4; s->size = VAR_5; if ((VAR_7 = ff_get_buffer(VAR_0, frame, 0)) < 0)
return VAR_7; if (idcin_decode_vlcs(s, frame))
return AVERROR_INVALIDDATA; if (VAR_6) { frame->palette_has_changed = 1; memcpy(s->VAR_6, VAR_6, AVPALETTE_SIZE); } memcpy(frame->VAR_1[1], s->VAR_6, AVPALETTE_SIZE); *VAR_2 = 1; return VAR_5; }