double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len,

                               int order, double *ref)

{

    int i;

    double signal = 0.0f, avg_err = 0.0f;

    double autoc[MAX_LPC_ORDER+1] = {0}, error[MAX_LPC_ORDER+1] = {0};

    const double a = 0.5f, b = 1.0f - a;



    /* Apply windowing */

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

        double weight = a - b*cos((2*M_PI*i)/(len - 1));

        s->windowed_samples[i] = weight*samples[i];

    }



    s->lpc_compute_autocorr(s->windowed_samples, len, order, autoc);

    signal = autoc[0];

    compute_ref_coefs(autoc, order, ref, error);

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

        avg_err = (avg_err + error[i])/2.0f;

    return signal/avg_err;

}

double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len,

                               int order, double *ref)

{

    int i;

    double signal = 0.0f, avg_err = 0.0f;

    double autoc[MAX_LPC_ORDER+1] = {0}, error[MAX_LPC_ORDER+1] = {0};

    const double a = 0.5f, b = 1.0f - a;



    

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

        double weight = a - b*cos((2*M_PI*i)/(len - 1));

        s->windowed_samples[i] = weight*samples[i];

    }



    s->lpc_compute_autocorr(s->windowed_samples, len, order, autoc);

    signal = autoc[0];

    compute_ref_coefs(autoc, order, ref, error);

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

        avg_err = (avg_err + error[i])/2.0f;

    return signal/avg_err;

}

    for (i = 0; i < len; i++) {
double FUNC_0(LPCContext *VAR_0, const float *VAR_1, int VAR_2,

                               int VAR_3, double *VAR_4)

{

    int VAR_5;

    double VAR_6 = 0.0f, VAR_7 = 0.0f;

    double VAR_8[MAX_LPC_ORDER+1] = {0}, error[MAX_LPC_ORDER+1] = {0};

    const double VAR_9 = 0.5f, VAR_10 = 1.0f - VAR_9;



    

    for (VAR_5 = 0; VAR_5 < VAR_2; VAR_5++) {

        double VAR_11 = VAR_9 - VAR_10*cos((2*M_PI*VAR_5)/(VAR_2 - 1));

        VAR_0->windowed_samples[VAR_5] = VAR_11*VAR_1[VAR_5];

    }



    VAR_0->lpc_compute_autocorr(VAR_0->windowed_samples, VAR_2, VAR_3, VAR_8);

    VAR_6 = VAR_8[0];

    compute_ref_coefs(VAR_8, VAR_3, VAR_4, error);

    for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++)

        VAR_7 = (VAR_7 + error[VAR_5])/2.0f;

    return VAR_6/VAR_7;

}

double FUNC_0(LPCContext *VAR_0, const float *VAR_1, int VAR_2,
int VAR_3, double *VAR_4)
{ int VAR_5; double VAR_6 = 0.0f, VAR_7 = 0.0f; double VAR_8[MAX_LPC_ORDER+1] = {0}, error[MAX_LPC_ORDER+1] = {0}; const double VAR_9 = 0.5f, VAR_10 = 1.0f - VAR_9; for (VAR_5 = 0; VAR_5 < VAR_2; VAR_5++) { double VAR_11 = VAR_9 - VAR_10*cos((2*M_PI*VAR_5)/(VAR_2 - 1)); VAR_0->windowed_samples[VAR_5] = VAR_11*VAR_1[VAR_5]; } VAR_0->lpc_compute_autocorr(VAR_0->windowed_samples, VAR_2, VAR_3, VAR_8); VAR_6 = VAR_8[0]; compute_ref_coefs(VAR_8, VAR_3, VAR_4, error); for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) VAR_7 = (VAR_7 + error[VAR_5])/2.0f; return VAR_6/VAR_7; }