IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
foo_dsp_downmix, downmix AC3/DTS etc to stereo, for use with PL2/FS/etc
pro_optimizer
post Feb 21 2007, 12:31
Post #1





Group: Developer
Posts: 99
Joined: 6-June 06
Member No.: 31515



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.

This post has been edited by pro_optimizer: Aug 12 2008, 03:36
Go to the top of the page
+Quote Post
Matyas
post Feb 21 2007, 16:28
Post #2





Group: Members
Posts: 158
Joined: 8-August 03
From: Bratislava
Member No.: 8242



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?
Go to the top of the page
+Quote Post
tebasuna51
post Feb 21 2007, 19:20
Post #3





Group: Members
Posts: 57
Joined: 11-July 06
Member No.: 32807



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
Go to the top of the page
+Quote Post
pro_optimizer
post Feb 21 2007, 19:50
Post #4





Group: Developer
Posts: 99
Joined: 6-June 06
Member No.: 31515



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.

This post has been edited by pro_optimizer: Feb 23 2007, 23:00
Go to the top of the page
+Quote Post
tebasuna51
post Feb 21 2007, 20:34
Post #5





Group: Members
Posts: 57
Joined: 11-July 06
Member No.: 32807



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.
Go to the top of the page
+Quote Post
pro_optimizer
post Feb 21 2007, 20:53
Post #6





Group: Developer
Posts: 99
Joined: 6-June 06
Member No.: 31515



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)
Go to the top of the page
+Quote Post
Matyas
post Feb 22 2007, 09:35
Post #7





Group: Members
Posts: 158
Joined: 8-August 03
From: Bratislava
Member No.: 8242



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?
Go to the top of the page
+Quote Post
pro_optimizer
post Feb 22 2007, 11:17
Post #8





Group: Developer
Posts: 99
Joined: 6-June 06
Member No.: 31515



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
Go to the top of the page
+Quote Post
Matyas
post Feb 23 2007, 09:27
Post #9





Group: Members
Posts: 158
Joined: 8-August 03
From: Bratislava
Member No.: 8242



@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?
Go to the top of the page
+Quote Post
pro_optimizer
post Feb 23 2007, 16:50
Post #10





Group: Developer
Posts: 99
Joined: 6-June 06
Member No.: 31515



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)

This post has been edited by pro_optimizer: Feb 24 2007, 10:30
Go to the top of the page
+Quote Post
Hancoque
post Apr 25 2007, 17:18
Post #11





Group: Members
Posts: 291
Joined: 27-January 04
From: Germany
Member No.: 11530



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).
Go to the top of the page
+Quote Post
klez
post Mar 17 2008, 22:11
Post #12





Group: Members
Posts: 49
Joined: 27-March 06
Member No.: 28881



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 post has been edited by klez: Mar 18 2008, 10:52
Go to the top of the page
+Quote Post
pro_optimizer
post Aug 12 2008, 03:33
Post #13





Group: Developer
Posts: 99
Joined: 6-June 06
Member No.: 31515



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 post has been edited by pro_optimizer: Aug 12 2008, 03:43
Go to the top of the page
+Quote Post
-Tiziano-
post Dec 31 2009, 10:41
Post #14





Group: Members
Posts: 23
Joined: 20-December 09
From: BelgiŽ
Member No.: 76179



Dear Friends

Tod S indicated me in this topic:
http://www.hydrogenaudio.org/forums/index....mp;#entry676408
the presence of your interesting topic.

I'm interested to experiment Foobar2000 as Dolby Prologic II encoder. So I ask:

the library:libfftw3f-3.dll for windows .. where do I have to install it ? In what directory please ?
What file of foo_dsp_downmix I need please ? because in your link there are several files. Anyway I have not clue were to install it/them ...

And I have aother qeustions as:
Is it possible to encode in Pro logic IIx and IIz ? Or is it too soon ?


About LFE Channel: I start from 6 files and or an interleaved 6 channel .WAV file that has discrete tracks for each channel LFE included. In what manner can I treat it please ?
Because till now, the LFE's separate tracks gave me some issue.

I thank you very much for your help and: happy new year 2010 to everybody wink.gif

This post has been edited by -Tiziano-: Dec 31 2009, 10:43
Go to the top of the page
+Quote Post
2E7AH
post Dec 31 2009, 10:47
Post #15





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



QUOTE (-Tiziano- @ Dec 31 2009, 10:41) *
the library:libfftw3f-3.dll for windows .. where do I have to install it ? In what directory please ?

In foobar's installation folder

QUOTE (-Tiziano- @ Dec 31 2009, 10:41) *
Is it possible to encode in Pro logic IIx and IIz ? Or is it too soon ?

I posted you link in your own thread: http://www.hydrogenaudio.org/forums/index....showtopic=50713
Go to the top of the page
+Quote Post
-Tiziano-
post Dec 31 2009, 12:00
Post #16





Group: Members
Posts: 23
Joined: 20-December 09
From: BelgiŽ
Member No.: 76179



QUOTE (2E7AH @ Dec 31 2009, 10:47) *
QUOTE (-Tiziano- @ Dec 31 2009, 10:41) *
the library:libfftw3f-3.dll for windows .. where do I have to install it ? In what directory please ?

In foobar's installation folder

QUOTE (-Tiziano- @ Dec 31 2009, 10:41) *
Is it possible to encode in Pro logic IIx and IIz ? Or is it too soon ?

I posted you link in your own thread: http://www.hydrogenaudio.org/forums/index....showtopic=50713


Hi 2E7AH.

ok perfect but in the main directory or in the "component" directory please ?

And: yes I saw your message in my thread but it's not clear to me .. so I have of course questions here below:

Do I have to put foo_dsp_pl2.dll in window/system ? because you are talking about: PL2XDLL.dll and I have not clue if it's the same. ( there are also: foo_dsp_fsurround.dll and foo_dsp_downmix.dll .. I don't know if I need them or not ... )
And also: How can I start conversion with Foobar ? ( I'm looking for some command on it just now without being successful ) ...

EDIT: Sorry i think to have found ho to convert, just now. Please confirm it: right-click and "convert" selecting the plug in .. correct ? Because I find "command line" also and sincerely I would prefer do not have any "command line" .. who remembers about commands to give ? biggrin.gif END-EDIT


Thank you very much

This post has been edited by -Tiziano-: Dec 31 2009, 12:07
Go to the top of the page
+Quote Post
2E7AH
post Dec 31 2009, 12:18
Post #17





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



PL2XDLL.dll and libfftw3f-3.dll in main foobar folder, other .dlls in components folder

[edit] about converting, you have DSP window in processing tab of converter dialog

This post has been edited by 2E7AH: Dec 31 2009, 12:20
Go to the top of the page
+Quote Post
-Tiziano-
post Dec 31 2009, 15:13
Post #18





Group: Members
Posts: 23
Joined: 20-December 09
From: BelgiŽ
Member No.: 76179



QUOTE (2E7AH @ Dec 31 2009, 12:18) *
PL2XDLL.dll and libfftw3f-3.dll in main foobar folder, other .dlls in components folder

[edit] about converting, you have DSP window in processing tab of converter dialog


ok perfect ... but I don't find: PL2XDLL.dll blink.gif
Go to the top of the page
+Quote Post
lvqcl
post Dec 31 2009, 16:36
Post #19





Group: Developer
Posts: 3362
Joined: 2-December 07
Member No.: 49183



You need PL2XDLL.dll for foo_dsp_pl2, not for foo_dsp_downmix. But if you use foo_dsp_pl2, look here.
Go to the top of the page
+Quote Post
-Tiziano-
post Jan 1 2010, 20:32
Post #20





Group: Members
Posts: 23
Joined: 20-December 09
From: BelgiŽ
Member No.: 76179



Yep, thank you really very much

2E7AH has helped me to solve some little issue I had and now with Foobar2000 I'm able to get an interleaved 6 channels ( 5.1 ) .WAV ( AC3/DTS is the Foobar2000's library I use ) file, produced with Nuendo, and create a .WAV or .MP3 Pro Logic II encoded ! great !! It works really fine wink.gif

Now the following step, not yet solved, is:

How to get 7.1 encoded ( Pro Logic IIx ) instead of 5.1.

This is really the maximum to reach, I think ...




P.S. off-topic: I uploaded my Avatar but it's not appearing here yet ...

This post has been edited by -Tiziano-: Jan 1 2010, 20:32
Go to the top of the page
+Quote Post
2E7AH
post Jan 2 2010, 11:58
Post #21





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



Do you want to upmix or downmix?

You can use matrix mixer if you know the matrix for DPL IIx
If you don't know the matrix you can try with DPL II upmix to 5.1 and then use matrix mixer for other 2 channels, like this for example:


or use only matrix mixer with this matrix for example (that's for downmix, you should invert it for upmix)

That would be for fast encoding, and none of that has anything to do with DPL of course. Probably the best would be as you were doing with Nuendo, as here you can't change phase, or add delay, or do bend pass as DPL IIx is doing. And you'll need to have that information, or experiment with DPL IIx encoded file and try to distill something
Go to the top of the page
+Quote Post
-Tiziano-
post Jan 2 2010, 12:13
Post #22





Group: Members
Posts: 23
Joined: 20-December 09
From: BelgiŽ
Member No.: 76179



QUOTE (2E7AH @ Jan 2 2010, 11:58) *
Do you want to upmix or downmix?

You can use matrix mixer if you know the matrix for DPL IIx
If you don't know the matrix you can try with DPL II upmix to 5.1 and then use matrix mixer for other 2 channels, like this for example:


or use only matrix mixer with this matrix for example (that's for downmix, you should invert it for upmix)

That would be for fast encoding, and none of that has anything to do with DPL of course. Probably the best would be as you were doing with Nuendo, as here you can't change phase, or add delay, or do bend pass as DPL IIx is doing. And you'll need to have that information, or experiment with DPL IIx encoded file and try to distill something


The need is always downmix ( as I did with 5.1 to Stereo for stereo compatibility ) ... I supposed was something like this one you posted, but if I using this matrix, there is not any phase variation .. I cannot establish it in any manner with that mixer ... is that correct? I have to change it manually in Nuendo THEN to matrix with this ...

Answering to your question: unfortunately I have not clue in what manner 7.1 is encoded in PLIIx. I even asked to Dolby but I doubt to have any answer.

All the matrices I know, I got information here and from Wikipedia ... and even in Wikipedia there is not written the matrix for 7.1 sad.gif
Go to the top of the page
+Quote Post
2E7AH
post Jan 2 2010, 12:29
Post #23





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



OK, you can try with ffdshow and use downmix to DPL II. it will produce the wanted stereo effect I think
Go to the top of the page
+Quote Post
2E7AH
post Jan 2 2010, 19:55
Post #24





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



I tried downmixing 8ch with ffdshow Dolby Prologic II and this is the matrix


SL and SR aren't downmixed

The stereo effect is similar to what downmixer component from this thread is doing, so try it

CyberLink downmixes very differently: back and side channels are exclusively at corresponding front channels
Go to the top of the page
+Quote Post
-Tiziano-
post Jan 2 2010, 20:39
Post #25





Group: Members
Posts: 23
Joined: 20-December 09
From: BelgiŽ
Member No.: 76179



QUOTE (2E7AH @ Jan 2 2010, 19:55) *
I tried downmixing 8ch with ffdshow Dolby Prologic II and this is the matrix


SL and SR aren't downmixed

The stereo effect is similar to what downmixer component from this thread is doing, so try it

CyberLink downmixes very differently: back and side channels are exclusively at corresponding front channels


Ok perfect ... in this way the amplitudes' relationships among channels are respected, but what about the phase ? I mean: I have to anticipate 90į some signal and delay 90į etc ... in what manner can I do that with that mixer please ?

P.S. in order to avoid misunderstanding: I have to do the same thing I'm doing now with the plug-in AC3/DTS as we were talking in private message, but coding 8 channels ( 7.1 ) instead of 6 ( 5.1 ) )


( is ffdshow in you website I think ... is it correct ? or is that one please ? ffdshow on Sourceforge.net )

This post has been edited by -Tiziano-: Jan 2 2010, 20:44
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th August 2014 - 11:00