static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,

                            uint8_t absexp, int8_t *dexps)

{

    int i, j, grp, group_size;

    int dexp[256];

    int expacc, prevexp;



    /* unpack groups */

    group_size = exp_strategy + (exp_strategy == EXP_D45);

    for(grp=0,i=0; grp<ngrps; grp++) {

        expacc = get_bits(gbc, 7);

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];

    }



    /* convert to absolute exps and expand groups */

    prevexp = absexp;

    for(i=0,j=0; i<ngrps*3; i++) {

        prevexp += dexp[i] - 2;

        if (prevexp < 0 || prevexp > 24)

            return -1;

        switch (group_size) {

            case 4: dexps[j++] = prevexp;

                    dexps[j++] = prevexp;

            case 2: dexps[j++] = prevexp;

            case 1: dexps[j++] = prevexp;

        }

    }

    return 0;

}

static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,

                            uint8_t absexp, int8_t *dexps)

{

    int i, j, grp, group_size;

    int dexp[256];

    int expacc, prevexp;



    

    group_size = exp_strategy + (exp_strategy == EXP_D45);

    for(grp=0,i=0; grp<ngrps; grp++) {

        expacc = get_bits(gbc, 7);

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];

        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];

    }



    

    prevexp = absexp;

    for(i=0,j=0; i<ngrps*3; i++) {

        prevexp += dexp[i] - 2;

        if (prevexp < 0 || prevexp > 24)

            return -1;

        switch (group_size) {

            case 4: dexps[j++] = prevexp;

                    dexps[j++] = prevexp;

            case 2: dexps[j++] = prevexp;

            case 1: dexps[j++] = prevexp;

        }

    }

    return 0;

}

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

                            uint8_t VAR_3, int8_t *VAR_4)

{

    int VAR_5, VAR_6, VAR_7, VAR_8;

    int VAR_9[256];

    int VAR_10, VAR_11;



    

    VAR_8 = VAR_1 + (VAR_1 == EXP_D45);

    for(VAR_7=0,VAR_5=0; VAR_7<VAR_2; VAR_7++) {

        VAR_10 = get_bits(VAR_0, 7);

        VAR_9[VAR_5++] = ungroup_3_in_7_bits_tab[VAR_10][0];

        VAR_9[VAR_5++] = ungroup_3_in_7_bits_tab[VAR_10][1];

        VAR_9[VAR_5++] = ungroup_3_in_7_bits_tab[VAR_10][2];

    }



    

    VAR_11 = VAR_3;

    for(VAR_5=0,VAR_6=0; VAR_5<VAR_2*3; VAR_5++) {

        VAR_11 += VAR_9[VAR_5] - 2;

        if (VAR_11 < 0 || VAR_11 > 24)

            return -1;

        switch (VAR_8) {

            case 4: VAR_4[VAR_6++] = VAR_11;

                    VAR_4[VAR_6++] = VAR_11;

            case 2: VAR_4[VAR_6++] = VAR_11;

            case 1: VAR_4[VAR_6++] = VAR_11;

        }

    }

    return 0;

}

static int FUNC_0(GetBitContext *VAR_0, int VAR_1, int VAR_2,
uint8_t VAR_3, int8_t *VAR_4)
{ int VAR_5, VAR_6, VAR_7, VAR_8; int VAR_9[256]; int VAR_10, VAR_11; VAR_8 = VAR_1 + (VAR_1 == EXP_D45); for(VAR_7=0,VAR_5=0; VAR_7<VAR_2; VAR_7++) { VAR_10 = get_bits(VAR_0, 7); VAR_9[VAR_5++] = ungroup_3_in_7_bits_tab[VAR_10][0]; VAR_9[VAR_5++] = ungroup_3_in_7_bits_tab[VAR_10][1]; VAR_9[VAR_5++] = ungroup_3_in_7_bits_tab[VAR_10][2]; } VAR_11 = VAR_3; for(VAR_5=0,VAR_6=0; VAR_5<VAR_2*3; VAR_5++) { VAR_11 += VAR_9[VAR_5] - 2; if (VAR_11 < 0 || VAR_11 > 24)
return -1; switch (VAR_8) { case 4: VAR_4[VAR_6++] = VAR_11; VAR_4[VAR_6++] = VAR_11; case 2: VAR_4[VAR_6++] = VAR_11; case 1: VAR_4[VAR_6++] = VAR_11; } } return 0; }