QUOTE(Matyas @ Feb 21 2007, 16:28)

Now this is awesome.
But to understand it right: This DSP downmixes my 5.1 channel AC3 48kHz, into 2 channel MP3 so that I won't loose _almost_ any channel information, and I will be able to "upmix" it into 5.1 channel with fsurround?
What's the level of lost information (not considering the lost info during lossy-lossy recoding?)
So in this case it is much better than foo_dsp_channelmixer, because it allows you to go back to 5.1?
Its hard to explain what information you may exactly lose, so I'll try to be as precise as possible.
The following things may get lost during the encoding step:
- the directions of a few sound sources that "clash". I will later explain what clashing means.
- sounds that accidentally cancel each other out. This is not very likely or noticeable.
- the information whether a center sound should be played by the center speaker or by left+right.
This may be a problem if one has a weak center speaker but you can still turn down the center image in the decoder
(and thus have left and right play the center sounds instead).
So let's talk about clashing.
Clashing means that in a short period of time (e.g. 0.2 seconds) multiple sound sources at different locations occupy the same freqencies.
There are 2048 frequency bands so this is not as likely as it may seem.
But it usually happens when identical instruments at different locations play the same melody in parallel.
In this case most decoders will place the offending instruments further behind (in the surrounds) than they were in the original sound.
It happens because the phase angles between the offenders (and thus between the stereo left/right channels, if the offenders where placed one left and the other right) are pretty random and this is what the decoders use for front-back positioning.
To make a wild guess, I would say that in an average song, you won't lose 90% of the channel information.
There may be songs where clashes happen relatively frequently which means you get a more diffuse surround image and there may be
songs where the upmix is not distinguishable from the original. That's why you may want to compare the original and the upmix.
There are still some possible improvements in the decoder (e.g. the output channel volumes may be slightly too low,
the positioning could more precise by a few degrees and maybe there are still bugs in it) but these things are only a matter of time.
In fact it should be possible to have the decoder identify the clashes and trace back to which sources those frequencies belong by cross-correlation but
it's not yet clear how one can do this on an average CPU. Once again, time will tell.
Btw: I use the following DSP chains for comparing 5.1 (in my case mostly dts) to the upmix:
1. no dsp
2. downmix ac3/dts (phase shift) -> free surround (center image=0.8, linear steering, exact reconstruction) -> equalizer (+2db, seems necessary)
3. downmix ac3/dts (phase shift) -> pl2 wrapper
4. downmix ac3/dts (phase shift) -> ATSurround-AS2
5. downmix ac3/dts (phase shift) -> ATSurround-ASr
When I do the comparisons via headphones, each of the chains is followed by Dolby Headphone -> SRC Resampler(96000) -> Convolver(Eq)
Just that it's possible doesn't mean that one should do it, though.
I wouldn't replace my 5.1 files by mp3 unless I were _really_ short on disk space.
QUOTE(tebasuna51 @ Feb 21 2007, 19:20)

1) Propossed controls for left panel 'Mixing coeficients' of 'Downmix AC3/DTS to PL2'
- ProLogic compatibility [CheckBox] (default checked)
If checked Front, Center, LFE, Surround B values not accesibles (grayed)
- LFE Enabled [CheckBox] (default unchecked)
If checked default value 0.7071
If unchecked value 0.0000
- Mix SL + SR ( ) (Option between) Mix SL - SR (x)
2) The generic matrix is:
CODE
Lt = FL + 0.7071*FC + A * SL + B * SR
Rt = FR + 0.7071*FC - B * SL - A * SR
When ProLogic compatibility checked:
B = sign(MIX_SL_SR) * sign(A) * sqr(1 - A * A)
3) Values required to recover the exact channels test with Free Surround (Center Image = 1.0, Simple and Non-Linear)
CODE
- Downmix: A = 0.8165, Mix SL-SR FS: A = 0.8165, Music Mode (0,0) (Default FS)
- Downmix: A = 0.8660, Mix SL+SR FS: A = 0.8660, PowerDVD comp. (0,180)
- Downmix: A = -0.8660, Mix SL+SR FS: A = 0.8660, BeSweet comp. (180,0)
With A = 0.7071, B = 0.7071 and we have dpl I.
@Matyas
Is better than other foo_mixers if we listen through an audio equipment with dpl decoder (attached to PC or standalone player). To listen through headphones or stereo speakers maybe other mixers can be similar or better.
With channel test (each channel separated in time) we can recover the 5 channels with error less than 0.0002. Of course with real sound is not true and is dependent of the relations between the source channels.
For instance, if left and right channel have a common sound is recovered at center channel
Thanks for the details.
Checkboxes: ok.
Mix SL - SR (x): Why do we need this? To be able to model SQ encoding, too?
I'll change the defaults from 0.707 to 0.7071.