static void mdct_test(AC3MDCTContext *mdct, AVLFG *lfg)

{

    int16_t input[MDCT_SAMPLES];

    int32_t output[AC3_MAX_COEFS];

    float input1[MDCT_SAMPLES];

    float output1[AC3_MAX_COEFS];

    float s, a, err, e, emax;

    int i, k, n;



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

        input[i]  = (av_lfg_get(lfg) % 65535 - 32767) * 9 / 10;

        input1[i] = input[i];

    }



    mdct512(mdct, output, input);



    /* do it by hand */

    for (k = 0; k < AC3_MAX_COEFS; k++) {

        s = 0;

        for (n = 0; n < MDCT_SAMPLES; n++) {

            a = (2*M_PI*(2*n+1+MDCT_SAMPLES/2)*(2*k+1) / (4 * MDCT_SAMPLES));

            s += input1[n] * cos(a);

        }

        output1[k] = -2 * s / MDCT_SAMPLES;

    }



    err  = 0;

    emax = 0;

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

        av_log(NULL, AV_LOG_DEBUG, "%3d: %7d %7.0f\n", i, output[i], output1[i]);

        e = output[i] - output1[i];

        if (e > emax)

            emax = e;

        err += e * e;

    }

    av_log(NULL, AV_LOG_DEBUG, "err2=%f emax=%f\n", err / AC3_MAX_COEFS, emax);

}

static void mdct_test(AC3MDCTContext *mdct, AVLFG *lfg)

{

    int16_t input[MDCT_SAMPLES];

    int32_t output[AC3_MAX_COEFS];

    float input1[MDCT_SAMPLES];

    float output1[AC3_MAX_COEFS];

    float s, a, err, e, emax;

    int i, k, n;



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

        input[i]  = (av_lfg_get(lfg) % 65535 - 32767) * 9 / 10;

        input1[i] = input[i];

    }



    mdct512(mdct, output, input);



    

    for (k = 0; k < AC3_MAX_COEFS; k++) {

        s = 0;

        for (n = 0; n < MDCT_SAMPLES; n++) {

            a = (2*M_PI*(2*n+1+MDCT_SAMPLES/2)*(2*k+1) / (4 * MDCT_SAMPLES));

            s += input1[n] * cos(a);

        }

        output1[k] = -2 * s / MDCT_SAMPLES;

    }



    err  = 0;

    emax = 0;

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

        av_log(NULL, AV_LOG_DEBUG, "%3d: %7d %7.0f\n", i, output[i], output1[i]);

        e = output[i] - output1[i];

        if (e > emax)

            emax = e;

        err += e * e;

    }

    av_log(NULL, AV_LOG_DEBUG, "err2=%f emax=%f\n", err / AC3_MAX_COEFS, emax);

}

static void FUNC_0(AC3MDCTContext *VAR_0, AVLFG *VAR_1)

{

    int16_t input[MDCT_SAMPLES];

    int32_t output[AC3_MAX_COEFS];

    float VAR_2[MDCT_SAMPLES];

    float VAR_3[AC3_MAX_COEFS];

    float VAR_4, VAR_5, VAR_6, VAR_7, VAR_8;

    int VAR_9, VAR_10, VAR_11;



    for (VAR_9 = 0; VAR_9 < MDCT_SAMPLES; VAR_9++) {

        input[VAR_9]  = (av_lfg_get(VAR_1) % 65535 - 32767) * 9 / 10;

        VAR_2[VAR_9] = input[VAR_9];

    }



    mdct512(VAR_0, output, input);



    

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

        VAR_4 = 0;

        for (VAR_11 = 0; VAR_11 < MDCT_SAMPLES; VAR_11++) {

            VAR_5 = (2*M_PI*(2*VAR_11+1+MDCT_SAMPLES/2)*(2*VAR_10+1) / (4 * MDCT_SAMPLES));

            VAR_4 += VAR_2[VAR_11] * cos(VAR_5);

        }

        VAR_3[VAR_10] = -2 * VAR_4 / MDCT_SAMPLES;

    }



    VAR_6  = 0;

    VAR_8 = 0;

    for (VAR_9 = 0; VAR_9 < AC3_MAX_COEFS; VAR_9++) {

        av_log(NULL, AV_LOG_DEBUG, "%3d: %7d %7.0f\VAR_11", VAR_9, output[VAR_9], VAR_3[VAR_9]);

        VAR_7 = output[VAR_9] - VAR_3[VAR_9];

        if (VAR_7 > VAR_8)

            VAR_8 = VAR_7;

        VAR_6 += VAR_7 * VAR_7;

    }

    av_log(NULL, AV_LOG_DEBUG, "err2=%f VAR_8=%f\VAR_11", VAR_6 / AC3_MAX_COEFS, VAR_8);

}

static void FUNC_0(AC3MDCTContext *VAR_0, AVLFG *VAR_1)
{ int16_t input[MDCT_SAMPLES]; int32_t output[AC3_MAX_COEFS]; float VAR_2[MDCT_SAMPLES]; float VAR_3[AC3_MAX_COEFS]; float VAR_4, VAR_5, VAR_6, VAR_7, VAR_8; int VAR_9, VAR_10, VAR_11; for (VAR_9 = 0; VAR_9 < MDCT_SAMPLES; VAR_9++) { input[VAR_9]  = (av_lfg_get(VAR_1) % 65535 - 32767) * 9 / 10; VAR_2[VAR_9] = input[VAR_9]; } mdct512(VAR_0, output, input); for (VAR_10 = 0; VAR_10 < AC3_MAX_COEFS; VAR_10++) { VAR_4 = 0; for (VAR_11 = 0; VAR_11 < MDCT_SAMPLES; VAR_11++) { VAR_5 = (2*M_PI*(2*VAR_11+1+MDCT_SAMPLES/2)*(2*VAR_10+1) / (4 * MDCT_SAMPLES)); VAR_4 += VAR_2[VAR_11] * cos(VAR_5); } VAR_3[VAR_10] = -2 * VAR_4 / MDCT_SAMPLES; } VAR_6  = 0; VAR_8 = 0; for (VAR_9 = 0; VAR_9 < AC3_MAX_COEFS; VAR_9++) { av_log(NULL, AV_LOG_DEBUG, "%3d: %7d %7.0f\VAR_11", VAR_9, output[VAR_9], VAR_3[VAR_9]); VAR_7 = output[VAR_9] - VAR_3[VAR_9]; if (VAR_7 > VAR_8)
VAR_8 = VAR_7; VAR_6 += VAR_7 * VAR_7; } av_log(NULL, AV_LOG_DEBUG, "err2=%f VAR_8=%f\VAR_11", VAR_6 / AC3_MAX_COEFS, VAR_8); }