static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
{
    int k, l;
    int subsubframe = s->current_subsubframe;
    const float *quant_step_table;
    LOCAL_ALIGNED_16(int32_t, block, [SAMPLES_PER_SUBBAND * DCA_SUBBANDS]);
    if (s->bit_rate_index == 0x1f)
        quant_step_table = ff_dca_lossless_quant_d;
    else
        quant_step_table = ff_dca_lossy_quant_d;
    for (k = base_channel; k < s->audio_header.prim_channels; k++) {
        float (*subband_samples)[8] = s->dca_chan[k].subband_samples[block_index];
        float rscale[DCA_SUBBANDS];
        if (get_bits_left(&s->gb) < 0)
            return AVERROR_INVALIDDATA;
        for (l = 0; l < s->audio_header.vq_start_subband[k]; l++) {
            int m;
            int abits = s->dca_chan[k].bitalloc[l];
            float quant_step_size = quant_step_table[abits];
            int sel = s->audio_header.quant_index_huffman[k][abits];
            if (!abits) {
                rscale[l] = 0;
                memset(block + SAMPLES_PER_SUBBAND * l, 0, SAMPLES_PER_SUBBAND * sizeof(block[0]));
            } else {
                int sfi = s->dca_chan[k].transition_mode[l] &&
                    subsubframe >= s->dca_chan[k].transition_mode[l];
                rscale[l] = quant_step_size * s->dca_chan[k].scale_factor[l][sfi] *
                            s->audio_header.scalefactor_adj[k][sel];
                if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table) {
                    if (abits <= 7) {
                        int block_code1, block_code2, size, levels, err;
                        size   = abits_sizes[abits - 1];
                        levels = abits_levels[abits - 1];
                        block_code1 = get_bits(&s->gb, size);
                        block_code2 = get_bits(&s->gb, size);
                        err         = decode_blockcodes(block_code1, block_code2,
                                                        levels, block + SAMPLES_PER_SUBBAND * l);
                        if (err) {
                            av_log(s->avctx, AV_LOG_ERROR,
                                   "ERROR: block code look-up failed\n");
                            return AVERROR_INVALIDDATA;
                        }
                    } else {
                        for (m = 0; m < SAMPLES_PER_SUBBAND; m++)
                            block[SAMPLES_PER_SUBBAND * l + m] = get_sbits(&s->gb, abits - 3);
                    }
                } else {
                    for (m = 0; m < SAMPLES_PER_SUBBAND; m++)
                        block[SAMPLES_PER_SUBBAND * l + m] = get_bitalloc(&s->gb,
                                                        &dca_smpl_bitalloc[abits], sel);
                }
            }
        }
        s->fmt_conv.int32_to_float_fmul_array8(&s->fmt_conv, subband_samples[0],
                                               block, rscale, SAMPLES_PER_SUBBAND * s->audio_header.vq_start_subband[k]);
        for (l = 0; l < s->audio_header.vq_start_subband[k]; l++) {
            int m;
            if (s->dca_chan[k].prediction_mode[l]) {
                int n;
                if (s->predictor_history)
                    subband_samples[l][0] += (ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][0] *
                                                 s->dca_chan[k].subband_samples_hist[l][3] +
                                                 ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][1] *
                                                 s->dca_chan[k].subband_samples_hist[l][2] +
                                                 ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][2] *
                                                 s->dca_chan[k].subband_samples_hist[l][1] +
                                                 ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][3] *
                                                 s->dca_chan[k].subband_samples_hist[l][0]) *
                                                (1.0f / 8192);
                for (m = 1; m < SAMPLES_PER_SUBBAND; m++) {
                    float sum = ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][0] *
                                subband_samples[l][m - 1];
                    for (n = 2; n <= 4; n++)
                        if (m >= n)
                            sum += ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][n - 1] *
                                   subband_samples[l][m - n];
                        else if (s->predictor_history)
                            sum += ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][n - 1] *
                                   s->dca_chan[k].subband_samples_hist[l][m - n + 4];
                    subband_samples[l][m] += sum * 1.0f / 8192;
                }
            }
        }
        for (l = 0; l < DCA_SUBBANDS; l++)
            AV_COPY128(s->dca_chan[k].subband_samples_hist[l], &subband_samples[l][4]);
        if (s->audio_header.subband_activity[k] > s->audio_header.vq_start_subband[k]) {
            if (!s->debug_flag & 0x01) {
                av_log(s->avctx, AV_LOG_DEBUG,
                       "Stream with high frequencies VQ coding\n");
                s->debug_flag |= 0x01;
            }
            s->dcadsp.decode_hf(subband_samples, s->dca_chan[k].high_freq_vq,
                                ff_dca_high_freq_vq, subsubframe * SAMPLES_PER_SUBBAND,
                                s->dca_chan[k].scale_factor,
                                s->audio_header.vq_start_subband[k],
                                s->audio_header.subband_activity[k]);
        }
    }
    if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 1) {
        if (get_bits(&s->gb, 16) != 0xFFFF) {
            av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n");
            return AVERROR_INVALIDDATA;
        }
    }
    return 0;
}
['static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)\n{\n    int k, l;\n    int subsubframe = s->current_subsubframe;\n    const float *quant_step_table;\n    LOCAL_ALIGNED_16(int32_t, block, [SAMPLES_PER_SUBBAND * DCA_SUBBANDS]);\n    if (s->bit_rate_index == 0x1f)\n        quant_step_table = ff_dca_lossless_quant_d;\n    else\n        quant_step_table = ff_dca_lossy_quant_d;\n    for (k = base_channel; k < s->audio_header.prim_channels; k++) {\n        float (*subband_samples)[8] = s->dca_chan[k].subband_samples[block_index];\n        float rscale[DCA_SUBBANDS];\n        if (get_bits_left(&s->gb) < 0)\n            return AVERROR_INVALIDDATA;\n        for (l = 0; l < s->audio_header.vq_start_subband[k]; l++) {\n            int m;\n            int abits = s->dca_chan[k].bitalloc[l];\n            float quant_step_size = quant_step_table[abits];\n            int sel = s->audio_header.quant_index_huffman[k][abits];\n            if (!abits) {\n                rscale[l] = 0;\n                memset(block + SAMPLES_PER_SUBBAND * l, 0, SAMPLES_PER_SUBBAND * sizeof(block[0]));\n            } else {\n                int sfi = s->dca_chan[k].transition_mode[l] &&\n                    subsubframe >= s->dca_chan[k].transition_mode[l];\n                rscale[l] = quant_step_size * s->dca_chan[k].scale_factor[l][sfi] *\n                            s->audio_header.scalefactor_adj[k][sel];\n                if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table) {\n                    if (abits <= 7) {\n                        int block_code1, block_code2, size, levels, err;\n                        size   = abits_sizes[abits - 1];\n                        levels = abits_levels[abits - 1];\n                        block_code1 = get_bits(&s->gb, size);\n                        block_code2 = get_bits(&s->gb, size);\n                        err         = decode_blockcodes(block_code1, block_code2,\n                                                        levels, block + SAMPLES_PER_SUBBAND * l);\n                        if (err) {\n                            av_log(s->avctx, AV_LOG_ERROR,\n                                   "ERROR: block code look-up failed\\n");\n                            return AVERROR_INVALIDDATA;\n                        }\n                    } else {\n                        for (m = 0; m < SAMPLES_PER_SUBBAND; m++)\n                            block[SAMPLES_PER_SUBBAND * l + m] = get_sbits(&s->gb, abits - 3);\n                    }\n                } else {\n                    for (m = 0; m < SAMPLES_PER_SUBBAND; m++)\n                        block[SAMPLES_PER_SUBBAND * l + m] = get_bitalloc(&s->gb,\n                                                        &dca_smpl_bitalloc[abits], sel);\n                }\n            }\n        }\n        s->fmt_conv.int32_to_float_fmul_array8(&s->fmt_conv, subband_samples[0],\n                                               block, rscale, SAMPLES_PER_SUBBAND * s->audio_header.vq_start_subband[k]);\n        for (l = 0; l < s->audio_header.vq_start_subband[k]; l++) {\n            int m;\n            if (s->dca_chan[k].prediction_mode[l]) {\n                int n;\n                if (s->predictor_history)\n                    subband_samples[l][0] += (ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][0] *\n                                                 s->dca_chan[k].subband_samples_hist[l][3] +\n                                                 ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][1] *\n                                                 s->dca_chan[k].subband_samples_hist[l][2] +\n                                                 ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][2] *\n                                                 s->dca_chan[k].subband_samples_hist[l][1] +\n                                                 ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][3] *\n                                                 s->dca_chan[k].subband_samples_hist[l][0]) *\n                                                (1.0f / 8192);\n                for (m = 1; m < SAMPLES_PER_SUBBAND; m++) {\n                    float sum = ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][0] *\n                                subband_samples[l][m - 1];\n                    for (n = 2; n <= 4; n++)\n                        if (m >= n)\n                            sum += ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][n - 1] *\n                                   subband_samples[l][m - n];\n                        else if (s->predictor_history)\n                            sum += ff_dca_adpcm_vb[s->dca_chan[k].prediction_vq[l]][n - 1] *\n                                   s->dca_chan[k].subband_samples_hist[l][m - n + 4];\n                    subband_samples[l][m] += sum * 1.0f / 8192;\n                }\n            }\n        }\n        for (l = 0; l < DCA_SUBBANDS; l++)\n            AV_COPY128(s->dca_chan[k].subband_samples_hist[l], &subband_samples[l][4]);\n        if (s->audio_header.subband_activity[k] > s->audio_header.vq_start_subband[k]) {\n            if (!s->debug_flag & 0x01) {\n                av_log(s->avctx, AV_LOG_DEBUG,\n                       "Stream with high frequencies VQ coding\\n");\n                s->debug_flag |= 0x01;\n            }\n            s->dcadsp.decode_hf(subband_samples, s->dca_chan[k].high_freq_vq,\n                                ff_dca_high_freq_vq, subsubframe * SAMPLES_PER_SUBBAND,\n                                s->dca_chan[k].scale_factor,\n                                s->audio_header.vq_start_subband[k],\n                                s->audio_header.subband_activity[k]);\n        }\n    }\n    if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 1) {\n        if (get_bits(&s->gb, 16) != 0xFFFF) {\n            av_log(s->avctx, AV_LOG_ERROR, "Didn\'t get subframe DSYNC\\n");\n            return AVERROR_INVALIDDATA;\n        }\n    }\n    return 0;\n}']