static void quantize_mantissas_blk_ch(AC3EncodeContext *s, int32_t *fixed_coef,

                                      int8_t exp_shift, uint8_t *exp,

                                      uint8_t *bap, uint16_t *qmant, int n)

{

    int i;



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

        int v;

        int c = fixed_coef[i];

        int e = exp[i] - exp_shift;

        int b = bap[i];

        switch (b) {

        case 0:

            v = 0;

            break;

        case 1:

            v = sym_quant(c, e, 3);

            switch (s->mant1_cnt) {

            case 0:

                s->qmant1_ptr = &qmant[i];

                v = 9 * v;

                s->mant1_cnt = 1;

                break;

            case 1:

                *s->qmant1_ptr += 3 * v;

                s->mant1_cnt = 2;

                v = 128;

                break;

            default:

                *s->qmant1_ptr += v;

                s->mant1_cnt = 0;

                v = 128;

                break;

            }

            break;

        case 2:

            v = sym_quant(c, e, 5);

            switch (s->mant2_cnt) {

            case 0:

                s->qmant2_ptr = &qmant[i];

                v = 25 * v;

                s->mant2_cnt = 1;

                break;

            case 1:

                *s->qmant2_ptr += 5 * v;

                s->mant2_cnt = 2;

                v = 128;

                break;

            default:

                *s->qmant2_ptr += v;

                s->mant2_cnt = 0;

                v = 128;

                break;

            }

            break;

        case 3:

            v = sym_quant(c, e, 7);

            break;

        case 4:

            v = sym_quant(c, e, 11);

            switch (s->mant4_cnt) {

            case 0:

                s->qmant4_ptr = &qmant[i];

                v = 11 * v;

                s->mant4_cnt = 1;

                break;

            default:

                *s->qmant4_ptr += v;

                s->mant4_cnt = 0;

                v = 128;

                break;

            }

            break;

        case 5:

            v = sym_quant(c, e, 15);

            break;

        case 14:

            v = asym_quant(c, e, 14);

            break;

        case 15:

            v = asym_quant(c, e, 16);

            break;

        default:

            v = asym_quant(c, e, b - 1);

            break;

        }

        qmant[i] = v;

    }

}

static void quantize_mantissas_blk_ch(AC3EncodeContext *s, int32_t *fixed_coef,

                                      int8_t exp_shift, uint8_t *exp,

                                      uint8_t *bap, uint16_t *qmant, int n)

{

    int i;



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

        int v;

        int c = fixed_coef[i];

        int e = exp[i] - exp_shift;

        int b = bap[i];

        switch (b) {

        case 0:

            v = 0;

            break;

        case 1:

            v = sym_quant(c, e, 3);

            switch (s->mant1_cnt) {

            case 0:

                s->qmant1_ptr = &qmant[i];

                v = 9 * v;

                s->mant1_cnt = 1;

                break;

            case 1:

                *s->qmant1_ptr += 3 * v;

                s->mant1_cnt = 2;

                v = 128;

                break;

            default:

                *s->qmant1_ptr += v;

                s->mant1_cnt = 0;

                v = 128;

                break;

            }

            break;

        case 2:

            v = sym_quant(c, e, 5);

            switch (s->mant2_cnt) {

            case 0:

                s->qmant2_ptr = &qmant[i];

                v = 25 * v;

                s->mant2_cnt = 1;

                break;

            case 1:

                *s->qmant2_ptr += 5 * v;

                s->mant2_cnt = 2;

                v = 128;

                break;

            default:

                *s->qmant2_ptr += v;

                s->mant2_cnt = 0;

                v = 128;

                break;

            }

            break;

        case 3:

            v = sym_quant(c, e, 7);

            break;

        case 4:

            v = sym_quant(c, e, 11);

            switch (s->mant4_cnt) {

            case 0:

                s->qmant4_ptr = &qmant[i];

                v = 11 * v;

                s->mant4_cnt = 1;

                break;

            default:

                *s->qmant4_ptr += v;

                s->mant4_cnt = 0;

                v = 128;

                break;

            }

            break;

        case 5:

            v = sym_quant(c, e, 15);

            break;

        case 14:

            v = asym_quant(c, e, 14);

            break;

        case 15:

            v = asym_quant(c, e, 16);

            break;

        default:

            v = asym_quant(c, e, b - 1);

            break;

        }

        qmant[i] = v;

    }

}

                                      int8_t exp_shift, uint8_t *exp,         int e = exp[i] - exp_shift;
static void FUNC_0(AC3EncodeContext *VAR_0, int32_t *VAR_1,

                                      int8_t VAR_2, uint8_t *VAR_3,

                                      uint8_t *VAR_4, uint16_t *VAR_5, int VAR_6)

{

    int VAR_7;



    for (VAR_7 = 0; VAR_7 < VAR_6; VAR_7++) {

        int VAR_8;

        int VAR_9 = VAR_1[VAR_7];

        int VAR_10 = VAR_3[VAR_7] - VAR_2;

        int VAR_11 = VAR_4[VAR_7];

        switch (VAR_11) {

        case 0:

            VAR_8 = 0;

            break;

        case 1:

            VAR_8 = sym_quant(VAR_9, VAR_10, 3);

            switch (VAR_0->mant1_cnt) {

            case 0:

                VAR_0->qmant1_ptr = &VAR_5[VAR_7];

                VAR_8 = 9 * VAR_8;

                VAR_0->mant1_cnt = 1;

                break;

            case 1:

                *VAR_0->qmant1_ptr += 3 * VAR_8;

                VAR_0->mant1_cnt = 2;

                VAR_8 = 128;

                break;

            default:

                *VAR_0->qmant1_ptr += VAR_8;

                VAR_0->mant1_cnt = 0;

                VAR_8 = 128;

                break;

            }

            break;

        case 2:

            VAR_8 = sym_quant(VAR_9, VAR_10, 5);

            switch (VAR_0->mant2_cnt) {

            case 0:

                VAR_0->qmant2_ptr = &VAR_5[VAR_7];

                VAR_8 = 25 * VAR_8;

                VAR_0->mant2_cnt = 1;

                break;

            case 1:

                *VAR_0->qmant2_ptr += 5 * VAR_8;

                VAR_0->mant2_cnt = 2;

                VAR_8 = 128;

                break;

            default:

                *VAR_0->qmant2_ptr += VAR_8;

                VAR_0->mant2_cnt = 0;

                VAR_8 = 128;

                break;

            }

            break;

        case 3:

            VAR_8 = sym_quant(VAR_9, VAR_10, 7);

            break;

        case 4:

            VAR_8 = sym_quant(VAR_9, VAR_10, 11);

            switch (VAR_0->mant4_cnt) {

            case 0:

                VAR_0->qmant4_ptr = &VAR_5[VAR_7];

                VAR_8 = 11 * VAR_8;

                VAR_0->mant4_cnt = 1;

                break;

            default:

                *VAR_0->qmant4_ptr += VAR_8;

                VAR_0->mant4_cnt = 0;

                VAR_8 = 128;

                break;

            }

            break;

        case 5:

            VAR_8 = sym_quant(VAR_9, VAR_10, 15);

            break;

        case 14:

            VAR_8 = asym_quant(VAR_9, VAR_10, 14);

            break;

        case 15:

            VAR_8 = asym_quant(VAR_9, VAR_10, 16);

            break;

        default:

            VAR_8 = asym_quant(VAR_9, VAR_10, VAR_11 - 1);

            break;

        }

        VAR_5[VAR_7] = VAR_8;

    }

}

static void FUNC_0(AC3EncodeContext *VAR_0, int32_t *VAR_1,
int8_t VAR_2, uint8_t *VAR_3,
uint8_t *VAR_4, uint16_t *VAR_5, int VAR_6)
{ int VAR_7; for (VAR_7 = 0; VAR_7 < VAR_6; VAR_7++) { int VAR_8; int VAR_9 = VAR_1[VAR_7]; int VAR_10 = VAR_3[VAR_7] - VAR_2; int VAR_11 = VAR_4[VAR_7]; switch (VAR_11) { case 0:
VAR_8 = 0; break; case 1:
VAR_8 = sym_quant(VAR_9, VAR_10, 3); switch (VAR_0->mant1_cnt) { case 0:
VAR_0->qmant1_ptr = &VAR_5[VAR_7]; VAR_8 = 9 * VAR_8; VAR_0->mant1_cnt = 1; break; case 1:
*VAR_0->qmant1_ptr += 3 * VAR_8; VAR_0->mant1_cnt = 2; VAR_8 = 128; break; default:
*VAR_0->qmant1_ptr += VAR_8; VAR_0->mant1_cnt = 0; VAR_8 = 128; break; } break; case 2:
VAR_8 = sym_quant(VAR_9, VAR_10, 5); switch (VAR_0->mant2_cnt) { case 0:
VAR_0->qmant2_ptr = &VAR_5[VAR_7]; VAR_8 = 25 * VAR_8; VAR_0->mant2_cnt = 1; break; case 1:
*VAR_0->qmant2_ptr += 5 * VAR_8; VAR_0->mant2_cnt = 2; VAR_8 = 128; break; default:
*VAR_0->qmant2_ptr += VAR_8; VAR_0->mant2_cnt = 0; VAR_8 = 128; break; } break; case 3:
VAR_8 = sym_quant(VAR_9, VAR_10, 7); break; case 4:
VAR_8 = sym_quant(VAR_9, VAR_10, 11); switch (VAR_0->mant4_cnt) { case 0:
VAR_0->qmant4_ptr = &VAR_5[VAR_7]; VAR_8 = 11 * VAR_8; VAR_0->mant4_cnt = 1; break; default:
*VAR_0->qmant4_ptr += VAR_8; VAR_0->mant4_cnt = 0; VAR_8 = 128; break; } break; case 5:
VAR_8 = sym_quant(VAR_9, VAR_10, 15); break; case 14:
VAR_8 = asym_quant(VAR_9, VAR_10, 14); break; case 15:
VAR_8 = asym_quant(VAR_9, VAR_10, 16); break; default:
VAR_8 = asym_quant(VAR_9, VAR_10, VAR_11 - 1); break; } VAR_5[VAR_7] = VAR_8; } }