static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,

                      float *coeffs, uint_fast16_t *posts, int samples)

{

    int range = 255 / fc->multiplier + 1;

    int i;

    float tot_average = 0.;

    float averages[fc->values];

    for (i = 0; i < fc->values; i++) {

        averages[i] = get_floor_average(fc, coeffs, i);

        tot_average += averages[i];

    }

    tot_average /= fc->values;

    tot_average /= venc->quality;



    for (i = 0; i < fc->values; i++) {

        int position  = fc->list[fc->list[i].sort].x;

        float average = averages[i];

        int j;



        average *= pow(tot_average / average, 0.5) * pow(1.25, position/200.); // MAGIC!

        for (j = 0; j < range - 1; j++)

            if (ff_vorbis_floor1_inverse_db_table[j * fc->multiplier] > average)

                break;

        posts[fc->list[i].sort] = j;

    }

}

static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,

                      float *coeffs, uint_fast16_t *posts, int samples)

{

    int range = 255 / fc->multiplier + 1;

    int i;

    float tot_average = 0.;

    float averages[fc->values];

    for (i = 0; i < fc->values; i++) {

        averages[i] = get_floor_average(fc, coeffs, i);

        tot_average += averages[i];

    }

    tot_average /= fc->values;

    tot_average /= venc->quality;



    for (i = 0; i < fc->values; i++) {

        int position  = fc->list[fc->list[i].sort].x;

        float average = averages[i];

        int j;



        average *= pow(tot_average / average, 0.5) * pow(1.25, position/200.); 

        for (j = 0; j < range - 1; j++)

            if (ff_vorbis_floor1_inverse_db_table[j * fc->multiplier] > average)

                break;

        posts[fc->list[i].sort] = j;

    }

}

static void FUNC_0(vorbis_enc_context *VAR_0, vorbis_enc_floor *VAR_1,

                      float *VAR_2, uint_fast16_t *VAR_3, int VAR_4)

{

    int VAR_5 = 255 / VAR_1->multiplier + 1;

    int VAR_6;

    float VAR_7 = 0.;

    float VAR_8[VAR_1->values];

    for (VAR_6 = 0; VAR_6 < VAR_1->values; VAR_6++) {

        VAR_8[VAR_6] = get_floor_average(VAR_1, VAR_2, VAR_6);

        VAR_7 += VAR_8[VAR_6];

    }

    VAR_7 /= VAR_1->values;

    VAR_7 /= VAR_0->quality;



    for (VAR_6 = 0; VAR_6 < VAR_1->values; VAR_6++) {

        int position  = VAR_1->list[VAR_1->list[VAR_6].sort].x;

        float average = VAR_8[VAR_6];

        int j;



        average *= pow(VAR_7 / average, 0.5) * pow(1.25, position/200.); 

        for (j = 0; j < VAR_5 - 1; j++)

            if (ff_vorbis_floor1_inverse_db_table[j * VAR_1->multiplier] > average)

                break;

        VAR_3[VAR_1->list[VAR_6].sort] = j;

    }

}

static void FUNC_0(vorbis_enc_context *VAR_0, vorbis_enc_floor *VAR_1,
float *VAR_2, uint_fast16_t *VAR_3, int VAR_4)
{ int VAR_5 = 255 / VAR_1->multiplier + 1; int VAR_6; float VAR_7 = 0.; float VAR_8[VAR_1->values]; for (VAR_6 = 0; VAR_6 < VAR_1->values; VAR_6++) { VAR_8[VAR_6] = get_floor_average(VAR_1, VAR_2, VAR_6); VAR_7 += VAR_8[VAR_6]; } VAR_7 /= VAR_1->values; VAR_7 /= VAR_0->quality; for (VAR_6 = 0; VAR_6 < VAR_1->values; VAR_6++) { int position  = VAR_1->list[VAR_1->list[VAR_6].sort].x; float average = VAR_8[VAR_6]; int j; average *= pow(VAR_7 / average, 0.5) * pow(1.25, position/200.); for (j = 0; j < VAR_5 - 1; j++) if (ff_vorbis_floor1_inverse_db_table[j * VAR_1->multiplier] > average)
break; VAR_3[VAR_1->list[VAR_6].sort] = j; } }