static float quantize_and_encode_band_cost(struct AACEncContext *s,

                                PutBitContext *pb, const float *in,

                                const float *scaled, int size, int scale_idx,

                                int cb, const float lambda, const float uplim,

                                int *bits)

{

    const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];

    const float  Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];

    const float CLIPPED_ESCAPE = 165140.0f*IQ;

    int i, j, k;

    float cost = 0;

    const int dim = cb < FIRST_PAIR_BT ? 4 : 2;

    int resbits = 0;

#ifndef USE_REALLY_FULL_SEARCH

    const float  Q34 = sqrtf(Q * sqrtf(Q));

    const int range  = aac_cb_range[cb];

    const int maxval = aac_cb_maxval[cb];

    int offs[4];

#endif /* USE_REALLY_FULL_SEARCH */



    if (!cb) {

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

            cost += in[i]*in[i];

        if (bits)

            *bits = 0;

        return cost * lambda;

    }

#ifndef USE_REALLY_FULL_SEARCH

    offs[0] = 1;

    for (i = 1; i < dim; i++)

        offs[i] = offs[i-1]*range;

    if (!scaled) {

        abs_pow34_v(s->scoefs, in, size);

        scaled = s->scoefs;

    }

    quantize_bands(s->qcoefs, in, scaled, size, Q34, !IS_CODEBOOK_UNSIGNED(cb), maxval);

#endif /* USE_REALLY_FULL_SEARCH */

    for (i = 0; i < size; i += dim) {

        float mincost;

        int minidx  = 0;

        int minbits = 0;

        const float *vec;

#ifndef USE_REALLY_FULL_SEARCH

        int (*quants)[2] = &s->qcoefs[i];

        mincost = 0.0f;

        for (j = 0; j < dim; j++)

            mincost += in[i+j]*in[i+j];

        minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;

        minbits = ff_aac_spectral_bits[cb-1][minidx];

        mincost = mincost * lambda + minbits;

        for (j = 0; j < (1<<dim); j++) {

            float rd = 0.0f;

            int curbits;

            int curidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;

            int same   = 0;

            for (k = 0; k < dim; k++) {

                if ((j & (1 << k)) && quants[k][0] == quants[k][1]) {

                    same = 1;

                    break;

                }

            }

            if (same)

                continue;

            for (k = 0; k < dim; k++)

                curidx += quants[k][!!(j & (1 << k))] * offs[dim - 1 - k];

            curbits =  ff_aac_spectral_bits[cb-1][curidx];

            vec     = &ff_aac_codebook_vectors[cb-1][curidx*dim];

#else

        mincost = INFINITY;

        vec = ff_aac_codebook_vectors[cb-1];

        for (j = 0; j < ff_aac_spectral_sizes[cb-1]; j++, vec += dim) {

            float rd = 0.0f;

            int curbits = ff_aac_spectral_bits[cb-1][j];

            int curidx = j;

#endif /* USE_REALLY_FULL_SEARCH */

            if (IS_CODEBOOK_UNSIGNED(cb)) {

                for (k = 0; k < dim; k++) {

                    float t = fabsf(in[i+k]);

                    float di;

                    if (vec[k] == 64.0f) { //FIXME: slow

                        //do not code with escape sequence small values

                        if (t < 39.0f*IQ) {

                            rd = INFINITY;

                            break;

                        }

                        if (t >= CLIPPED_ESCAPE) {

                            di = t - CLIPPED_ESCAPE;

                            curbits += 21;

                        } else {

                            int c = av_clip(quant(t, Q), 0, 8191);

                            di = t - c*cbrtf(c)*IQ;

                            curbits += av_log2(c)*2 - 4 + 1;

                        }

                    } else {

                        di = t - vec[k]*IQ;

                    }

                    if (vec[k] != 0.0f)

                        curbits++;

                    rd += di*di;

                }

            } else {

                for (k = 0; k < dim; k++) {

                    float di = in[i+k] - vec[k]*IQ;

                    rd += di*di;

                }

            }

            rd = rd * lambda + curbits;

            if (rd < mincost) {

                mincost = rd;

                minidx  = curidx;

                minbits = curbits;

            }

        }

        cost    += mincost;

        resbits += minbits;

        if (cost >= uplim)

            return uplim;

        if (pb) {

        put_bits(pb, ff_aac_spectral_bits[cb-1][minidx], ff_aac_spectral_codes[cb-1][minidx]);

        if (IS_CODEBOOK_UNSIGNED(cb))

            for (j = 0; j < dim; j++)

                if (ff_aac_codebook_vectors[cb-1][minidx*dim+j] != 0.0f)

                    put_bits(pb, 1, in[i+j] < 0.0f);

        if (cb == ESC_BT) {

            for (j = 0; j < 2; j++) {

                if (ff_aac_codebook_vectors[cb-1][minidx*2+j] == 64.0f) {

                    int coef = av_clip(quant(fabsf(in[i+j]), Q), 0, 8191);

                    int len = av_log2(coef);



                    put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);

                    put_bits(pb, len, coef & ((1 << len) - 1));

                }

            }

        }

        }

    }



    if (bits)

        *bits = resbits;

    return cost;

}

static float quantize_and_encode_band_cost(struct AACEncContext *s,

                                PutBitContext *pb, const float *in,

                                const float *scaled, int size, int scale_idx,

                                int cb, const float lambda, const float uplim,

                                int *bits)

{

    const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];

    const float  Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];

    const float CLIPPED_ESCAPE = 165140.0f*IQ;

    int i, j, k;

    float cost = 0;

    const int dim = cb < FIRST_PAIR_BT ? 4 : 2;

    int resbits = 0;

#ifndef USE_REALLY_FULL_SEARCH

    const float  Q34 = sqrtf(Q * sqrtf(Q));

    const int range  = aac_cb_range[cb];

    const int maxval = aac_cb_maxval[cb];

    int offs[4];

#endif 



    if (!cb) {

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

            cost += in[i]*in[i];

        if (bits)

            *bits = 0;

        return cost * lambda;

    }

#ifndef USE_REALLY_FULL_SEARCH

    offs[0] = 1;

    for (i = 1; i < dim; i++)

        offs[i] = offs[i-1]*range;

    if (!scaled) {

        abs_pow34_v(s->scoefs, in, size);

        scaled = s->scoefs;

    }

    quantize_bands(s->qcoefs, in, scaled, size, Q34, !IS_CODEBOOK_UNSIGNED(cb), maxval);

#endif 

    for (i = 0; i < size; i += dim) {

        float mincost;

        int minidx  = 0;

        int minbits = 0;

        const float *vec;

#ifndef USE_REALLY_FULL_SEARCH

        int (*quants)[2] = &s->qcoefs[i];

        mincost = 0.0f;

        for (j = 0; j < dim; j++)

            mincost += in[i+j]*in[i+j];

        minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;

        minbits = ff_aac_spectral_bits[cb-1][minidx];

        mincost = mincost * lambda + minbits;

        for (j = 0; j < (1<<dim); j++) {

            float rd = 0.0f;

            int curbits;

            int curidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;

            int same   = 0;

            for (k = 0; k < dim; k++) {

                if ((j & (1 << k)) && quants[k][0] == quants[k][1]) {

                    same = 1;

                    break;

                }

            }

            if (same)

                continue;

            for (k = 0; k < dim; k++)

                curidx += quants[k][!!(j & (1 << k))] * offs[dim - 1 - k];

            curbits =  ff_aac_spectral_bits[cb-1][curidx];

            vec     = &ff_aac_codebook_vectors[cb-1][curidx*dim];

#else

        mincost = INFINITY;

        vec = ff_aac_codebook_vectors[cb-1];

        for (j = 0; j < ff_aac_spectral_sizes[cb-1]; j++, vec += dim) {

            float rd = 0.0f;

            int curbits = ff_aac_spectral_bits[cb-1][j];

            int curidx = j;

#endif 

            if (IS_CODEBOOK_UNSIGNED(cb)) {

                for (k = 0; k < dim; k++) {

                    float t = fabsf(in[i+k]);

                    float di;

                    if (vec[k] == 64.0f) { 

                        

                        if (t < 39.0f*IQ) {

                            rd = INFINITY;

                            break;

                        }

                        if (t >= CLIPPED_ESCAPE) {

                            di = t - CLIPPED_ESCAPE;

                            curbits += 21;

                        } else {

                            int c = av_clip(quant(t, Q), 0, 8191);

                            di = t - c*cbrtf(c)*IQ;

                            curbits += av_log2(c)*2 - 4 + 1;

                        }

                    } else {

                        di = t - vec[k]*IQ;

                    }

                    if (vec[k] != 0.0f)

                        curbits++;

                    rd += di*di;

                }

            } else {

                for (k = 0; k < dim; k++) {

                    float di = in[i+k] - vec[k]*IQ;

                    rd += di*di;

                }

            }

            rd = rd * lambda + curbits;

            if (rd < mincost) {

                mincost = rd;

                minidx  = curidx;

                minbits = curbits;

            }

        }

        cost    += mincost;

        resbits += minbits;

        if (cost >= uplim)

            return uplim;

        if (pb) {

        put_bits(pb, ff_aac_spectral_bits[cb-1][minidx], ff_aac_spectral_codes[cb-1][minidx]);

        if (IS_CODEBOOK_UNSIGNED(cb))

            for (j = 0; j < dim; j++)

                if (ff_aac_codebook_vectors[cb-1][minidx*dim+j] != 0.0f)

                    put_bits(pb, 1, in[i+j] < 0.0f);

        if (cb == ESC_BT) {

            for (j = 0; j < 2; j++) {

                if (ff_aac_codebook_vectors[cb-1][minidx*2+j] == 64.0f) {

                    int coef = av_clip(quant(fabsf(in[i+j]), Q), 0, 8191);

                    int len = av_log2(coef);



                    put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);

                    put_bits(pb, len, coef & ((1 << len) - 1));

                }

            }

        }

        }

    }



    if (bits)

        *bits = resbits;

    return cost;

}

#ifndef USE_REALLY_FULL_SEARCH     int offs[4]; #ifndef USE_REALLY_FULL_SEARCH     offs[0] = 1;     for (i = 1; i < dim; i++)         offs[i] = offs[i-1]*range;         float mincost;         int minidx  = 0;         int minbits = 0; #ifndef USE_REALLY_FULL_SEARCH         int (*quants)[2] = &s->qcoefs[i];         mincost = 0.0f;         for (j = 0; j < dim; j++)             mincost += in[i+j]*in[i+j];         minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;         minbits = ff_aac_spectral_bits[cb-1][minidx];         mincost = mincost * lambda + minbits;         for (j = 0; j < (1<<dim); j++) {             float rd = 0.0f;             int curbits;             int curidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;             int same   = 0;             for (k = 0; k < dim; k++) {                 if ((j & (1 << k)) && quants[k][0] == quants[k][1]) {                     same = 1;                     break;             if (same)                 continue;             for (k = 0; k < dim; k++)                 curidx += quants[k][!!(j & (1 << k))] * offs[dim - 1 - k]; #else         mincost = INFINITY;         vec = ff_aac_codebook_vectors[cb-1];         for (j = 0; j < ff_aac_spectral_sizes[cb-1]; j++, vec += dim) {             float rd = 0.0f;             int curbits = ff_aac_spectral_bits[cb-1][j];             int curidx = j;                         if (t < 39.0f*IQ) {                             rd = INFINITY;                             break;             rd = rd * lambda + curbits;             if (rd < mincost) {                 mincost = rd;                 minidx  = curidx;                 minbits = curbits;         cost    += mincost;         resbits += minbits;         put_bits(pb, ff_aac_spectral_bits[cb-1][minidx], ff_aac_spectral_codes[cb-1][minidx]);                 if (ff_aac_codebook_vectors[cb-1][minidx*dim+j] != 0.0f)                 if (ff_aac_codebook_vectors[cb-1][minidx*2+j] == 64.0f) {
static float FUNC_0(struct AACEncContext *VAR_0,

                                PutBitContext *VAR_1, const float *VAR_2,

                                const float *VAR_3, int VAR_4, int VAR_5,

                                int VAR_6, const float VAR_7, const float VAR_8,

                                int *VAR_9)

{

    const float VAR_10 = ff_aac_pow2sf_tab[200 + VAR_5 - SCALE_ONE_POS + SCALE_DIV_512];

    const float  VAR_11 = ff_aac_pow2sf_tab[200 - VAR_5 + SCALE_ONE_POS - SCALE_DIV_512];

    const float VAR_12 = 165140.0f*VAR_10;

    int VAR_13, VAR_14, VAR_15;

    float VAR_16 = 0;

    const int VAR_17 = VAR_6 < FIRST_PAIR_BT ? 4 : 2;

    int VAR_18 = 0;

#ifndef USE_REALLY_FULL_SEARCH

    const float  VAR_19 = sqrtf(VAR_11 * sqrtf(VAR_11));

    const int VAR_20  = aac_cb_range[VAR_6];

    const int VAR_21 = aac_cb_maxval[VAR_6];

    int VAR_22[4];

#endif 



    if (!VAR_6) {

        for (VAR_13 = 0; VAR_13 < VAR_4; VAR_13++)

            VAR_16 += VAR_2[VAR_13]*VAR_2[VAR_13];

        if (VAR_9)

            *VAR_9 = 0;

        return VAR_16 * VAR_7;

    }

#ifndef USE_REALLY_FULL_SEARCH

    VAR_22[0] = 1;

    for (VAR_13 = 1; VAR_13 < VAR_17; VAR_13++)

        VAR_22[VAR_13] = VAR_22[VAR_13-1]*VAR_20;

    if (!VAR_3) {

        abs_pow34_v(VAR_0->scoefs, VAR_2, VAR_4);

        VAR_3 = VAR_0->scoefs;

    }

    quantize_bands(VAR_0->qcoefs, VAR_2, VAR_3, VAR_4, VAR_19, !IS_CODEBOOK_UNSIGNED(VAR_6), VAR_21);

#endif 

    for (VAR_13 = 0; VAR_13 < VAR_4; VAR_13 += VAR_17) {

        float VAR_23;

        int VAR_24  = 0;

        int VAR_25 = 0;

        const float *VAR_26;

#ifndef USE_REALLY_FULL_SEARCH

        int (*VAR_27)[2] = &VAR_0->qcoefs[VAR_13];

        VAR_23 = 0.0f;

        for (VAR_14 = 0; VAR_14 < VAR_17; VAR_14++)

            VAR_23 += VAR_2[VAR_13+VAR_14]*VAR_2[VAR_13+VAR_14];

        VAR_24 = IS_CODEBOOK_UNSIGNED(VAR_6) ? 0 : 40;

        VAR_25 = ff_aac_spectral_bits[VAR_6-1][VAR_24];

        VAR_23 = VAR_23 * VAR_7 + VAR_25;

        for (VAR_14 = 0; VAR_14 < (1<<VAR_17); VAR_14++) {

            float VAR_28 = 0.0f;

            int VAR_29;

            int VAR_30 = IS_CODEBOOK_UNSIGNED(VAR_6) ? 0 : 40;

            int VAR_31   = 0;

            for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) {

                if ((VAR_14 & (1 << VAR_15)) && VAR_27[VAR_15][0] == VAR_27[VAR_15][1]) {

                    VAR_31 = 1;

                    break;

                }

            }

            if (VAR_31)

                continue;

            for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++)

                VAR_30 += VAR_27[VAR_15][!!(VAR_14 & (1 << VAR_15))] * VAR_22[VAR_17 - 1 - VAR_15];

            VAR_29 =  ff_aac_spectral_bits[VAR_6-1][VAR_30];

            VAR_26     = &ff_aac_codebook_vectors[VAR_6-1][VAR_30*VAR_17];

#else

        VAR_23 = INFINITY;

        VAR_26 = ff_aac_codebook_vectors[VAR_6-1];

        for (VAR_14 = 0; VAR_14 < ff_aac_spectral_sizes[VAR_6-1]; VAR_14++, VAR_26 += VAR_17) {

            float VAR_28 = 0.0f;

            int VAR_29 = ff_aac_spectral_bits[VAR_6-1][VAR_14];

            int VAR_30 = VAR_14;

#endif 

            if (IS_CODEBOOK_UNSIGNED(VAR_6)) {

                for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) {

                    float VAR_32 = fabsf(VAR_2[VAR_13+VAR_15]);

                    float VAR_35;

                    if (VAR_26[VAR_15] == 64.0f) { 

                        

                        if (VAR_32 < 39.0f*VAR_10) {

                            VAR_28 = INFINITY;

                            break;

                        }

                        if (VAR_32 >= VAR_12) {

                            VAR_35 = VAR_32 - VAR_12;

                            VAR_29 += 21;

                        } else {

                            int VAR_34 = av_clip(quant(VAR_32, VAR_11), 0, 8191);

                            VAR_35 = VAR_32 - VAR_34*cbrtf(VAR_34)*VAR_10;

                            VAR_29 += av_log2(VAR_34)*2 - 4 + 1;

                        }

                    } else {

                        VAR_35 = VAR_32 - VAR_26[VAR_15]*VAR_10;

                    }

                    if (VAR_26[VAR_15] != 0.0f)

                        VAR_29++;

                    VAR_28 += VAR_35*VAR_35;

                }

            } else {

                for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) {

                    float VAR_35 = VAR_2[VAR_13+VAR_15] - VAR_26[VAR_15]*VAR_10;

                    VAR_28 += VAR_35*VAR_35;

                }

            }

            VAR_28 = VAR_28 * VAR_7 + VAR_29;

            if (VAR_28 < VAR_23) {

                VAR_23 = VAR_28;

                VAR_24  = VAR_30;

                VAR_25 = VAR_29;

            }

        }

        VAR_16    += VAR_23;

        VAR_18 += VAR_25;

        if (VAR_16 >= VAR_8)

            return VAR_8;

        if (VAR_1) {

        put_bits(VAR_1, ff_aac_spectral_bits[VAR_6-1][VAR_24], ff_aac_spectral_codes[VAR_6-1][VAR_24]);

        if (IS_CODEBOOK_UNSIGNED(VAR_6))

            for (VAR_14 = 0; VAR_14 < VAR_17; VAR_14++)

                if (ff_aac_codebook_vectors[VAR_6-1][VAR_24*VAR_17+VAR_14] != 0.0f)

                    put_bits(VAR_1, 1, VAR_2[VAR_13+VAR_14] < 0.0f);

        if (VAR_6 == ESC_BT) {

            for (VAR_14 = 0; VAR_14 < 2; VAR_14++) {

                if (ff_aac_codebook_vectors[VAR_6-1][VAR_24*2+VAR_14] == 64.0f) {

                    int VAR_35 = av_clip(quant(fabsf(VAR_2[VAR_13+VAR_14]), VAR_11), 0, 8191);

                    int VAR_36 = av_log2(VAR_35);



                    put_bits(VAR_1, VAR_36 - 4 + 1, (1 << (VAR_36 - 4 + 1)) - 2);

                    put_bits(VAR_1, VAR_36, VAR_35 & ((1 << VAR_36) - 1));

                }

            }

        }

        }

    }



    if (VAR_9)

        *VAR_9 = VAR_18;

    return VAR_16;

}

static float FUNC_0(struct AACEncContext *VAR_0,
PutBitContext *VAR_1, const float *VAR_2,
const float *VAR_3, int VAR_4, int VAR_5,
int VAR_6, const float VAR_7, const float VAR_8,
int *VAR_9)
{ const float VAR_10 = ff_aac_pow2sf_tab[200 + VAR_5 - SCALE_ONE_POS + SCALE_DIV_512]; const float  VAR_11 = ff_aac_pow2sf_tab[200 - VAR_5 + SCALE_ONE_POS - SCALE_DIV_512]; const float VAR_12 = 165140.0f*VAR_10; int VAR_13, VAR_14, VAR_15; float VAR_16 = 0; const int VAR_17 = VAR_6 < FIRST_PAIR_BT ? 4 : 2; int VAR_18 = 0; #ifndef USE_REALLY_FULL_SEARCH
const float  VAR_19 = sqrtf(VAR_11 * sqrtf(VAR_11)); const int VAR_20  = aac_cb_range[VAR_6]; const int VAR_21 = aac_cb_maxval[VAR_6]; int VAR_22[4]; #endif
if (!VAR_6) { for (VAR_13 = 0; VAR_13 < VAR_4; VAR_13++) VAR_16 += VAR_2[VAR_13]*VAR_2[VAR_13]; if (VAR_9)
*VAR_9 = 0; return VAR_16 * VAR_7; } #ifndef USE_REALLY_FULL_SEARCH
VAR_22[0] = 1; for (VAR_13 = 1; VAR_13 < VAR_17; VAR_13++) VAR_22[VAR_13] = VAR_22[VAR_13-1]*VAR_20; if (!VAR_3) { abs_pow34_v(VAR_0->scoefs, VAR_2, VAR_4); VAR_3 = VAR_0->scoefs; } quantize_bands(VAR_0->qcoefs, VAR_2, VAR_3, VAR_4, VAR_19, !IS_CODEBOOK_UNSIGNED(VAR_6), VAR_21); #endif
for (VAR_13 = 0; VAR_13 < VAR_4; VAR_13 += VAR_17) { float VAR_23; int VAR_24  = 0; int VAR_25 = 0; const float *VAR_26; #ifndef USE_REALLY_FULL_SEARCH
int (*VAR_27)[2] = &VAR_0->qcoefs[VAR_13]; VAR_23 = 0.0f; for (VAR_14 = 0; VAR_14 < VAR_17; VAR_14++) VAR_23 += VAR_2[VAR_13+VAR_14]*VAR_2[VAR_13+VAR_14]; VAR_24 = IS_CODEBOOK_UNSIGNED(VAR_6) ? 0 : 40; VAR_25 = ff_aac_spectral_bits[VAR_6-1][VAR_24]; VAR_23 = VAR_23 * VAR_7 + VAR_25; for (VAR_14 = 0; VAR_14 < (1<<VAR_17); VAR_14++) { float VAR_28 = 0.0f; int VAR_29; int VAR_30 = IS_CODEBOOK_UNSIGNED(VAR_6) ? 0 : 40; int VAR_31   = 0; for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) { if ((VAR_14 & (1 << VAR_15)) && VAR_27[VAR_15][0] == VAR_27[VAR_15][1]) { VAR_31 = 1; break; } } if (VAR_31)
continue; for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) VAR_30 += VAR_27[VAR_15][!!(VAR_14 & (1 << VAR_15))] * VAR_22[VAR_17 - 1 - VAR_15]; VAR_29 =  ff_aac_spectral_bits[VAR_6-1][VAR_30]; VAR_26     = &ff_aac_codebook_vectors[VAR_6-1][VAR_30*VAR_17]; #else
VAR_23 = INFINITY; VAR_26 = ff_aac_codebook_vectors[VAR_6-1]; for (VAR_14 = 0; VAR_14 < ff_aac_spectral_sizes[VAR_6-1]; VAR_14++, VAR_26 += VAR_17) { float VAR_28 = 0.0f; int VAR_29 = ff_aac_spectral_bits[VAR_6-1][VAR_14]; int VAR_30 = VAR_14; #endif
if (IS_CODEBOOK_UNSIGNED(VAR_6)) { for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) { float VAR_32 = fabsf(VAR_2[VAR_13+VAR_15]); float VAR_35; if (VAR_26[VAR_15] == 64.0f) { if (VAR_32 < 39.0f*VAR_10) { VAR_28 = INFINITY; break; } if (VAR_32 >= VAR_12) { VAR_35 = VAR_32 - VAR_12; VAR_29 += 21; } else { int VAR_34 = av_clip(quant(VAR_32, VAR_11), 0, 8191); VAR_35 = VAR_32 - VAR_34*cbrtf(VAR_34)*VAR_10; VAR_29 += av_log2(VAR_34)*2 - 4 + 1; } } else { VAR_35 = VAR_32 - VAR_26[VAR_15]*VAR_10; } if (VAR_26[VAR_15] != 0.0f)
VAR_29++; VAR_28 += VAR_35*VAR_35; } } else { for (VAR_15 = 0; VAR_15 < VAR_17; VAR_15++) { float VAR_35 = VAR_2[VAR_13+VAR_15] - VAR_26[VAR_15]*VAR_10; VAR_28 += VAR_35*VAR_35; } } VAR_28 = VAR_28 * VAR_7 + VAR_29; if (VAR_28 < VAR_23) { VAR_23 = VAR_28; VAR_24  = VAR_30; VAR_25 = VAR_29; } } VAR_16    += VAR_23; VAR_18 += VAR_25; if (VAR_16 >= VAR_8)
return VAR_8; if (VAR_1) { put_bits(VAR_1, ff_aac_spectral_bits[VAR_6-1][VAR_24], ff_aac_spectral_codes[VAR_6-1][VAR_24]); if (IS_CODEBOOK_UNSIGNED(VAR_6))
for (VAR_14 = 0; VAR_14 < VAR_17; VAR_14++) if (ff_aac_codebook_vectors[VAR_6-1][VAR_24*VAR_17+VAR_14] != 0.0f)
put_bits(VAR_1, 1, VAR_2[VAR_13+VAR_14] < 0.0f); if (VAR_6 == ESC_BT) { for (VAR_14 = 0; VAR_14 < 2; VAR_14++) { if (ff_aac_codebook_vectors[VAR_6-1][VAR_24*2+VAR_14] == 64.0f) { int VAR_35 = av_clip(quant(fabsf(VAR_2[VAR_13+VAR_14]), VAR_11), 0, 8191); int VAR_36 = av_log2(VAR_35); put_bits(VAR_1, VAR_36 - 4 + 1, (1 << (VAR_36 - 4 + 1)) - 2); put_bits(VAR_1, VAR_36, VAR_35 & ((1 << VAR_36) - 1)); } } } } } if (VAR_9)
*VAR_9 = VAR_18; return VAR_16; }