static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table)

{

    int pattern, code, cbp=0;

    int ones;

    static const int cbp_masks[3] = {0x100000, 0x010000, 0x110000};

    static const int shifts[4] = { 0, 2, 8, 10 };

    const int *curshift = shifts;

    int i, t, mask;



    code = get_vlc2(gb, vlc->cbppattern[table].table, 9, 2);

    pattern = code & 0xF;

    code >>= 4;



    ones = rv34_count_ones[pattern];



    for(mask = 8; mask; mask >>= 1, curshift++){

        if(pattern & mask)

            cbp |= get_vlc2(gb, vlc->cbp[table][ones].table, vlc->cbp[table][ones].bits, 1) << curshift[0];

    }



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

        t = modulo_three_table[code][i];

        if(t == 1)

            cbp |= cbp_masks[get_bits1(gb)] << i;

        if(t == 2)

            cbp |= cbp_masks[2] << i;

    }

    return cbp;

}

static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table)

{

    int pattern, code, cbp=0;

    int ones;

    static const int cbp_masks[3] = {0x100000, 0x010000, 0x110000};

    static const int shifts[4] = { 0, 2, 8, 10 };

    const int *curshift = shifts;

    int i, t, mask;



    code = get_vlc2(gb, vlc->cbppattern[table].table, 9, 2);

    pattern = code & 0xF;

    code >>= 4;



    ones = rv34_count_ones[pattern];



    for(mask = 8; mask; mask >>= 1, curshift++){

        if(pattern & mask)

            cbp |= get_vlc2(gb, vlc->cbp[table][ones].table, vlc->cbp[table][ones].bits, 1) << curshift[0];

    }



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

        t = modulo_three_table[code][i];

        if(t == 1)

            cbp |= cbp_masks[get_bits1(gb)] << i;

        if(t == 2)

            cbp |= cbp_masks[2] << i;

    }

    return cbp;

}

static int FUNC_0(GetBitContext *VAR_0, RV34VLC *VAR_1, int VAR_2)

{

    int VAR_3, VAR_4, VAR_5=0;

    int VAR_6;

    static const int VAR_7[3] = {0x100000, 0x010000, 0x110000};

    static const int VAR_8[4] = { 0, 2, 8, 10 };

    const int *VAR_9 = VAR_8;

    int VAR_10, VAR_11, VAR_12;



    VAR_4 = get_vlc2(VAR_0, VAR_1->cbppattern[VAR_2].VAR_2, 9, 2);

    VAR_3 = VAR_4 & 0xF;

    VAR_4 >>= 4;



    VAR_6 = rv34_count_ones[VAR_3];



    for(VAR_12 = 8; VAR_12; VAR_12 >>= 1, VAR_9++){

        if(VAR_3 & VAR_12)

            VAR_5 |= get_vlc2(VAR_0, VAR_1->VAR_5[VAR_2][VAR_6].VAR_2, VAR_1->VAR_5[VAR_2][VAR_6].bits, 1) << VAR_9[0];

    }



    for(VAR_10 = 0; VAR_10 < 4; VAR_10++){

        VAR_11 = modulo_three_table[VAR_4][VAR_10];

        if(VAR_11 == 1)

            VAR_5 |= VAR_7[get_bits1(VAR_0)] << VAR_10;

        if(VAR_11 == 2)

            VAR_5 |= VAR_7[2] << VAR_10;

    }

    return VAR_5;

}

static int FUNC_0(GetBitContext *VAR_0, RV34VLC *VAR_1, int VAR_2)
{ int VAR_3, VAR_4, VAR_5=0; int VAR_6; static const int VAR_7[3] = {0x100000, 0x010000, 0x110000}; static const int VAR_8[4] = { 0, 2, 8, 10 }; const int *VAR_9 = VAR_8; int VAR_10, VAR_11, VAR_12; VAR_4 = get_vlc2(VAR_0, VAR_1->cbppattern[VAR_2].VAR_2, 9, 2); VAR_3 = VAR_4 & 0xF; VAR_4 >>= 4; VAR_6 = rv34_count_ones[VAR_3]; for(VAR_12 = 8; VAR_12; VAR_12 >>= 1, VAR_9++){ if(VAR_3 & VAR_12)
VAR_5 |= get_vlc2(VAR_0, VAR_1->VAR_5[VAR_2][VAR_6].VAR_2, VAR_1->VAR_5[VAR_2][VAR_6].bits, 1) << VAR_9[0]; } for(VAR_10 = 0; VAR_10 < 4; VAR_10++){ VAR_11 = modulo_three_table[VAR_4][VAR_10]; if(VAR_11 == 1)
VAR_5 |= VAR_7[get_bits1(VAR_0)] << VAR_10; if(VAR_11 == 2)
VAR_5 |= VAR_7[2] << VAR_10; } return VAR_5; }