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

Function extract_audio

libavcodec/dca_core.c:579–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579static inline int extract_audio(DCACoreDecoder *s, int32_t *audio, int abits, int ch)
580{
581 av_assert1(abits >= 0 && abits <= DCA_ABITS_MAX);
582
583 if (abits == 0) {
584 // No bits allocated
585 memset(audio, 0, DCA_SUBBAND_SAMPLES * sizeof(*audio));
586 return 0;
587 }
588
589 if (abits <= DCA_CODE_BOOKS) {
590 int sel = s->quant_index_sel[ch][abits - 1];
591 if (sel < ff_dca_quant_index_group_size[abits - 1]) {
592 // Huffman codes
593 return parse_huffman_codes(s, audio, abits, sel);
594 }
595 if (abits <= 7) {
596 // Block codes
597 return parse_block_codes(s, audio, abits);
598 }
599 }
600
601 // No further encoding
602 get_array(&s->gb, audio, DCA_SUBBAND_SAMPLES, abits - 3);
603 return 0;
604}
605
606static inline void inverse_adpcm(int32_t **subband_samples,
607 const int16_t *vq_index,

Callers 2

parse_subframe_audioFunction · 0.85
parse_x96_subframe_audioFunction · 0.85

Calls 3

parse_huffman_codesFunction · 0.85
parse_block_codesFunction · 0.85
get_arrayFunction · 0.70

Tested by

no test coverage detected