static int idcin_decode_init(AVCodecContext *avctx)

{

    IdcinContext *s = avctx->priv_data;

    int i, j, histogram_index = 0;

    unsigned char *histograms;



    s->avctx = avctx;

    avctx->pix_fmt = PIX_FMT_PAL8;

    dsputil_init(&s->dsp, avctx);



    /* make sure the Huffman tables make it */

    if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {

        av_log(s->avctx, AV_LOG_ERROR, "  Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);

        return -1;

    }



    /* build the 256 Huffman decode trees */

    histograms = (unsigned char *)s->avctx->extradata;

    for (i = 0; i < 256; i++) {

        for(j = 0; j < HUF_TOKENS; j++)

            s->huff_nodes[i][j].count = histograms[histogram_index++];

        huff_build_tree(s, i);

    }



    s->frame.data[0] = NULL;



    return 0;

}

static int idcin_decode_init(AVCodecContext *avctx)

{

    IdcinContext *s = avctx->priv_data;

    int i, j, histogram_index = 0;

    unsigned char *histograms;



    s->avctx = avctx;

    avctx->pix_fmt = PIX_FMT_PAL8;

    dsputil_init(&s->dsp, avctx);



    

    if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {

        av_log(s->avctx, AV_LOG_ERROR, "  Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);

        return -1;

    }



    

    histograms = (unsigned char *)s->avctx->extradata;

    for (i = 0; i < 256; i++) {

        for(j = 0; j < HUF_TOKENS; j++)

            s->huff_nodes[i][j].count = histograms[histogram_index++];

        huff_build_tree(s, i);

    }



    s->frame.data[0] = NULL;



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0)

{

    IdcinContext *s = VAR_0->priv_data;

    int VAR_1, VAR_2, VAR_3 = 0;

    unsigned char *VAR_4;



    s->VAR_0 = VAR_0;

    VAR_0->pix_fmt = PIX_FMT_PAL8;

    dsputil_init(&s->dsp, VAR_0);



    

    if (s->VAR_0->extradata_size != HUFFMAN_TABLE_SIZE) {

        av_log(s->VAR_0, AV_LOG_ERROR, "  Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);

        return -1;

    }



    

    VAR_4 = (unsigned char *)s->VAR_0->extradata;

    for (VAR_1 = 0; VAR_1 < 256; VAR_1++) {

        for(VAR_2 = 0; VAR_2 < HUF_TOKENS; VAR_2++)

            s->huff_nodes[VAR_1][VAR_2].count = VAR_4[VAR_3++];

        huff_build_tree(s, VAR_1);

    }



    s->frame.data[0] = NULL;



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0)
{ IdcinContext *s = VAR_0->priv_data; int VAR_1, VAR_2, VAR_3 = 0; unsigned char *VAR_4; s->VAR_0 = VAR_0; VAR_0->pix_fmt = PIX_FMT_PAL8; dsputil_init(&s->dsp, VAR_0); if (s->VAR_0->extradata_size != HUFFMAN_TABLE_SIZE) { av_log(s->VAR_0, AV_LOG_ERROR, "  Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE); return -1; } VAR_4 = (unsigned char *)s->VAR_0->extradata; for (VAR_1 = 0; VAR_1 < 256; VAR_1++) { for(VAR_2 = 0; VAR_2 < HUF_TOKENS; VAR_2++) s->huff_nodes[VAR_1][VAR_2].count = VAR_4[VAR_3++]; huff_build_tree(s, VAR_1); } s->frame.data[0] = NULL; return 0; }