MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / alloc_x96_sample_buffer

Function alloc_x96_sample_buffer

libavcodec/dca_core.c:1280–1304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278}
1279
1280static 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
1306static int parse_x96_subframe_header(DCACoreDecoder *s, int xch_base)
1307{

Callers 2

parse_x96_frameFunction · 0.85
parse_x96_frame_exssFunction · 0.85

Calls 2

av_fast_malloczFunction · 0.85
erase_x96_adpcm_historyFunction · 0.85

Tested by

no test coverage detected