static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],

                                const uint8_t *map, unsigned size, VLC *vlc)

{

    Node nodes[2*size], *tmp = &nodes[size];

    int a, b, i;



    /* first compute probabilities from model */

    tmp[0].count = 256;

    for (i=0; i<size-1; i++) {

        a = tmp[i].count *        coeff_model[i]  >> 8;

        b = tmp[i].count * (255 - coeff_model[i]) >> 8;

        nodes[map[2*i  ]].count = a + !a;

        nodes[map[2*i+1]].count = b + !b;

    }




    /* then build the huffman tree accodring to probabilities */

    ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,

                       FF_HUFFMAN_FLAG_HNODE_FIRST);

}
static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],

                                const uint8_t *map, unsigned size, VLC *vlc)

{

    Node nodes[2*size], *tmp = &nodes[size];

    int a, b, i;



    

    tmp[0].count = 256;

    for (i=0; i<size-1; i++) {

        a = tmp[i].count *        coeff_model[i]  >> 8;

        b = tmp[i].count * (255 - coeff_model[i]) >> 8;

        nodes[map[2*i  ]].count = a + !a;

        nodes[map[2*i+1]].count = b + !b;

    }




    

    ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,

                       FF_HUFFMAN_FLAG_HNODE_FIRST);

}
static void FUNC_0(VP56Context *VAR_0, uint8_t VAR_1[],

                                const uint8_t *VAR_2, unsigned VAR_3, VLC *VAR_4)

{

    Node nodes[2*VAR_3], *tmp = &nodes[VAR_3];

    int VAR_5, VAR_6, VAR_7;



    

    tmp[0].count = 256;

    for (VAR_7=0; VAR_7<VAR_3-1; VAR_7++) {

        VAR_5 = tmp[VAR_7].count *        VAR_1[VAR_7]  >> 8;

        VAR_6 = tmp[VAR_7].count * (255 - VAR_1[VAR_7]) >> 8;

        nodes[VAR_2[2*VAR_7  ]].count = VAR_5 + !VAR_5;

        nodes[VAR_2[2*VAR_7+1]].count = VAR_6 + !VAR_6;

    }




    

    ff_huff_build_tree(VAR_0->avctx, VAR_4, VAR_3, nodes, vp6_huff_cmp,

                       FF_HUFFMAN_FLAG_HNODE_FIRST);

}
static void FUNC_0(VP56Context *VAR_0, uint8_t VAR_1[],
const uint8_t *VAR_2, unsigned VAR_3, VLC *VAR_4)
{ Node nodes[2*VAR_3], *tmp = &nodes[VAR_3]; int VAR_5, VAR_6, VAR_7; tmp[0].count = 256; for (VAR_7=0; VAR_7<VAR_3-1; VAR_7++) { VAR_5 = tmp[VAR_7].count *        VAR_1[VAR_7]  >> 8; VAR_6 = tmp[VAR_7].count * (255 - VAR_1[VAR_7]) >> 8; nodes[VAR_2[2*VAR_7  ]].count = VAR_5 + !VAR_5; nodes[VAR_2[2*VAR_7+1]].count = VAR_6 + !VAR_6; } ff_huff_build_tree(VAR_0->avctx, VAR_4, VAR_3, nodes, vp6_huff_cmp,
FF_HUFFMAN_FLAG_HNODE_FIRST); }