RAVEN the Elemental
Nov 8 2003, 03:57
I tried to use LAME 3.90.2 with the --alt preset switch and i found that it encodes in Joint-Stereo mode. How come? Because it is said to make the highest-quality files, and I don't believe you can retain quality by downsampling high frequencies to mono.
Later I used Vorbis (in Stereo mode) and with quality 6 and it made a smaller file which sounded better, and was in Stereo.
Why does LAME use Joint-Stereo all the time?
Thanks
Hi RAVEN, welcome to Hydrogenaudio.
One important goal of this place is to provide knowledge. To reach this goal, it's necessary to collect proven facts and to keep opinions out. Because of this there's rule # 8 in the
Terms of Service:
QUOTE
8. Statements on technical or quality oriented matters are expected to be supported by the author responsible for such statements
You have violated this rule with this:
QUOTE(RAVEN the Elemental @ Nov 8 2003, 11:57 AM)
Later I used Vorbis (in Stereo mode) and with quality 6 and it made a smaller file which sounded better, and was in Stereo.
Supporting this statement would consist of the following steps:
- Perform double-blind (=ABX) listening tests (original vs. mp3 AND original vs. ogg - you CAN do mp3 vs. ogg
additionally but this isn't necessary) and post the results here
- If you've ABX'ed successfully, post a losslessly compressed sample (< 30 seconds) in upload forum and
- give a detailed description of
-- what encoder/settings you used
-- what hardware was used (soundcard etc.)
-- where exactly in the sample you hear a difference
-- what exactly does the difference sound like
For details (ABX software etc.) the FAQ.
Cheers tigre
QUOTE(RAVEN the Elemental @ Nov 8 2003, 05:57 PM)
...and I don't believe you can retain quality by downsampling high frequencies to mono.
Please do read the links provided in the earlier posts. These 3 terms 'Joint Stereo', 'downsampling high frequencies' and 'mono' are
totally unrelated to each other in this context.
Mike Giacomelli
Nov 9 2003, 00:35
QUOTE
tried to use LAME 3.90.2 with the --alt preset switch and i found that it encodes in Joint-Stereo mode. How come? Because it is said to make the highest-quality files, and I don't believe you can retain quality by downsampling high frequencies to mono.
joint stereo = a form of stereo. Hence the name joint
stereo. Stereo is not related to high frequencies. Joint Stereo is not related to downsampleing. In fact none of the things you mentioned have anything to do with one another
QUOTE
Later I used Vorbis (in Stereo mode) and with quality 6 and it made a smaller file which sounded better, and was in Stereo.
q6 uses joint stereo AFAIK, just like LAME.
QUOTE
Why does LAME use Joint-Stereo all the time?
It doesn't. Neither does APS. Joint stereo in APS is used when it is needed, full stereo is used the rest of the time.
You seem to think joint stereo is lower quality then full stereo, however this is not the case.
QUOTE(Mike Giacomelli @ Nov 9 2003, 07:35 AM)
joint stereo = a form of stereo. Hence the name joint
stereo. Stereo is not related to high frequencies. Joint Stereo is not related to downsampleing. In fact none of the things you mentioned have anything to do with one another
q6 uses joint stereo AFAIK, just like LAME.
It doesn't. Neither does APS. Joint stereo in APS is used when it is needed, full stereo is used the rest of the time.
You seem to think joint stereo is lower quality then full stereo, however this is not the case.
The terms are somewhat confusing. Intensity stereo (which lame can't do at the moment) works similar to what he described above.
Are you sure about Vorbis q6? Last I heard was that it only uses lossless stereo coupling.
As far as I know lame aps, ape and api all use what is called joint stereo. It usually means that it can choose between using mid/side stereo and left/right stereo on a per block basis. Left/right stereo is the one people usually refer to with the term full stereo.
Is the original poster actually reading the responses?
Sebastian Mares
Nov 9 2003, 06:41
First of all, Joint Stereo has nothing to do with mono or high frequencies. Joint Stereo (in Mid/Side Stereo mode) will create a Middle channel and a Side channel.
Let us say you have a stereo file with the following channel values (applies to one sample):
Right = 59
Left = 44
Mid/Side stereo encoding used in LAME will do the following thing:
Middle = (Right + Left) / 2 = (59 + 44) / 2 = 51,5
Side = (Right - Left) / 2 = (59 - 44) / 2 = 7,5
When the decoder plays (decodes) the file, it will recreate the left / right channels using the following formula:
Right = Middle + Side = 51,5 + 7,5 = 59
Left = Middle - Side = 51,5 - 7,5 = 44
As you can see, the original stereo sound will be reproduced. When the difference between the left and the right channel is too big, LAME will switch from Mid/Side Stereo to Simple Stereo. LAME will apply this changes per frame.
You could use a program like EncSpot to see the distribution of the channel mode in the file.
Also, radios and TVs use Joint Stereo to transmit stereo signals.
Sebastian Mares
Nov 9 2003, 06:45
Small addition:
You should distinguish between Mid/Side Stereo which is (almost) lossless (rounding errors can occur, but they are not noticeable) and Intensity Stereo (LAME doesn't support that as far as I know) which will simply cut the values, which are not relevant.
RAVEN the Elemental
Nov 9 2003, 15:42
I apologise if I have violated any directions on this forum.
Just forget about my post... I guess I should read a lot more about these things.
Mike Giacomelli
Nov 9 2003, 20:06
Its fine, as long as you're willing to read up you'll fit in. The rules are just to avoid stupid fanboays and trolls from wasteing people's time.
Gabriel
Nov 10 2003, 02:10
QUOTE
Are you sure about Vorbis q6? Last I heard was that it only uses lossless stereo coupling.
"lossless stereo coupling" means joint stereo.
Sebastian Mares
Nov 10 2003, 05:49
Off Topic: Is it true that AAC can switch between the various Joint Stereo types per sample (rather than per frame)?
Gabriel
Nov 10 2003, 07:22
QUOTE
Is it true that AAC can switch between the various Joint Stereo types per sample (rather than per frame)?
It can switch per scalefactor band.
See:
http://www.mp3-tech.org/content/?Mp3%20Limitations
Sebastian Mares
Nov 10 2003, 07:26
QUOTE(Gabriel @ Nov 10 2003, 02:22 PM)
QUOTE
Is it true that AAC can switch between the various Joint Stereo types per sample (rather than per frame)?
It can switch per scalefactor band.
See:
http://www.mp3-tech.org/content/?Mp3%20Limitations I think the link is broken... Mozilla keeps telling me that it cannot connect and IE throws out a 404.
Gabriel
Nov 10 2003, 07:36
works here...
RAVEN the Elemental
Nov 10 2003, 14:53
QUOTE(Mike Giacomelli @ Nov 9 2003, 06:06 PM)
Its fine, as long as you're willing to read up you'll fit in. The rules are just to avoid stupid fanboays and trolls from wasteing people's time.
OK, thanks.
BTW, can you guys give me a few directives on what to study? I mean, where can I find some basics?
ViPER1313
Nov 10 2003, 16:33
erm,
"joint stereo" is not so perfect as suggested here by most.
Though, "lossless stereo coupling" is perfect.
For joint stereo it depends on bitrates invested in the mid and the side channels.
To save bitrate, joint stereo is a lossy stereo mode, opposite to lossless stereo coupling.
( Of course, "joint stereo" can be made lossless, but that is not case in Lame iirc.
In lame, you call the lossless stereo "stereo", the lossy stereo mode "joint stereo".
Nevertheless, Lame offers a good joint stereo mode, especially in aps and higher.
If one would use stereo in mp3/lame, he would introduce way more annoying problems to the sound. )
Otherwise you would not need to have 2 names for the 2 frame types, or use both methods, eg. in api, still.
If "joint stereo" would work lossless, you could use it all the time, even in api, and invest saved bitrate in other problems.
sven_Bent
Nov 12 2003, 03:20
QUOTE(user @ Nov 12 2003, 09:58 AM)
erm,
"joint stereo" is not so perfect as suggested here by most.
Though, "lossless stereo coupling" is perfect.
For joint stereo it depends on bitrates invested in the mid and the side channels.
To save bitrate, joint stereo is a lossy stereo mode, opposite to lossless stereo coupling.
( Of course, "joint stereo" can be made lossless, but that is not case in Lame iirc.
In lame, you call the lossless stereo "stereo", the lossy stereo mode "joint stereo".
Nevertheless, Lame offers a good joint stereo mode, especially in aps and higher.
If one would use stereo in mp3/lame, he would introduce way more annoying problems to the sound. )
Otherwise you would not need to have 2 names for the 2 frame types, or use both methods, eg. in api, still.
If "joint stereo" would work lossless, you could use it all the time, even in api, and invest saved bitrate in other problems.
i belive therr is some nsffix parameter that adjust how much lossy/lossles the lame M/S joint stereoe image is.
You can esayli make a lossless joinst stereo in lame, but it would eat away bits to encode the sound and you would probaly have alot of artifatcs.
The AP's are very tuned wit join stereo so you have the the best you can get...
Also i believe that stereo just can adjust bitrates for the 2 channel individually and dont have anything joint. (e.g. a 160kbits file kan have 100kbits for right and 60 for left)
And that dual channel gives halv bitrate for each channel (80kbits to each channel in 160kbits file)
but i could be wrong as I'm no lame developer
yep, you are right, sven.
The nsfix parameter offered a kind of treshhold, when lame decides to use eitehr stereo mode, or joint stereo mode.
also correct the thing about dual channel.
Well, as short result to get the best out of mp3/lame, for each bitrate,
we got the --alt-presets.
So, simply apply them...
eltoder
Nov 12 2003, 03:33
QUOTE(user @ Nov 12 2003, 02:58 PM)
erm,
"joint stereo" is not so perfect as suggested here by most.
Though, "lossless stereo coupling" is perfect.
Nope.
IIRC, "loseless stereo coupling" is very close to MS stereo. So, it's not any better than joint stereo used in mp3.
Previous stereo modes in vorbis reject some phase information, so they are close to IS stereo. But they are better in that you can choose how much phase information to loose.
-Eugene
Gabriel
Nov 12 2003, 06:13
Lame is using Mid/Side stereo as joint stereo. This is lossless, and is similar to "loseless stereo coupling". What is lossy is the following quantization, not the l/r->m/s transform.
There is another joint stereo mode available in mp3, and this one is lossy: intensity stereo. This is similar to the "point stereo" used in Vorbis.
Right now, Lame only uses m/s stereo.
well, if the transformation stereo to mid/side channels is lossless, so is not the later on encoded information by lame, as as result less bitrate is distributed to the side channels, which leads to sacrifizing some stereo information compared to full stereo mode at same bitrate (but wins bitrate for improving sound compared to full stereo bitrate at given bitrate).
is this description right ?
sven_Bent
Nov 12 2003, 06:54
QUOTE(user @ Nov 12 2003, 01:30 PM)
well, if the transformation stereo to mid/side channels is lossless, so is not the later on encoded information by lame, as as result less bitrate is distributed to the side channels, which leads to sacrifizing some stereo information compared to full stereo mode at same bitrate (but wins bitrate for improving sound compared to full stereo bitrate at given bitrate).
is this description right ?
yuo are gettign the idea of tweaking :-)
but to end it all --alt-preset are tweaked over months(years?). Contains some internal source code tweaking.
Testet but numberous of people over numbeours og samples.
So you should consider it the most qualitywise safe way to encode.
anything add would probaly decrease quality (99% likehod) ore enhance for the given sample but reduce quality on other samples (0.99% likehod) .
the LAst 0.001% liekhodd is that you actuat make an enhancement that goes over more then one sample
Sample=tracks..whatever
gazzyk1ns
Nov 12 2003, 08:22
QUOTE(Gabriel @ Nov 12 2003, 04:13 AM)
Lame is using Mid/Side stereo as joint stereo. This is lossless <snip>
Right now, Lame only uses m/s stereo.
Hi Gabriel,
I was wondering if you could clear something up for me. About a year (possibly longer) ago, I read either on here or on the r3mix forums that LAME could use two types of joint stereo. One was the standard type, which was slightly imperfect in some situations, and the other was lossless. I think they called it "--nssafejoint"... which sounds like a switch to add when you're using joint stereo. They said that this was the mode the presets used, to achieve lossless joing stereo.
Now, I've read practically every discussion on this topic in the last 6 months, so I'm not worried about the quality of my MP3s, as I'm using the presets. However, I was just interested in this issue... is there a slight difference between the joint stereo mode which the presets use, and the joint stereo that can be specified by simply using the "-m j" switch? Or were they just unsure of what they were talking about? Sounds like they could have been getting mixed up with the difference between "-m j" and "-m f"?
Thanks...
no, nssafejoint is not a joint stereo mode, nssafejoint is switch inside the joint stereo mode.
nssafejoint is a switch, one of several possible msfix switches, as I wrote above, it defines a level of treshold, when from stereo mode lame switches to mid/side mode or vice versa.
API uses nssafejoint as level to decide, when stereo, when m/s frames are used (even in api u find some mid7side frames).
APE, APS and other lower bitrate alt-presets have own levels (=msfix values), when stereo, when m/s frames are used.
Even at 128 kbit. --alt-preset 128, there are some stereo mode frames, not mid/side all the time.
Please recall:
Joint stereo mode in lame means:
Lame decides: sometimes stereo mode, sometimes mid/side mode.
nssafejoint, msfix:
values, tresholds, which determine, when stereo or mid/side modes kick in.
Gabriel
Nov 12 2003, 08:42
The difference between nssafejoint and older mode is mainly in the decision criterion, in order to decide when to use m/s and when to use l/r.
--nssafejoint is an alias for --nsmsfix 1
Here's some explanation what it actually does:
http://www.hydrogenaudio.org/forums/index....indpost&p=63414
gazzyk1ns
Nov 12 2003, 09:02
Thanks you three.
User, I wasn't sure about what msfix and nssafejoint were, so thanks... but I still have the same basic problem - maybe my question was unclear.
We have discussed numerous times on here that LAME's Joint Stereo is lossless, I've not got a problem understanding that. I also understand that Joint stereo means switching between "full" (l/r) stereo, and mid/side stereo.
However, as User and Gabriel just confirmed... there is a threshold involved with joint stereo, i.e. when to use m/s and when to use l/r.
What I don't understand is how something that is apparently always 100% lossless can have a threshold. What exactly is happening when the threshold is altered... from what I understand, the lower the bitrate, the more m/s frames are used in order to allocate more bits to other areas, where they are more needed; then conversely, in high bitrate files, more l/r frames are used because the bits aren't needed elsewhere.
There is a contradiction there, if joint stereo is lossless then why allocate more l/r frames in high bitrate files? Surely if it's already a lossless process then this is pointless? Or you could look at it the other way round - surely if, in a low bitrate (128) MP3, LAME's joint stereo always allocates mostly m/s frames no matter what the "situation" is with the stereo image of the track... then surely the process must be lossy to some degree?
You find the answer to your question in my posts in this thread from beginning, as this was nearly buried , but interesting knowledge to myself.
well, I am more into mpc and lossless these days, but still I use mp3 for my DVdplayer and the portable.
We have figured out, thanks to gabriel,
that:
* the first step of mid/side transformation is lossless.
* the clue, why mid7side is preferred to lower target bitrates:
there is a different bitrate distributiuon, allocation to the mid- (more bitrate) and the side- channel (less bitrate).
So in the end at low bitrates, it is not anymore a lossless procedure, as you have to encode to lossy at quite low bitrates usually.
btw., if you would go stereo mode only, let's take as example at 128k low bitrate, then there will be a lot losses, too, as only 64k per channel are possible.
gazzyk1ns
Nov 12 2003, 09:23
EDIT: Just read your previous posts to the thread as you recommended, User... hehe I skipped most of the first page because I knew the answer to the original question(s).
Right, that clears things up a bit - joint stereo is not lossless at low bitrates, but as the file is going to be poor anyway, it's only sensible to take some bits away from the joint stereo process... so they can be allocated where they are needed more.
Still, you said there that --api has a different joint stereo threshold to --aps/--ape... this again seems illogical as I specifically remember Dibrom saying that none of the three compromised on stereo in the slightest.
Pio2001
Nov 12 2003, 17:07
QUOTE(user @ Nov 12 2003, 01:30 PM)
well, if the transformation stereo to mid/side channels is lossless, so is not the later on encoded information by lame,
I don't understand the distinction between lossless stereo and lossy stereo.
You seem to imply that below a given threshold, the process is no more lossless and becomes lossy, but if I refer to the quote above, the process is always lossless during the channel handling, and always lossy after...
It seems to me that it is like saying that "MPC is lossless above quality 7". How can something be lossless in a lossy file ?
If I decode the MP3 file and substract left from right, will I get the same thing, bit for bit, as if I do it with the original wav ?
Gabriel
Nov 13 2003, 02:20
QUOTE
You seem to imply that below a given threshold, the process is no more lossless and becomes lossy, but if I refer to the quote above, the process is always lossless during the channel handling, and always lossy after...
Exactly. Both the "lossless stereo" from Vorbis and m/s from mp3 are lossless process. Both codecs are lossy and including a lossy quantization step after this transform. So in both case, the final result is lossy.
gazzyk1ns
Nov 13 2003, 06:45
Right... so the way I did understand it was that the stereo image was not altered in any way. MP3 is lossy and so the quality of the audio is inferior, but the "channel differences", whether the two channels are 100% the same or 100% different (or somewhere in between), remain untouched. In the VBR presets, anyway.
Or, is it as simple as the fact that I don't understand quantisation - i.e. it is impossible to have a lossless stereo mode within an encoder which always uses quantisation? Because as I say, my assumption was that whilst obviously the quality of audio incurred a loss, the two channels could remain the same.
I would just leave this alone and/or read up, putting it down to my lack of understanding but I remember Dibrom saying "The VBR presets do not compromise the stereo image at all" or something almost exactly the same, in a thread not so long ago. Where two LAME developers appear to contradict each other, I think it would be interesting for everyone to have a clear answer.
That's probably not Dibrom's exact quote and of course I don't want to misquote him... maybe someone remembers the post? It was longinsh, and after someone started a thread similar to this one. He began by saying something like "Right, just to clear this up once and for all..."
Sebastian Mares
Nov 13 2003, 06:49
Gabriel, in fact, Mid/Side channel coding has a minimal loss - rounding errors.
sven_Bent
Nov 13 2003, 07:09
to put this in non-developer talk
The M/S is lossless.. but how to use the bitrate for encoding is lossy
kinda like this
Original/full stereo:
right = 892
left = 825
M/S joint stereo
Middle (r+l)/2 = 858,5
Side (r-l)2 = 33,5
Sofar the convestion is lossless
But now coms the next step - bit allocation as we only have a given bitrate thing are going to be discard... Which its then lossy.
Lets say we only got 5 ciffer bitrate
JS could discard the .5 part and have the values M=858 & S=33 that would en up being
Rigt M+S = 891
Left M-S = 825
Going from 6 ciffers to 5 ciffers with joint stereo did only "hurt" the right channel with 1.
Let see full stereo
with only 5 ciffers you have to discard one chiffer the would end up being r=892 l=99
This hurts the left channel with an entirily 725.
So as you can se with a giving bitrate JS steroe can describe the audio data much better then dual channels. because it use less bit to describe the same stereo info and therofr have to discard less data to come under a certain bitrate
off cause this is only a pseudo description of what really happes, as i have NO skill on audio encoding/programming. but i hope I'm kinda right in this..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.