Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
24th June 2002, 23:39 | #1 | Link | |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
The Dolby Surround Pro Logic II Matrix
BeSweet 1.4b7 has a plugin that can downmix DS2 audio tracks. In newer versions this downmix is built-in. But the downmix has heavy bugs, centre channel C sounds 16 dB louder than L, R! I searched the internet for the right downmix matrix but no success.
In this thread I'll explain the technics and derive the right DS2 downmix matrix parameters. Basics of Dolby Pro Logic are published on http://www.dolby.com Dolby Surround Pro Logic II (DS2) Quote:
Downmix matrix In Pro Logic the rear channels Ls, Rs are stored as ONE mono surround signal S with symmetrical amounts into the stereo wave. In DS2 the rears Ls, Rs are stored with DIFFERENT amount of levels. That's the trick! The new feedback-design allows to steer the gain of Ls, Rs. Pro Logic Code:
Lt = 1.0*L + 0.707*C - 0.707*Ls - 0.707*Rs left-total Rt = 1.0*R + 0.707*C + 0.707*Ls + 0.707*Rs right-total Pro Logic II We set the amount of acoustic power of Rs in Lt equal to the half of Ls. Or, Rs has a level of -3 dB referred to Ls. Same to Ls in Rt. The total power sum of each channel L, R, C, Ls, Rs equals 1. For acoustic power we must square! a*a*Ls*Ls + 2*a*a*Rs*Rs = 1 max levels = 1 a*a + 2*a*a = 1 --> a*a = 1/3 = 0.3333 --> a = 0.5774 --> 2*a*a = 2/3 = 0.6666 = b*b --> b = 0.8165 Code:
Lt = 1.0*L + 0.707*C - 0.8165*Ls - 0.5774*Rs Rt = 1.0*R + 0.707*C + 0.5774*Ls + 0.8165*Rs (Lt+Rt)' = 0.2391*(Rs - Ls) is fed to a polarity splitter which will control Ls, Rs outputs. If amount of Rs < Ls then output will be negative for left directional dominance, and if Rs > Ls the output will be positive for right directional dominance. So far to the principle of operation, in reality the Pro Logic II decoder is much more complicated. The actual coefficients used must be scaled downwards to prevent arithmetic overflow. The sum of unscaled coefficients is 1 + 0.707 + 0.8165 + 0.5774 = 3.101 All coefficients must be multiplied by 1/3.101 = 0.3225 Downwards scaling by -9.8 dB. That means the DS2 downmix has an attenuation of -9.8 dB. The probability of overflow is very small. You should start a 1-step decoding with a static gain of +9.8 dB. The resulting dialog level will be unchanged in this case. Important: For downmix you ever have to use DRC because more acoustic power will be concentrated in less channels! Pro Logic II with LFE (Not recommended by Dolby) Code:
Lt = 1.0*L + 0.707*C + 0.707*LFE - 0.8165*Ls - 0.5774*Rs Rt = 1.0*R + 0.707*C + 0.707*LFE + 0.5774*Ls + 0.8165*Rs Downwards scaling by -11.6 dB. Because of the small overflow probability and low LFE level it is sufficient to work with -9.8 dB scaling from above. Last edited by frank; 2nd July 2002 at 16:58. |
|
25th June 2002, 00:49 | #2 | Link |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Compiling BeSweet Plugin - Help wanted
Here comes the corrected DS2 BeeSweet plugin.
Please help compile, I don't have MS C++. With Besweet 1.4b7 you can test the plugin. The following BeeSweet versions until b11 include the buggy version. Debugged source BS_downmix.c from DSPGuru in the next thread. Corrected downmix matrix: Code:
{ // l,c,r,sl,sr,lfe buffer[j] =buffer[i++]* 0.3225; // fl. -> l. buffer[j] +=buffer[i] * 0.2280; // c. -3db -> l. buffer[j+1] =buffer[i++]* 0.2280; // c. -3dB -> r. buffer[j+1]+=buffer[i++]* 0.3225; // fr. -> r. buffer[j] +=buffer[i] *-0.2633; // sl -1.76dB -> l. buffer[j+1]+=buffer[i++]* 0.1862; // sl -4.77dB -> r. buffer[j] +=buffer[i] *-0.1862; // sr -4.77dB -> l. buffer[j+1]+=buffer[i++]* 0.2633; // sr -1.76dB -> r. Last edited by frank; 25th June 2002 at 01:15. |
25th June 2002, 04:55 | #4 | Link |
BeSweet Author
Join Date: Oct 2001
Location: On top of a supercompact cardinal
Posts: 3,506
|
frank's matrix had been integrated into beta12.
didn't debug it. post your comments.
__________________
FAQs : BeSweet, Audio :readfaq: Homepage : DSPguru's Webpage http://dspguru.notrace.dk/cs.gif Guides : Multilingual Guides of my tools http://dspguru.notrace.dk/1zhelp.gif |
25th June 2002, 11:12 | #5 | Link |
Registered User
Join Date: Oct 2001
Location: England
Posts: 19
|
Brilliant work frank It works great now. I had a quick look at the source myself but it would've taken me ages to figure it all out. Thanks.
For completeness' sake here is a shot of my test file downmixed with your new matrix. (It is zoomed not normalised ) I have written to cyberlink asking why DS2 encoded wav/mp3 files don't work in PoerDVD but AC3 files do. Am not holding my breath though! |
25th June 2002, 13:26 | #6 | Link |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Thanks for the quick help DSPGuru, trg100. I'm very pleased.
trg100, your tests show an issue on BeSweet's LFE level. I'm missing the -3 dB attenuation to each track. The LFE level must be equal to the centre. Did you set Azid's LFE downmix parameters right? (-3db into L,R) Or, is there another issue in BeSweet? BeSweet does the LFE downmix prior the matrix. Please verify. Last edited by frank; 25th June 2002 at 13:36. |
25th June 2002, 14:10 | #7 | Link |
Registered User
Join Date: Oct 2001
Location: England
Posts: 19
|
Ooops
You're quite right frank. I had specified -L 0db. I had rerun the test with -L -3db and updated the picture. The LFE channel is now equal in voume to the centre channel
To be honest I wasn't exactly sure why the -3db was necessary but I notice HeadAC3he does it automatically. I've added another picture (8) which shows that the transitions are not perfectly smooth. I wonder if this is due to the Dolby Digital compression. |
25th June 2002, 15:21 | #8 | Link |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Yeah! Now I can sleep well.
The constant signal power for all reproduced channels is maintained now. C and LFE are splitted in two parts with half of the power. Means -3 db level attenuation if you don't want any power change. The decoder sums the two parts back into ONE channel! LFE is a small bandwith low bass channel. Greater signal raising time and delaying. I think these artifacts come from Dolby compression and aren't audible at this low frequencies. For downmixing is no need to mix the LFE if the AC-3 tracks are right mastered - Dolby says. 5ch into 2ch mix is a consumer adaption. And which consumer has a separated active subwoofer (30 cm loudspeakers)? Very expensive technics, needed by THX systems only. But this HiFi fans normally use 5.1 audio. Last edited by frank; 26th June 2002 at 09:37. |
27th June 2002, 07:05 | #11 | Link |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
v1.4b12: DS2 has more attenuation
I compared transcoding to WAVs (no floating point).
1) DS2 downmix is fully compliant to DS . Sounds equal on my DS receiver if the rear filter was disabled on DS (less muffled sound in the rears). 2) Now DS2 downmix has additional -4...-5 dB attenuation compared with DS and old versions! I've tested with +11.7 dB static gain to DS and 9.8 dB to DS2. There should be same results. I think that comes from Azid's different operating modes (2/0 vs. 3/2) and the implementation in BeSweet. More tests are running to this issue. Regards frank |
27th June 2002, 23:11 | #12 | Link |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Test results
Latest test results of transcoding AC-3 5.1 49 min
-27 dB dialog level, DRC normal Gain to maintain dialog level (compensation of downmix attenuation) BeSweet 1.4B12 DS +11.7 dB DS2 +14.5 dB (6+8.5, LFE included ) headAC3he +10 dB Last edited by frank; 5th July 2002 at 12:10. |
28th June 2002, 08:56 | #13 | Link | |
BeSweet Author
Join Date: Oct 2001
Location: On top of a supercompact cardinal
Posts: 3,506
|
Re: Test results
Quote:
__________________
FAQs : BeSweet, Audio :readfaq: Homepage : DSPguru's Webpage http://dspguru.notrace.dk/cs.gif Guides : Multilingual Guides of my tools http://dspguru.notrace.dk/1zhelp.gif |
|
28th June 2002, 09:08 | #14 | Link |
Registered User
Join Date: Feb 2002
Posts: 35
|
Frank, I had tried to play your mp3 file with PowerDVD4 (with Dolby Pro Logic2 enabled).
It works, I hear the sound in the rear speakers. But how can I play the same file in DS2 in OGG format? PowerDVD4 doesn't accept OGG file format. |
29th June 2002, 09:05 | #19 | Link | |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Final DS2 test results
Quote:
But the commandline I used at DS2 was "d:\DVD\AudioTools\BeSweet\BeSweet.exe" -core( -input "i:\test\kiss1 AC3 T01 3_2ch 448Kbps DELAY 0ms.ac3" -output "i:\test\test-ds2.wav" -2ch ) -azid( -s surround2 -c normal -g 6db -L -3db ) -ota( -g 8.5db ) -ssrc( --rate 44100 ) The tests included LFE. Following tests without splitted gain and without LFE brought the expected results. LFE ( -L -3 dB ) reduced the sound level about -4.4 dB!! That's wrong, in Azid's 2/0 downmix matrix that reduction is only -1.78 dB. DS2 +10 dB setting as ota gain compensates the matrix attenuation (equal to the theory). Same results as headAC3he. ... -output "i:\test\test-ds2.wav" -2ch ) -azid( -s surround2 -c normal ) <<<<< or -L 0 (not 0db!) -ota( -g 10db ) ... BeSweet has ~6dB lower bit noise at lowest sound levels than headAC3he. Measured with CEpro2. Last edited by frank; 29th June 2002 at 19:12. |
|
30th June 2002, 16:21 | #20 | Link |
Registered User
Join Date: Oct 2001
Location: England
Posts: 19
|
fiorettoe: What sounds card/speaker setup are you using to play back frank's file? Does the DS2 channel mapping works correctly with powerDVD? On my 4 channel SBlive it is messed up unless I reencode to a 2.0 AC3. PowerDVD and WinDVD 4 are the only payers with DPL2 I know of so there's nothing that can playback DS2 oggs as far as I know.
|
Thread Tools | Search this Thread |
Display Modes | |
|
|