static int uncouple_channels(AC3DecodeContext * ctx)

{

    ac3_audio_block *ab = &ctx->audio_block;

    int ch, sbnd, bin;

    int index;

    float (*samples)[256];

    int16_t mantissa;



    samples = (float (*)[256])((ctx->bsi.flags & AC3_BSI_LFEON) ? (ctx->samples + 256) : (ctx->samples));



    /* uncouple channels */

    for (ch = 0; ch < ctx->bsi.nfchans; ch++)

        if (ab->chincpl & (1 << ch))

            for (sbnd = ab->cplbegf; sbnd < 3 + ab->cplendf; sbnd++)

                for (bin = 0; bin < 12; bin++) {

                    index = sbnd * 12 + bin + 37;

                    samples[ch][index] = ab->cplcoeffs[index] * ab->cplco[ch][sbnd] * ab->chcoeffs[ch];

                }



    /* generate dither if required */

    for (ch = 0; ch < ctx->bsi.nfchans; ch++)

        if ((ab->chincpl & (1 << ch)) && (ab->dithflag & (1 << ch)))

            for (index = 0; index < ab->endmant[ch]; index++)

                if (!ab->bap[ch][index]) {

                    mantissa = dither_int16(&ctx->state);

                    samples[ch][index] = to_float(ab->dexps[ch][index], mantissa) * ab->chcoeffs[ch];

                }



    return 0;

}

static int uncouple_channels(AC3DecodeContext * ctx)

{

    ac3_audio_block *ab = &ctx->audio_block;

    int ch, sbnd, bin;

    int index;

    float (*samples)[256];

    int16_t mantissa;



    samples = (float (*)[256])((ctx->bsi.flags & AC3_BSI_LFEON) ? (ctx->samples + 256) : (ctx->samples));



    

    for (ch = 0; ch < ctx->bsi.nfchans; ch++)

        if (ab->chincpl & (1 << ch))

            for (sbnd = ab->cplbegf; sbnd < 3 + ab->cplendf; sbnd++)

                for (bin = 0; bin < 12; bin++) {

                    index = sbnd * 12 + bin + 37;

                    samples[ch][index] = ab->cplcoeffs[index] * ab->cplco[ch][sbnd] * ab->chcoeffs[ch];

                }



    

    for (ch = 0; ch < ctx->bsi.nfchans; ch++)

        if ((ab->chincpl & (1 << ch)) && (ab->dithflag & (1 << ch)))

            for (index = 0; index < ab->endmant[ch]; index++)

                if (!ab->bap[ch][index]) {

                    mantissa = dither_int16(&ctx->state);

                    samples[ch][index] = to_float(ab->dexps[ch][index], mantissa) * ab->chcoeffs[ch];

                }



    return 0;

}

static int FUNC_0(AC3DecodeContext * VAR_0)

{

    ac3_audio_block *ab = &VAR_0->audio_block;

    int VAR_1, VAR_2, VAR_3;

    int VAR_4;

    float (*VAR_5)[256];

    int16_t mantissa;



    VAR_5 = (float (*)[256])((VAR_0->bsi.flags & AC3_BSI_LFEON) ? (VAR_0->VAR_5 + 256) : (VAR_0->VAR_5));



    

    for (VAR_1 = 0; VAR_1 < VAR_0->bsi.nfchans; VAR_1++)

        if (ab->chincpl & (1 << VAR_1))

            for (VAR_2 = ab->cplbegf; VAR_2 < 3 + ab->cplendf; VAR_2++)

                for (VAR_3 = 0; VAR_3 < 12; VAR_3++) {

                    VAR_4 = VAR_2 * 12 + VAR_3 + 37;

                    VAR_5[VAR_1][VAR_4] = ab->cplcoeffs[VAR_4] * ab->cplco[VAR_1][VAR_2] * ab->chcoeffs[VAR_1];

                }



    

    for (VAR_1 = 0; VAR_1 < VAR_0->bsi.nfchans; VAR_1++)

        if ((ab->chincpl & (1 << VAR_1)) && (ab->dithflag & (1 << VAR_1)))

            for (VAR_4 = 0; VAR_4 < ab->endmant[VAR_1]; VAR_4++)

                if (!ab->bap[VAR_1][VAR_4]) {

                    mantissa = dither_int16(&VAR_0->state);

                    VAR_5[VAR_1][VAR_4] = to_float(ab->dexps[VAR_1][VAR_4], mantissa) * ab->chcoeffs[VAR_1];

                }



    return 0;

}

static int FUNC_0(AC3DecodeContext * VAR_0)
{ ac3_audio_block *ab = &VAR_0->audio_block; int VAR_1, VAR_2, VAR_3; int VAR_4; float (*VAR_5)[256]; int16_t mantissa; VAR_5 = (float (*)[256])((VAR_0->bsi.flags & AC3_BSI_LFEON) ? (VAR_0->VAR_5 + 256) : (VAR_0->VAR_5)); for (VAR_1 = 0; VAR_1 < VAR_0->bsi.nfchans; VAR_1++) if (ab->chincpl & (1 << VAR_1))
for (VAR_2 = ab->cplbegf; VAR_2 < 3 + ab->cplendf; VAR_2++) for (VAR_3 = 0; VAR_3 < 12; VAR_3++) { VAR_4 = VAR_2 * 12 + VAR_3 + 37; VAR_5[VAR_1][VAR_4] = ab->cplcoeffs[VAR_4] * ab->cplco[VAR_1][VAR_2] * ab->chcoeffs[VAR_1]; } for (VAR_1 = 0; VAR_1 < VAR_0->bsi.nfchans; VAR_1++) if ((ab->chincpl & (1 << VAR_1)) && (ab->dithflag & (1 << VAR_1)))
for (VAR_4 = 0; VAR_4 < ab->endmant[VAR_1]; VAR_4++) if (!ab->bap[VAR_1][VAR_4]) { mantissa = dither_int16(&VAR_0->state); VAR_5[VAR_1][VAR_4] = to_float(ab->dexps[VAR_1][VAR_4], mantissa) * ab->chcoeffs[VAR_1]; } return 0; }