| 992 | } |
| 993 | |
| 994 | static 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 | |
| 1018 | static int parse_decoder_init(DCALbrDecoder *s, GetByteContext *gb) |
| 1019 | { |
no test coverage detected