static int generate_coupling_coordinates(AC3DecodeContext * ctx)

{

    ac3_audio_block *ab = &ctx->audio_block;

    uint8_t exp, mstrcplco;

    int16_t mant;

    uint32_t cplbndstrc = (1 << ab->ncplsubnd) >> 1;

    int ch, bnd, sbnd;

    float cplco;



    if (ab->cplcoe)

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

            if (ab->cplcoe & (1 << ch)) {

                mstrcplco = 3 * ab->mstrcplco[ch];

                sbnd = ab->cplbegf;

                for (bnd = 0; bnd < ab->ncplbnd; bnd++) {

                    exp = ab->cplcoexp[ch][bnd];

                    if (exp == 15)

                        mant = ab->cplcomant[ch][bnd] <<= 14;

                    else

                        mant = (ab->cplcomant[ch][bnd] | 0x10) << 13;

                    cplco = to_float(exp + mstrcplco, mant);

                    if (ctx->bsi.acmod == 0x02 && (ab->flags & AC3_AB_PHSFLGINU) && ch == 1

                            && (ab->phsflg & (1 << bnd)))

                        cplco = -cplco; /* invert the right channel */

                    ab->cplco[ch][sbnd++] = cplco;

                    while (cplbndstrc & ab->cplbndstrc) {

                        cplbndstrc >>= 1;

                        ab->cplco[ch][sbnd++] = cplco;

                    }

                    cplbndstrc >>= 1;

                }

            }



    return 0;

}

static int generate_coupling_coordinates(AC3DecodeContext * ctx)

{

    ac3_audio_block *ab = &ctx->audio_block;

    uint8_t exp, mstrcplco;

    int16_t mant;

    uint32_t cplbndstrc = (1 << ab->ncplsubnd) >> 1;

    int ch, bnd, sbnd;

    float cplco;



    if (ab->cplcoe)

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

            if (ab->cplcoe & (1 << ch)) {

                mstrcplco = 3 * ab->mstrcplco[ch];

                sbnd = ab->cplbegf;

                for (bnd = 0; bnd < ab->ncplbnd; bnd++) {

                    exp = ab->cplcoexp[ch][bnd];

                    if (exp == 15)

                        mant = ab->cplcomant[ch][bnd] <<= 14;

                    else

                        mant = (ab->cplcomant[ch][bnd] | 0x10) << 13;

                    cplco = to_float(exp + mstrcplco, mant);

                    if (ctx->bsi.acmod == 0x02 && (ab->flags & AC3_AB_PHSFLGINU) && ch == 1

                            && (ab->phsflg & (1 << bnd)))

                        cplco = -cplco; 

                    ab->cplco[ch][sbnd++] = cplco;

                    while (cplbndstrc & ab->cplbndstrc) {

                        cplbndstrc >>= 1;

                        ab->cplco[ch][sbnd++] = cplco;

                    }

                    cplbndstrc >>= 1;

                }

            }



    return 0;

}

static int FUNC_0(AC3DecodeContext * VAR_0)

{

    ac3_audio_block *ab = &VAR_0->audio_block;

    uint8_t exp, mstrcplco;

    int16_t mant;

    uint32_t cplbndstrc = (1 << ab->ncplsubnd) >> 1;

    int VAR_1, VAR_2, VAR_3;

    float VAR_4;



    if (ab->cplcoe)

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

            if (ab->cplcoe & (1 << VAR_1)) {

                mstrcplco = 3 * ab->mstrcplco[VAR_1];

                VAR_3 = ab->cplbegf;

                for (VAR_2 = 0; VAR_2 < ab->ncplbnd; VAR_2++) {

                    exp = ab->cplcoexp[VAR_1][VAR_2];

                    if (exp == 15)

                        mant = ab->cplcomant[VAR_1][VAR_2] <<= 14;

                    else

                        mant = (ab->cplcomant[VAR_1][VAR_2] | 0x10) << 13;

                    VAR_4 = to_float(exp + mstrcplco, mant);

                    if (VAR_0->bsi.acmod == 0x02 && (ab->flags & AC3_AB_PHSFLGINU) && VAR_1 == 1

                            && (ab->phsflg & (1 << VAR_2)))

                        VAR_4 = -VAR_4; 

                    ab->VAR_4[VAR_1][VAR_3++] = VAR_4;

                    while (cplbndstrc & ab->cplbndstrc) {

                        cplbndstrc >>= 1;

                        ab->VAR_4[VAR_1][VAR_3++] = VAR_4;

                    }

                    cplbndstrc >>= 1;

                }

            }



    return 0;

}

static int FUNC_0(AC3DecodeContext * VAR_0)
{ ac3_audio_block *ab = &VAR_0->audio_block; uint8_t exp, mstrcplco; int16_t mant; uint32_t cplbndstrc = (1 << ab->ncplsubnd) >> 1; int VAR_1, VAR_2, VAR_3; float VAR_4; if (ab->cplcoe)
for (VAR_1 = 0; VAR_1 < VAR_0->bsi.nfchans; VAR_1++) if (ab->cplcoe & (1 << VAR_1)) { mstrcplco = 3 * ab->mstrcplco[VAR_1]; VAR_3 = ab->cplbegf; for (VAR_2 = 0; VAR_2 < ab->ncplbnd; VAR_2++) { exp = ab->cplcoexp[VAR_1][VAR_2]; if (exp == 15)
mant = ab->cplcomant[VAR_1][VAR_2] <<= 14; else
mant = (ab->cplcomant[VAR_1][VAR_2] | 0x10) << 13; VAR_4 = to_float(exp + mstrcplco, mant); if (VAR_0->bsi.acmod == 0x02 && (ab->flags & AC3_AB_PHSFLGINU) && VAR_1 == 1
&& (ab->phsflg & (1 << VAR_2)))
VAR_4 = -VAR_4; ab->VAR_4[VAR_1][VAR_3++] = VAR_4; while (cplbndstrc & ab->cplbndstrc) { cplbndstrc >>= 1; ab->VAR_4[VAR_1][VAR_3++] = VAR_4; } cplbndstrc >>= 1; } } return 0; }