Help - Search - Members - Calendar
Full Version: foo_dsp_downmix
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
pro_optimizer
Hi, here is once again a new DSP for your pleasure.

The purpose of this plugin is to downmix your 5.1 files to matrix-encoded stereo so you can send them to an external PL1/PL2/etc. capable receiver or just if you have to save quite a deal of harddisk space (you know, the compression ratio between dts and downmixed mp3 is nearly 1:10!). In the latter case I would use foo_dsp_fsurround for decoding (trust me smile.gif).

What is the difference to the available downmixers?
- Optional phase shifting. Necessary to handle both AC3 and DTS.
- Very good frequency response for the surround channels (55-24000 Hz @ +/- 0.005db, -3db @ 22Hz)
- Full control over the mixing matrix. Just know what coefficients are used, if it's standards conformant, PL1/PL2 or CS compatible. Customize it if necessary.

Get the plugin here.
You also need libfftw for this.
Matyas
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?
tebasuna51
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
pro_optimizer
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.
tebasuna51
QUOTE(pro_optimizer @ Feb 21 2007, 20:50) *

Mix SL - SR (x): Why do we need this? To be able to model SQ encoding, too?

The default FS mode: Music Mode (0,0) need a initial downmix with Mix SL-SR.

And other people also experiment with this kind of mixes, this is a old discussion.

Really for me is not necessary but maybe you need change the default FS.
pro_optimizer
QUOTE(tebasuna51 @ Feb 21 2007, 20:34) *

QUOTE(pro_optimizer @ Feb 21 2007, 20:50) *

Mix SL - SR (x): Why do we need this? To be able to model SQ encoding, too?

The default FS mode: Music Mode (0,0) need a initial downmix with Mix SL-SR.

And other people also experiment with this kind of mixes, this is a old discussion.

Really for me is not necessary but maybe you need change the default FS.


Ah, I see.
I would not use the music mode to play music for which I know that it's properly encoded.
Music Mode is more useful if you don't really know if the music you send through it is encoded or not because
it will at least not invert (potentially arbitrary) parts of it.
One cannot really encode with SL-SR because centered surround sources would be mostly cancelled out by this.
e.g. Lt = 0.8165x-0.5774x = 0.2391x is already quite low and its even worse for the DPL1 matrix:
Lt = Rt = 0.7071x-0.7071x = 0 (in words: zero)
Matyas
QUOTE
When I do the comparisons via headphones, each of the chains is followed by Dolby Headphone -> SRC Resampler(96000) -> Convolver(Eq)


Why do you use the SSRC resampler to go up to 96kHz? And what's the point behind using Convolver instead of the built-in EQ?
pro_optimizer
QUOTE(Matyas @ Feb 22 2007, 09:35) *

Why do you use the SSRC resampler to go up to 96kHz? And what's the point behind using Convolver instead of the built-in EQ?


The reason why I don't use the built-in EQ is this one.

The reason for using SRC is much more subjective, probably I cannot ABX it against the PPHS resampler.
I know how SRC works and that it does, in principle, the Right Thing whereas I don't know how a polyphase resampler works and what the quality tradeoffs involved are. So SRC gives me a better gut feeling at the moment biggrin.gif
Matyas
@EQ: Thanks for the link.
@SSRC: the question is not why SSRC, but why do you need 96Khz before the EQ which anyway goes directly to your headphones. Isn't 44kHz enough in this case?
pro_optimizer
QUOTE(Matyas @ Feb 23 2007, 09:27) *

@EQ: Thanks for the link.
@SSRC: the question is not why SSRC, but why do you need 96Khz before the EQ which anyway goes directly to your headphones. Isn't 44kHz enough in this case?

Well I resample the music because
a) I have an Audigy soundcard which supports only 48/96/... KHz natively.
Therefore it resamples 44.1 KHz music internally and its resampler is said to be quite crappy.
b) the convolver does not match the sampling rates of the filter kernel and the incoming music.
Therefore one has to resample the music to the rate of the kernel.

So the question remains: why 96 KHz and not 48.
Probably it doesn't matter. But at least I don't have to downsample 96KHz music this way.
(And, even if my soundcard's DACs were really bad their lowpass filter would still not reach down into the audible range. smile.gif)
Hancoque
I have found a strange behaviour when downmixing some DTS material with this plugin. With the "Channel Mixer" plugin the sound seems centered for the listener. But if I use the "Downmix AC3/DTS" plugin instead, some elements seem to be shifted more to the right (DTS mode) or to the left (AC3 mode).
klez
For any Reason, this Plugin doesnt Work here...
Its loadable, but every File which leaves the Converter (Wav Output) is still a 5 Channel WAV.
Even if i Change the "Master Gain" in the Configuration Dialog , nothing Happens.

Can someone help me?
pro_optimizer
QUOTE(klez @ Mar 17 2008, 23:11) *

For any Reason, this Plugin doesnt Work here...
Its loadable, but every File which leaves the Converter (Wav Output) is still a 5 Channel WAV.
Even if i Change the "Master Gain" in the Configuration Dialog , nothing Happens.

Can someone help me?


This is because the plugin currently downmixes only 5.1 input (i.e. no 5.0 as it seems to be the case with your source file). A temporary workaround before I pull myself together and add that damn special case would be that you put channel mixer before the downmix plugin and tell it to produce and additional dummy subwoofer channel.

Btw: Sorry for the immense posting delay! Somehow I didn't receive a reply notification for you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.