IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Lame and surround
Fr4nz
post Aug 6 2003, 12:45
Post #1





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



Hi guys. I've read many past threads about Lame and encoding movies soundtracks from AC3 to Dolby Surround1/2. While many people claim that Lame preserves the phase informations thanks to its safe joint stereo mode, in this thread http://www.hydrogenaudio.org/forums/index....t=0&#entry47454 it's stated that only at very high bitrates (for e.g. --alt-preset extreme or insane(!!)) Lame can conserve surround infos in a decent way.

Anyway i've encoded lots of movie soundtracks with Lame, and the --alt-preset standard setting seems quite good to me for surround1/2 tracks.

Thanks for any answer!

Fr4nz
Go to the top of the page
+Quote Post
sld
post Aug 6 2003, 13:17
Post #2





Group: Members
Posts: 1016
Joined: 4-March 03
From: Singapore
Member No.: 5312



Pardon me, but did you ask a question?
Go to the top of the page
+Quote Post
Fr4nz
post Aug 6 2003, 13:21
Post #3





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



Yes, sorry for my english dry.gif
The question would be: is LAME good at --alt-preset standard if you want to encode a movie soundtrack in Dolby Surround 1/2?
Go to the top of the page
+Quote Post
TrNSZ
post Aug 6 2003, 14:20
Post #4





Group: Developer
Posts: 717
Joined: 25-September 01
From: ... The Studio
Member No.: 20



What do you mean by Dolby Surround? If you are speaking of files that are hinted for the Dolby Pro Logic technology, then using --alt-preset standard should be adequate for most samples to preserve most imaging, but I would certaintly recommend using "extreme" for the extra headroom.

I can remember back to when the r3mix preset was being moved to use VBR MTRH method, and there was some testing of Pro Logic encoded with LAME MP3. I believe it was found that the rear channels had definate weirdness when nssafejoint (nsmsfix=1.0) wasn't used. Keep in mind that was a non-scientific test done ages ago that wouldn't fly around HA nowadays without some real testing.
Go to the top of the page
+Quote Post
Fr4nz
post Aug 6 2003, 14:32
Post #5





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



QUOTE (TrNSZ @ Aug 6 2003, 05:20 AM)
What do you mean by Dolby Surround?  If you are speaking of files that are hinted for the Dolby Pro Logic technology, then using --alt-preset standard should be adequate for most samples to preserve most imaging, but I would certaintly recommend using "extreme" for the extra headroom.

I can remember back to when the r3mix preset was being moved to use VBR MTRH method, and there was some testing of Pro Logic encoded with LAME MP3.  I believe it was found that the rear channels had definate weirdness when nssafejoint (nsmsfix=1.0) wasn't used.  Keep in mind that was a non-scientific test done ages ago that wouldn't fly around HA nowadays without some real testing.

I'm speaking about AC3->MP3 process done via Besweet using the latest Lame DLL (3.93.1)

This post has been edited by Fr4nz: Aug 6 2003, 14:32
Go to the top of the page
+Quote Post
smok3
post Aug 6 2003, 14:37
Post #6


A/V Moderator


Group: Moderator
Posts: 1726
Joined: 30-April 02
From: Slovenia
Member No.: 1922



i remember the thread on HA where someone was testing different encoders and how they 'preserve' the pro-logic info and found quite some problems with it, but imho pro-logic should be preserved without any problems even if you dump the track onto old analog tape or use any lossy encoder with any settings.

This post has been edited by smok3: Aug 6 2003, 14:38


--------------------
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung
Go to the top of the page
+Quote Post
2Bdecided
post Aug 6 2003, 14:43
Post #7


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



I've always wondered about these two threads:

http://www.hydrogenaudio.org/forums/index....t=0&#entry47454
and
http://www.hydrogenaudio.org/forums/index....=ST&f=11&t=4109

because I had a brief look at this issue during my PhD, and found that it was a huge issue for some encoders, and not for others. I couldn't believe that our favourite encoders (i.e. lame --alt-preset standard, and mpc standard a/k/a --quality 5) could have such problems.

However, I've just tried the same kinds of testing as atom, and have found similar results.

If you listen carefully (and actually create the test sample yourself, and listen to front and surround at once, rather than just the surround on its own) you can figure out what's happening...

We have two channels of information, Left and Right. These can be transformed to Mid (or Sum) and Side (or Difference). These M and S channels can be encoded instead of the original L and R channels when joint stereo encoding is enabled, though the encoder still has the choice of encoding straight L and R if it wishes. Also, the encoder can trade bits between L and R, or M and S as it wishes - so, for a mono signal, S gets no bits.

Of course, M is the same as the centre channel in Dolby Stereo, and S is similar to the surround channel. In Pro Logic decoders, the signal is actively steered between the channels, so if the decoder detects that most of the signal should be going to the surround channel, it cuts off the front left, centre, and right channels - this stops the surround info also being present in the front Left and Right channels - a problem with the older passive Dolby Stereo decoding.


Both lame and Musepack have a problem at the "standard" settings where ever both the front and surround channels carry high frequency information simultaneously. I'm guessing at the psychoacoustic calculations that are involved, but where the out-of-phase components are significantly quieter than (i.e. masked by) the in-phase components, they are dumped.

This makes sense from a psychoacoustic point of view, and (as we know) works perfectly for stereo reproduction. The problem is that the surround decoding process takes the out-of-phase signal component, and moves it behind you. The in-phase signal component that was masking it is now unable to do so. (I found that spatial unmasking was about 15dB for coding noise moved 90 degrees away from the original signal).

Accepting that you won't actually listen to the surround channel in isolation, the coding artefacts are bad enough that they are audible when listening to all channels at once using a typical surround system. I'm judging this by knowing the level of artefacts that are needed to be audible in this context, and comparing it to the level of artefacts I'm now hearing listening via headphones - I haven't verified it using a real surround sound system. But I'm willing to bet that it's true, especially for people who have their surround speakers closer than their front speakers, and don't compensate.

The 8kHz bandwidth on Dolby Pro Logic will help to hide the problem, but the problem goes down to 4kHz, and DPL2 doesn't have this bandwidth limitation.


Now, this result holds when you make an intentionally difficult signal yourself by combining various signals. So why do people encoding movies not encounter serious problems - after all, they're often only using 128kbps!!! Well, because of the steering in Dolby Pro-logic decoders, it's important that the dominant sound source only comes from one direction at once, otherwise they'll be no effective steering. So, in a movie sound track, there shouldn't be an instance where there's significant high frequency info from both the front and surround channels.

If the movie producer wants the sound to come from all around (subtle ambience), then I'd guess the surround has to be loud enough to prevent the steering from shutting it off. So it's possible that, when the mp3 or mpc encoder does destroy the surround channel, the pro-logic encoder has shut it off anyway, and where the pro-logic encoder has left all channels open, there's enough information in each channel that none of it is "masked", and hence none of it is discarded by the encoder.

This assumption may work pretty well for movies, and a dolby decoder. It will probably break for music, which isn't specially encoded to cause a DPL encoder to steer the signal, but can have any relative levels of in-phase and out-of-phase information. It will probably break for an arbitrary dematrix operation (e.g. Logic7, DPL2) which is trying to extract subtle ambient info from "stereo" sources.



In short: Movie sound tracks will probably be OK, but there will almost certainly be instances where music will not be.

Cheers,
David.

P.S. Would it be possible to adapt the lame or musepack psychoacoustic model to perform masking calculations on L, R, M, and S rather than just one pair of them? It would increase the bitrate, but make any stereo source dematrix safe.

EDIT: sorry this is so long - there have been three posts while I was typing this!!!

EDIT 2: Months later, I edited this post to remove all the repeats which were added within the text when it was originally posted by a forum bug (which has since been fixed). I don't normally return to old posts and "correct" them, but I wanted to link to this, and found it unreadable. All the comments below about a long and repeating post were referring to the original "damaged" version.

This post has been edited by 2Bdecided: Dec 8 2003, 10:54
Go to the top of the page
+Quote Post
Fr4nz
post Aug 6 2003, 15:00
Post #8





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



Lol you're post is a little fucked up but I understood it. yes it could be a good idea to make a preset for surround 1 || 2 tracks...let's hope that someone of the lame developers takes it into consideration.
Go to the top of the page
+Quote Post
Lev
post Aug 6 2003, 15:10
Post #9





Group: Members
Posts: 524
Joined: 7-November 02
From: Gloucester, UK
Member No.: 3716



QUOTE
EDIT: sorry this is so long - there have been three posts while I was typing this!!!

I was going to ask why all your posts are so bl00dy long, but this time I actually bothered to read it, and realised : Its a couple of central themes repeated a few times smile.gif

Nothing technical to add, m'lord


--------------------
http://www.megalev.co.uk
Go to the top of the page
+Quote Post
Gabriel
post Aug 6 2003, 15:23
Post #10


LAME developer


Group: Developer
Posts: 2950
Joined: 1-October 01
From: Nanterre, France
Member No.: 138



David, your post would probably be more understandable with a little editing...
Go to the top of the page
+Quote Post
CiTay
post Aug 6 2003, 15:37
Post #11


Administrator


Group: Admin
Posts: 2378
Joined: 22-September 01
Member No.: 3



QUOTE (Gabriel @ Aug 6 2003, 04:23 PM)
David, your post would probably be more understandable with a little editing...

It's not his fault, it's a bug in Invisionboard 1.2 RC1 and/or the way it's set up here. I will have to post a warning on the portal or something... this happens with most long posts these days...
Go to the top of the page
+Quote Post
TrNSZ
post Aug 6 2003, 16:02
Post #12





Group: Developer
Posts: 717
Joined: 25-September 01
From: ... The Studio
Member No.: 20



Yeah, it's the board formatting causing the error, but the post is readable if you sit down and work with it. =)

@2Bdecided: Have you determined if nssafejoint (i.e. nsmsfix = 1.0) improves the situation with these tracks?
Go to the top of the page
+Quote Post
2Bdecided
post Aug 6 2003, 17:08
Post #13


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



QUOTE (TrNSZ @ Aug 6 2003, 03:02 PM)
Yeah, it's the board formatting causing the error, but the post is readable if you sit down and work with it. =)

@2Bdecided: Have you determined if nssafejoint (i.e. nsmsfix = 1.0) improves the situation with these tracks?

Excellent idea!

Just tried it. Yes, huge improvement. I wouldn't swear that the surround channel, listened to on its own is transparent - but it may be, and it's certainly more than good enough to be used as a surround channel with the other channels playing from speakers in the same room.

--aps: average: 220.1 kbps LR: 153 (36.96%) MS: 261 (63.04%)
--aps --nsmsfix 1.0: average: 245.1 kbps LR: 368 (88.89%) MS: 46 (11.11%)


Is adding --nsmsfix 1.0 going to reduce the transparency (i.e. add or increase artefacts) for some signals?

I know the similar approach (ms 15) for mpc won't cause any problems - but mpc doesn't have a hard upper bitrate limit, whereas mp3 does; we know mp3 runs out of bits (or uses them badly!) sometimes already.

Cheers,
David.
Go to the top of the page
+Quote Post
Fr4nz
post Aug 6 2003, 17:51
Post #14





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



If I remember well --alt-presets uses nssafejoint option....or I am wrong?
Go to the top of the page
+Quote Post
TrNSZ
post Aug 6 2003, 17:56
Post #15





Group: Developer
Posts: 717
Joined: 25-September 01
From: ... The Studio
Member No.: 20



I recall having a similar discussion on the r3mix board a very long time with Dibrom after I released the first patch for tuning nsmsfix on the command line. All of Dibrom's alt-presets already have a dynamic tuned nsmsfix value set if I remember correctly.

By increasing nsmsfix to nssafejoint (nsmsfix = 1.0) more bits will be used because simply to encode frames as stereo, so you might lose some quality since those bits would surely (??) be better used encoding the signal normally with more joint frames in most places, I assume.

Just so everyone knows and doesn't get any ideas, I wouldn't recommend this as a general quality improvement to the alt-presets by any means. IMHO it has proven itself with audible transparency on most natural audio signals for the majority of the public. Leave it alone unless your tweaking a special case such as encoding artificial signals.

I guess an interesting test would be to listen to the output of the surround from aps and aps nssafejoint. If this can be ABX'd, then I think it would be smart to ABX alt-preset extreme vs. alt-preset standard + nssafejoint. The bitrates will probably be very similar; the real test is to increase the quality of the "surround" channel without degrading the rest of the signal below the level of audible transparency. Maybe someone else can define a better test methodology -- I've been up for two days now and might not be thinking straight. =)

This post has been edited by TrNSZ: Aug 6 2003, 17:59
Go to the top of the page
+Quote Post
kxy
post Aug 6 2003, 18:41
Post #16





Group: Members
Posts: 67
Joined: 1-October 01
Member No.: 149



QUOTE (Fr4nz @ Aug 6 2003, 08:00 AM)
Lol you're post is a little fucked up but I understood it.

I don't think his post is fucked up. I appreciate it all the time he spent writing it up and word it without any tech jargons. So a layman can understand it.

Thank for all your post 2Bdecided, and I had learn a lot from you. smile.gif
Go to the top of the page
+Quote Post
Fr4nz
post Aug 6 2003, 18:54
Post #17





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



QUOTE (kxy @ Aug 6 2003, 09:41 AM)
QUOTE (Fr4nz @ Aug 6 2003, 08:00 AM)
Lol you're post is a little fucked up but I understood it.

I don't think his post is fucked up. I appreciate it all the time he spent writing it up and word it without any tech jargons. So a layman can understand it.

Thank for all your post 2Bdecided, and I had learn a lot from you. smile.gif

You really didn't understand what I meaned...his post is fucked up because of the numerous repetitions (caused by a forum bug).
Go to the top of the page
+Quote Post
Fr4nz
post Aug 7 2003, 09:05
Post #18





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



So guys --nsmsfix 1.0 is the way to go for encoding surround tracks?
Go to the top of the page
+Quote Post
2Bdecided
post Aug 7 2003, 10:42
Post #19


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



QUOTE (Fr4nz @ Aug 7 2003, 08:05 AM)
So guys --nsmsfix 1.0 is the way to go for encoding surround tracks?

Well, maybe, but you missed three points:

1. In a movie soundtrack intended for Dolby Pro-logic decoding, it's unlikely that you will find the combinations of sounds which cause a problem. That's just my guess though, and it's only a guess. This discussion should be shared with doom9 to get some experts on board!

2. --nsmsfix 1.0 might make things worse elsewhere. Again, that's a guess - I'm not trying to give answers in this post - I'm trying to get other people to test this, and those involved to remember what the issues were when this was tweaked.

3. I'm still not sure it's a 100% solution for the most serious surround problems. It sounds fine to me, but I don't have a propper surround system to test it on, and there are people with better ears here. What I can see it doing to the surround channel in spectral view makes me suspect that there may well be some audible problems remaining.


I'll ask again - is it possible to make lame (or mpc) view the Side channel as a real channel, and perform psychoacoustic calculations on it; rather than viewing it as something that can be dumped? That would be much better than an nsmsfix hack in lame, or than using ms 15 in mpc. I'm happy to help with the algorithm (but not the coding!) because I think some of the spatial masking measurements I made in 1999 might be a good starting point.

Cheers,
David.
Go to the top of the page
+Quote Post
Fr4nz
post Aug 7 2003, 11:19
Post #20





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



QUOTE (TrNSZ @ Aug 6 2003, 08:56 AM)
II guess an interesting test would be to listen to the output of the surround from aps and aps nssafejoint.  If this can be ABX'd, then I think it would be smart to ABX alt-preset extreme vs. alt-preset standard + nssafejoint.  The bitrates will probably be very similar; the real test is to increase the quality of the "surround" channel without degrading the rest of the signal below the level of audible transparency.  Maybe someone else can define a better test methodology -- I've been up for two days now and might not be thinking straight. =)

I encoded an AC3 sample from matrix with --aps --nsmsfix 1.0 and --ape

--aps --nsmsfix 1.0 gave me ~198kbps

--ape gave me 242kbps!!!

So there's a great difference in terms of kbits between these 2 modes.

It would be nice to have a preset optimized for surround tracks like 2BDecided suggests smile.gif
Go to the top of the page
+Quote Post
2Bdecided
post Aug 8 2003, 13:33
Post #21


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



I've had an email from Frank. He asked 6 sensible questions...

1. What piece of music is affected?
2. What Dolby Surround Prologic or Dolby Surround Prologic II decoder is used?
3. In the case of Dolby Surround Prologic II: Music or Movie mode?
4. Delay for the rear channels?
5. Distance difference between front and rear speakers? ||front - listener|| -
||rear - listener||
6. What type of loudspreakers are used?


I tried listening via speakers, sending the "centre" channel to a speaker infront of me, and the "surround" channel to a speaker behind me. A poor man's experimental surround system, if you like.

Despite the obvious problems present in the surround channel when auditioned on its own, I can't hear any problems with it when replayed over speakers at the same time as the centre channel.

OK - I can hear problems if I put my ear quite close to the surround speaker - but with both speakers equidistant, the distortion in the surround channel is totally inaudible.


I emailed Frank to tell him this (I'm sure he already knows!!!) but asked, since he once had a braindead profile for people who insist on judging codecs by spectral analysis (i.e. the wrong way), maybe it would be worth his time adding a switch to preserve the surround channel for people who insist of judging codecs by listening to the surround channel in isolation (i.e. the wrong way!).


In the mean time, if anyone can find a sample which gives audible artefacts using a real surround decoder and sensible speaker placement, I think Frank might be interested.

Cheers,
David.
Go to the top of the page
+Quote Post
Fr4nz
post Aug 8 2003, 13:45
Post #22





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



David you're totally right. If I put my ears next to surround loudspeakers I can hear evident artifacts, but if I listen to all the loudspeakers the sound is perfect.

Try also this: put your ears next to the right/left loudspeaker, you should hear artifacts also there smile.gif
Go to the top of the page
+Quote Post
Fr4nz
post Aug 10 2003, 11:04
Post #23





Group: Members
Posts: 102
Joined: 30-June 03
From: Venice (yeah, city of the gondola!!)
Member No.: 7470



David are you alive?? I'm waiting for a PM reply from you! wink.gif
Go to the top of the page
+Quote Post

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: 26th July 2014 - 17:26