static void qmf_32_subbands(DCAContext * s, int chans,
                            float samples_in[32][8], float *samples_out,
                            float scale, float bias)
{
    const float *prCoeff;
    int i, j, k;
    float praXin[33], *raXin = &praXin[1];
    float *subband_fir_hist = s->subband_fir_hist[chans];
    float *subband_fir_hist2 = s->subband_fir_noidea[chans];
    int chindex = 0, subindex;
    praXin[0] = 0.0;
    if (!s->multirate_inter)
        prCoeff = fir_32bands_nonperfect;
    else
        prCoeff = fir_32bands_perfect;
    for (subindex = 0; subindex < 8; subindex++) {
        float t1, t2, sum[16], diff[16];
        for (i = 0; i < s->subband_activity[chans]; i++)
            raXin[i] = samples_in[i][subindex];
        for (; i < 32; i++)
            raXin[i] = 0.0;
        for (j = 0, k = 0; k < 16; k++) {
            t1 = 0.0;
            t2 = 0.0;
            for (i = 0; i < 16; i++, j++){
                t1 += (raXin[2 * i] + raXin[2 * i + 1]) * cos_mod[j];
                t2 += (raXin[2 * i] + raXin[2 * i - 1]) * cos_mod[j + 256];
            }
            sum[k] = t1 + t2;
            diff[k] = t1 - t2;
        }
        j = 512;
        for (k = 0; k < 16; k++)
            subband_fir_hist[k] = cos_mod[j++] * sum[k];
        for (k = 0; k < 16; k++)
            subband_fir_hist[32-k-1] = cos_mod[j++] * diff[k];
        for (k = 31, i = 0; i < 32; i++, k--)
            for (j = 0; j < 512; j += 64){
                subband_fir_hist2[i]    += prCoeff[i+j]  * ( subband_fir_hist[i+j] - subband_fir_hist[j+k]);
                subband_fir_hist2[i+32] += prCoeff[i+j+32]*(-subband_fir_hist[i+j] - subband_fir_hist[j+k]);
            }
        for (i = 0; i < 32; i++)
            samples_out[chindex++] = subband_fir_hist2[i] * scale + bias;
        memmove(&subband_fir_hist[32], &subband_fir_hist[0], (512 - 32) * sizeof(float));
        memmove(&subband_fir_hist2[0], &subband_fir_hist2[32], 32 * sizeof(float));
        memset(&subband_fir_hist2[32], 0, 32 * sizeof(float));
    }
}
['static int dca_subsubframe(DCAContext * s)\n{\n    int k, l;\n    int subsubframe = s->current_subsubframe;\n    const float *quant_step_table;\n    float subband_samples[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8];\n    if (s->bit_rate == 0x1f)\n        quant_step_table = lossless_quant_d;\n    else\n        quant_step_table = lossy_quant_d;\n    for (k = 0; k < s->prim_channels; k++) {\n        for (l = 0; l < s->vq_start_subband[k]; l++) {\n            int m;\n            int abits = s->bitalloc[k][l];\n            float quant_step_size = quant_step_table[abits];\n            float rscale;\n            int sel = s->quant_index_huffman[k][abits];\n            if(!abits){\n                memset(subband_samples[k][l], 0, 8 * sizeof(subband_samples[0][0][0]));\n            }else if(abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){\n                if(abits <= 7){\n                    int block_code1, block_code2, size, levels;\n                    int block[8];\n                    size = abits_sizes[abits-1];\n                    levels = abits_levels[abits-1];\n                    block_code1 = get_bits(&s->gb, size);\n                    decode_blockcode(block_code1, levels, block);\n                    block_code2 = get_bits(&s->gb, size);\n                    decode_blockcode(block_code2, levels, &block[4]);\n                    for (m = 0; m < 8; m++)\n                        subband_samples[k][l][m] = block[m];\n                }else{\n                    for (m = 0; m < 8; m++)\n                        subband_samples[k][l][m] = get_sbits(&s->gb, abits - 3);\n                }\n            }else{\n                for (m = 0; m < 8; m++)\n                    subband_samples[k][l][m] = get_bitalloc(&s->gb, &dca_smpl_bitalloc[abits], sel);\n            }\n            if (s->transition_mode[k][l] &&\n                subsubframe >= s->transition_mode[k][l])\n                rscale = quant_step_size * s->scale_factor[k][l][1];\n            else\n                rscale = quant_step_size * s->scale_factor[k][l][0];\n            rscale *= s->scalefactor_adj[k][sel];\n            for (m = 0; m < 8; m++)\n                subband_samples[k][l][m] *= rscale;\n            if (s->prediction_mode[k][l]) {\n                int n;\n                for (m = 0; m < 8; m++) {\n                    for (n = 1; n <= 4; n++)\n                        if (m >= n)\n                            subband_samples[k][l][m] +=\n                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *\n                                 subband_samples[k][l][m - n] / 8192);\n                        else if (s->predictor_history)\n                            subband_samples[k][l][m] +=\n                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *\n                                 s->subband_samples_hist[k][l][m - n +\n                                                               4] / 8192);\n                }\n            }\n        }\n        for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) {\n            int m;\n            if (!s->debug_flag & 0x01) {\n                av_log(s->avctx, AV_LOG_DEBUG, "Stream with high frequencies VQ coding\\n");\n                s->debug_flag |= 0x01;\n            }\n            for (m = 0; m < 8; m++) {\n                subband_samples[k][l][m] =\n                    high_freq_vq[s->high_freq_vq[k][l]][subsubframe * 8 +\n                                                        m]\n                    * (float) s->scale_factor[k][l][0] / 16.0;\n            }\n        }\n    }\n    if (s->aspf || subsubframe == s->subsubframes - 1) {\n        if (0xFFFF == get_bits(&s->gb, 16)) {\n#ifdef TRACE\n            av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\\n");\n#endif\n        } else {\n            av_log(s->avctx, AV_LOG_ERROR, "Didn\'t get subframe DSYNC\\n");\n        }\n    }\n    for (k = 0; k < s->prim_channels; k++)\n        for (l = 0; l < s->vq_start_subband[k]; l++)\n            memcpy(s->subband_samples_hist[k][l], &subband_samples[k][l][4],\n                        4 * sizeof(subband_samples[0][0][0]));\n    for (k = 0; k < s->prim_channels; k++) {\n         qmf_32_subbands(s, k, subband_samples[k], &s->samples[256 * k],\n                            2.0 / 3   ,\n                            0   );\n    }\n    if (s->prim_channels > dca_channels[s->output & DCA_CHANNEL_MASK]) {\n        dca_downmix(s->samples, s->amode, s->downmix_coef);\n    }\n    if (s->output & DCA_LFE) {\n        int lfe_samples = 2 * s->lfe * s->subsubframes;\n        int i_channels = dca_channels[s->output & DCA_CHANNEL_MASK];\n        lfe_interpolation_fir(s->lfe, 2 * s->lfe,\n                              s->lfe_data + lfe_samples +\n                              2 * s->lfe * subsubframe,\n                              &s->samples[256 * i_channels],\n                              256.0, 0  );\n    }\n    return 0;\n}', 'static void qmf_32_subbands(DCAContext * s, int chans,\n                            float samples_in[32][8], float *samples_out,\n                            float scale, float bias)\n{\n    const float *prCoeff;\n    int i, j, k;\n    float praXin[33], *raXin = &praXin[1];\n    float *subband_fir_hist = s->subband_fir_hist[chans];\n    float *subband_fir_hist2 = s->subband_fir_noidea[chans];\n    int chindex = 0, subindex;\n    praXin[0] = 0.0;\n    if (!s->multirate_inter)\n        prCoeff = fir_32bands_nonperfect;\n    else\n        prCoeff = fir_32bands_perfect;\n    for (subindex = 0; subindex < 8; subindex++) {\n        float t1, t2, sum[16], diff[16];\n        for (i = 0; i < s->subband_activity[chans]; i++)\n            raXin[i] = samples_in[i][subindex];\n        for (; i < 32; i++)\n            raXin[i] = 0.0;\n        for (j = 0, k = 0; k < 16; k++) {\n            t1 = 0.0;\n            t2 = 0.0;\n            for (i = 0; i < 16; i++, j++){\n                t1 += (raXin[2 * i] + raXin[2 * i + 1]) * cos_mod[j];\n                t2 += (raXin[2 * i] + raXin[2 * i - 1]) * cos_mod[j + 256];\n            }\n            sum[k] = t1 + t2;\n            diff[k] = t1 - t2;\n        }\n        j = 512;\n        for (k = 0; k < 16; k++)\n            subband_fir_hist[k] = cos_mod[j++] * sum[k];\n        for (k = 0; k < 16; k++)\n            subband_fir_hist[32-k-1] = cos_mod[j++] * diff[k];\n        for (k = 31, i = 0; i < 32; i++, k--)\n            for (j = 0; j < 512; j += 64){\n                subband_fir_hist2[i]    += prCoeff[i+j]  * ( subband_fir_hist[i+j] - subband_fir_hist[j+k]);\n                subband_fir_hist2[i+32] += prCoeff[i+j+32]*(-subband_fir_hist[i+j] - subband_fir_hist[j+k]);\n            }\n        for (i = 0; i < 32; i++)\n            samples_out[chindex++] = subband_fir_hist2[i] * scale + bias;\n        memmove(&subband_fir_hist[32], &subband_fir_hist[0], (512 - 32) * sizeof(float));\n        memmove(&subband_fir_hist2[0], &subband_fir_hist2[32], 32 * sizeof(float));\n        memset(&subband_fir_hist2[32], 0, 32 * sizeof(float));\n    }\n}']