static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,

                                     const float *in, int size, int scale_idx,

                                     int cb, const float lambda)

{

    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;

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

    int i, j, k;

#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];

    float *scaled = s->scoefs;

#endif /* USE_REALLY_FULL_SEARCH */



//START_TIMER

    if (!cb)

        return;



#ifndef USE_REALLY_FULL_SEARCH

    offs[0] = 1;

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

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

    abs_pow34_v(scaled, in, size);

    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

        vec = ff_aac_codebook_vectors[cb-1];

        mincost = INFINITY;

        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;

            }

        }

        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));

                }

            }

        }

    }

//STOP_TIMER("quantize_and_encode")

}

static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,

                                     const float *in, int size, int scale_idx,

                                     int cb, const float lambda)

{

    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;

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

    int i, j, k;

#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];

    float *scaled = s->scoefs;

#endif 





    if (!cb)

        return;



#ifndef USE_REALLY_FULL_SEARCH

    offs[0] = 1;

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

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

    abs_pow34_v(scaled, in, size);

    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

        vec = ff_aac_codebook_vectors[cb-1];

        mincost = INFINITY;

        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;

            }

        }

        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));

                }

            }

        }

    }



}

static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,                                      const float *in, int size, int scale_idx,                                      int cb, const float lambda)     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;     const int dim = (cb < FIRST_PAIR_BT) ? 4 : 2;     int i, j, k; #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];     float *scaled = s->scoefs;     if (!cb) #ifndef USE_REALLY_FULL_SEARCH     offs[0] = 1;     for (i = 1; i < dim; i++)         offs[i] = offs[i-1]*range;     abs_pow34_v(scaled, in, size);     quantize_bands(s->qcoefs, in, scaled, size, Q34, !IS_CODEBOOK_UNSIGNED(cb), maxval);     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         vec = ff_aac_codebook_vectors[cb-1];         mincost = INFINITY;         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 (IS_CODEBOOK_UNSIGNED(cb)) {                 for (k = 0; k < dim; k++) {                     float t = fabsf(in[i+k]);                     float di;                         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;
static void FUNC_0(struct AACEncContext *VAR_0, PutBitContext *VAR_1,

                                     const float *VAR_2, int VAR_3, int VAR_4,

                                     int VAR_5, const float VAR_6)

{

    const float VAR_7 = ff_aac_pow2sf_tab[200 + VAR_4 - SCALE_ONE_POS + SCALE_DIV_512];

    const float  VAR_8 = ff_aac_pow2sf_tab[200 - VAR_4 + SCALE_ONE_POS - SCALE_DIV_512];

    const float VAR_9 = 165140.0f*VAR_7;

    const int VAR_10 = (VAR_5 < FIRST_PAIR_BT) ? 4 : 2;

    int VAR_11, VAR_12, VAR_13;

#ifndef USE_REALLY_FULL_SEARCH

    const float  VAR_14 = sqrtf(VAR_8 * sqrtf(VAR_8));

    const int VAR_15  = aac_cb_range[VAR_5];

    const int VAR_16 = aac_cb_maxval[VAR_5];

    int VAR_17[4];

    float *VAR_18 = VAR_0->scoefs;

#endif 





    if (!VAR_5)

        return;



#ifndef USE_REALLY_FULL_SEARCH

    VAR_17[0] = 1;

    for (VAR_11 = 1; VAR_11 < VAR_10; VAR_11++)

        VAR_17[VAR_11] = VAR_17[VAR_11-1]*VAR_15;

    abs_pow34_v(VAR_18, VAR_2, VAR_3);

    quantize_bands(VAR_0->qcoefs, VAR_2, VAR_18, VAR_3, VAR_14, !IS_CODEBOOK_UNSIGNED(VAR_5), VAR_16);

#endif 

    for (VAR_11 = 0; VAR_11 < VAR_3; VAR_11 += VAR_10) {

        float VAR_19;

        int VAR_20  = 0;

        int VAR_21 = 0;

        const float *VAR_22;

#ifndef USE_REALLY_FULL_SEARCH

        int (*VAR_23)[2] = &VAR_0->qcoefs[VAR_11];

        VAR_19 = 0.0f;

        for (VAR_12 = 0; VAR_12 < VAR_10; VAR_12++)

            VAR_19 += VAR_2[VAR_11+VAR_12]*VAR_2[VAR_11+VAR_12];

        VAR_20 = IS_CODEBOOK_UNSIGNED(VAR_5) ? 0 : 40;

        VAR_21 = ff_aac_spectral_bits[VAR_5-1][VAR_20];

        VAR_19 = VAR_19 * VAR_6 + VAR_21;

        for (VAR_12 = 0; VAR_12 < (1<<VAR_10); VAR_12++) {

            float VAR_24 = 0.0f;

            int VAR_25;

            int VAR_26 = IS_CODEBOOK_UNSIGNED(VAR_5) ? 0 : 40;

            int VAR_27   = 0;

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

                if ((VAR_12 & (1 << VAR_13)) && VAR_23[VAR_13][0] == VAR_23[VAR_13][1]) {

                    VAR_27 = 1;

                    break;

                }

            }

            if (VAR_27)

                continue;

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

                VAR_26 += VAR_23[VAR_13][!!(VAR_12 & (1 << VAR_13))] * VAR_17[VAR_10 - 1 - VAR_13];

            VAR_25 =  ff_aac_spectral_bits[VAR_5-1][VAR_26];

            VAR_22     = &ff_aac_codebook_vectors[VAR_5-1][VAR_26*VAR_10];

#else

        VAR_22 = ff_aac_codebook_vectors[VAR_5-1];

        VAR_19 = INFINITY;

        for (VAR_12 = 0; VAR_12 < ff_aac_spectral_sizes[VAR_5-1]; VAR_12++, VAR_22 += VAR_10) {

            float VAR_24 = 0.0f;

            int VAR_25 = ff_aac_spectral_bits[VAR_5-1][VAR_12];

            int VAR_26  = VAR_12;

#endif 

            if (IS_CODEBOOK_UNSIGNED(VAR_5)) {

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

                    float VAR_28 = fabsf(VAR_2[VAR_11+VAR_13]);

                    float VAR_31;

                    if (VAR_22[VAR_13] == 64.0f) { 

                        

                        if (VAR_28 < 39.0f*VAR_7) {

                            VAR_24 = INFINITY;

                            break;

                        }

                        if (VAR_28 >= VAR_9) {

                            VAR_31 = VAR_28 - VAR_9;

                            VAR_25 += 21;

                        } else {

                            int VAR_30 = av_clip(quant(VAR_28, VAR_8), 0, 8191);

                            VAR_31 = VAR_28 - VAR_30*cbrtf(VAR_30)*VAR_7;

                            VAR_25 += av_log2(VAR_30)*2 - 4 + 1;

                        }

                    } else {

                        VAR_31 = VAR_28 - VAR_22[VAR_13]*VAR_7;

                    }

                    if (VAR_22[VAR_13] != 0.0f)

                        VAR_25++;

                    VAR_24 += VAR_31*VAR_31;

                }

            } else {

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

                    float VAR_31 = VAR_2[VAR_11+VAR_13] - VAR_22[VAR_13]*VAR_7;

                    VAR_24 += VAR_31*VAR_31;

                }

            }

            VAR_24 = VAR_24 * VAR_6 + VAR_25;

            if (VAR_24 < VAR_19) {

                VAR_19 = VAR_24;

                VAR_20  = VAR_26;

                VAR_21 = VAR_25;

            }

        }

        put_bits(VAR_1, ff_aac_spectral_bits[VAR_5-1][VAR_20], ff_aac_spectral_codes[VAR_5-1][VAR_20]);

        if (IS_CODEBOOK_UNSIGNED(VAR_5))

            for (VAR_12 = 0; VAR_12 < VAR_10; VAR_12++)

                if (ff_aac_codebook_vectors[VAR_5-1][VAR_20*VAR_10+VAR_12] != 0.0f)

                    put_bits(VAR_1, 1, VAR_2[VAR_11+VAR_12] < 0.0f);

        if (VAR_5 == ESC_BT) {

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

                if (ff_aac_codebook_vectors[VAR_5-1][VAR_20*2+VAR_12] == 64.0f) {

                    int VAR_31 = av_clip(quant(fabsf(VAR_2[VAR_11+VAR_12]), VAR_8), 0, 8191);

                    int VAR_32 = av_log2(VAR_31);



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

                    put_bits(VAR_1, VAR_32, VAR_31 & ((1 << VAR_32) - 1));

                }

            }

        }

    }



}

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