View Single Post
Old 9th March 2005, 23:01   #1  |  Link
malc0mn^CBK
Registered User
 
Join Date: Mar 2005
Posts: 3
DTS to AC3: your opinions on this guide

Hi al!!

It's me again. Just straigtened out a misunderstanding about my previous post with KpeX (thanks man!).

I'll explain the problem I had, to make the situation clear. I have a DTS only DVD but I have no DTS decoder. So I ripped the DTS track and wanted to properly encode it to AC3.
I started reading a lot of threads on this board and collected various bits of information (like SomeJoes excellent guide).
I studied the DTS an AC3 audio formats from info I could find on the net and on Doom9 and I found that both of them are mastered in a specific way. Remember that I'm specifically referring to DTS and AC3 tracks from movie DVD's, not from music or other DVD's.

I have written a guide, at first for myself, but since I learned a lot on Doom9, I thought it would be appropriate to post it here to aid people who might be in the same situation.

If I have made wrong conclusions or assumptions, please do correct me!

Here we go...

----------------------------------------------------------------------

Purpose
Convert a DTS stream to an AC3 stream with as little quality loss as possible.
Note 1: This method uses a lot of disk space, but it's the only reliable method I could piece together to compensate for the different channel mappings in DTS and AC3.
There is a special BeSweet.dll available that should solve the channel mapping problem, but since it's not that easy to find (nicely tucked away in the Doom9 forums since Feb 2k4), I used the DLL posted on DSPGuru's site.
Note 2: I have read in different sources that you should have the full registered version of WinDVD to pull this off. This seems untrue to me. I legally downloaded the trial version (v6) without registering. You don't even need to launch the program. Just install and follow this guide. I don't think using the trial version in this way is "illegal". Correct me if I'm wrong though!
Note 3: We'll be using Soft Encode to make the actual AC3 file because this way we can optimally use the procedure proposed by SomeJoe. As far as I can tell, ac3enc.dll still has the low volume issue without a decent workaround available (although the new AC3 Machine looked promising).
You can of course use an AC3 encoder a you see fit, as long as it supports the options explained in the first link of the "Reading" section.

Reason
I found loads of bits of information on and via this board but never a full guide (on DTS to AC3!) as there are so many others available here.
Maybe I missed the "full guides" and if so, I do not pretend to have invented this method, I merely pieced it together from other sources of information.

Reading
If you want to understand what you will be doing in step 3/4 where we get and set the AC3 encoder settings, then the following links are a must read:

1. http://forum.doom9.org/showthread.ph...0&pagenumber=1
2. http://www.hometheaterhifi.com/volum...on-6-2000.html

More info on the LFE channel:
3. http://206.225.87.49/volume_7_2/feat...pril-2000.html

Full guidelines on professional Dolby Digital encoding are here:
4. http://www.beussery.com/pdf/beussery.dolby.pdf

Credits
Credit where credit's due: the Doom9 community and all the authors of the used programs. People without whom this guide would not exist are DSPGuru, SomeJoe and Daphy.
Who am I? Does it matter?

Used progs
- WinDVD 6 Gold/Platinum
- Gabest DTS filters (listed in the download section as "DTS / AVI Filters") *
- azidts 0.1 *
- BeSweet DLL 1.5b23 *
- BeSplit 0.9b6 *
- Sonic Foundry Soft Ecnode 1.0
- Adobe Audition/CoolEdit

* You can get all of these programs in one go by using Daphy's BeSweet Installer.

Procedure
1. Open up a shell and cd to your azidts dir
1.1 Call azidts with the following parameters:
Code:
azidts -core( -input "<source>.dts" -output "<destination>-" -6chfloat -logfilea "<logfile>.log" )
This will crate six separate 32bit float wav files named
Code:
<destination>-<channelname>.wav
Note that the "-logfilea" parameter is of course optional.

1.2 The IVIAudio properties window will pop up. Select 6 speaker mode (5.1 channel) and No Vocal in order to get 6 mono wav files.


1.3 If azidts refuses to process your DTS file, then do the following:
open BeSliced (packaged with BeSplit 0.9b6) and drag and drop the DTS file on the window and select Fix File!. Now try step 1.1 again

2. Now we need to mux these mono wav files into one AC3 stream. We'll use Soft Encode for this, so start it up
2.1 Open the mono wav files in the following order: FL, FR, C, SR, LFE, SL.
It is absolutely imperative to respect this file ordering to get correct channel mappings in the resulting AC3 stream! (You can of course change the channel mapping after you've loaded the files, but the above order will immediately give you the right mapping.)
It seems that the BeSweet.dll 1.5b23 wrongly names the resulting mono wavs when converting from DTS (as reported several times in the forums here).

Here's what they should be like:
Code:
FL  -> correct
FR  -> C
C   -> FR
LFE -> SR
SL  -> LFE
SR  -> SL
If you don't want the hassle with the wrong channelmappings, you can always use the special BeSweet.dll (or use Daphy's BeSweet Installer) which fixes this problem.

2.2 You now have a graph of all your channels. If you have a true 5.1 movie mix, all of the dialog will be concentrated on the centre channel, as you should be able to see by looking at the graph. This will in most cases be so, since we started from a "movie" DTS to begin with.


3. Open up CoolEdit or Adobe Audition and load the centre channel wav file (named *-FR.wav)
3.1 Go to Analyze/Statistics. Abort the scan if it starts automatically.
3.2 In the RMS Settings section select 0dB = FS Sine Wave and check Account for DC. Leave the Window Size set to 50ms. I have tried increasing this value but other than the RMS calculation taking somewhat longer, it never truly changed the average RMS power. (For clarification of these settings, see "Additional comments" and read the first link in the "Reading" section.)


3.3 Recalculate the RMS values and note the Average RMS Power value. Mostly you will see this number floating around -27dB. That is because this is somewhat the "standard" value used in the movie industry to mix the dialogue to since it produces a natural level for conversation (read link 2 in the "Reading" section for more info on this). Also make a note of the DC Offset value.


4. Go back to Soft Encode and go to Options/Encode Settings...
4.1 Set Data Rate to 448kbps and check Auto for the sample rate.


4.2 Audio encoding mode should be 3:2 (L, C, R, l, r) with LFE enabled. Unless of course, your DTS source has a different channel setup.


4.3 Bit stream mode should be set to Main audio service: Complete main.
As we all know, you can add multiple elementary audio streams to one movie. One of them is always the "main mix". Others can be directors commentary, a stream with "augmented" dialogue for the hearing impaired and so on.
If you wish to encode a second stream, you can change this setting accordingly. It's just metadata and will not affect playback.
For a full explanation of the bit stream modes, read the fourth link (point 5.4.4) from the "reading" section.


4.4 Set the Dialogue normalisation to the number you noted in 3.3. This is by far the most important setting. If this one is wrong, the resulting AC3 file will not sound as it's supposed to. Read links 1 and 2 in the "Reading" section for clarification.


4.5 Intel byte order is not needed


4.6 In the Bit Stream tab, we see the centre and surround mix channels.
The values shown here will be used to down mix the centre and surround channels when they are not available on the playback system.
If you do not have a centre channel, then the centre channel will be down mixed by the value indicated in respect to the left and right channels. The same goes for the surround channels.
I recommend leaving them at -3dB, unless you feel that the resulting mix on a two channel system is not at all what you expect.


4.7 The copyright bit and original bit stream can be set as you please, this will not affect playback in any way.


4.8 The Info exists checkbox will allow you to add metadata about how the AC3 stream was mixed. The mix level can help the decoder to produce playback that is more consistent with the original mix. Room type is usually not used by the decoder, but might still be useful by other parts in the decoding chain.
Since we cannot tell how and where the original DTS mix was done, I recommend unchecking Info exists.


4.9 On the Preprocessing tab we have the Input filtering checkboxes.
Digital deemphasis will apply a de-emphasis filter on the encoded stream. This should only be used if an emphasis filter was applied on the source material. I doubt that this will be the case, unless you did that yourself or are encoding quite old material (in the beginning of the Audio CD, old recordings used emphasis to "enhance" the sound on the CD). I recommend leaving it unchecked.
DC high-pass filter is used to remove any DC offset that might be present in your source files. You should have spotted that in 3.3 if this is the case. For best results, leave this turned on. If there is an offset, it will be removed. If not, no harm done.
Bandwidth low-pass filter should be turned on. The cut-off frequency will be close to the Audio bandwidth you can see on the left.
LFE low-pass filter is not really needed when converting from DTS. DTS recommends cutting off the LFE at 80Hz and AC3 asks to do so at 120Hz. We can thus conclude that our LFE channel has nothing above 120Hz so we can safely turn off this filter.


4.10 The surround channel processing settings then.
90 degrees phase shift will apply a 90 degree phase shift to the surround channels, which is useful when the stream will be down mixed to two channels by the decoder. Since this option does not exist with a DTS encoder and thus was not used in the DTS stream we started with, I recommend always turning this on.
3 db attenuation will lower the surround channels by 3 db. When encoding an original cinema stream for home use (DVD distribution etc.) this is useful because the surround channels in a cinema mix are usually mixed 3 db "too high" to compensate for cinema amplifier gains. This feature is also available in DTS encoders, so we can be pretty sure that it was applied when encoding our DTS stream for DVD distribution if the mixer did a proper job (unless your DTS stream came from a different source).
I'd say it's safe to turn it off. No need to lower the surround channels twice!


4.11 The compression characteristics relevant to us are Film: Standard, which is recommended for most movies, and Film: Light, which you can use if you want a little more range.
If you have a blasting action movie with a lot of explosions etc, you might want to choose "Standard". Light might be better for a more "quiet" movie without such extremes as mentioned before. I mostly go for Standard.
The "null band" (in which no audio modification takes place) is 10 dB for Standard and 20 dB for Light.
A full explanation of the options can be found in link four (point 4.2.2) in the "Reading" section.
Turning off the DRC is only useful if you have pre-limited material which already falls within an acceptable range for home theatre playback.
RF overmodulation protection is only valid if you will use the stream for broadcasting purposes. For DVD mastering we do not need this at all!
The two small graphs show the area (in red) in which no alteration of the sound will take place. All of the dialog should be in this area with the dialogue normalization as its centre point.


4.12 The final tab is of no use to us at all, so leave everything turned off.
4.13 Hit OK and go to File/Save As... to start encoding.


Additional comments
1. Step 3.2, options explained (from the manual):

0dB = FS Sine Wave sets the dB level of the RMS settings to correspond to a full-scale sine wave (where peak amplitude is at 0 dB, using every sample value in the 16-bit range).
=> We need that to comply with the Dolby dbFS logic (see first link in the "Reading" section)
0dB = FS Square Wave sets the dB level of the RMS settings to correspond to a full-scale square wave, where peak amplitude is about 3.02 dB louder than a full-scale sine wave.

Account For DC subtracts any DC offset to achieve the most accurate RMS values.
=> We want to be as accurate as we can get

Window Width specifies the number of milliseconds in each RMS window. A selected range contains a series of such windows, which Adobe Audition averages to calculate the Minimum RMS and Maximum RMS values. To achieve the most accurate RMS values, use wide windows for audio with a wide dynamic range, and narrow windows for audio with a narrow dynamic range.

2. Maven3D.com must have aquired Soft Encode and incorporates it in their "Maven 3D Pro" suite. Take a look at the product page:
http://maven3d.com/en/features.asp?PID=1#ID401
Specifically check the AC3 encoder. I'm just guessing here, but I find it pretty apparent!

So if you like Soft Encode and would like a "newer version" (and you may take that very lightly) then this might be something to check out. Demo versions are available for download.
__________________
"...the rest are details." -- Albert Einstein

Last edited by malc0mn^CBK; 11th March 2005 at 14:48.
malc0mn^CBK is offline   Reply With Quote