static int get_transform_coeffs1(uint8_t *exps, uint8_t *bap, float chcoeff,

        float *coeffs, int start, int end, int dith_flag, GetBitContext *gb,

        dither_state *state)

{

    int16_t mantissa;

    int i;

    int gcode;

    mant_group l3_grp, l5_grp, l11_grp;



    for (i = 0; i < 3; i++)

        l3_grp.gcodes[i] = l5_grp.gcodes[i] = l11_grp.gcodes[i] = -1;

    l3_grp.gcptr = l5_grp.gcptr = 3;

    l11_grp.gcptr = 2;



    i = 0;

    while (i < start)

        coeffs[i++] = 0;



    for (i = start; i < end; i++) {

        switch (bap[i]) {

            case 0:

                if (!dith_flag) {

                    coeffs[i] = 0;

                    continue;

                }

                else {

                    mantissa = dither_int16(state);

                    coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                    continue;

                }



            case 1:

                if (l3_grp.gcptr > 2) {

                    gcode = get_bits(gb, 5);

                    if (gcode > 26)

                        return -1;

                    l3_grp.gcodes[0] = gcode / 9;

                    l3_grp.gcodes[1] = (gcode % 9) / 3;

                    l3_grp.gcodes[2] = (gcode % 9) % 3;

                    l3_grp.gcptr = 0;

                }

                mantissa = l3_q_tab[l3_grp.gcodes[l3_grp.gcptr++]];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            case 2:

                if (l5_grp.gcptr > 2) {

                    gcode = get_bits(gb, 7);

                    if (gcode > 124)

                        return -1;

                    l5_grp.gcodes[0] = gcode / 25;

                    l5_grp.gcodes[1] = (gcode % 25) / 5;

                    l5_grp.gcodes[2] = (gcode % 25) % 5;

                    l5_grp.gcptr = 0;

                }

                mantissa = l5_q_tab[l5_grp.gcodes[l5_grp.gcptr++]];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            case 3:

                mantissa = get_bits(gb, 3);

                if (mantissa > 6)

                    return -1;

                mantissa = l7_q_tab[mantissa];

                coeffs[i] = to_float(exps[i], mantissa);

                continue;



            case 4:

                if (l11_grp.gcptr > 1) {

                    gcode = get_bits(gb, 7);

                    if (gcode > 120)

                        return -1;

                    l11_grp.gcodes[0] = gcode / 11;

                    l11_grp.gcodes[1] = gcode % 11;

                }

                mantissa = l11_q_tab[l11_grp.gcodes[l11_grp.gcptr++]];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            case 5:

                mantissa = get_bits(gb, 4);

                if (mantissa > 14)

                    return -1;

                mantissa = l15_q_tab[mantissa];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            default:

                mantissa = get_bits(gb, qntztab[bap[i]]) << (16 - qntztab[bap[i]]);

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;

        }

    }



    i = end;

    while (i < 256)

        coeffs[i++] = 0;



    return 0;

}

static int get_transform_coeffs1(uint8_t *exps, uint8_t *bap, float chcoeff,

        float *coeffs, int start, int end, int dith_flag, GetBitContext *gb,

        dither_state *state)

{

    int16_t mantissa;

    int i;

    int gcode;

    mant_group l3_grp, l5_grp, l11_grp;



    for (i = 0; i < 3; i++)

        l3_grp.gcodes[i] = l5_grp.gcodes[i] = l11_grp.gcodes[i] = -1;

    l3_grp.gcptr = l5_grp.gcptr = 3;

    l11_grp.gcptr = 2;



    i = 0;

    while (i < start)

        coeffs[i++] = 0;



    for (i = start; i < end; i++) {

        switch (bap[i]) {

            case 0:

                if (!dith_flag) {

                    coeffs[i] = 0;

                    continue;

                }

                else {

                    mantissa = dither_int16(state);

                    coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                    continue;

                }



            case 1:

                if (l3_grp.gcptr > 2) {

                    gcode = get_bits(gb, 5);

                    if (gcode > 26)

                        return -1;

                    l3_grp.gcodes[0] = gcode / 9;

                    l3_grp.gcodes[1] = (gcode % 9) / 3;

                    l3_grp.gcodes[2] = (gcode % 9) % 3;

                    l3_grp.gcptr = 0;

                }

                mantissa = l3_q_tab[l3_grp.gcodes[l3_grp.gcptr++]];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            case 2:

                if (l5_grp.gcptr > 2) {

                    gcode = get_bits(gb, 7);

                    if (gcode > 124)

                        return -1;

                    l5_grp.gcodes[0] = gcode / 25;

                    l5_grp.gcodes[1] = (gcode % 25) / 5;

                    l5_grp.gcodes[2] = (gcode % 25) % 5;

                    l5_grp.gcptr = 0;

                }

                mantissa = l5_q_tab[l5_grp.gcodes[l5_grp.gcptr++]];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            case 3:

                mantissa = get_bits(gb, 3);

                if (mantissa > 6)

                    return -1;

                mantissa = l7_q_tab[mantissa];

                coeffs[i] = to_float(exps[i], mantissa);

                continue;



            case 4:

                if (l11_grp.gcptr > 1) {

                    gcode = get_bits(gb, 7);

                    if (gcode > 120)

                        return -1;

                    l11_grp.gcodes[0] = gcode / 11;

                    l11_grp.gcodes[1] = gcode % 11;

                }

                mantissa = l11_q_tab[l11_grp.gcodes[l11_grp.gcptr++]];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            case 5:

                mantissa = get_bits(gb, 4);

                if (mantissa > 14)

                    return -1;

                mantissa = l15_q_tab[mantissa];

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;



            default:

                mantissa = get_bits(gb, qntztab[bap[i]]) << (16 - qntztab[bap[i]]);

                coeffs[i] = to_float(exps[i], mantissa) * chcoeff;

                continue;

        }

    }



    i = end;

    while (i < 256)

        coeffs[i++] = 0;



    return 0;

}

static int FUNC_0(uint8_t *VAR_0, uint8_t *VAR_1, float VAR_2,

        float *VAR_3, int VAR_4, int VAR_5, int VAR_6, GetBitContext *VAR_7,

        dither_state *VAR_8)

{

    int16_t mantissa;

    int VAR_9;

    int VAR_10;

    mant_group l3_grp, l5_grp, l11_grp;



    for (VAR_9 = 0; VAR_9 < 3; VAR_9++)

        l3_grp.gcodes[VAR_9] = l5_grp.gcodes[VAR_9] = l11_grp.gcodes[VAR_9] = -1;

    l3_grp.gcptr = l5_grp.gcptr = 3;

    l11_grp.gcptr = 2;



    VAR_9 = 0;

    while (VAR_9 < VAR_4)

        VAR_3[VAR_9++] = 0;



    for (VAR_9 = VAR_4; VAR_9 < VAR_5; VAR_9++) {

        switch (VAR_1[VAR_9]) {

            case 0:

                if (!VAR_6) {

                    VAR_3[VAR_9] = 0;

                    continue;

                }

                else {

                    mantissa = dither_int16(VAR_8);

                    VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2;

                    continue;

                }



            case 1:

                if (l3_grp.gcptr > 2) {

                    VAR_10 = get_bits(VAR_7, 5);

                    if (VAR_10 > 26)

                        return -1;

                    l3_grp.gcodes[0] = VAR_10 / 9;

                    l3_grp.gcodes[1] = (VAR_10 % 9) / 3;

                    l3_grp.gcodes[2] = (VAR_10 % 9) % 3;

                    l3_grp.gcptr = 0;

                }

                mantissa = l3_q_tab[l3_grp.gcodes[l3_grp.gcptr++]];

                VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2;

                continue;



            case 2:

                if (l5_grp.gcptr > 2) {

                    VAR_10 = get_bits(VAR_7, 7);

                    if (VAR_10 > 124)

                        return -1;

                    l5_grp.gcodes[0] = VAR_10 / 25;

                    l5_grp.gcodes[1] = (VAR_10 % 25) / 5;

                    l5_grp.gcodes[2] = (VAR_10 % 25) % 5;

                    l5_grp.gcptr = 0;

                }

                mantissa = l5_q_tab[l5_grp.gcodes[l5_grp.gcptr++]];

                VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2;

                continue;



            case 3:

                mantissa = get_bits(VAR_7, 3);

                if (mantissa > 6)

                    return -1;

                mantissa = l7_q_tab[mantissa];

                VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa);

                continue;



            case 4:

                if (l11_grp.gcptr > 1) {

                    VAR_10 = get_bits(VAR_7, 7);

                    if (VAR_10 > 120)

                        return -1;

                    l11_grp.gcodes[0] = VAR_10 / 11;

                    l11_grp.gcodes[1] = VAR_10 % 11;

                }

                mantissa = l11_q_tab[l11_grp.gcodes[l11_grp.gcptr++]];

                VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2;

                continue;



            case 5:

                mantissa = get_bits(VAR_7, 4);

                if (mantissa > 14)

                    return -1;

                mantissa = l15_q_tab[mantissa];

                VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2;

                continue;



            default:

                mantissa = get_bits(VAR_7, qntztab[VAR_1[VAR_9]]) << (16 - qntztab[VAR_1[VAR_9]]);

                VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2;

                continue;

        }

    }



    VAR_9 = VAR_5;

    while (VAR_9 < 256)

        VAR_3[VAR_9++] = 0;



    return 0;

}

static int FUNC_0(uint8_t *VAR_0, uint8_t *VAR_1, float VAR_2,
float *VAR_3, int VAR_4, int VAR_5, int VAR_6, GetBitContext *VAR_7,
dither_state *VAR_8)
{ int16_t mantissa; int VAR_9; int VAR_10; mant_group l3_grp, l5_grp, l11_grp; for (VAR_9 = 0; VAR_9 < 3; VAR_9++) l3_grp.gcodes[VAR_9] = l5_grp.gcodes[VAR_9] = l11_grp.gcodes[VAR_9] = -1; l3_grp.gcptr = l5_grp.gcptr = 3; l11_grp.gcptr = 2; VAR_9 = 0; while (VAR_9 < VAR_4)
VAR_3[VAR_9++] = 0; for (VAR_9 = VAR_4; VAR_9 < VAR_5; VAR_9++) { switch (VAR_1[VAR_9]) { case 0:
if (!VAR_6) { VAR_3[VAR_9] = 0; continue; } else { mantissa = dither_int16(VAR_8); VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2; continue; } case 1:
if (l3_grp.gcptr > 2) { VAR_10 = get_bits(VAR_7, 5); if (VAR_10 > 26)
return -1; l3_grp.gcodes[0] = VAR_10 / 9; l3_grp.gcodes[1] = (VAR_10 % 9) / 3; l3_grp.gcodes[2] = (VAR_10 % 9) % 3; l3_grp.gcptr = 0; } mantissa = l3_q_tab[l3_grp.gcodes[l3_grp.gcptr++]]; VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2; continue; case 2:
if (l5_grp.gcptr > 2) { VAR_10 = get_bits(VAR_7, 7); if (VAR_10 > 124)
return -1; l5_grp.gcodes[0] = VAR_10 / 25; l5_grp.gcodes[1] = (VAR_10 % 25) / 5; l5_grp.gcodes[2] = (VAR_10 % 25) % 5; l5_grp.gcptr = 0; } mantissa = l5_q_tab[l5_grp.gcodes[l5_grp.gcptr++]]; VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2; continue; case 3:
mantissa = get_bits(VAR_7, 3); if (mantissa > 6)
return -1; mantissa = l7_q_tab[mantissa]; VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa); continue; case 4:
if (l11_grp.gcptr > 1) { VAR_10 = get_bits(VAR_7, 7); if (VAR_10 > 120)
return -1; l11_grp.gcodes[0] = VAR_10 / 11; l11_grp.gcodes[1] = VAR_10 % 11; } mantissa = l11_q_tab[l11_grp.gcodes[l11_grp.gcptr++]]; VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2; continue; case 5:
mantissa = get_bits(VAR_7, 4); if (mantissa > 14)
return -1; mantissa = l15_q_tab[mantissa]; VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2; continue; default:
mantissa = get_bits(VAR_7, qntztab[VAR_1[VAR_9]]) << (16 - qntztab[VAR_1[VAR_9]]); VAR_3[VAR_9] = to_float(VAR_0[VAR_9], mantissa) * VAR_2; continue; } } VAR_9 = VAR_5; while (VAR_9 < 256)
VAR_3[VAR_9++] = 0; return 0; }