static void noise_scale(int *coefs, int scale, int band_energy, int len)

{

    int ssign = scale < 0 ? -1 : 1;

    int s = FFABS(scale);

    unsigned int round;

    int i, out, c = exp2tab[s & 3];

    int nlz = 0;



    while (band_energy > 0x7fff) {

        band_energy >>= 1;

        nlz++;

    }

    c /= band_energy;

    s = 21 + nlz - (s >> 2);



    if (s > 0) {

        round = 1 << (s-1);

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

            out = (int)(((int64_t)coefs[i] * c) >> 32);

            coefs[i] = ((int)(out+round) >> s) * ssign;

        }

    }

    else {

        s = s + 32;

        round = 1 << (s-1);

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

            out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);

            coefs[i] = out * ssign;

        }

    }

}

static void noise_scale(int *coefs, int scale, int band_energy, int len)

{

    int ssign = scale < 0 ? -1 : 1;

    int s = FFABS(scale);

    unsigned int round;

    int i, out, c = exp2tab[s & 3];

    int nlz = 0;



    while (band_energy > 0x7fff) {

        band_energy >>= 1;

        nlz++;

    }

    c /= band_energy;

    s = 21 + nlz - (s >> 2);



    if (s > 0) {

        round = 1 << (s-1);

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

            out = (int)(((int64_t)coefs[i] * c) >> 32);

            coefs[i] = ((int)(out+round) >> s) * ssign;

        }

    }

    else {

        s = s + 32;

        round = 1 << (s-1);

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

            out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);

            coefs[i] = out * ssign;

        }

    }

}

    if (s > 0) {
static void FUNC_0(int *VAR_0, int VAR_1, int VAR_2, int VAR_3)

{

    int VAR_4 = VAR_1 < 0 ? -1 : 1;

    int VAR_5 = FFABS(VAR_1);

    unsigned int VAR_6;

    int VAR_7, VAR_8, VAR_9 = exp2tab[VAR_5 & 3];

    int VAR_10 = 0;



    while (VAR_2 > 0x7fff) {

        VAR_2 >>= 1;

        VAR_10++;

    }

    VAR_9 /= VAR_2;

    VAR_5 = 21 + VAR_10 - (VAR_5 >> 2);



    if (VAR_5 > 0) {

        VAR_6 = 1 << (VAR_5-1);

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

            VAR_8 = (int)(((int64_t)VAR_0[VAR_7] * VAR_9) >> 32);

            VAR_0[VAR_7] = ((int)(VAR_8+VAR_6) >> VAR_5) * VAR_4;

        }

    }

    else {

        VAR_5 = VAR_5 + 32;

        VAR_6 = 1 << (VAR_5-1);

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

            VAR_8 = (int)((int64_t)((int64_t)VAR_0[VAR_7] * VAR_9 + VAR_6) >> VAR_5);

            VAR_0[VAR_7] = VAR_8 * VAR_4;

        }

    }

}

static void FUNC_0(int *VAR_0, int VAR_1, int VAR_2, int VAR_3)
{ int VAR_4 = VAR_1 < 0 ? -1 : 1; int VAR_5 = FFABS(VAR_1); unsigned int VAR_6; int VAR_7, VAR_8, VAR_9 = exp2tab[VAR_5 & 3]; int VAR_10 = 0; while (VAR_2 > 0x7fff) { VAR_2 >>= 1; VAR_10++; } VAR_9 /= VAR_2; VAR_5 = 21 + VAR_10 - (VAR_5 >> 2); if (VAR_5 > 0) { VAR_6 = 1 << (VAR_5-1); for (VAR_7=0; VAR_7<VAR_3; VAR_7++) { VAR_8 = (int)(((int64_t)VAR_0[VAR_7] * VAR_9) >> 32); VAR_0[VAR_7] = ((int)(VAR_8+VAR_6) >> VAR_5) * VAR_4; } } else { VAR_5 = VAR_5 + 32; VAR_6 = 1 << (VAR_5-1); for (VAR_7=0; VAR_7<VAR_3; VAR_7++) { VAR_8 = (int)((int64_t)((int64_t)VAR_0[VAR_7] * VAR_9 + VAR_6) >> VAR_5); VAR_0[VAR_7] = VAR_8 * VAR_4; } } }