void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data, int channels)

{

    int i, j, ch;

    Band *bands = c->bands;

    int off;

    float mul;



    /* dequantize */

    memset(c->sb_samples, 0, sizeof(c->sb_samples));

    off = 0;

    for(i = 0; i <= maxband; i++, off += SAMPLES_PER_BAND){

        for(ch = 0; ch < 2; ch++){

            if(bands[i].res[ch]){

                j = 0;

                mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][0] & 0xFF];

                for(; j < 12; j++)

                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];

                mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][1] & 0xFF];

                for(; j < 24; j++)

                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];

                mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][2] & 0xFF];

                for(; j < 36; j++)

                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];

            }

        }

        if(bands[i].msf){

            int t1, t2;

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

                t1 = c->sb_samples[0][j][i];

                t2 = c->sb_samples[1][j][i];

                c->sb_samples[0][j][i] = t1 + t2;

                c->sb_samples[1][j][i] = t1 - t2;

            }

        }

    }



    mpc_synth(c, data, channels);

}

void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data, int channels)

{

    int i, j, ch;

    Band *bands = c->bands;

    int off;

    float mul;



    

    memset(c->sb_samples, 0, sizeof(c->sb_samples));

    off = 0;

    for(i = 0; i <= maxband; i++, off += SAMPLES_PER_BAND){

        for(ch = 0; ch < 2; ch++){

            if(bands[i].res[ch]){

                j = 0;

                mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][0] & 0xFF];

                for(; j < 12; j++)

                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];

                mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][1] & 0xFF];

                for(; j < 24; j++)

                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];

                mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][2] & 0xFF];

                for(; j < 36; j++)

                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];

            }

        }

        if(bands[i].msf){

            int t1, t2;

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

                t1 = c->sb_samples[0][j][i];

                t2 = c->sb_samples[1][j][i];

                c->sb_samples[0][j][i] = t1 + t2;

                c->sb_samples[1][j][i] = t1 - t2;

            }

        }

    }



    mpc_synth(c, data, channels);

}

void FUNC_0(MPCContext * VAR_0, int VAR_1, void *VAR_2, int VAR_3)

{

    int VAR_4, VAR_5, VAR_6;

    Band *bands = VAR_0->bands;

    int VAR_7;

    float VAR_8;



    

    memset(VAR_0->sb_samples, 0, sizeof(VAR_0->sb_samples));

    VAR_7 = 0;

    for(VAR_4 = 0; VAR_4 <= VAR_1; VAR_4++, VAR_7 += SAMPLES_PER_BAND){

        for(VAR_6 = 0; VAR_6 < 2; VAR_6++){

            if(bands[VAR_4].res[VAR_6]){

                VAR_5 = 0;

                VAR_8 = mpc_CC[bands[VAR_4].res[VAR_6]] * mpc_SCF[bands[VAR_4].scf_idx[VAR_6][0] & 0xFF];

                for(; VAR_5 < 12; VAR_5++)

                    VAR_0->sb_samples[VAR_6][VAR_5][VAR_4] = VAR_8 * VAR_0->Q[VAR_6][VAR_5 + VAR_7];

                VAR_8 = mpc_CC[bands[VAR_4].res[VAR_6]] * mpc_SCF[bands[VAR_4].scf_idx[VAR_6][1] & 0xFF];

                for(; VAR_5 < 24; VAR_5++)

                    VAR_0->sb_samples[VAR_6][VAR_5][VAR_4] = VAR_8 * VAR_0->Q[VAR_6][VAR_5 + VAR_7];

                VAR_8 = mpc_CC[bands[VAR_4].res[VAR_6]] * mpc_SCF[bands[VAR_4].scf_idx[VAR_6][2] & 0xFF];

                for(; VAR_5 < 36; VAR_5++)

                    VAR_0->sb_samples[VAR_6][VAR_5][VAR_4] = VAR_8 * VAR_0->Q[VAR_6][VAR_5 + VAR_7];

            }

        }

        if(bands[VAR_4].msf){

            int VAR_9, VAR_10;

            for(VAR_5 = 0; VAR_5 < SAMPLES_PER_BAND; VAR_5++){

                VAR_9 = VAR_0->sb_samples[0][VAR_5][VAR_4];

                VAR_10 = VAR_0->sb_samples[1][VAR_5][VAR_4];

                VAR_0->sb_samples[0][VAR_5][VAR_4] = VAR_9 + VAR_10;

                VAR_0->sb_samples[1][VAR_5][VAR_4] = VAR_9 - VAR_10;

            }

        }

    }



    mpc_synth(VAR_0, VAR_2, VAR_3);

}

void FUNC_0(MPCContext * VAR_0, int VAR_1, void *VAR_2, int VAR_3)
{ int VAR_4, VAR_5, VAR_6; Band *bands = VAR_0->bands; int VAR_7; float VAR_8; memset(VAR_0->sb_samples, 0, sizeof(VAR_0->sb_samples)); VAR_7 = 0; for(VAR_4 = 0; VAR_4 <= VAR_1; VAR_4++, VAR_7 += SAMPLES_PER_BAND){ for(VAR_6 = 0; VAR_6 < 2; VAR_6++){ if(bands[VAR_4].res[VAR_6]){ VAR_5 = 0; VAR_8 = mpc_CC[bands[VAR_4].res[VAR_6]] * mpc_SCF[bands[VAR_4].scf_idx[VAR_6][0] & 0xFF]; for(; VAR_5 < 12; VAR_5++) VAR_0->sb_samples[VAR_6][VAR_5][VAR_4] = VAR_8 * VAR_0->Q[VAR_6][VAR_5 + VAR_7]; VAR_8 = mpc_CC[bands[VAR_4].res[VAR_6]] * mpc_SCF[bands[VAR_4].scf_idx[VAR_6][1] & 0xFF]; for(; VAR_5 < 24; VAR_5++) VAR_0->sb_samples[VAR_6][VAR_5][VAR_4] = VAR_8 * VAR_0->Q[VAR_6][VAR_5 + VAR_7]; VAR_8 = mpc_CC[bands[VAR_4].res[VAR_6]] * mpc_SCF[bands[VAR_4].scf_idx[VAR_6][2] & 0xFF]; for(; VAR_5 < 36; VAR_5++) VAR_0->sb_samples[VAR_6][VAR_5][VAR_4] = VAR_8 * VAR_0->Q[VAR_6][VAR_5 + VAR_7]; } } if(bands[VAR_4].msf){ int VAR_9, VAR_10; for(VAR_5 = 0; VAR_5 < SAMPLES_PER_BAND; VAR_5++){ VAR_9 = VAR_0->sb_samples[0][VAR_5][VAR_4]; VAR_10 = VAR_0->sb_samples[1][VAR_5][VAR_4]; VAR_0->sb_samples[0][VAR_5][VAR_4] = VAR_9 + VAR_10; VAR_0->sb_samples[1][VAR_5][VAR_4] = VAR_9 - VAR_10; } } } mpc_synth(VAR_0, VAR_2, VAR_3); }