View Full Version : Determining the Quality of MP2 Audio (Thread Split)
r6d2
2nd November 2003, 04:10
Originally posted by KpeX
The loss introduced in encoding from AC3 to 128k MP3 will be much greater than either.
@KpeX,
First of all, congrats on your promotion to Team Member! :cool:
Perhaps you know that Tylo's Plugin for DVD2SVCD implements a quality-based decision making to determine the number of CDs needed to achieve the expected video output quality.
The plugin also decides the audio BR according to the obtained video BR and number of CDs. It's done that way mainly for historic reasons, and because of the 10% rule. When doing SVCDs users are in general more videophiles (or sizeophiles ;)) than audiophiles.
This typically results in 128-kbps for 2 CDs, 160 for 3 CDs.
Thinking of increasing the plugin functionality, do you know if there is any "quality" indicator we may use when encoding from an AC3 source to an MP2 audio, like quantization is for video, that might make that decision more audiophile oriented?
If I did not express myself clearly enough or if you need more info to answer the question, please feel free to ask.
KpeX
2nd November 2003, 04:37
Hi r6d2, and thanks for the welcome,
I clearly understand your question, the answer might be the hard part. ;)
Assuming you use besweet for your audio encoding, 2lame has a quality-based setting that could be valuable. I've never experimented with quality based mp2 encoding, but assuming it works similar to other encoders, and applies bits as necessary to reach a certain quality, it could be useful. Commandline would look something like
besweet -core ( -input "infile.ac3" -output "outfile.mp2" ) -2lame( -v 5 )where the quality varies between 0 and 9. I don't recall at the moment whether or not SVCD specs support VBR audio - however, even if it doesn't, perhaps you could implement a 2-pass audio encoding scheme to do a quality-based encode on the first pass and choose a CBR bitrate based on the size that was reached.
However, all that being said, on most people's ears and most people's speakers, the audio quality degradation will be limited and probably inaudible even at 128kbps. Attempting to measure audio quality may be a lot of work for little result, as the difference in bitrate needed to achieve constant quality for different movie soudntracks will be much smaller than the large difference in compressibility between different movie's videos.
However, you're correct, there are definitely different mentalities as on encoding: when I encode MPEG-4 manually, I almost always encode audio first with Lame --alt-preset standard or vorbis quality settings and fill out the CD(s) with my video bitrate :).
Hope this makes sense, regards,
r6d2
2nd November 2003, 05:11
Originally posted by KpeX
I don't recall at the moment whether or not SVCD specs support VBR audio
The problem with VBR audio is that when muxing with video you may get spikes which surpass the SVCD specs. Since encoding of both streams is done separately, the encoders don't talk to each other at encoding time.
An action scene, highly demanding of BR, typically may be accompained by lots of sounds.
perhaps you could implement a 2-pass audio encoding scheme to do a quality-based encode on the first pass and choose a CBR bitrate based on the size that was reached.
I don't think this would be useful. The advantage of video is that it is encoded ultimately in VBR, so you can take advantage of the savings from low movement scenes.
If, for instance, your suggestion was applied to video it would be equivalent to do a video encoding at CBR with the obtained average bitrate, which would surely be quite variable in quality and sub-optimal.
IMHO, the CBR audio with the obtained BR would suffer from the same problem (plese confirm, since I'm really a lego at audio encoding.)
I was thinking of something like a test which would yield:
"This AC3 audio track deserves/contains x quality, recommended CBR at y-kbps."
Do you think this makes sense at all?
However, all that being said, on most people's ears and most people's speakers, the audio quality degradation will be limited and probably inaudible even at 128kbps.
What you're saying is that it makes little sense to encode at higher audio BRs? We might just use 128 for all movies with no noticeable degradation?
when I encode MPEG-4 manually, I almost always encode audio first with Lame --alt-preset standard or vorbis quality settings and fill out the CD(s) with my video bitrate :).
I wouldn't expect less from an audio moderator :)
KpeX
2nd November 2003, 05:35
Originally posted by r6d2
I was thinking of something like a test which would yield:
"This AC3 audio track deserves/contains x quality, recommended CBR at y-kbps."
Do you think this makes sense at all?
That's kind of what I was trying to get at with the two-pass possibility, attempt to determine what kind of quality is needed with a VBR encoding and then apply that average bitrate to a CBR encoding. You're right, this is far from optimal, but the only thing I can think of that comes close to what you're wanting to attempt.
Originally posted by r6d2
What you're saying is that it makes little sense to encode at higher audio BRs? We might just use 128 for all movies with no noticeable degradation?
That's a tough question to answer, 128 Kbps CBR is far from transparent over all samples, but in order to notice much difference between the quality of the mp2 and the original ac3, one would probably need good headphones and good ears.
Additionally, the difference in bitrates to attain quality is not as extreme for audio as in video. Let me give you an example: to attain a reasonable amount of quality for video, some movies might average around 800 kbps, where others might need as much as 2000 kbps. Audio, however, would have nowhere near that range. For example, the lame mp3 encoder's --alt-preset standard setting, which sets a quality level which is transparent over nearly all samples, only averages from about 160 to 200 kbps.
Wrapping up, a lot of this is theory, my ears are not incredibly accurate, and on my few SVCD ventures in which I've gone down to 128kbps, I have not noticed any quality problems at all.
r6d2
2nd November 2003, 05:59
Originally posted by KpeX
You're right, this is far from optimal, but the only thing I can think of that comes close to what you're wanting to attempt.
What about this?:
Having an histogram of each "audio frame"'s BR (from the source) and calculating some sort of integral, the area below the curve, I mean, and based on that plus:
1. The variance of the BR
2. The determined min and max.
3. The calculated average (you get this last figure with the CBR theory too)
Then estimate a % of quality loss in the range [avg..max]?
(sort of what we do with GKnot's compressibility indicator, which must match 60%-80% of the bits/(pixel*frame).)
Too much calculus notes in my head? (DDogg would tell me I'm getting too babylonian again. :))
128 Kbps CBR is far from transparent over all samples, but in order to notice much difference between the quality of the mp2 and the original ac3, one would probably need good headphones and good ears. [...] For example, the lame mp3 encoder's --alt-preset standard setting, which sets a quality level which is transparent over nearly all samples, only averages from about 160 to 200 kbps.
No figures for MP2?
I've gone down to 128kbps, I have not noticed any quality problems at all.
Very enlightening indeed.
KpeX
2nd November 2003, 06:19
Originally posted by r6d2
What about this?:
Having an histogram of each "audio frame"'s BR (from the source) and calculating some sort of integral, the area below the curve, I mean, and based on that plus:
1. The variance of the BR
2. The determined min and max.
3. The calculated average (you get this last figure with the CBR theory too)
Then estimate a % of quality loss in the range [avg..max]?
(sort of what we do with GKnot's compressibility indicator, which must match 60%-80% of the bits/(pixel*frame).)
The only problem I can see with that is that bitrate is not directly related to the quality of audio. Unfortunately, unlike quantizer for video, there isn't anything easily determinable from audio that can judge the quality. True VBR encodes are quality based, but since actually using VBR audio isn't an option, there isn't much we can do with that.Originally posted by r6d2
Too much calculus notes in my head? (DDogg would tell me I'm getting too babylonian again. :))Hey, this is _the_ cutting edge AV conversion board, I have no problem with throwing some serious math into it.
Originally posted by r6d2
No figures for MP2? Unfortunately, I don't have enough experience with MP2 to give any serious data. I've only done a few SVCD encodes, mostly for experimental reasons, and my music is mostly MP3.
Overall, I'd have to say that the effort put in is not worth the slight audio quality you get out. Considering that in most cases we're talking about transcoding 384 or 448 kbps CBR AC3 to MP2, a bitrate of 128 or 160, using joint stereo encoding, will have quite sufficient quality.
KpeX
2nd November 2003, 06:46
Also, there is a utility available atRarewares (http://rarewares.hydrogenaudio.org) called Eaqual (evaluation of audio quality), that tries to objectively determine audio quality - I haven't experimented with it much, from what I've heard it's not very accurate (remind anybody else of PSNR ?), and I don't believe it would take mp2 input anyways.
Wrapping up my thoughts, considering that CBR is basically required for the situation, and that one is in most cases encoding from a CBR lossy source, I don't think the results will be worth the effort in this case. I'd stick to 160 k or higher audio, 128 when space is really tight, make sure you're using joint stereo, and I doubt you'll ever have audio problems.
jorel
2nd November 2003, 09:19
:o
excuse me.
for mp2:
stereo and/or dual channel are better than joint stereo
(for prologic receivers and our ears)
48k is better than 44k(always),you can hear the differences easily,
the basses have "proud" and overall quality is clear!
HeadAC3he do 2 pass cbr (i need to learn it using BeSweet)!
128 is acceptable(only)for conversations,192 is the min for musicals
and for good sound effects(explosions for example).
ps:
the default in d2s is stereo-192k!
wise developer,wise prog...wise choice!
my phrases are short....means: poor english!
:)
r6d2
2nd November 2003, 14:39
Originally posted by KpeX
Considering that in most cases we're talking about transcoding 384 or 448 kbps CBR AC3 to MP2, a bitrate of 128 or 160, using joint stereo encoding, will have quite sufficient quality.
Thanks, Kpex, It has been very interesting.
That joint stero stuff was news to me. I had read in several places that it was a big no-no.
r6d2
2nd November 2003, 16:46
On this page, a mimimun of 192 is suggested for Stereo.
http://www.modatic.net/audio/stereo_vs_jointstereo.php
And "always, and I mean always" use Joint Stereo is suggested.
@KpeX, I guess you agree. Is this for MP2 also, in your opinion?
Trahald
2nd November 2003, 17:33
joint stereo (basically) takes parts of the audio that are non-stereo (or very close to non stereo) and combines them to one "mid" channel (hence taking up less space and more efficient use of bitrate) the differences (stereo) parts are encoded as a side channel. if there is too much separation then the frames are encoded in stereo. a bad/overagressive encoder will produce a mono sounding output. and possibly damage dolby-pro-logic info.
in my experience (at 160 kbps and below) joint stereo sounds better than stereo - (imho) of course i only listen to my encodes on my pc speakers (which are about 3" from each other) and my mono-tv. so i only get to hear the "gain" in bitrate (because most of the bitrate is devoted to one channel) and not the loss of stereo info
r6d2
2nd November 2003, 17:53
Originally posted by w00kiee
hence taking up less space and more efficient use of bitrate
Thanks for your comment, w00kie. The question I still have is: How does that efficiency translates in an advantage?
The output will still be CBR at the same rate, so... are this savings used to enhance the quality (minimize data loss) of the original source?
KpeX
2nd November 2003, 18:19
Originally posted by jorel
:o
excuse me.
for mp2:
stereo and/or dual channel are better than joint stereo
(for prologic receivers and our ears)
48k is better than 44k(always),you can hear the differences easily,
the basses have "proud" and overall quality is clear!
HeadAC3he do 2 pass cbr (i need to learn it using BeSweet)!
128 is acceptable(only)for conversations,192 is the min for musicals
and for good sound effects(explosions for example).
ps:
the default in d2s is stereo-192k!
wise developer,wise prog...wise choice!
my phrases are short....means: poor english!
:)
Stereo is _not_ better than joint stereo. Joint stereo will always have more quality, the encoder can be more efficient with more bits shared between channels. I honestly doubt you can hear the difference that clearly between 48 and 44.1 Khz. I'd like to see some ABX test results to prove it.
@r6d2
I never understood why joint stereo is not recommended for pro logic. A joint stereo file retains Dolby Pro Logic just fine on my system, as long as the correct downmix is used from the Dolby Digital. Considering this and the increase in efficiency for the encoder, I don't see any reason not to use joint stereo.
I agree that when using full stereo 192kbps should be a minimum. Most of the numbers there will also apply to mp2, but I wouldn't take too much at that site to heart - some of the things he says bother me. More info on that if I find more time to read it.
The output will still be CBR at the same rate, so... are this savings used to enhance the quality (minimize data loss) of the original source?
Yes, since the encoder has more bits to work with per channel, effectively, the quality will be higher and closer to the source.
r6d2
2nd November 2003, 18:53
Originally posted by KpeX
Yes, since the encoder has more bits to work with per channel, effectively, the quality will be higher and closer to the source.
Crystal clear, thanks a lot.
Trahald
3rd November 2003, 00:40
i think KpeX pretty much summed it up
KpeX
3rd November 2003, 03:39
Originally posted by w00kiee
i think KpeX pretty much summed it up
:D
I'm considering a simple listening test soon to test some of what we've discussed in this thread - to see if people can actually hear the differences from resampling, joint stereo versus full, etc.
r6d2
3rd November 2003, 11:59
Looking forward to it.
jorel
3rd November 2003, 12:43
only removing doubts...
Kpex wrote:
"Stereo is _not_ better than joint stereo.
Joint stereo will always have more quality,
the encoder can be more efficient with
more bits shared between channels"
i'm not against your opinion,i'm only searching the best to use but
after read in "everywhere" about stereo and dual channel,
nobody have a perfect and clear explanation about the differences!
i know,joint stereo can use with more efficience the bits but
it not means better quality...
dual stereo use individual channels with half bitrate for each channel
stereo, two channels with bitrate alocation changing from channels.
like explanations from DSPguru:
12) what's the difference between stereo, joint stereo & dual channel ?
http://forum.doom9.org/showthread.php?s=&threadid=7633
and:
"I never understood why joint stereo is not recommended for pro logic."
but...
how the encoder "knows" the exact moment to choose
bits to share between channels?!?!
-->in this "moments" we(well,i can)feel the audio breathing
in fast transitions between channels!
joint stereo is good to gain more compression(not quality)
..maybe this is the reason for no use,
and some decoders have problems with joint stereo but
no problems with stereo and/or dual channels!
then,why don't use stereo for quality?
and wrote too:
" I honestly doubt you can hear the difference
that clearly between 48 and 44.1 Khz."
48k is really better than 44k,i can hear the differences easily,
i don't have doubts,the low frequences show enhanced details!
believe,i can hear easily!
:)
KpeX
3rd November 2003, 18:30
Originally posted by jorel
joint stereo is good to gain more compression(not quality)
More compression with the same bitrate = higher quality. So assuming you use the same bitrate, joint stereo will be higher quality than stereo/dual mono, there's no doubt about it.
And don't worry, we will be testing your hearing soon :D.
DDogg
3rd November 2003, 22:29
The conventional wisdom always had MP2 dealt with separately from MP3. In MP2, Stereo was "always" used. Supposedly there is some specific reason that stereo *must* be used with MP2 in MPEG2, but heck if I know what it is. :)
KpeX
4th November 2003, 02:48
Originally posted by DDogg
The conventional wisdom always had MP2 dealt with separately from MP3. In MP2, Stereo was "always" used. Supposedly there is some specific reason that stereo *must* be used with MP2 in MPEG2, but heck if I know what it is. :)
Interesting. May have to look into this more - I know I've done a number of SVCD's with joint stereo and had no problems.
Anyways, I've opened a simple first listening test - see this thread (http://forum.doom9.org/showthread.php?s=&threadid=64441).
Boulder
4th November 2003, 18:31
Actually all you need to know about MP2 joint stereo is that it's only IS.
http://www.hydrogenaudio.org/index.php?showtopic=10240&hl=mp2,and,joint,and,stereo
I once compared a 128kbps joint stereo and stereo file. I encoded a small piece of classical music (actually it was from the beginning of one Osbournes season 1 episode). The joint stereo one had a lot of artifacts (crackling, distortion) in it throughout the whole clip whereas the stereo one sounded very good.
KpeX
4th November 2003, 20:15
I've done similar comparisons - I definitely had no problems with Besweet / 2lame encoding to joint stereo. Differences were essentially inaudible on speakers with a typical movie soundtrack around 128k.
Boulder
4th November 2003, 20:56
I gave that test a bit more thought and remembered that tooLAME did produce better results than mp2enc. Mp2enc had a lot of artifacts, tooLAME sounded _almost_ as good as the stereo clip.
The fact that MP2 joint stereo destroys the surround information is more than enough to keep me encoding in stereo. If MP2 specs had M/S stereo for joint stereo, it would be as safe as LAME is for MP3.
[rant mode]
What I don't understand is that people say that you'll have to use bitrates like 192 or 224kbps for stereo. I've heard numerous 128kbps stereo tracks (DPL II downmix) on very good 5.1 speakers and really can't say a bad word. It may not be as clear and bright as a 224kbps track but still sounds very good.
[/rant mode]
KpeX
4th November 2003, 22:12
Very interesting stuff. I've been looking into this mid/side vs. intensity/stereo issue more. There's a very interesting thread on HA (http://www.hydrogenaudio.org/index.php?showtopic=1273&) that confirms mp2 specs only support IS for joint stereo, but Ivan Dimkovic (Ahead AAC/MP4 developer) still recommends joint stereo for bitrates of 128 and below. However I agree with Boulder that for many movie soundtracks 128k full stereo will still be okay. Also interesting to note in that thread is that 2lame's psymodel 2 is recommended for all scenarios.
Edit: based on further research, it appears that there is no reason to ever use joint stereo for MP2 encodings, which came as quite a surprise to me. A number of postings here and on HA indicate that the development of mp2's joint stereo mode (I/S) is quite inferior to that of, say, MP3. That's SVCD for you I guess ;)
jorel
6th November 2003, 03:11
another good reference:
http://andreas.welcomes-you.com/projects/dv/index.html#jointstereo
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.