static av_cold int fft_init(AVCodecContext *avctx, AC3MDCTContext *mdct, int ln)

{

    int i, n, n2;

    float alpha;



    n  = 1 << ln;

    n2 = n >> 1;



    FF_ALLOC_OR_GOTO(avctx, mdct->costab, n2 * sizeof(*mdct->costab), fft_alloc_fail);

    FF_ALLOC_OR_GOTO(avctx, mdct->sintab, n2 * sizeof(*mdct->sintab), fft_alloc_fail);



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

        alpha     = 2.0 * M_PI * i / n;

        mdct->costab[i] = FIX15(cos(alpha));

        mdct->sintab[i] = FIX15(sin(alpha));

    }



    return 0;

fft_alloc_fail:

    mdct_end(mdct);

    return AVERROR(ENOMEM);

}

static av_cold int fft_init(AVCodecContext *avctx, AC3MDCTContext *mdct, int ln)

{

    int i, n, n2;

    float alpha;



    n  = 1 << ln;

    n2 = n >> 1;



    FF_ALLOC_OR_GOTO(avctx, mdct->costab, n2 * sizeof(*mdct->costab), fft_alloc_fail);

    FF_ALLOC_OR_GOTO(avctx, mdct->sintab, n2 * sizeof(*mdct->sintab), fft_alloc_fail);



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

        alpha     = 2.0 * M_PI * i / n;

        mdct->costab[i] = FIX15(cos(alpha));

        mdct->sintab[i] = FIX15(sin(alpha));

    }



    return 0;

fft_alloc_fail:

    mdct_end(mdct);

    return AVERROR(ENOMEM);

}

static av_cold int FUNC_0(AVCodecContext *avctx, AC3MDCTContext *mdct, int ln)

{

    int VAR_0, VAR_1, VAR_2;

    float VAR_3;



    VAR_1  = 1 << ln;

    VAR_2 = VAR_1 >> 1;



    FF_ALLOC_OR_GOTO(avctx, mdct->costab, VAR_2 * sizeof(*mdct->costab), fft_alloc_fail);

    FF_ALLOC_OR_GOTO(avctx, mdct->sintab, VAR_2 * sizeof(*mdct->sintab), fft_alloc_fail);



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

        VAR_3     = 2.0 * M_PI * VAR_0 / VAR_1;

        mdct->costab[VAR_0] = FIX15(cos(VAR_3));

        mdct->sintab[VAR_0] = FIX15(sin(VAR_3));

    }



    return 0;

fft_alloc_fail:

    mdct_end(mdct);

    return AVERROR(ENOMEM);

}

static av_cold int FUNC_0(AVCodecContext *avctx, AC3MDCTContext *mdct, int ln)
{ int VAR_0, VAR_1, VAR_2; float VAR_3; VAR_1  = 1 << ln; VAR_2 = VAR_1 >> 1; FF_ALLOC_OR_GOTO(avctx, mdct->costab, VAR_2 * sizeof(*mdct->costab), fft_alloc_fail); FF_ALLOC_OR_GOTO(avctx, mdct->sintab, VAR_2 * sizeof(*mdct->sintab), fft_alloc_fail); for (VAR_0 = 0; VAR_0 < VAR_2; VAR_0++) { VAR_3     = 2.0 * M_PI * VAR_0 / VAR_1; mdct->costab[VAR_0] = FIX15(cos(VAR_3)); mdct->sintab[VAR_0] = FIX15(sin(VAR_3)); } return 0; fft_alloc_fail:
mdct_end(mdct); return AVERROR(ENOMEM); }