| 801 | } |
| 802 | |
| 803 | static int parse_frame_data(DCACoreDecoder *s, enum HeaderType header, int xch_base) |
| 804 | { |
| 805 | int sf, ch, ret, band, sub_pos, lfe_pos; |
| 806 | |
| 807 | if ((ret = parse_coding_header(s, header, xch_base)) < 0) |
| 808 | return ret; |
| 809 | |
| 810 | for (sf = 0, sub_pos = 0, lfe_pos = DCA_LFE_HISTORY; sf < s->nsubframes; sf++) { |
| 811 | if ((ret = parse_subframe_header(s, sf, header, xch_base)) < 0) |
| 812 | return ret; |
| 813 | if ((ret = parse_subframe_audio(s, sf, header, xch_base, &sub_pos, &lfe_pos)) < 0) |
| 814 | return ret; |
| 815 | } |
| 816 | |
| 817 | for (ch = xch_base; ch < s->nchannels; ch++) { |
| 818 | // Determine number of active subbands for this channel |
| 819 | int nsubbands = s->nsubbands[ch]; |
| 820 | if (s->joint_intensity_index[ch]) |
| 821 | nsubbands = FFMAX(nsubbands, s->nsubbands[s->joint_intensity_index[ch] - 1]); |
| 822 | |
| 823 | // Update history for ADPCM |
| 824 | for (band = 0; band < nsubbands; band++) { |
| 825 | int32_t *samples = s->subband_samples[ch][band] - DCA_ADPCM_COEFFS; |
| 826 | AV_COPY128(samples, samples + s->npcmblocks); |
| 827 | } |
| 828 | |
| 829 | // Clear inactive subbands |
| 830 | for (; band < DCA_SUBBANDS; band++) { |
| 831 | int32_t *samples = s->subband_samples[ch][band] - DCA_ADPCM_COEFFS; |
| 832 | memset(samples, 0, (DCA_ADPCM_COEFFS + s->npcmblocks) * sizeof(int32_t)); |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | return 0; |
| 837 | } |
| 838 | |
| 839 | static int parse_xch_frame(DCACoreDecoder *s) |
| 840 | { |
no test coverage detected