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

Function alloc_sample_buffer

libavcodec/dca_lbr.c:994–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994static int alloc_sample_buffer(DCALbrDecoder *s)
995{
996 // Reserve space for history and padding
997 int nchsamples = DCA_LBR_TIME_SAMPLES + DCA_LBR_TIME_HISTORY * 2;
998 int nsamples = nchsamples * s->nchannels * s->nsubbands;
999 int ch, sb;
1000 float *ptr;
1001
1002 // Reallocate time sample buffer
1003 av_fast_mallocz(&s->ts_buffer, &s->ts_size, nsamples * sizeof(float));
1004 if (!s->ts_buffer)
1005 return AVERROR(ENOMEM);
1006
1007 ptr = s->ts_buffer + DCA_LBR_TIME_HISTORY;
1008 for (ch = 0; ch < s->nchannels; ch++) {
1009 for (sb = 0; sb < s->nsubbands; sb++) {
1010 s->time_samples[ch][sb] = ptr;
1011 ptr += nchsamples;
1012 }
1013 }
1014
1015 return 0;
1016}
1017
1018static int parse_decoder_init(DCALbrDecoder *s, GetByteContext *gb)
1019{

Callers 1

parse_decoder_initFunction · 0.70

Calls 1

av_fast_malloczFunction · 0.85

Tested by

no test coverage detected