IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
LAME MP3 - CBR, VBR, and channel mode options
Trinket
post Jun 22 2013, 04:56
Post #1





Group: Members
Posts: 8
Joined: 7-June 13
Member No.: 108530



Hi everyone,

I've been delving a bit into LAME MP3 encoding options lately and had some specific questions about different combinations of encoding options.

When using Dual Mono mode with CBR encoding, I found it pretty easy to understand what this does. On a CBR 320 encode you basically get 160kbps on each channel as the bitrate it set and the channels are separate.

I noticed you can also encode using VBR and Dual Mono mode. Since it's been hard for me to find much (understandable) documentation on some of these options and combination of options, I thought I would ask the community here if anyone can shed some light on how the aforementioned VBR->Dual Mono actually works in the sense of how bitrate gets calculated over the channels.

I encoded a track using the following settings: -m d -V 0 -q 0 -lowpass 22.1 -- (so this is Dual Mono mode). When I did this, MediaInfo tells me I got an average bitrate of 292 Kbps. When I did an encode of the same track but used Joint Stereo mode instead, the file size of the (75mb) track was maybe 40kb bigger than the Dual Mono encoded track, so negligible, and the average bitrate is also 292kbps. OK, so one can encode in VBR and Dual Mono; at first I did not realize this as not that many frontends for LAME even feature the Dual Mono option, but I see now this is possible. Perhaps I was mixing up my understanding of VBR with Joint Stereo. So am I correct to assume that if I use VBR and Dual Mono, that basically VBR still calculates (via its psycho-acoustic model) what the required bit-density of any given passage in a track is, but in Dual Mono mode does this separately on each channel? Is that a good way of thinking about it? Perhaps VBR does this anyway, but with Joint Stereo mode it's actually JS doing its own thing despite of VBR or CBR or what have you? Does that sound reasonable? Any comments or insights anyone might have, please share, because I have more questions that I'm not even sure how to formulate yet and any insights will definitely help.

The Dual Mono mode is not one I actively use, but I would like to have a better understanding of all encoding options. I do have some binaural tracks that I have considered encoding in Dual Mono mode due to its absolute separation of L + R channels, although when I did detailed spectral analyses (and listening tests) of a Joint Stereo encoded MP3 I could not detect any mixing of L + R channels either, and I think this helped my mind getting firm in considering the idea that 'Joint Stereo degrades binaural beats tracks' as myth. Still, I would like to form a better understanding of the various encoding modes and methods.

Thanks in advance for any comments or insights biggrin.gif

This post has been edited by Trinket: Jun 22 2013, 04:58
Go to the top of the page
+Quote Post
slks
post Jun 22 2013, 08:24
Post #2





Group: Members
Posts: 426
Joined: 31-March 06
From: Houston, Texas
Member No.: 29046



For a real binaural recording (as in, a field recording done with 2 mics simulating human ears) the encoder is probably using L+R for most of all the frames anyway, since the channels differ significantly.

The thing with joint stereo, it doesn't force left/right or mid/side encoding. It lets the encoder choose what's best dynamically based on the source signal. If there's no correlation between the channels, you'll get a file that's mostly L+R. Take a mono mix of a song, and you'll get a file where every frame is M+S. Without changing any encoder settings.

There was a program - MP3EncSpot I think it was - that let you view the percentage of left-right frames and the percentage of mid-side frames in an MP3. With "normal" music where some instruments are center, some are to the side, you'll see a mix. For special cases like binaural recordings I would expect the balance to heavily favor l+r frames.


--------------------
http://www.last.fm/user/sls/
Go to the top of the page
+Quote Post
Trinket
post Jun 22 2013, 08:41
Post #3





Group: Members
Posts: 8
Joined: 7-June 13
Member No.: 108530



Thanks for the reply, slks.

Ah yes, binaural recordings, now that you mention it I remember I came across nature sound recordings a long time ago done with a human head dummy with mics for ears. Thanks for refreshing my memory, but I was actually thinking about the binaural beat tracks (brainwave entrainment), where different tones are coming (via headphones) into each ear. So for example there may be a 100hz tone in the left ear, and a 104hz tone in the right ear, which makes for a difference of 4hz. For such entrainment to be effective a division of left + right channels is essential. From my spectral analysis and listening test it seems Joint Stereo has no adverse effect on such tones, but I can't say I understand it completely from the LAME MP3 point of view and Joint Stereo, etc.

I'll check out that program you mentioned. Looks from your location we're only 2 hours apart (well, by car that is).

This post has been edited by Trinket: Jun 22 2013, 08:42
Go to the top of the page
+Quote Post
[JAZ]
post Jun 22 2013, 13:05
Post #4





Group: Members
Posts: 1797
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



Do not use Dual Mono.
Generally you won't find decoders that play it as mono, but Dual Mono is exactly that: two mono channels, originally intended as "Dual" in the sense used in TV. : Language A and Language B. (So, choosing one or the other).

I do not believe that you got the same bitrate encoding in Dual mono than in Joint Stereo. Like the documentation says, dual mono is used as two independent signals, so encoding separetely each as a mono stream but stored inside a single file. This means that the bitrate is exactly half for each.

When using simple stereo, the bitrate is shared for both left and right, so one channel can use more bitrate in a specific passage than the other.
You will have a situation similar to dual mono just when the two channels are the same (as in mono) or when the signal is similar in both channels in terms of energy (so, with very similar bitrate requirements).

Lastly, Joint stereo, when using the Mid/Side encoding, is able to use much more bitrate for Mid than side. (The more mono it is, the smaller side can be).


So for your scenario to be possible, the signal should be sufficiently different to not use Mid/Side, but sufficiently "equal" to have very similar bitrate requirements for both channels.

The only other reason for the difference to be so small is that your final bitrate is 292, and there only exists 256 and 320 kbps packets, so it cannot fluctuate much.
But if you were to encode a common stereo song, I am sure the differences would be much more important.



Btw: On a side note: Even if you tell the encoder to "not use a lowpass" (setting it above half the sampling rate), That will not prevent it from removing content when it finds it "useless" in the context of audibility (ATH, etc...).
Go to the top of the page
+Quote Post
Trinket
post Jun 22 2013, 15:38
Post #5





Group: Members
Posts: 8
Joined: 7-June 13
Member No.: 108530



Thanks for the reply, JAZ.

QUOTE
I do not believe that you got the same bitrate encoding in Dual mono than in Joint Stereo.

Yes, I think because it was done in Dual Mono, the bitrate is actually half for the 'whole track' as it were.

QUOTE
So for your scenario to be possible, the signal should be sufficiently different to not use Mid/Side, but sufficiently "equal" to have very similar bitrate requirements for both channels.

Very well put, that helps wrap the idea up, yes.

QUOTE
The only other reason for the difference to be so small is that your final bitrate is 292, and there only exists 256 and 320 kbps packets, so it cannot fluctuate much.

Does what you say there mean that there are only 256 and 320 packets available in MP3 encoding (ever)? So when it fluctuates in VBR, it really only fluctuates as either 256 or 320 (nothing in between)?

QUOTE
But if you were to encode a common stereo song, I am sure the differences would be much more important.

What exactly do you mean by this?

QUOTE
Btw: On a side note: Even if you tell the encoder to "not use a lowpass" (setting it above half the sampling rate), That will not prevent it from removing content when it finds it "useless" in the context of audibility (ATH, etc...).

Thanks for the info. Is there something about the encoding options I used/mentioned that made you say that, or is that just a FYI? I did not set a lowpass but I did notice the -lowpass 22.1 part when checking the MP3 with MediaInfo, so I guess the frontends I had been using did this (which were dBpoweramp 14.4 and Lame Frontend 1.8).

This post has been edited by Trinket: Jun 22 2013, 15:39
Go to the top of the page
+Quote Post
db1989
post Jun 22 2013, 16:07
Post #6





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (Trinket @ Jun 22 2013, 15:38) *
QUOTE
The only other reason for the difference to be so small is that your final bitrate is 292, and there only exists 256 and 320 kbps packets, so it cannot fluctuate much.
Does what you say there mean that there are only 256 and 320 packets available in MP3 encoding (ever)? So when it fluctuates in VBR, it really only fluctuates as either 256 or 320 (nothing in between)?
He means there are only those two sizes of frames at that high end of the scale. There are plenty sizes available below those: 224, 192, 160, 128, 96, 80, 64, 56, 48, 40, and 32 kbps. Reference: http://id3.org/mp3Frame

This post has been edited by db1989: Jun 22 2013, 16:10
Go to the top of the page
+Quote Post
Trinket
post Jun 22 2013, 16:16
Post #7





Group: Members
Posts: 8
Joined: 7-June 13
Member No.: 108530



Thanks, db1989, and thanks for the useful link!
Go to the top of the page
+Quote Post
[JAZ]
post Jun 23 2013, 10:35
Post #8





Group: Members
Posts: 1797
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



db1989 answered about the bitrates.

About the other two questions, I meant that I expect that a common stereo song would have a bigger difference in bitrate usage between dual mono and joint stereo (as a consequence that it would use more mid/side frames and as such, require less bitrate for the same quality).

And about the setting, yes, I meant the lowpass switch. If you didn't write it explicitely, maybe it is a frontend, or maybe is mediainfo that guesses it from the V setting. (I think that recently V0 was allowed to use all the frequency bandwitdth, but I haven't kept up to date about that)
Go to the top of the page
+Quote Post
Trinket
post Jun 23 2013, 18:01
Post #9





Group: Members
Posts: 8
Joined: 7-June 13
Member No.: 108530



QUOTE ([JAZ] @ Jun 23 2013, 10:35) *

db1989 answered about the bitrates.

About the other two questions, I meant that I expect that a common stereo song would have a bigger difference in bitrate usage between dual mono and joint stereo (as a consequence that it would use more mid/side frames and as such, require less bitrate for the same quality).

Thanks for the clarification, JAZ.

The binaural tracks I was interested in encoding may have up to 10 frequency pairs (like 100 and 104hz being one), and those are just tones, nothing overly complex. And those are all contained within the 50hz to 1000hz spectrum and are well defined. All the other audio (including pink noise modulations, or sometimes music, etc.) are not different between L + R (meaning they don't have a difference in frequency between channels applied to them as far as binaural beat goes). So but for the binaural tones (few in number) the rest of the tracks are pretty much common stereo tracks, as it were.

QUOTE ([JAZ] @ Jun 23 2013, 10:35) *
And about the setting, yes, I meant the lowpass switch. If you didn't write it explicitely, maybe it is a frontend, or maybe is mediainfo that guesses it from the V setting. (I think that recently V0 was allowed to use all the frequency bandwitdth, but I haven't kept up to date about that)

I'm seeing such a lowpass mentioned by MediaInfo with all frontends (as far as I can remember) I've tried so far, which include dBpoweramp, TAudioConverter, Lame Front-End, and others. So they're either all adding that in or it is MediaInfo. I like the MediaInfo Lite version as it's clean and to the point (http://codecguide.com/download_other.htm is a good place to get it) but there may be better apps out there for that but I'm not familiar with them.
Go to the top of the page
+Quote Post
DVDdoug
post Jun 24 2013, 22:31
Post #10





Group: Members
Posts: 2712
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



QUOTE (Trinket @ Jun 21 2013, 20:56) *
I could not detect any mixing of L + R channels either...
I think you might misunderstand how joint stereo works. It does mix the left & right channels, but in a completely reversable* way.

M/S encoding (mid/side) takes the existing two left & right channels and creates two new channels, a L+R chanel and a L-R channel. You just as easily reverse the M/S encoding and get your original separate stereo channels back. i.e. (L+R) - (L-R)/2 = R and (L+R) + (L-R)/2 = L.

This is not a new idea and it can be done in analog. It has always been used in FM stereo broadcast for mono compatibility long ... An old mono FM radio can receive the L+R signal and won't decode L-R signal.

MP3 benefits from M/S encoding if there is lots of information in the L+R channel and little information in the L-R channel. It only has to encode the common information once, and it can use most of the bits encoding the L+R channel and very-few bits encoding the L-R channel. That allows higher-quality or a lower bitrate.





* Of course after lossy compression, it's not mathematically reversable and you can never get your original bytes back.

Go to the top of the page
+Quote Post
db1989
post Jun 25 2013, 00:01
Post #11





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Yes, the encoding process for mid/side stereo, which is what we tend to mean when we use the term joint stereo, is mathematically lossless. It is a key part of lossless encoders too. In lossy compression, all it does is to promote efficient encoding of stereo frames when the two channels are largely similar (and hence mid has a large value while side has a small one).

I suspect that mistakenly thinking the opposite is why many people seem to have an aversion to joint stereo, imagining that it constricts the soundstage and whatnot. In some cases, this is probably due to people confusing mid/side stereo with intensity stereo, which, by some definitions, can fall under the umbrella of joint stereo. In others, the cause is most likely just fear, uncertainty, and doubt, in classic ’phool style.

This post has been edited by db1989: Jun 25 2013, 00:06
Go to the top of the page
+Quote Post
saratoga
post Jun 25 2013, 01:56
Post #12





Group: Members
Posts: 5154
Joined: 2-September 02
Member No.: 3264



QUOTE (Trinket @ Jun 22 2013, 03:41) *
So for example there may be a 100hz tone in the left ear, and a 104hz tone in the right ear, which makes for a difference of 4hz. For such entrainment to be effective a division of left + right channels is essential. From my spectral analysis and listening test it seems Joint Stereo has no adverse effect on such tones, but I can't say I understand it completely from the LAME MP3 point of view and Joint Stereo, etc.


If you care about precise control over the frequency content of tones, you may want to consider a lossless format.
Go to the top of the page
+Quote Post
pdq
post Jun 25 2013, 14:29
Post #13





Group: Members
Posts: 3450
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (saratoga @ Jun 24 2013, 20:56) *
QUOTE (Trinket @ Jun 22 2013, 03:41) *
So for example there may be a 100hz tone in the left ear, and a 104hz tone in the right ear, which makes for a difference of 4hz. For such entrainment to be effective a division of left + right channels is essential. From my spectral analysis and listening test it seems Joint Stereo has no adverse effect on such tones, but I can't say I understand it completely from the LAME MP3 point of view and Joint Stereo, etc.


If you care about precise control over the frequency content of tones, you may want to consider a lossless format.

In fact, shouldn't lossless compression be highly efficient for pure sine waves, maybe even better than lossy?
Go to the top of the page
+Quote Post
pdq
post Jun 25 2013, 14:33
Post #14





Group: Members
Posts: 3450
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (Trinket @ Jun 22 2013, 03:41) *
So for example there may be a 100hz tone in the left ear, and a 104hz tone in the right ear, which makes for a difference of 4hz. For such entrainment to be effective a division of left + right channels is essential. From my spectral analysis and listening test it seems Joint Stereo has no adverse effect on such tones, but I can't say I understand it completely from the LAME MP3 point of view and Joint Stereo, etc.

Joint stereo will have no adverse effect in this situation because unless the two channels have enough similarity to merit mid/side encoding, all frames will be encoded as left/right anyway. Your left and right channels have no such similarity, so it would make no difference whether you use joint stereo or not.
Go to the top of the page
+Quote Post

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

 



RSS Lo-Fi Version Time is now: 21st December 2014 - 22:12