The xll extension includes an hierachy of channel sets. I think I have understood the general idea (the file can can provide a channel set representing a downmix, followed by another channel set with the information needed to undo the downmix and generate additional channels), but not the fine details.
When parsing embedded downmix coefficient, the number of coefficients is described as DownmixCoeffs This is present only if bOne2OneMapChannels2Speakers is true. If bDownmixCoefCodeEmbedded SetDownmix = true, then extract nDownmixCoeffs. To extract the coefficients, the decoder needs to determine the number of downmix coefficients (NDownmixCoeffs) by calculating the size of the NxM table of coefficients. N is defined as nChSetLLChannel+1 rows, where the extra row represents the down scaling coefficients that prevent overflow. Conversely, the number of columns M (the number of channels that the current channel set is mixed into) is determined when the decoder decodes the channel set hierarchy down to the primary channel set. Consider the case where there are 2 extended channel sets and 1 primary channel set (a total of 3 channel sets). When the decoder is currently unpacking the downmix coefficients defined in the second extended channel set (4 channels), N is 4+1=5. To determine M, the decoder shall traverse the channel set hierarchy and count the number of channels within each channel set. Hence, there are 6 channels in the primary set and 2 channels in the first extended channel set. Therefore M=8 and thus 5*8 coefficients. When downmix coefficients are defined for the primary channel group, use the nLLDownmixType to determine M (number of resultant fold down channels) and the total number of channels in the primary channel group to determine N. (ETSI TS 102 114 V1.4.1 (2012-09), page 122) Does anyone (Kostya?) know what "the decoder shall traverse the channel set hierarchy and count the number of channels within each channel set" means? (I admit I'm a bit lazy here; the description makes my head spin, and I haven't yet tried very hard to figure out what to do. So I ask, in case someone else already have it all figured out). And is there a distinction between "primary channel set" and "primary channel group", or are they the same thing? For the http://samples.libav.org/A-codecs/DTS/dts/Master%20Audio%205.0%2096khz.dts file, I get only a single channel set, with channels = 5, primar_ch_set = 1 and downmix_type 1. So N = 5+1 = 6, and since the primary flag is set, the final paragraph seems to apply, so M = 2 (downmix_type = 1 is a downmix to stereo). I'm not going to to anything with the coefficients now, but at least I think I know the number of bits (6*2*9) to skip. The testfile also has residual_encode = 0, which I think is a good case to start with. And one other thing: If anyone has access to a known-good decoder for dca xll, it would be great if I could get unpacked wav files corresponding to the dts/"Master Audio"* sample files. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
