Kostya Shishkov <[email protected]> writes:
> Maybe someone can give you a sample with lossless-only tracks? IIRC it's quite
> common to have 7.1 lossless audio with 5.1 core channels with residue plus two
> fully lossless channels. And you'll have fun with remixing channel sets then.
Fun, indeed...
I'm now looking at the "Master Audio 7.1.dts" file. There are 5.1 core
channels, and the xll extension has two channel sets.
Channel set 0 contain 6 residual channels, and from the channel mask,
these are, in order, C, L, R, LFE1, Lss, Rss (surround side).
Channel set 1 contain 2 non-residual channels, Lsr, Rsr (surround rear).
And it has the downmix coefficients, and the BHierChSet flag set. There
appear to be 18 coefficients (2+1) * 6. All either zero or 1/sqrt(2)
(nine bit codes 256 and 473, respectively). To make sense of them, I can
arrange them in the following matrix:
C L R LFE Lss Rss
self? 0.7 0.7 0.7 0.7 0.7 0.7
Lsr 0 0 0 0 0.7 0
Rsr 0 0 0 0 0 0.7
Ordered in the stream starting with the first column, i.e., 0.7, 0, 0,
0.7, 0, 0, ..., 0.7, 0, 0.7. I guess that this means that the downmix
was done as
C' = 0.7 C
L' = 0.7 L
R' = 0.7 R
LFE' = 0.7 LFE
Lss' = 0.7 Lss + 0.7 Lsr
Rss' = 0.7 Rss + 0.7 Rsr
where C, L, ..., Rsr are the intended 7.1 audio, and C', L',..., Rss' is
the downmixed 5.1 audio coded by the first channel set (+ core).
Then, to undo this downmix and recover 7.1 audio, I have to compute
C = C' / 0.7
L = L' / 0.7
R = R' / 0.7
LFE = LFE' / 0.7
L = L' / 0.7
Lss = Lss' / 0.7 - Lsr
Rss = Rss' / 0.7 - Lsr
Or in general, if column X is x_0, x_1, x_2, downmix is
X' = x_0 X + x_1 Lsr + x_2 Rsr
and the inverse is
X = X' / x_0 + (x_1 / x_0) Lsr + (x_1 / x_0) Rsr
And the inversion of x_0 is what the invDmixTab (D.11 in the spec) is
for.
Do I get this right?
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