static void chs_filter_band_data(DCAXllDecoder *s, DCAXllChSet *c, int band)

{

    DCAXllBand *b = &c->bands[band];

    int nsamples = s->nframesamples;

    int i, j, k;



    // Inverse adaptive or fixed prediction

    for (i = 0; i < c->nchannels; i++) {

        int32_t *buf = b->msb_sample_buffer[i];

        int order = b->adapt_pred_order[i];

        if (order > 0) {

            int coeff[DCA_XLL_ADAPT_PRED_ORDER_MAX];

            // Conversion from reflection coefficients to direct form coefficients

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

                int rc = b->adapt_refl_coeff[i][j];

                for (k = 0; k < (j + 1) / 2; k++) {

                    int tmp1 = coeff[    k    ];

                    int tmp2 = coeff[j - k - 1];

                    coeff[    k    ] = tmp1 + mul16(rc, tmp2);

                    coeff[j - k - 1] = tmp2 + mul16(rc, tmp1);

                }

                coeff[j] = rc;

            }

            // Inverse adaptive prediction

            for (j = 0; j < nsamples - order; j++) {

                int64_t err = 0;

                for (k = 0; k < order; k++)

                    err += (int64_t)buf[j + k] * coeff[order - k - 1];

                buf[j + k] -= (SUINT)clip23(norm16(err));

            }

        } else {

            // Inverse fixed coefficient prediction

            for (j = 0; j < b->fixed_pred_order[i]; j++)

                for (k = 1; k < nsamples; k++)

                    buf[k] += buf[k - 1];

        }

    }



    // Inverse pairwise channel decorrellation

    if (b->decor_enabled) {

        int32_t *tmp[DCA_XLL_CHANNELS_MAX];



        for (i = 0; i < c->nchannels / 2; i++) {

            int coeff = b->decor_coeff[i];

            if (coeff) {

                s->dcadsp->decor(b->msb_sample_buffer[i * 2 + 1],

                                 b->msb_sample_buffer[i * 2    ],

                                 coeff, nsamples);

            }

        }



        // Reorder channel pointers to the original order

        for (i = 0; i < c->nchannels; i++)

            tmp[i] = b->msb_sample_buffer[i];



        for (i = 0; i < c->nchannels; i++)

            b->msb_sample_buffer[b->orig_order[i]] = tmp[i];

    }



    // Map output channel pointers for frequency band 0

    if (c->nfreqbands == 1)

        for (i = 0; i < c->nchannels; i++)

            s->output_samples[c->ch_remap[i]] = b->msb_sample_buffer[i];

}

static void chs_filter_band_data(DCAXllDecoder *s, DCAXllChSet *c, int band)

{

    DCAXllBand *b = &c->bands[band];

    int nsamples = s->nframesamples;

    int i, j, k;



    

    for (i = 0; i < c->nchannels; i++) {

        int32_t *buf = b->msb_sample_buffer[i];

        int order = b->adapt_pred_order[i];

        if (order > 0) {

            int coeff[DCA_XLL_ADAPT_PRED_ORDER_MAX];

            

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

                int rc = b->adapt_refl_coeff[i][j];

                for (k = 0; k < (j + 1) / 2; k++) {

                    int tmp1 = coeff[    k    ];

                    int tmp2 = coeff[j - k - 1];

                    coeff[    k    ] = tmp1 + mul16(rc, tmp2);

                    coeff[j - k - 1] = tmp2 + mul16(rc, tmp1);

                }

                coeff[j] = rc;

            }

            

            for (j = 0; j < nsamples - order; j++) {

                int64_t err = 0;

                for (k = 0; k < order; k++)

                    err += (int64_t)buf[j + k] * coeff[order - k - 1];

                buf[j + k] -= (SUINT)clip23(norm16(err));

            }

        } else {

            

            for (j = 0; j < b->fixed_pred_order[i]; j++)

                for (k = 1; k < nsamples; k++)

                    buf[k] += buf[k - 1];

        }

    }



    

    if (b->decor_enabled) {

        int32_t *tmp[DCA_XLL_CHANNELS_MAX];



        for (i = 0; i < c->nchannels / 2; i++) {

            int coeff = b->decor_coeff[i];

            if (coeff) {

                s->dcadsp->decor(b->msb_sample_buffer[i * 2 + 1],

                                 b->msb_sample_buffer[i * 2    ],

                                 coeff, nsamples);

            }

        }



        

        for (i = 0; i < c->nchannels; i++)

            tmp[i] = b->msb_sample_buffer[i];



        for (i = 0; i < c->nchannels; i++)

            b->msb_sample_buffer[b->orig_order[i]] = tmp[i];

    }



    

    if (c->nfreqbands == 1)

        for (i = 0; i < c->nchannels; i++)

            s->output_samples[c->ch_remap[i]] = b->msb_sample_buffer[i];

}

                    buf[k] += buf[k - 1];
static void FUNC_0(DCAXllDecoder *VAR_0, DCAXllChSet *VAR_1, int VAR_2)

{

    DCAXllBand *b = &VAR_1->bands[VAR_2];

    int VAR_3 = VAR_0->nframesamples;

    int VAR_4, VAR_5, VAR_6;



    

    for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++) {

        int32_t *buf = b->msb_sample_buffer[VAR_4];

        int order = b->adapt_pred_order[VAR_4];

        if (order > 0) {

            int coeff[DCA_XLL_ADAPT_PRED_ORDER_MAX];

            

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

                int rc = b->adapt_refl_coeff[VAR_4][VAR_5];

                for (VAR_6 = 0; VAR_6 < (VAR_5 + 1) / 2; VAR_6++) {

                    int tmp1 = coeff[    VAR_6    ];

                    int tmp2 = coeff[VAR_5 - VAR_6 - 1];

                    coeff[    VAR_6    ] = tmp1 + mul16(rc, tmp2);

                    coeff[VAR_5 - VAR_6 - 1] = tmp2 + mul16(rc, tmp1);

                }

                coeff[VAR_5] = rc;

            }

            

            for (VAR_5 = 0; VAR_5 < VAR_3 - order; VAR_5++) {

                int64_t err = 0;

                for (VAR_6 = 0; VAR_6 < order; VAR_6++)

                    err += (int64_t)buf[VAR_5 + VAR_6] * coeff[order - VAR_6 - 1];

                buf[VAR_5 + VAR_6] -= (SUINT)clip23(norm16(err));

            }

        } else {

            

            for (VAR_5 = 0; VAR_5 < b->fixed_pred_order[VAR_4]; VAR_5++)

                for (VAR_6 = 1; VAR_6 < VAR_3; VAR_6++)

                    buf[VAR_6] += buf[VAR_6 - 1];

        }

    }



    

    if (b->decor_enabled) {

        int32_t *tmp[DCA_XLL_CHANNELS_MAX];



        for (VAR_4 = 0; VAR_4 < VAR_1->nchannels / 2; VAR_4++) {

            int coeff = b->decor_coeff[VAR_4];

            if (coeff) {

                VAR_0->dcadsp->decor(b->msb_sample_buffer[VAR_4 * 2 + 1],

                                 b->msb_sample_buffer[VAR_4 * 2    ],

                                 coeff, VAR_3);

            }

        }



        

        for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++)

            tmp[VAR_4] = b->msb_sample_buffer[VAR_4];



        for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++)

            b->msb_sample_buffer[b->orig_order[VAR_4]] = tmp[VAR_4];

    }



    

    if (VAR_1->nfreqbands == 1)

        for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++)

            VAR_0->output_samples[VAR_1->ch_remap[VAR_4]] = b->msb_sample_buffer[VAR_4];

}

static void FUNC_0(DCAXllDecoder *VAR_0, DCAXllChSet *VAR_1, int VAR_2)
{ DCAXllBand *b = &VAR_1->bands[VAR_2]; int VAR_3 = VAR_0->nframesamples; int VAR_4, VAR_5, VAR_6; for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++) { int32_t *buf = b->msb_sample_buffer[VAR_4]; int order = b->adapt_pred_order[VAR_4]; if (order > 0) { int coeff[DCA_XLL_ADAPT_PRED_ORDER_MAX]; for (VAR_5 = 0; VAR_5 < order; VAR_5++) { int rc = b->adapt_refl_coeff[VAR_4][VAR_5]; for (VAR_6 = 0; VAR_6 < (VAR_5 + 1) / 2; VAR_6++) { int tmp1 = coeff[    VAR_6    ]; int tmp2 = coeff[VAR_5 - VAR_6 - 1]; coeff[    VAR_6    ] = tmp1 + mul16(rc, tmp2); coeff[VAR_5 - VAR_6 - 1] = tmp2 + mul16(rc, tmp1); } coeff[VAR_5] = rc; } for (VAR_5 = 0; VAR_5 < VAR_3 - order; VAR_5++) { int64_t err = 0; for (VAR_6 = 0; VAR_6 < order; VAR_6++) err += (int64_t)buf[VAR_5 + VAR_6] * coeff[order - VAR_6 - 1]; buf[VAR_5 + VAR_6] -= (SUINT)clip23(norm16(err)); } } else { for (VAR_5 = 0; VAR_5 < b->fixed_pred_order[VAR_4]; VAR_5++) for (VAR_6 = 1; VAR_6 < VAR_3; VAR_6++) buf[VAR_6] += buf[VAR_6 - 1]; } } if (b->decor_enabled) { int32_t *tmp[DCA_XLL_CHANNELS_MAX]; for (VAR_4 = 0; VAR_4 < VAR_1->nchannels / 2; VAR_4++) { int coeff = b->decor_coeff[VAR_4]; if (coeff) { VAR_0->dcadsp->decor(b->msb_sample_buffer[VAR_4 * 2 + 1],
b->msb_sample_buffer[VAR_4 * 2    ],
coeff, VAR_3); } } for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++) tmp[VAR_4] = b->msb_sample_buffer[VAR_4]; for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++) b->msb_sample_buffer[b->orig_order[VAR_4]] = tmp[VAR_4]; } if (VAR_1->nfreqbands == 1)
for (VAR_4 = 0; VAR_4 < VAR_1->nchannels; VAR_4++) VAR_0->output_samples[VAR_1->ch_remap[VAR_4]] = b->msb_sample_buffer[VAR_4]; }