Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: VBR vs. CBR in regards of quality fluctuations (Read 24667 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

VBR vs. CBR in regards of quality fluctuations

On a different board there is in interesting discussion about which format is in general the better one, VBR or CBR, assuming that both have the same max. bitrate and disregarding any space issues. Some were saying that CBR is the better one as it gives all frames at least or more bits thatn VBR does. While this sounds pretty reasonable, we were also discussing whether the frames on CBR tend to fluctuate more in terms of quality than they do with VBR. It has been said that VBR tries to "estimate" how "complex" a frame is, and gives bits accordingly to its complexity. So we would think that the quality on VBR is to some extend more constant than with CBR (assuming that VBR detects the complexity of each frame correctly at a rate of 100% (which is not the case in reality, I know)).

In other words and with an example:

Quote
|_F1_|_F2_|_F3_|_F4_|_F5_|_F6_|_F7_|_F8_|_F9_|_Framenumber
|_2__|_3__|_5__|_6__|_7__|_9__|_9__|_3__|_2__|_Complexity
|_2__|_3__|_5__|_6__|_7__|_7__|_7__|_3__|_2__|_bits_with_VBR
|_7__|_7__|_7__|_7__|_7__|_7__|_7__|_7__|_7__|_bits_with_CBR

(max bitrate is 7)

Quality is defined as bits given for that frame divided by complexity, the better the quality the better, but please keep in mind a ratio of 1 doesnt mean exact (lossless) representation. Lets have a look at the quality.

|_F1_|_F2_|_F3_|_F4_|_F5_|_F6_|_F7_|_F8_|_F9_|_Framenumber
|_2__|_3__|_5__|_6__|_7__|_9__|_8__|_3__|_2__|_Complexity
|_2__|_3__|_5__|_6__|_6__|_6__|_6__|_3__|_2__|_bits_with_VBR
|_1__|_1__|_1__|_1__|0.86|0.67|0.75|_1__|_1__|_quality_with_VBR
Total bits used = 39

|_F1_|_F2_|_F3_|_F4_|_F5_|_F6_|_F7_|_F8_|_F9_|_Framenumber
|_2__|_3__|_5__|_6__|_7__|_9__|_8__|_3__|_2__|_Complexity
|_6__|_6__|_6__|_6__|_6__|_6__|_6__|_6__|_6__|_bits_with_CBR
|_3__|_2__|1.20|_1__|0.86|0.67|0.75|_2__|_3__|_quality_with_CBR
Total bits used = 54

|_F1_|_F2_|_F3_|_F4_|_F5_|_F6_|_F7_|_F8_|_F9_|_Framenumber
|_2__|_3__|_5__|_6__|_7__|_9__|_8__|_3__|_2__|_Complexity
|_y__|_y__|_y__|_y__|_y__|_y__|_y__|_y__|_y__|_bits_with_lossless
|_z__|_z__|_z__|_z__|_z__|_z__|_z__|_z__|_z__|_quality_with_lossless
Total bits used = 9*y

As you can see the quality in CBR fluctuates more than with VBR, plus you will end up with a bigger filesize. Personally I prefer a constant quality through the entire file. If I want better overall quality, I will make sure that the max bitrate is adjusted accordingly.
The last table with "lossless" just demonstrates that it is important we talk about lossy encoding and that the fluctuating with CBR has to do with the fact that it is a fixed bitrate AND a lossy encoding. A fixed bitrate doesnt necessarily mean fluctuating quality, that what I was trying to say.


(You can find the full discussion here http://scratchlive.net/forum/discussion/?d...ion_id=2065#new )

So... what do the experts here think about it? Is it true that audio encoded with CBR fluctuates (in terms of quality) more than with VBR?

Thanks for your help in advance.

VBR vs. CBR in regards of quality fluctuations

Reply #1
Nature of modes:
CBR - gives you constant bitrate through stream and predictable size. Quality can vary through the stream.
VBR - gives you constant quality through the stream (is controled via number of parameters) and completely unpredictable size.
ABR - gives you more constant quality than CBR while maintain some control over bitrate.
Note: actually, many new standarts like for example AAC have no CBR mode at all. They always working in ABR, using bit reservoir. If bit reservour depth is no more than defined in standart for used mode, then such a mode is called "CBR" while technically it is not.
Hope this helps...
P.S. and search the forum - there were many discussions on this topic already...

VBR vs. CBR in regards of quality fluctuations

Reply #2
Thanks for the quick reply. I have searched the forum, and read many threads about the advantes of VBR over CBR, but just this particular question I wanted it to be answered explicitly. Esp. as I read that CBR at 320kbps is the best quality you can get, and then read on the other hand CBR is bad cause it makes the quality fluctuate (as you also said).

So, just to make it 100% sure, CBR give frames which fluctuate in their quality, means less "complex" frames will indeed sound better then more "complex" frames?

Lets assume we use CBR at 320kbps and VBR with a decent min bitrate and a max bitrate of 320kbps. I know that the CBR file will have each frame to be at least as good as all frames in VBR. But thats not the point. Quality fluctuations is a concern for me, so does CBR's quality fluctuate a lot?

VBR vs. CBR in regards of quality fluctuations

Reply #3
Higher than 320 kbps is not possible. So the VBR file is not VBR, cause bitrate is fixed at 320.

Since 320 kbps is the highest possible, offcourse CBR will bring the best results, because VBR will always use a lower average bitrate due to it's nature. Chances you're gonna hear it are quite low though. I suggest you do some ABX testing and start it real easy with 128 kbit mp3. (I bet it will be more difficult than you think)

<edit> CBR will probably always lose compared to VBR at the same filesize, so I don't see the logic of comparing CBR/VBR when using different filesizes.  </edit>
A secure audio ripper for linux: code.google.com/p/rubyripper

VBR vs. CBR in regards of quality fluctuations

Reply #4
I am not comparing filesizes, lets disregard filesizes for a second.

Yes, I know CBR will give the best results, as it always gives the maxium bits to _all_ frames. My question is how that influences the quality fluctuations. (I dont define quality only by "how much bits has been give to a frame", for me its also important how constant quality is during one song)

And... (as Sir Grey) has pointed out, if CBR gives fluctuating quality, if and to what extent is that cured by the "bit reservoir" (which CBR uses a lot, as I have read)?

Is the bit reservoit a kind of littel vbr implementation?

VBR vs. CBR in regards of quality fluctuations

Reply #5
Why don't you first try to ABX 128k/bit mp3 and if you succeed in that, try lame --preset standard. If you still can tell the difference with the original I'll continue the discussion of quality. Because I define quality as how much difference I'm able to hear compared with the original.

About what SirGrey said: He didn't say that mp3 uses a bit reservoir, only that AAC seems to use this. And in that case it will help some, but not perfectly. That's the reason why there is VBR mode available, wouldn't it?
A secure audio ripper for linux: code.google.com/p/rubyripper

VBR vs. CBR in regards of quality fluctuations

Reply #6
Simple explanation (I hope  ).
Imagine: there are some parameters that are related to sound quality, for example s/n ratio or something else...
When encoding at VBR encoder try to get this parameters equal for each frame by fluctuating a bitrate. That is the idea of VBR, that's why people tell that VBR is producing constant quality (by some measurement system taken).
Note that for mp3 max frame size is fixed, so bitrate of 320Kbit is maximum possible (excluding freeformat streams that can be up to 640Kbit).
For pure CBR on the other hand, equal quantity of bits is given to every frame, thus some frames (with low complexity) will have excelent quality, but others may not.
>>Is the bit reservoit a kind of littel vbr implementation?
To some point, yes. 
Mode using bit reservoir is called ABR, which means that average bitrate would be held about what you requested, but when there will be low complexity frames in a stream, you can encode them with fewer bits and spend this bits later, when high complexity frames appears on the scene. Complexity is measured in similiar way that is used for VBR.

VBR vs. CBR in regards of quality fluctuations

Reply #7
Quote
Why don't you first try to ABX 128k/bit mp3


Cause I am not the "standard". What I might hear or not hear, shouldnt be the scale.

Quote
About what SirGrey said: He didn't say that mp3 uses a bit reservoir


CBR mp3 does use a bit reservoir. I thought you as an member on this board should know... And you seem to miss my question, I was asking how that "improves" CBRs quality and also decreases CBRs quality fluctuations (assuming it exists... which still is a question, if and to what extent).

[edit: I posted this, while in the meantime Sir Grey responded... just to avoid any confusion]

VBR vs. CBR in regards of quality fluctuations

Reply #8
Total data size for a frame, using bit from the reservoir or no, is limited to the size of a 320kbps frame.
It means that bit reservoir is only helping to regulate quality if bitrate is lower than 320kbps.

VBR vs. CBR in regards of quality fluctuations

Reply #9
Quote
For pure CBR on the other hand, equal quantity of bits is given to every frame, thus some frames (with low complexity) will have excelent quality, but others may not.


Nice, that is exactly what I have assumed. On this mentioned thread, this arguement has been said a couple of times, some were still saying CBR is superior (again, all assuming a max bitrate of 320 with VBR and of course the same for CBR).

Quote
Mode using bit reservoir is called ABR, which means that average bitrate would be held about what you requested, but when there will be low complexity frames in a stream, you can encode them with fewer bits and spend this bits later, when high complexity frames appears on the scene. Complexity is measured in similiar way that is used for VBR.


Are you sure? I thought that ABR is just a different implementation of VBR where you have a target bitrate value.

Besides that, bit reservoir is not only used in ABR, its also heavily used in CBR, or am I wrong? So, to what extent does that help reducing the fluctutating quality of CBR frames?

VBR vs. CBR in regards of quality fluctuations

Reply #10
Quote
Total data size for a frame, using bit from the reservoir or no, is limited to the size of a 320kbps frame.
It means that bit reservoir is only helping to regulate quality if bitrate is lower than 320kbps.
[a href="index.php?act=findpost&pid=264510"][{POST_SNAPBACK}][/a]

Lets assume we have a song which has complex frames at the beginning, and then the rest is complete silent (or at least one with very little complexity), does this mean CBR can basically drop (okay, it should be "saved", but as the saved bits are never used in this song, I say drop) all uncessary bits in all frames, making those less complex frames having the same quality as the first few complex frames?

Lets assume my bit reservoir is completely empty, then I have this frame with a very little complexity, does that mean, that basically this frame gets about the same amount of bits as when you encode this in VBR (cause as said "spare" bits are being saved in the bit reservoir)? The only advante of VBR would then be to really save the bits by not using them, while CBR can only save them (until the bit reservoir is full) for a later usage. But that would then mean you have pretty no quality fluctutation on CBR (as in VBR). Wrong/right?

VBR vs. CBR in regards of quality fluctuations

Reply #11
If you want steady quality and CBR use WAV
A secure audio ripper for linux: code.google.com/p/rubyripper

VBR vs. CBR in regards of quality fluctuations

Reply #12
The advantage of VBR is to be smaller than a max bitrate CBR (320kbps) while providing better quality than a comparable sized CBR file.

Of course if you consider a max bitrate CBR file (320kbps), vbr can not provide better quality.
The point is just that there are lower bitrates than 320kbps.

VBR vs. CBR in regards of quality fluctuations

Reply #13
I'm not finished reading the whole original thread, but no doubt this feniks person doesn't understand the difference between bitrate and quality
Quote
the CBR encoder will give each frame the exact same amount of bits (6 in this case). no frame is higher or lower in quality (bitrate) than the other.
Maybe his confusion is caused by how some ripping/encoding applications uses the term quality, when they should have used bitrate (e.g.: quality = 192kbps).

VBR vs. CBR in regards of quality fluctuations

Reply #14
To ssl_addict:
Did you read my posts ?
CBR has constant frame size.
Many people when speak CBR mean ABR (as Ahead ingeneers, where their mpeg4 aac implementation refers to ABR as CBR in settings) because of limited bit reservoir.
You completely missed the point, I see. 
Try to encode silence with pure CBR and you 'll see that it takes exactly amount of space you requested. It can not save anything.
When using ABR when encoding silence you will have a bit better result - the stream should be a bit undersized, because of bit reservoir not used. But encoder will try to get bitrate around requested.
In VBR the final size will depend not on your bitrate settings, but on desired quality, but bitrate can not be less than 32Kbit, as I remeber.
>>(okay, it should be "saved", but as the saved bits are never used in this song, I say drop)
It seems that you swaped CBR and VBR here...
If they are dropped, then it will be VBR. Bit reservoir have constant length and after it is full frames should became about you requested when set a bitrate.
EDIT:
>>Maybe his confusion is caused by how some ripping/encoding applications uses the term quality
Some misunderstanding is present...  May be my English is the cause ?

VBR vs. CBR in regards of quality fluctuations

Reply #15
Quote
Of course if you consider a max bitrate CBR file (320kbps), vbr can not provide better quality.
The point is just that there are lower bitrates than 320kbps.
[a href="index.php?act=findpost&pid=264525"][{POST_SNAPBACK}][/a]

I know that. It is a fixed bitrate, and I have explained + said that a couple of times. There is no doubt about that each frames bitrate will be the highest in CBR, but the questions is how we should "rate" the frames with lower complexity, as of course CBR will spend more bits on them [higher complex frames will get (assuming VBR always detects the complexity correctly) the same bitrate it CBR and in VBR].

Does this mean with CBR the less complex frames will sound better than those complex frames as you have more then enough bits (enough bits=number of bits which VBR will spend) left? Or will this somehow and to which extend be compensated by CBRs bit reservoir technique?

Quote
You completely missed the point, I see.

Sorry, but now I am confused, when you say people call CBR ABR ...

Quote
Try to encode silence with pure CBR and you 'll see that it takes exactly amount of space you requested. It can not save anything.

If I understand bit reservoir correctly, than it will hold (reserve) these bits looking for the next frames and checking if it can spend those bits on the next frames (if the bits are need means frames are complex enough), and if it cant spend those saved/reserved bits, then... nothing, while VBR really doesnt use these bits). Correct?

Quote
>>(okay, it should be "saved", but as the saved bits are never used in this song, I say drop)

Sorry for my english, what I meant with "dropped" was, those bits are not used for encoding anything. Of course they are not saved in a way that they dont appear in the encoded frame.

VBR vs. CBR in regards of quality fluctuations

Reply #16
Quote
Yes, I know CBR will give the best results, as it always gives the maxium bits to _all_ frames.

this is not true. CBR always (99,99%) results a worse result than vbr or abr at the same bitrate. The only exception is CBR at a bitrate of 320kbps. A ABR/VBR file can't sound better than that but rather could sound the same with the advantage of a much lower bitrate.

Quote
Is the bit reservoit a kind of littel vbr implementation?
[a href="index.php?act=findpost&pid=264494"][{POST_SNAPBACK}][/a]

yes, you could say that
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'

VBR vs. CBR in regards of quality fluctuations

Reply #17
Quote
Does this mean with CBR the less complex frames will sound better than those complex frames

Yes.
>>Sorry, but now I am confused, when you say people call CBR ABR ...
Example: Ahead aac encoder used in Nero. It has 2 modes: vbr and cbr. But if you ask Ivan, their lead engeneer, he will tell you that encoder is abr with bit reservoir depth defined by ISO standart. It is rather confusing, may be... But generally, if bitrate fluctuation is not exceed some value it can be CALLED cbr (while by the matter of fact it isn't).
Quote
If I understand bit reservoir correctly, than it will hold (reserve) these bits looking for the next frames and checking if it can spend those bits on the next frames (if the bits are need means frames are complex enough), and if it cant spend those saved/reserved bits, then... nothing, while VBR really doesnt use these bits). Correct?

Yes.
Rought example.
We have 10 frames. Each frame need 50Bits to encode. Bit reservoir is 450Bits. ABR bitrate is set to 200Bit/frame.
VBR - total stream will have 50*10 = 500Bits.
ABR - First 3 frames will take 3*50 = 150Bits and fill up reservoir ((200-50)*3 = 450). After that encoder will encode each frame with 200Bit to try to maintain bitrate defined. So it will take 7*200 = 1400. Overall will be 1400 + 150 = 1550.
Things are not that simple in real life, but I hope you 've got the idea.

VBR vs. CBR in regards of quality fluctuations

Reply #18
Quote
this is not true. CBR always (99,99%) results a worse result than vbr or abr at the same bitrate. The only exception is CBR at a bitrate of 320kbps

The whole time we have been talking about this exceptional case :-)

Quote
But generally, if bitrate fluctuation is not exceed some value it can be CALLED cbr (while by the matter of fact it isn't).

Okay, thanks. I was not clear enough, I am talking about the lame encoder.
Thanks for the example.

So does the CBR implementation of LAME produce frames of (almost) equal quality (as defined above) with the help of bit reservoir?

VBR vs. CBR in regards of quality fluctuations

Reply #19
Quote
The whole time we have been talking about this exceptional case :-)

Hmm ?
Speaking of mp3 nothing can be better than 320Kbit CBR except freeformat of higher bitrate.
Quote
So does the CBR implementation of LAME produce frames of (almost) equal quality (as defined above) with the help of bit reservoir?

I'm almost on aac side for last 4 years, so I can't be completely sure...
As I remeber, last versions of lame has cbr mode, wich is exactly pure cbr, with equal frame sizes and abr mode, which obviously use bit reservoir. And vbr mode, of course.
So, "implementation of LAME produce frames of (almost) equal quality" must be abr, not cbr by definition... If you think of abr - yes, you can say so till some point. Depends on how much bit reservoir is used...
I've checked switches of 3.96.1 - that is. May be somebody more familiar with lame (as Gabriel, one of the devs) will answer your question.
Ok, I'm out
EDIT: small corrections.

VBR vs. CBR in regards of quality fluctuations

Reply #20
In Lame cbr/abr/vbr are all using the bit reservoir.
Cbr can only increase bits by taking them from the reservoir, while abr and vbr can also increase frame size.

With 320kbps, you can not do anything usefull with the bit reservoir, so let's say it is not used.
In 320kbps cbr, you are the easier parts do not sound better than transparent, you are just wasting bits on those.

VBR vs. CBR in regards of quality fluctuations

Reply #21
Tnx for explanation.

VBR vs. CBR in regards of quality fluctuations

Reply #22
Quote
In 320kbps cbr, you are the easier parts do not sound better than transparent, you are just wasting bits on those.
[a href="index.php?act=findpost&pid=264572"][{POST_SNAPBACK}][/a]


Is it possible sometimes a frame has to be padded (i dont mean the padding bit) to keep CBR, for example with silence.

in MPEG4 video the max amount of bits you can spend on a frame is with quant =1... i guess something similar could be true for MP3.
"We cannot win against obsession. They care, we don't. They win."

VBR vs. CBR in regards of quality fluctuations

Reply #23
All right first thing to remember is that bitrate != quality.

Second assuming mp3 with a maximum frame size of 320, 320 is theoretically the highest quality possible.  It generally wastes a lot of bits though.  A much lower VBR setting may be and generally is of the same perceivable quality.  If you drop below 320 for CBR and you come across frames where it needs more bits than it can be given then  you come across these so called quality fluctuations.

As Gabriel said LAME always use bit reservoir.  CBR is actually extremely strict ABR, ABR is much less strict, and VBR is not aiming for a certain size.

VBR is extremely more efficient than CBR.  CBR really should only be used if an exact size is needed but even then I'd recommend ABR because it gets so close anyway.  Also mp3 is not the only codec and there are several lossy codecs like Vorbis and Musepack that are VBR only and don't have such a low upper ceiling like mp3.
Nero AAC 1.5.1.0: -q0.45

VBR vs. CBR in regards of quality fluctuations

Reply #24
Using CBR at 320kpbs, thats about half the bitrate of uncompressed 16bit 44.1kHz, wouldnt it rather then make more sense to simply use an compressed lossless format like FLAC (which IIRC also gives an average saving of 50%)?