| 577 | } |
| 578 | |
| 579 | static 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 | |
| 606 | static inline void inverse_adpcm(int32_t **subband_samples, |
| 607 | const int16_t *vq_index, |
no test coverage detected