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

Function parse_frame_data

libavcodec/dca_core.c:803–837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803static int parse_frame_data(DCACoreDecoder *s, enum HeaderType header, int xch_base)
804{
805 int sf, ch, ret, band, sub_pos, lfe_pos;
806
807 if ((ret = parse_coding_header(s, header, xch_base)) < 0)
808 return ret;
809
810 for (sf = 0, sub_pos = 0, lfe_pos = DCA_LFE_HISTORY; sf < s->nsubframes; sf++) {
811 if ((ret = parse_subframe_header(s, sf, header, xch_base)) < 0)
812 return ret;
813 if ((ret = parse_subframe_audio(s, sf, header, xch_base, &sub_pos, &lfe_pos)) < 0)
814 return ret;
815 }
816
817 for (ch = xch_base; ch < s->nchannels; ch++) {
818 // Determine number of active subbands for this channel
819 int nsubbands = s->nsubbands[ch];
820 if (s->joint_intensity_index[ch])
821 nsubbands = FFMAX(nsubbands, s->nsubbands[s->joint_intensity_index[ch] - 1]);
822
823 // Update history for ADPCM
824 for (band = 0; band < nsubbands; band++) {
825 int32_t *samples = s->subband_samples[ch][band] - DCA_ADPCM_COEFFS;
826 AV_COPY128(samples, samples + s->npcmblocks);
827 }
828
829 // Clear inactive subbands
830 for (; band < DCA_SUBBANDS; band++) {
831 int32_t *samples = s->subband_samples[ch][band] - DCA_ADPCM_COEFFS;
832 memset(samples, 0, (DCA_ADPCM_COEFFS + s->npcmblocks) * sizeof(int32_t));
833 }
834 }
835
836 return 0;
837}
838
839static int parse_xch_frame(DCACoreDecoder *s)
840{

Callers 3

parse_xch_frameFunction · 0.85
parse_xxch_frameFunction · 0.85
ff_dca_core_parseFunction · 0.85

Calls 4

parse_coding_headerFunction · 0.85
parse_subframe_headerFunction · 0.85
parse_subframe_audioFunction · 0.85
AV_COPY128Function · 0.50

Tested by

no test coverage detected