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

Function parse_sub_headers

libavcodec/dca_xll.c:915–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

913}
914
915static int parse_sub_headers(DCAXllDecoder *s, DCAExssAsset *asset)
916{
917 DCAContext *dca = s->avctx->priv_data;
918 DCAXllChSet *c;
919 int i, ret;
920
921 // Parse channel set headers
922 s->nfreqbands = 0;
923 s->nchannels = 0;
924 s->nreschsets = 0;
925 for (i = 0, c = s->chset; i < s->nchsets; i++, c++) {
926 c->hier_ofs = s->nchannels;
927 if ((ret = chs_parse_header(s, c, asset)) < 0)
928 return ret;
929 if (c->nfreqbands > s->nfreqbands)
930 s->nfreqbands = c->nfreqbands;
931 if (c->hier_chset)
932 s->nchannels += c->nchannels;
933 if (c->residual_encode != (1 << c->nchannels) - 1)
934 s->nreschsets++;
935 }
936
937 // Pre-scale downmixing coefficients for all non-primary channel sets
938 for (i = s->nchsets - 1, c = &s->chset[i]; i > 0; i--, c--) {
939 if (is_hier_dmix_chset(c)) {
940 DCAXllChSet *o = find_next_hier_dmix_chset(s, c);
941 if (o)
942 prescale_down_mix(c, o);
943 }
944 }
945
946 // Determine number of active channel sets to decode
947 switch (dca->request_channel_layout) {
948 case DCA_SPEAKER_LAYOUT_STEREO:
949 s->nactivechsets = 1;
950 break;
951 case DCA_SPEAKER_LAYOUT_5POINT0:
952 case DCA_SPEAKER_LAYOUT_5POINT1:
953 s->nactivechsets = (s->chset[0].nchannels < 5 && s->nchsets > 1) ? 2 : 1;
954 break;
955 default:
956 s->nactivechsets = s->nchsets;
957 break;
958 }
959
960 return 0;
961}
962
963static int parse_navi_table(DCAXllDecoder *s)
964{

Callers 1

parse_frameFunction · 0.85

Calls 4

chs_parse_headerFunction · 0.85
is_hier_dmix_chsetFunction · 0.85
prescale_down_mixFunction · 0.85

Tested by

no test coverage detected