static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * posts, int samples) {

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

    int i;

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

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

        int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x;

        int end   = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x;

        int j;

        float average = 0;

        begin = (position + begin) / 2;

        end   = (position + end  ) / 2;



        assert(end <= samples);

        for (j = begin; j < end; j++) average += fabs(coeffs[j]);

        average /= end - begin;

        average /= 32; // MAGIC!

        for (j = 0; j < range; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break;

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

    }

}

static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * posts, int samples) {

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

    int i;

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

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

        int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x;

        int end   = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x;

        int j;

        float average = 0;

        begin = (position + begin) / 2;

        end   = (position + end  ) / 2;



        assert(end <= samples);

        for (j = begin; j < end; j++) average += fabs(coeffs[j]);

        average /= end - begin;

        average /= 32; 

        for (j = 0; j < range; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break;

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

    }

}

        for (j = 0; j < range; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break;
static void FUNC_0(venc_context_t * VAR_0, floor_t * VAR_1, float * VAR_2, int * VAR_3, int VAR_4) {

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

    int VAR_6;

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

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

        int begin = VAR_1->list[VAR_1->list[FFMAX(VAR_6-1, 0)].sort].x;

        int end   = VAR_1->list[VAR_1->list[FFMIN(VAR_6+1, VAR_1->values - 1)].sort].x;

        int j;

        float average = 0;

        begin = (position + begin) / 2;

        end   = (position + end  ) / 2;



        assert(end <= VAR_4);

        for (j = begin; j < end; j++) average += fabs(VAR_2[j]);

        average /= end - begin;

        average /= 32; 

        for (j = 0; j < VAR_5; j++) if (floor1_inverse_db_table[j * VAR_1->multiplier] > average) break;

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

    }

}

static void FUNC_0(venc_context_t * VAR_0, floor_t * VAR_1, float * VAR_2, int * VAR_3, int VAR_4) { int VAR_5 = 255 / VAR_1->multiplier + 1; int VAR_6; for (VAR_6 = 0; VAR_6 < VAR_1->values; VAR_6++) { int position = VAR_1->list[VAR_1->list[VAR_6].sort].x; int begin = VAR_1->list[VAR_1->list[FFMAX(VAR_6-1, 0)].sort].x; int end   = VAR_1->list[VAR_1->list[FFMIN(VAR_6+1, VAR_1->values - 1)].sort].x; int j; float average = 0; begin = (position + begin) / 2; end   = (position + end  ) / 2; assert(end <= VAR_4); for (j = begin; j < end; j++) average += fabs(VAR_2[j]); average /= end - begin; average /= 32; for (j = 0; j < VAR_5; j++) if (floor1_inverse_db_table[j * VAR_1->multiplier] > average) break; VAR_3[VAR_1->list[VAR_6].sort] = j; } }