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.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st October 2002, 19:59   #1  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Besweet surround2 option effect

I am trying to understand the difference in the Besweet Surround and Surround2 options. I am aware that the later is supposed to be optimized for DPL2. I would like to understand a little more, what changes are done and why. I don't expect anyone telling me this at great length, but a link on a relevant page, article or whatever would be much appreciated.

TIA
ux-3
ux-3 is offline   Reply With Quote
Old 1st October 2002, 22:49   #2  |  Link
DSPguru
BeSweet Author
 
DSPguru's Avatar
 
Join Date: Oct 2001
Location: On top of a supercompact cardinal
Posts: 3,506
here we go..

Dolby Pro Logic (1 or 2 or whatever) is a decoding algorithm.
unlike in mp3/ogg/aac/etc', when the "brain" is mostly placed in the encoder, and each encoder has his own way of encoding audio samples into the mp3/etc format, and all mp3/etc decoders basicly does the very same thing. in Dolby Pro Logic (DPL), the brain is placed inside the decoder.

DPL decoder is about interpolating more than two channels out of a 2ch track. (like in a 2.0 --> 5.1 process).
the DPL/DPL2 implements an adaptive 2x5 matrix :
[Lt Rt]*MTX=[L R C SL SR LFE]'.
the left channel output, L, would be equal in this case to : Lt*MTX(1,1)+Rt*MTX(2,1).
(and so on for R,C,SL,..)

this matrix is adaptive, and that means that the coefficients changes from time to time, according to the input data.
the dpl algorithm doesn't "care" if the source is a dolby surround material or a plain stereo track.

let's think of this very primitive process with a statix dpl-like matrix.
given a 5.1 source L,R,C,SL,SR,LFE, we would create a 2ch downmixed track with channels Lt&Rt:
Lt=L+C+(SL+SR)
Rt=R+C-(SL+SR)
the (static) decoding process would look like :
Lr=Lt;
Rr=Rt;
Cr=(Lr+Lt)/2; [=L+C+(SL+SR)+R+C-(SL+SR)=L+R+C]
Sr=(Lr-Lt)/2; [=L+C+(SL+SR)-R-C+(SL+SR)=(L-R)/2+(SL+SR)]

creating Lt&Rt is principly what Dolby Surround Downmix is about, and creating Lr,Rr,Cr,Sr is principly what Dolby Pro Logic is about.


as mentioned before, the (adaptive) DPL algorithm can reproduce 4/5/6 channels out of ANY 2ch source, but in case the source was encoded as Dolby Surround, the decoded track would be very close to the original.

as you can now understand, Dolby Surround "encoding" is a very simple process of simply weighted summings of 5.0/5.1 channels into two channels.

as for DPL2 & Dolby Surround 2,
in Dolby Surround (1), we would sum the surround channels into one mono channel, and treat them just like in the example as "(SL+SR)", while in Dolby Surround 2 we would "help" DPL2 seperating them back by giving different weights to each channel. for instance :
Lt=L+C+SL+0.5*Sr
Rt=R+C-SR-0.5*Sl

that's it.


note : all above equations are only for demonstration! for the real downmix coefficients download BS_Downmix.dll from my webpage.
DSPguru is offline   Reply With Quote
Old 2nd October 2002, 01:52   #3  |  Link
kxy
Registered User
 
Join Date: Oct 2001
Posts: 343
Quite a detailed explanations there, DSPguru. Very insightful.
kxy is offline   Reply With Quote
Old 2nd October 2002, 16:09   #4  |  Link
pacohaas
Audio Moderator
 
Join Date: Oct 2001
Posts: 697
something to add to the Audio FAQ, you think?
__________________
{-n24-}
The Old Fair Use Homepage
pacohaas is offline   Reply With Quote
Old 2nd October 2002, 17:55   #5  |  Link
DSPguru
BeSweet Author
 
DSPguru's Avatar
 
Join Date: Oct 2001
Location: On top of a supercompact cardinal
Posts: 3,506
Quote:
Originally posted by pacohaas
something to add to the Audio FAQ, you think?
i think we should add a small section inside the faq with links to useful threads (+description for each).
DSPguru is offline   Reply With Quote
Old 3rd October 2002, 20:35   #6  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Well, first of all: thank you very much!

Second, could you please check the math for the formula for Cr and Sr, I suspect a typo in the first term. Second long term makes sense if one would use 0.5*(Lt + Rt) etc.

I also have difficulties to figure out the dpl2 formulae. You use SL and Sl in it (and SR, Sr). If this is supposed to be intentional, and if, what is that difference? If not, how would you get a channel selective decode? What formulae will preserve some more SR on the right rear channel etc. (Yes, I read the demonstration mode warning, but perhaps there is a simple model?)

So it all boils down to a bunch of linear transforms? I assume they operate in amplitude space?

You say the matrix is adaptive. What does it adapt to?
ux-3 is offline   Reply With Quote
Old 4th October 2002, 15:55   #7  |  Link
frank
Registered User
 
Join Date: Oct 2001
Location: Germany
Posts: 743
For Dolby Pro Logic Matrix decoding read my posting
BeSweet & Dolby Surround II Matrix

You'll not find much detailed information about DPL2 because Dolby handles it as company secret.

In Pro Logic II we set the amount of acoustic power of Rs (right surround) in Lt (left total) equal to the half of Ls (left surround). Or, Rs has a level of -3 dB referred to Ls. Same to Ls in Rt. Lt and Rt are the two encoded stereo channels.
(For acoustic power you have to square the levels!)
Code:
Lt = L + 0.707*C - 0.8165*Ls - 0.5774*Rs
Rt = R + 0.707*C + 0.5774*Ls + 0.8165*Rs
Now it's possible to generate a rear directional steering signal with an operational amplifier, computing Lt+Rt but eliminating L, R, C. The OA output

(Lt+Rt)' = 0.2391*(Rs - Ls)

is fed to a polarity splitter which controls the Ls, Rs output gain.
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.

Last edited by frank; 4th October 2002 at 16:43.
frank is offline   Reply With Quote
Old 4th October 2002, 16:46   #8  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Frank: Thanks a lot too. Very informative to say the least! I see that DPL uses rms Coefs - so we are talking about amplitude space.
Having read most of the linked thred, I wonder what I do from here?

So far I am using DVD2SVCD 1.09 b3. I downloaded the beta, but that was no fun to say the least. I found a post by DVD2SVCD himself on how to hack the current exe to allow a surround2 downmix setting. This is all I want to do, so I have no need for robshot inclusion.

I would also need to grab the latest besweet version (?), which implements your improved matrix and stick it into the folder DVD2SVCD uses. Can I get it (incl. the matrix) from DSPGurus site? I just downloaded something called BS_Downmix.zip. From the text file, it seems to address dsp2. I took a look at the sourcce code, which also looks exactly like the linear algebra stuff we've been talking about.

But now I am still clueless as to the actual procedure. It seems like grande voodoo if I stuff it all in the besweet folder and run the hacked dvd2svcd exe. The hack only replaces the string "stereo" with "surround2". Is this all it takes?

Don't feel obliged to tackle my problems though, eventually there will be an update. With my speed, it will be there before I get it figured out...
ux-3 is offline   Reply With Quote
Old 4th October 2002, 17:23   #9  |  Link
frank
Registered User
 
Join Date: Oct 2001
Location: Germany
Posts: 743
Sorry, I never used DVD2SVCD.
I use DVD2AVI, AviSynth, CCE/TMPGEnc, BeSweet, TSCV084 separately to create my SVCDs..

The latest BeSweet 1.4 has built-in the DPL2 downmix and all you need. You don't need the BS_downmix.dll. Download BeSweet 1.4 from doom9 or DSPGurus website.

DVD2SVCD must give the parameter (among other stuff) -s surround2 to BeSweet's command line, not -s stereo. That's all.

You can watch the difference of commandlines if used BeSweet with GUI.

A great problem is that actually the AC3 decoder Azid only can downmix Stereo and Surround. Surround II downmix is an external job of BeSweet after Azid's wav decoding.

Last edited by frank; 4th October 2002 at 17:39.
frank is offline   Reply With Quote
Old 5th October 2002, 09:41   #10  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Quote:
A great problem is that actually the AC3 decoder Azid only can downmix Stereo and Surround. Surround II downmix is an external job of BeSweet after Azid's wav decoding.
Sorry, but I don't understand this. What is the problem? What does this imply / mean? DVD2SVCD starts besweet at some stage, not azid as a standalone program...
ux-3 is offline   Reply With Quote
Old 5th October 2002, 09:47   #11  |  Link
frank
Registered User
 
Join Date: Oct 2001
Location: Germany
Posts: 743
Don't worry.
Azid & co. are the utilities used by BeSweet.
You only have to use BeSweet including the utilities as DLLs!
frank is offline   Reply With Quote
Old 5th October 2002, 11:39   #12  |  Link
DSPguru
BeSweet Author
 
DSPguru's Avatar
 
Join Date: Oct 2001
Location: On top of a supercompact cardinal
Posts: 3,506
search results

http://forum.doom9.org/showthread.php?s=&threadid=28321
http://forum.doom9.org/showthread.php?s=&threadid=28510
DSPguru is offline   Reply With Quote
Old 5th October 2002, 17:11   #13  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Thanks. As I said above, I already found the second thread, which explains how to hack dpl2 downmix into dvd2svcd. I guess I only stick the latest release of Besweet into the folder and give it another try. In fact, the other thread also looks familiar. Due to the unfortunate circumstance that search doesn't allow an isolated 2 as input, I had to read plenty of articles on surround...

Just in case I create a wrong impression: I have already done some encodes with the beta, but god only knows if the settings actually worked the way I intended it. DPL2 sounds nice, even if it works on plain stereo. So without elaborate tests, I wouldn't know success from failure anyway. I just started this thread to understand a little more what I want to do - In fact I am delighted about the simple transforms involved and I would now like to understand the adaptivity. Also this links well to my favorite topic of the past: encode stability in omega-space. This business of summing and differencing may be degraded by encoding this in the frequence domain. How much phase relations will survive this, especially at the high end?

Can't help but I look forward to buying a DVD Writer. Just take the original AC-3 and leave it that way...
ux-3 is offline   Reply With Quote
Old 6th October 2002, 20:32   #14  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
I have done a test encode with besweet 1.4 on surround2 setting. I am under the impression that the center speaker is very heavily used. I remember reading about someone claiming this to be a fault of besweets matrix and suggesting another one. I also remember that this problem was supposed to be fixed. I am using DVD2SVCD with default downmix amplitudes. I did not add any plugin into the besweet folder. Just grapped the last regular version from dspguru's site.
Here is the log:

BeSweet v1.4 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 10/05/02 , 18:41:31.

C:\Programme\DVD2SVCD\BeSweet\BeSweet.exe -core( -input D:\??????\Extracted_audio_1.ac3 -output D:\??????\Encoded_audio_1.mp2 -logfile D:\??????\Encoded_audio_1.log ) -azid( -L -3db -c normal -s surround2 -g max ) -ota( -d -288 ) -2lame( -e -b 192 -m s )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : D:\??????\Extracted_audio_1.ac3
[00:00:00:000] | Output: D:\??????\Encoded_audio_1.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:-288] +-------- AZID -------
[00:00:00:-288] | Input Channels Mode: 3/2, Bitrate: 448kbps
[00:00:00:-288] | Output Stereo mode: Dolby Surround 2 compatible
[00:00:00:-288] | Total Gain: 21.428dB, Compression: Normal
[00:00:00:-288] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:-288] | Center mix level: BSI
[00:00:00:-288] | Surround mix level: BSI
[00:00:00:-288] | Dialog normalization: No
[00:00:00:-288] | Rear channels filtering: No
[00:00:00:-288] | Source Sample-Rate: 48.0KHz
[00:00:00:-288] +------- MP2ENC ------
[00:00:00:-288] | Bitrate method : CBR
[00:00:00:-288] | MP2 bitrate : 192
[00:00:00:-288] | Channels Mode : Stereo
[00:00:00:-288] | Error Protection: Yes
[00:00:00:-288] +---------------------
[00:06:29:024] Conversion Completed !
[00:06:29:024] Actual Avg. Bitrate : 192kbps
[00:00:59:000] <-- Transcoding Duration
Logging ends : 10/05/02 , 18:42:30.
ux-3 is offline   Reply With Quote
Old 7th October 2002, 19:59   #15  |  Link
DSPguru
BeSweet Author
 
DSPguru's Avatar
 
Join Date: Oct 2001
Location: On top of a supercompact cardinal
Posts: 3,506
coefficients

#define FRONT_DS2 0.3225
#define CENTER_DS2 0.2280
#define REAR1_DS2 0.2633
#define REAR2_DS2 0.1862
DSPguru is offline   Reply With Quote
Old 8th October 2002, 08:12   #16  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Thanks for lending a hand, but unfortunately I can't jump that high...

What am I supposed to do with these? I just tried the resource hacker on the besweet.exe, but to no avail.

I also did a search on #define, and I found little. Perhaps I have to create a file in the besweet folder, which overrides the presets when besweet is executed?
ux-3 is offline   Reply With Quote
Old 9th October 2002, 17:37   #17  |  Link
frank
Registered User
 
Join Date: Oct 2001
Location: Germany
Posts: 743
Believe me, the DPL2 downmix in BeSweet 1.4 is ok.
Tested with software and hardware.
frank is offline   Reply With Quote
Old 10th October 2002, 11:17   #18  |  Link
ux-3
Registered User
 
Join Date: Mar 2002
Posts: 512
Well, I will. Perhaps I just stumbled upon a Movie which didn't have many surround sounds. When I did the first movie with the DVD2SVCD 1.10 beta and some besweet beta on surround2, I was quite pleased with the surround sound. I will just try another movie and see.
Thanks for your time...
ux-3 is offline   Reply With Quote
Old 30th October 2004, 20:10   #19  |  Link
chris_y2k_r1
Registered User
 
chris_y2k_r1's Avatar
 
Join Date: May 2003
Posts: 6
VCD?? No?

Is it possible to produce Dolby Surround with a VCD as well? Using Besweet/Azid and TMPGenc?

*BUMP* to the old thread
chris_y2k_r1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.