static int idcin_decode_frame(AVCodecContext *avctx,

                              void *data, int *data_size,

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



    s->buf = buf;

    s->size = buf_size;



    if (s->frame.data[0])

        avctx->release_buffer(avctx, &s->frame);



    if (avctx->get_buffer(avctx, &s->frame)) {

        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }



    idcin_decode_vlcs(s);



    if (pal) {

        s->frame.palette_has_changed = 1;

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

    }

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

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



    *data_size = sizeof(AVFrame);

    *(AVFrame*)data = s->frame;



    /* report that the buffer was completely consumed */

    return buf_size;

}

static int idcin_decode_frame(AVCodecContext *avctx,

                              void *data, int *data_size,

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



    s->buf = buf;

    s->size = buf_size;



    if (s->frame.data[0])

        avctx->release_buffer(avctx, &s->frame);



    if (avctx->get_buffer(avctx, &s->frame)) {

        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }



    idcin_decode_vlcs(s);



    if (pal) {

        s->frame.palette_has_changed = 1;

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

    }

    

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



    *data_size = sizeof(AVFrame);

    *(AVFrame*)data = s->frame;



    

    return buf_size;

}

    if (avctx->get_buffer(avctx, &s->frame)) {         return -1;     idcin_decode_vlcs(s);
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);



    s->VAR_4 = VAR_4;

    s->size = VAR_5;



    if (s->frame.VAR_1[0])

        VAR_0->release_buffer(VAR_0, &s->frame);



    if (VAR_0->get_buffer(VAR_0, &s->frame)) {

        av_log(VAR_0, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }



    idcin_decode_vlcs(s);



    if (VAR_6) {

        s->frame.palette_has_changed = 1;

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

    }

    

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



    *VAR_2 = sizeof(AVFrame);

    *(AVFrame*)VAR_1 = s->frame;



    

    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); s->VAR_4 = VAR_4; s->size = VAR_5; if (s->frame.VAR_1[0])
VAR_0->release_buffer(VAR_0, &s->frame); if (VAR_0->get_buffer(VAR_0, &s->frame)) { av_log(VAR_0, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } idcin_decode_vlcs(s); if (VAR_6) { s->frame.palette_has_changed = 1; memcpy(s->VAR_6, VAR_6, AVPALETTE_SIZE); } memcpy(s->frame.VAR_1[1], s->VAR_6, AVPALETTE_SIZE); *VAR_2 = sizeof(AVFrame); *(AVFrame*)VAR_1 = s->frame; return VAR_5; }