Log in

View Full Version : CCE CBR and bitrate


RB
4th December 2002, 10:33
I recently encoded a movie with the CCE CBR option because it was relatively short (82 minutes). In this case however, I noticed that DVD2SVCD sets the constant bitrate no higher than the max. average bitrate specified on the Bitrate tab even if it could go up to the max. bitrate for the given number of CDs.

Why is that? Does CCE have problems if the difference between avg. and max. bitrate is too small even in case of a CBR encode? I can't imagine that because there should be no average bitrate for CBR, no?

I can manually fix this by temporarily setting both max. and avg. bitrate to 2530 but...

Thanks!

winxi
4th December 2002, 11:10
Hello!
Maybe I don`t understand you right, but its logically right that you have to set the same for max and avg bitrate.
In every encode exists an average bitrate. The consequence is, that for constant bitrate min, max and avg bitrate are the same. So your constant bitrate canīt be higher than avg or max (thats why you have to set it the same) and canīt be lower than min bitrate.

greets, winxi

RB
4th December 2002, 12:49
You are right, all I'm asking is that DVD2SVCD does this setting for me automatically in case of a CBR encode. Right now, the constant bitrate for a CBR is limited to max avg. bitrate (bitrate tab). It should be limited to max. bitrate (usually 2530). Unless I'm missing something.

winxi
4th December 2002, 13:30
Ok, for CBR, average bitrate is equal to the max bitrate, so its limited to the lowest of the two. DVD2SVCD makes this absolutely right.

markrb
4th December 2002, 17:33
I do believe you are right that DVD2SVCD uses the Max AVG as the limator for CBR bitrates. Simply raise that to 2530 if you are going to be making a CBR encode, then the limator will be the AVG as set by DVD2SVCD's internal calculation for movie length and number of cd's. Make sure to set this back down to at least 120 Kbit below the MAX to avoid a known issue in CCE when you go back to VBR.

Mark

RB
4th December 2002, 19:28
Originally posted by markrb
I do believe you are right that DVD2SVCD uses the Max AVG as the limator for CBR bitrates.

OK, just wanted to have that confirmed. Maybe it can be fixed in a later release so that the max. bitrate is the upper limit.

markrb
4th December 2002, 20:21
Actually I don't believe it can without some major overhaul of the way the bitrate is figured out. The calculation that DVD2SVCD uses to figure out the bitrate is tied to the AVG, so then he would have to change the way the bitrate calculation works and have seperate tie-ins for each type of encoding(VBR, CBR, CQ, 1-Pass VBR, etc...). This adds levels of complexity that really are not needed.

It's simple enough and not really a hassle to change it manually when you do a CBR encode.

Mark

RB
4th December 2002, 20:48
Well, I can't imagine that. Afterall, I'm pretty there is some final code like this after the average bitrate is calculated:


if (AvgBitrate > MaxAvgBitrate)
AvgBitrate = MaxAvgBitrate;


If so, all I'm asking is that this takes into account the special case of CBR:


if (CBREncode)
{
if (AvgBitrate > MaxBitrate)
AvgBitrate = MaxBitrate;
}
else if (AvgBitrate > MaxAvgBitrate)
AvgBitrate = MaxAvgBitrate;

winxi
4th December 2002, 21:01
I really donīt understand why you think that this is a bug. Everytime you do a encode, you have an average bitrate, also for constant bitrate. As the name says, the bitrate is constant. This means that the average bitrate equals the CBR. It would be a bug when the constant bitrate of your encode could be higher than the average bitrate, because thats mathematically impossible.
The bitrate shouldnt be higher than the max bitrate you have specified, too. This means that its right, when the bitrate is limited to the lowest of the two (max, max avg). And that is, what the program does and why i wouldnt call it a bug!

winxi

markrb
4th December 2002, 22:42
Well RB when you go and create a program such as this then you can go ahead and make it work the way you want it to. Until then this is the way DVD2SVCD has always worked and I figure always will. If it's just too much work for you to change one little thing then I don't think anyone is going to be able to help you out.
You may not like the way it works, but it is definately not a bug. It was designed this way.

While you are at it why don't you read this:
http://forum.doom9.org/showthread.php?s=&threadid=7770

Mark

RB
5th December 2002, 13:37
Originally posted by winxi
I really donīt understand why you think that this is a bug.

I'm not saying it is a bug. It's just that at times the maximum possible bitrate for a CBR encode is not used. I'd rather call this a "suboptimal setting".


Everytime you do a encode, you have an average bitrate, also for constant bitrate. As the name says, the bitrate is constant. This means that the average bitrate equals the CBR. It would be a bug when the constant bitrate of your encode could be higher than the average bitrate, because thats mathematically impossible.


Of course, because for CBR, the constant bitrate, max and avg. bitrate are the same. Let's try an example to make myself clear:

We tell D2S to perform a CCE CBR encode. D2S looks at the length of the movie, the size and number of CDs and calculates the constant (average) bitrate. Let's say it comes out at 5000 kb/s because the movie is very short.

Now it looks at the Max. Avg. Bitrate specified on the bitrate tab (default: 2230) and cuts bitrate down to this value if it's lower than the calculated value. And this is what I think is not optimal for CBR. Instead, it should cut down to the Max. Bitrate (default: 2530) in this case.

Am I making any sense?

RB
5th December 2002, 13:59
Originally posted by markrb
Well RB when you go and create a program such as this then you can go ahead and make it work the way you want it to. Until then this is the way DVD2SVCD has always worked and I figure always will. If it's just too much work for you to change one little thing then I don't think anyone is going to be able to help you out.
You may not like the way it works, but it is definately not a bug. It was designed this way.


Mark, I'm not trying to twist anyones arm, really. Nor did I say that it is a bug (see my reply to winxi). Maybe it's because English is not my native language, but when I ask for a "fix", to me it doesn't necessarily mean that something is seriously broken. Again, in this case all I'm asking for is a small enhancement to an already great program - unless it's a major PITA to implement because I'm missing something about D2S' internal bitrate calculation. I'm hoping that the author of DVD2SVCD can shed some light on this. And no, it's not too much work for me to change the setting manually, where did I say that?

About the link you pointed me to: one of the first threads I read in this forum. I've written freeware myself so it all sounded very familiar :). But are we not allowed to ask for enhancements and/or some information on the inner workings in a gentle manner? IMHO, that's all I've tried in this thread. If I'm trampling on the pie in your eyes then that was not intentional and I'm sorry.

Sofliberty
5th December 2002, 14:26
@ RB
IF D2s worked in the way you describe, don't you think some one would complain:

"I've set average bitrate to 2230 bud D2s encodes with bitrate of 2500 which is the max bitrate set. When I set average bitrate to 2230 I want average bitrate 2230 not 2500."

I find this very likely.

RB
5th December 2002, 16:30
Again, I'm talking about the special case of a CBR encode.

winxi
5th December 2002, 17:44
Again: There is no difference between the average bitrate of a CBR encode and the average bitrate of a 10-pass VBR encode! So it would be false if the average bitrate would be higher than the specified max average bitrate, even for a CBR encode.
I really donīt think that your method makes sense, as it would confuse lots of people.

Ps: Sorry, I thought that you talk about a bug, because you wanted it do be "fixed".

winxi

markrb
5th December 2002, 18:02
Well in the end it doesn't matter since this is the way it was designed to work. I am sorry you don't like it, but it is not going to change so best to just drop it.
It has been this way from day 1 and you are the first ever to complain or suggest a fix or suggest a different way of doing it.

And you did say fix so that says to me that you thought it was a bug. Probably a language thing as you pointed out. It happens here once in a while since many here are not native English speakers.

Mark

RB
5th December 2002, 20:41
Originally posted by winxi
Again: There is no difference between the average bitrate of a CBR encode and the average bitrate of a 10-pass VBR encode!

Of course, but there is a difference between CBR and VBR :) For VBR, the bitrate will alternate between the min. and max. bitrate. But for CBR, it will be constant. And if it is constant anyway, why not take the highest possible bitrate for the number of CDs that does not exceed the max. bitrate set on the bitrate tab?

@markrb and winxi:

I'll shut up now :), OK.

winxi
6th December 2002, 19:40
And if it is constant anyway, why not take the highest possible bitrate for the number of CDs that does not exceed the max. bitrate set on the bitrate tab?
Simply because the average bitrate of your encode would exceed the specified max average bitrate of the bitrate tab. And this would be a bug. But as it seems that I canīt convince you, Iīll also shut up ;).

dvd2svcd
6th December 2002, 19:51
Here is why I do as I do.

In VBR:
1. I calculate the Avg. Bitrate
2. I compare it to Max. Avg. and if Min Avg. is checked I comapre it to that too. If my calculated bitrate is out of bounds I adjust my bitrate to either Min. or Max. Avg.
3. I then set in CCE (or TMPGEnc) the Max. and Min. bitrate (not the max or min avg) and also the calculated bitrate (adjusted if need be)

In CBR
1. I do exactly the same because that is what users is used to from VBR encoding, except that Min. and Max. Bitrate isn't used when doing CBR. I still use Min. and Max. Avg. bitrate to adjust the calculated bitrate if need be

You see?

Basicly, if you read "Max. Avg." as "Max. Calculated Bitrate" all should be clear.

markrb
6th December 2002, 23:49
And you do it so well :D :D :D

Mark