| 1278 | } |
| 1279 | |
| 1280 | static int alloc_x96_sample_buffer(DCACoreDecoder *s) |
| 1281 | { |
| 1282 | int nchsamples = DCA_ADPCM_COEFFS + s->npcmblocks; |
| 1283 | int nframesamples = nchsamples * DCA_CHANNELS * DCA_SUBBANDS_X96; |
| 1284 | unsigned int size = s->x96_subband_size; |
| 1285 | int ch, band; |
| 1286 | |
| 1287 | // Reallocate subband sample buffer |
| 1288 | av_fast_mallocz(&s->x96_subband_buffer, &s->x96_subband_size, |
| 1289 | nframesamples * sizeof(int32_t)); |
| 1290 | if (!s->x96_subband_buffer) |
| 1291 | return AVERROR(ENOMEM); |
| 1292 | |
| 1293 | if (size != s->x96_subband_size) { |
| 1294 | for (ch = 0; ch < DCA_CHANNELS; ch++) |
| 1295 | for (band = 0; band < DCA_SUBBANDS_X96; band++) |
| 1296 | s->x96_subband_samples[ch][band] = s->x96_subband_buffer + |
| 1297 | (ch * DCA_SUBBANDS_X96 + band) * nchsamples + DCA_ADPCM_COEFFS; |
| 1298 | } |
| 1299 | |
| 1300 | if (!s->predictor_history) |
| 1301 | erase_x96_adpcm_history(s); |
| 1302 | |
| 1303 | return 0; |
| 1304 | } |
| 1305 | |
| 1306 | static int parse_x96_subframe_header(DCACoreDecoder *s, int xch_base) |
| 1307 | { |
no test coverage detected