HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: cahklowor on 2006-07-20 15:46:07

Title: mp3 and vorbis comparison
Post by: cahklowor on 2006-07-20 15:46:07
I have made some comparison between Vorbis(aoTuV) and mp3 LAME(using ABR). And I have some question. Please help me. 

1) I use Adobe Audition's frequency analysis. I found that at every given bitrate target, vorbis always  provide a higher frequency response than mp3 . Even at very low bitrate Vorbis can still have a good frequency response. Technically, why does this happen?Is there any association with noise-normalization used by Vorbis?

2) In some case, Vorbis sometimes produce larger file than mp3 at the same nominal bitrate. I've heard that Vorbis frame can be any size. Is there any limitations for the frame size(ex: if I encode it at different nominal bitrate)? How can Vorbis know bit allocation for each frame(busy section?)?

3)I've also heard that bit reservoir used by mp3 have limited size. How many bytes that mp3 use for bit reservoir exactly? Is that a fixed value or some condition can change it?

Thanks for everyone who help me...
Title: mp3 and vorbis comparison
Post by: Garf on 2006-07-20 15:57:30
I have made some comparison between Vorbis(aoTuV) and mp3 LAME(using ABR). And I have some question. Please help me. 

1) I use Adobe Audition's frequency analysis. I found that at every given bitrate target, vorbis always  provide a higher frequency response than mp3 . Even at very low bitrate Vorbis can still have a good frequency response. Technically, why does this happen?Is there any association with noise-normalization used by Vorbis?


It's 100% dependant on the exact encoder and settings. Try adding -k to your MP3 commandline, for example.

Looking at the spectrum of an audio codec is about as smart as listening to a video codec's bitstream.

Quote
2) In some case, Vorbis sometimes produce larger file than mp3 at the same nominal bitrate.


What kind of differences? If it's really the same bitrate, they should be the same size, with some minor differences possible due to headers.

But by default, the vorbis encoder doesn't encode to a bitrate. It encodes to a quality level that _usually_ gives approximately the birate you asked for.

Quote
How can Vorbis know bit allocation for each frame(busy section?)?


By looking at what the psymodel says.

Quote
3)I've also heard that bit reservoir used by mp3 have limited size. How many bytes that mp3 use for bit reservoir exactly? Is that a fixed value or some condition can change it?


Fixed value, set by the standard.
Title: mp3 and vorbis comparison
Post by: cahklowor on 2006-07-20 16:29:38
Quote
It's 100% dependant on the exact encoder and settings. Try adding -k to your MP3 commandline, for example.

Looking at the spectrum of an audio codec is about as smart as listening to a video codec's bitstream.

Why you said that?Give me a detail explanation,please. 

Quote
What kind of differences? If it's really the same bitrate, they should be the same size, with some minor differences possible due to headers.

But by default, the vorbis encoder doesn't encode to a bitrate. It encodes to a quality level that _usually_ gives approximately the birate you asked for.

It is not the same bitrate but the same "nominal bitrate" because its use VBR. The result file can't be predicted. I've read that VBR gives more bits for busy section n mp3 have limitations for bit allocation for that section because the size of bit reservoir is limited too. Am I right?
I use Vorbis quality 5(roughly 160kbps) and mp3 --abr 160 for my comparison. 

Quote
By looking at what the psymodel says.

What is the psymodel says about that?

Quote
Fixed value, set by the standard.

What size it is exactly based on the standard?

Thanks again for your attention.
Title: mp3 and vorbis comparison
Post by: ggf31416 on 2006-07-20 17:11:16
Quote
I use Vorbis quality 5(roughly 160kbps) and mp3 --abr 160 for my comparison


You are comparing Vorbis VBR and MP3 ABR. It's not a surprise that MP3 is closer to the nominal bitrate. IIRC the switch for ABR in Vorbis is --managed.


Quote
Why you said that?Give me a detail explanation,please.


See:
Lowpass (http://wiki.hydrogenaudio.org/index.php?title=Lowpass)
Technical data for recommended LAME settings (http://wiki.hydrogenaudio.org/index.php?title=Technical_data_for_recommended_LAME_settings)
Updated Table for LAME 3.97b1 (http://www.hydrogenaudio.org/forums/index.php?showtopic=38020&st=0&p=335491&#entry335491)
Ogg Vorbis Lowpass Frequency (http://www.hydrogenaudio.org/forums/index.php?showtopic=15049&st=160&p=357461&#entry357461)
Title: mp3 and vorbis comparison
Post by: Garf on 2006-07-20 17:45:47
Quote

It's 100% dependant on the exact encoder and settings. Try adding -k to your MP3 commandline, for example.

Looking at the spectrum of an audio codec is about as smart as listening to a video codec's bitstream.

Why you said that?Give me a detail explanation,please. 


Because they're AUDIO codecs, meaning that they care about how something SOUNDS, not how it LOOKS.

Looking at the spectrum is not going to tell you much useful things, and can be totally misleading.

Quote
I've read that VBR gives more bits for busy section n mp3 have limitations for bit allocation for that section because the size of bit reservoir is limited too. Am I right?


No. The limitation has nothing to do with the bit reservoir. MP3 is not allowed to have frames of more than 320kbps. Vorbis and AAC have a higher limitaiton.

Quote
I use Vorbis quality 5(roughly 160kbps) and mp3 --abr 160 for my comparison.


Which is completely flawed as explained above.

Quote
Quote

By looking at what the psymodel says.

What is the psymodel says about that?


Depends on the encoder. In the case of LAME, it's probably something along the lines of "this frame contains x bits of audible audio content". The encoder can compare this to the average and make a decision how many bits to spend.
Title: mp3 and vorbis comparison
Post by: Klyith on 2006-07-20 19:21:02
Why you said that?Give me a detail explanation,please. 
<snip>
What is the psymodel says about that?
Because the way that our ears hear is totally different from the way that our eyes see, looking at audio spectral data is a very bad way to judge a lossy codec. I'm sure someone could make a lossy audio compressor that would make a spectrum that looked much closer to the original, but it would probably sound terrible.

Lossy (http://wiki.hydrogenaudio.org/index.php?title=Lossy) encoders use psychoacoustic (http://en.wikipedia.org/wiki/Psychoacoustics) models to make a prediction of what parts of the audio signal are most important to out hearing. The basic idea is to keep those parts and throw out the rest. There are other parts to compressing the audio in a codec, but that's the lossy part. One of the reasons that audio compression works so well is that our ears are really pretty poor, in comparison with our eyes. If we had cat-ears it would probably be a much more difficult thing!

Quote
What size it is exactly based on the standard?

511 bytes. There's a good explanation of the bit reservoir here (http://www.hydrogenaudio.org/forums/index.php?showtopic=42194).
Vorbis's reservoir is variable; the default is two seconds of data at the average bitrate.
Title: mp3 and vorbis comparison
Post by: Pio2001 on 2006-07-20 19:37:04
Quote

It's 100% dependant on the exact encoder and settings. Try adding -k to your MP3 commandline, for example.

Looking at the spectrum of an audio codec is about as smart as listening to a video codec's bitstream.

Why you said that?Give me a detail explanation,please. 


Because they're AUDIO codecs, meaning that they care about how something SOUNDS, not how it LOOKS.


That's not the good reason. The good reason is because a psycho-acoustic encoder removes things that are not heard, but that are seen.

Looking at graphs, we can see problems that we can hear, problems that we can't hear, hear problems that we cannot see, and hear problems that we can see.

In the case of psychoacoustic encoders, we can see a lot of problems that we can't hear. Thus it is perfectly possible to have a good looking graph with a few problems that we can hear, and to compare it with a bad looking graph full of problems that we can't hear at all.
Title: mp3 and vorbis comparison
Post by: Slipstreem on 2006-07-20 19:50:40
[quote name='Pio2001' date='Jul 20 2006, 19:37' post='413867']
[quote name='Garf' post='413830' date='Jul 20 2006, 18:45']
[quote name='cahklowor' post='413799' date='Jul 20 2006, 17:29']
Quote

Looking at graphs, we can see problems that we can hear, problems that we can't hear, hear problems that we cannot see, and hear problems that we can see.


Straight from the Donald Rumsfeld school of linguistics. LOL 

Please don't take offence at me picking this one up. It really did make me laugh out loud! 

Thanks, Slipstreem. 
Title: mp3 and vorbis comparison
Post by: gameplaya15143 on 2006-07-21 21:36:58
Looking at the spectrum of an audio codec is about as smart as listening to a video codec's bitstream.

  I wish I could listen to a video codec's bistream.
Spectrum analysis can be very informative, but it doesn't say much for how something sounds.
try vorbis -q -2 --advanced-encode-option lowpass_frequency=99 or lame --abr 64 --resample 44 -k if you don't believe it  .. I won't comment on how it sounds, but the spectrum looks nice.