static void subband_transform(DCAEncContext *c, const int32_t *input)

{

    int ch, subs, i, k, j;



    for (ch = 0; ch < c->fullband_channels; ch++) {

        /* History is copied because it is also needed for PSY */

        int32_t hist[512];

        int hist_start = 0;

        const int chi = c->channel_order_tab[ch];



        for (i = 0; i < 512; i++)

            hist[i] = c->history[i][ch];



        for (subs = 0; subs < SUBBAND_SAMPLES; subs++) {

            int32_t accum[64];

            int32_t resp;

            int band;



            /* Calculate the convolutions at once */

            for (i = 0; i < 64; i++)

                accum[i] = 0;



            for (k = 0, i = hist_start, j = 0;

                    i < 512; k = (k + 1) & 63, i++, j++)

                accum[k] += mul32(hist[i], c->band_interpolation[j]);

            for (i = 0; i < hist_start; k = (k + 1) & 63, i++, j++)

                accum[k] += mul32(hist[i], c->band_interpolation[j]);



            for (k = 16; k < 32; k++)

                accum[k] = accum[k] - accum[31 - k];

            for (k = 32; k < 48; k++)

                accum[k] = accum[k] + accum[95 - k];



            for (band = 0; band < 32; band++) {

                resp = 0;

                for (i = 16; i < 48; i++) {

                    int s = (2 * band + 1) * (2 * (i + 16) + 1);

                    resp += mul32(accum[i], cos_t(s << 3)) >> 3;

                }



                c->subband[subs][band][ch] = ((band + 1) & 2) ? -resp : resp;

            }



            /* Copy in 32 new samples from input */

            for (i = 0; i < 32; i++)

                hist[i + hist_start] = input[(subs * 32 + i) * c->channels + chi];

            hist_start = (hist_start + 32) & 511;

        }

    }

}

static void subband_transform(DCAEncContext *c, const int32_t *input)

{

    int ch, subs, i, k, j;



    for (ch = 0; ch < c->fullband_channels; ch++) {

        

        int32_t hist[512];

        int hist_start = 0;

        const int chi = c->channel_order_tab[ch];



        for (i = 0; i < 512; i++)

            hist[i] = c->history[i][ch];



        for (subs = 0; subs < SUBBAND_SAMPLES; subs++) {

            int32_t accum[64];

            int32_t resp;

            int band;



            

            for (i = 0; i < 64; i++)

                accum[i] = 0;



            for (k = 0, i = hist_start, j = 0;

                    i < 512; k = (k + 1) & 63, i++, j++)

                accum[k] += mul32(hist[i], c->band_interpolation[j]);

            for (i = 0; i < hist_start; k = (k + 1) & 63, i++, j++)

                accum[k] += mul32(hist[i], c->band_interpolation[j]);



            for (k = 16; k < 32; k++)

                accum[k] = accum[k] - accum[31 - k];

            for (k = 32; k < 48; k++)

                accum[k] = accum[k] + accum[95 - k];



            for (band = 0; band < 32; band++) {

                resp = 0;

                for (i = 16; i < 48; i++) {

                    int s = (2 * band + 1) * (2 * (i + 16) + 1);

                    resp += mul32(accum[i], cos_t(s << 3)) >> 3;

                }



                c->subband[subs][band][ch] = ((band + 1) & 2) ? -resp : resp;

            }



            

            for (i = 0; i < 32; i++)

                hist[i + hist_start] = input[(subs * 32 + i) * c->channels + chi];

            hist_start = (hist_start + 32) & 511;

        }

    }

}

static void FUNC_0(DCAEncContext *VAR_0, const int32_t *VAR_1)

{

    int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6;



    for (VAR_2 = 0; VAR_2 < VAR_0->fullband_channels; VAR_2++) {

        

        int32_t hist[512];

        int hist_start = 0;

        const int chi = VAR_0->channel_order_tab[VAR_2];



        for (VAR_4 = 0; VAR_4 < 512; VAR_4++)

            hist[VAR_4] = VAR_0->history[VAR_4][VAR_2];



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

            int32_t accum[64];

            int32_t resp;

            int band;



            

            for (VAR_4 = 0; VAR_4 < 64; VAR_4++)

                accum[VAR_4] = 0;



            for (VAR_5 = 0, VAR_4 = hist_start, VAR_6 = 0;

                    VAR_4 < 512; VAR_5 = (VAR_5 + 1) & 63, VAR_4++, VAR_6++)

                accum[VAR_5] += mul32(hist[VAR_4], VAR_0->band_interpolation[VAR_6]);

            for (VAR_4 = 0; VAR_4 < hist_start; VAR_5 = (VAR_5 + 1) & 63, VAR_4++, VAR_6++)

                accum[VAR_5] += mul32(hist[VAR_4], VAR_0->band_interpolation[VAR_6]);



            for (VAR_5 = 16; VAR_5 < 32; VAR_5++)

                accum[VAR_5] = accum[VAR_5] - accum[31 - VAR_5];

            for (VAR_5 = 32; VAR_5 < 48; VAR_5++)

                accum[VAR_5] = accum[VAR_5] + accum[95 - VAR_5];



            for (band = 0; band < 32; band++) {

                resp = 0;

                for (VAR_4 = 16; VAR_4 < 48; VAR_4++) {

                    int s = (2 * band + 1) * (2 * (VAR_4 + 16) + 1);

                    resp += mul32(accum[VAR_4], cos_t(s << 3)) >> 3;

                }



                VAR_0->subband[VAR_3][band][VAR_2] = ((band + 1) & 2) ? -resp : resp;

            }



            

            for (VAR_4 = 0; VAR_4 < 32; VAR_4++)

                hist[VAR_4 + hist_start] = VAR_1[(VAR_3 * 32 + VAR_4) * VAR_0->channels + chi];

            hist_start = (hist_start + 32) & 511;

        }

    }

}

static void FUNC_0(DCAEncContext *VAR_0, const int32_t *VAR_1)
{ int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6; for (VAR_2 = 0; VAR_2 < VAR_0->fullband_channels; VAR_2++) { int32_t hist[512]; int hist_start = 0; const int chi = VAR_0->channel_order_tab[VAR_2]; for (VAR_4 = 0; VAR_4 < 512; VAR_4++) hist[VAR_4] = VAR_0->history[VAR_4][VAR_2]; for (VAR_3 = 0; VAR_3 < SUBBAND_SAMPLES; VAR_3++) { int32_t accum[64]; int32_t resp; int band; for (VAR_4 = 0; VAR_4 < 64; VAR_4++) accum[VAR_4] = 0; for (VAR_5 = 0, VAR_4 = hist_start, VAR_6 = 0; VAR_4 < 512; VAR_5 = (VAR_5 + 1) & 63, VAR_4++, VAR_6++) accum[VAR_5] += mul32(hist[VAR_4], VAR_0->band_interpolation[VAR_6]); for (VAR_4 = 0; VAR_4 < hist_start; VAR_5 = (VAR_5 + 1) & 63, VAR_4++, VAR_6++) accum[VAR_5] += mul32(hist[VAR_4], VAR_0->band_interpolation[VAR_6]); for (VAR_5 = 16; VAR_5 < 32; VAR_5++) accum[VAR_5] = accum[VAR_5] - accum[31 - VAR_5]; for (VAR_5 = 32; VAR_5 < 48; VAR_5++) accum[VAR_5] = accum[VAR_5] + accum[95 - VAR_5]; for (band = 0; band < 32; band++) { resp = 0; for (VAR_4 = 16; VAR_4 < 48; VAR_4++) { int s = (2 * band + 1) * (2 * (VAR_4 + 16) + 1); resp += mul32(accum[VAR_4], cos_t(s << 3)) >> 3; } VAR_0->subband[VAR_3][band][VAR_2] = ((band + 1) & 2) ? -resp : resp; } for (VAR_4 = 0; VAR_4 < 32; VAR_4++) hist[VAR_4 + hist_start] = VAR_1[(VAR_3 * 32 + VAR_4) * VAR_0->channels + chi]; hist_start = (hist_start + 32) & 511; } } }