static void spectral_to_sample(AACContext *ac, int samples)

{

    int i, type;

    void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);

    switch (ac->oc[1].m4ac.object_type) {

    case AOT_ER_AAC_LD:

        imdct_and_window = imdct_and_windowing_ld;

        break;

    case AOT_ER_AAC_ELD:

        imdct_and_window = imdct_and_windowing_eld;

        break;

    default:

        imdct_and_window = ac->imdct_and_windowing;

    }

    for (type = 3; type >= 0; type--) {

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

            ChannelElement *che = ac->che[type][i];

            if (che && che->present) {

                if (type <= TYPE_CPE)

                    apply_channel_coupling(ac, che, type, i, BEFORE_TNS, AAC_RENAME(apply_dependent_coupling));

                if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {

                    if (che->ch[0].ics.predictor_present) {

                        if (che->ch[0].ics.ltp.present)

                            ac->apply_ltp(ac, &che->ch[0]);

                        if (che->ch[1].ics.ltp.present && type == TYPE_CPE)

                            ac->apply_ltp(ac, &che->ch[1]);

                    }

                }

                if (che->ch[0].tns.present)

                    ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);

                if (che->ch[1].tns.present)

                    ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);

                if (type <= TYPE_CPE)

                    apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, AAC_RENAME(apply_dependent_coupling));

                if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {

                    imdct_and_window(ac, &che->ch[0]);

                    if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)

                        ac->update_ltp(ac, &che->ch[0]);

                    if (type == TYPE_CPE) {

                        imdct_and_window(ac, &che->ch[1]);

                        if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)

                            ac->update_ltp(ac, &che->ch[1]);

                    }

                    if (ac->oc[1].m4ac.sbr > 0) {

                        AAC_RENAME(ff_sbr_apply)(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);

                    }

                }

                if (type <= TYPE_CCE)

                    apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, AAC_RENAME(apply_independent_coupling));



#if USE_FIXED

                {

                    int j;

                    /* preparation for resampler */

                    for(j = 0; j<samples; j++){

                        che->ch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;

                        if(type == TYPE_CPE)

                            che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;

                    }

                }

#endif /* USE_FIXED */

                che->present = 0;

            } else if (che) {

                av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);

            }

        }

    }

}

static void spectral_to_sample(AACContext *ac, int samples)

{

    int i, type;

    void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);

    switch (ac->oc[1].m4ac.object_type) {

    case AOT_ER_AAC_LD:

        imdct_and_window = imdct_and_windowing_ld;

        break;

    case AOT_ER_AAC_ELD:

        imdct_and_window = imdct_and_windowing_eld;

        break;

    default:

        imdct_and_window = ac->imdct_and_windowing;

    }

    for (type = 3; type >= 0; type--) {

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

            ChannelElement *che = ac->che[type][i];

            if (che && che->present) {

                if (type <= TYPE_CPE)

                    apply_channel_coupling(ac, che, type, i, BEFORE_TNS, AAC_RENAME(apply_dependent_coupling));

                if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {

                    if (che->ch[0].ics.predictor_present) {

                        if (che->ch[0].ics.ltp.present)

                            ac->apply_ltp(ac, &che->ch[0]);

                        if (che->ch[1].ics.ltp.present && type == TYPE_CPE)

                            ac->apply_ltp(ac, &che->ch[1]);

                    }

                }

                if (che->ch[0].tns.present)

                    ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);

                if (che->ch[1].tns.present)

                    ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);

                if (type <= TYPE_CPE)

                    apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, AAC_RENAME(apply_dependent_coupling));

                if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {

                    imdct_and_window(ac, &che->ch[0]);

                    if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)

                        ac->update_ltp(ac, &che->ch[0]);

                    if (type == TYPE_CPE) {

                        imdct_and_window(ac, &che->ch[1]);

                        if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)

                            ac->update_ltp(ac, &che->ch[1]);

                    }

                    if (ac->oc[1].m4ac.sbr > 0) {

                        AAC_RENAME(ff_sbr_apply)(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);

                    }

                }

                if (type <= TYPE_CCE)

                    apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, AAC_RENAME(apply_independent_coupling));



#if USE_FIXED

                {

                    int j;

                    

                    for(j = 0; j<samples; j++){

                        che->ch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;

                        if(type == TYPE_CPE)

                            che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;

                    }

                }

#endif 

                che->present = 0;

            } else if (che) {

                av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);

            }

        }

    }

}

                        che->ch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;                             che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;
static void FUNC_0(AACContext *VAR_5, int VAR_1)

{

    int VAR_2, VAR_3;

    void (*VAR_4)(AACContext *VAR_5, SingleChannelElement *VAR_5);

    switch (VAR_5->oc[1].m4ac.object_type) {

    case AOT_ER_AAC_LD:

        VAR_4 = imdct_and_windowing_ld;

        break;

    case AOT_ER_AAC_ELD:

        VAR_4 = imdct_and_windowing_eld;

        break;

    default:

        VAR_4 = VAR_5->imdct_and_windowing;

    }

    for (VAR_3 = 3; VAR_3 >= 0; VAR_3--) {

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

            ChannelElement *che = VAR_5->che[VAR_3][VAR_2];

            if (che && che->present) {

                if (VAR_3 <= TYPE_CPE)

                    apply_channel_coupling(VAR_5, che, VAR_3, VAR_2, BEFORE_TNS, AAC_RENAME(apply_dependent_coupling));

                if (VAR_5->oc[1].m4ac.object_type == AOT_AAC_LTP) {

                    if (che->ch[0].ics.predictor_present) {

                        if (che->ch[0].ics.ltp.present)

                            VAR_5->apply_ltp(VAR_5, &che->ch[0]);

                        if (che->ch[1].ics.ltp.present && VAR_3 == TYPE_CPE)

                            VAR_5->apply_ltp(VAR_5, &che->ch[1]);

                    }

                }

                if (che->ch[0].tns.present)

                    VAR_5->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);

                if (che->ch[1].tns.present)

                    VAR_5->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);

                if (VAR_3 <= TYPE_CPE)

                    apply_channel_coupling(VAR_5, che, VAR_3, VAR_2, BETWEEN_TNS_AND_IMDCT, AAC_RENAME(apply_dependent_coupling));

                if (VAR_3 != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {

                    VAR_4(VAR_5, &che->ch[0]);

                    if (VAR_5->oc[1].m4ac.object_type == AOT_AAC_LTP)

                        VAR_5->update_ltp(VAR_5, &che->ch[0]);

                    if (VAR_3 == TYPE_CPE) {

                        VAR_4(VAR_5, &che->ch[1]);

                        if (VAR_5->oc[1].m4ac.object_type == AOT_AAC_LTP)

                            VAR_5->update_ltp(VAR_5, &che->ch[1]);

                    }

                    if (VAR_5->oc[1].m4ac.sbr > 0) {

                        AAC_RENAME(ff_sbr_apply)(VAR_5, &che->sbr, VAR_3, che->ch[0].ret, che->ch[1].ret);

                    }

                }

                if (VAR_3 <= TYPE_CCE)

                    apply_channel_coupling(VAR_5, che, VAR_3, VAR_2, AFTER_IMDCT, AAC_RENAME(apply_independent_coupling));



#if USE_FIXED

                {

                    int j;

                    

                    for(j = 0; j<VAR_1; j++){

                        che->ch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;

                        if(VAR_3 == TYPE_CPE)

                            che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000;

                    }

                }

#endif 

                che->present = 0;

            } else if (che) {

                av_log(VAR_5->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", VAR_3, VAR_2);

            }

        }

    }

}

static void FUNC_0(AACContext *VAR_5, int VAR_1)
{ int VAR_2, VAR_3; void (*VAR_4)(AACContext *VAR_5, SingleChannelElement *VAR_5); switch (VAR_5->oc[1].m4ac.object_type) { case AOT_ER_AAC_LD:
VAR_4 = imdct_and_windowing_ld; break; case AOT_ER_AAC_ELD:
VAR_4 = imdct_and_windowing_eld; break; default:
VAR_4 = VAR_5->imdct_and_windowing; } for (VAR_3 = 3; VAR_3 >= 0; VAR_3--) { for (VAR_2 = 0; VAR_2 < MAX_ELEM_ID; VAR_2++) { ChannelElement *che = VAR_5->che[VAR_3][VAR_2]; if (che && che->present) { if (VAR_3 <= TYPE_CPE)
apply_channel_coupling(VAR_5, che, VAR_3, VAR_2, BEFORE_TNS, AAC_RENAME(apply_dependent_coupling)); if (VAR_5->oc[1].m4ac.object_type == AOT_AAC_LTP) { if (che->ch[0].ics.predictor_present) { if (che->ch[0].ics.ltp.present)
VAR_5->apply_ltp(VAR_5, &che->ch[0]); if (che->ch[1].ics.ltp.present && VAR_3 == TYPE_CPE)
VAR_5->apply_ltp(VAR_5, &che->ch[1]); } } if (che->ch[0].tns.present)
VAR_5->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1); if (che->ch[1].tns.present)
VAR_5->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1); if (VAR_3 <= TYPE_CPE)
apply_channel_coupling(VAR_5, che, VAR_3, VAR_2, BETWEEN_TNS_AND_IMDCT, AAC_RENAME(apply_dependent_coupling)); if (VAR_3 != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) { VAR_4(VAR_5, &che->ch[0]); if (VAR_5->oc[1].m4ac.object_type == AOT_AAC_LTP)
VAR_5->update_ltp(VAR_5, &che->ch[0]); if (VAR_3 == TYPE_CPE) { VAR_4(VAR_5, &che->ch[1]); if (VAR_5->oc[1].m4ac.object_type == AOT_AAC_LTP)
VAR_5->update_ltp(VAR_5, &che->ch[1]); } if (VAR_5->oc[1].m4ac.sbr > 0) { AAC_RENAME(ff_sbr_apply)(VAR_5, &che->sbr, VAR_3, che->ch[0].ret, che->ch[1].ret); } } if (VAR_3 <= TYPE_CCE)
apply_channel_coupling(VAR_5, che, VAR_3, VAR_2, AFTER_IMDCT, AAC_RENAME(apply_independent_coupling)); #if USE_FIXED
{ int j; for(j = 0; j<VAR_1; j++){ che->ch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000; if(VAR_3 == TYPE_CPE)
che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]<<7, INT32_MIN, INT32_MAX-0x8000)+0x8000; } } #endif
che->present = 0; } else if (che) { av_log(VAR_5->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", VAR_3, VAR_2); } } } }