[Ffmpeg-devel] ratecontrol experimentation

Oded Shimon ods15
Tue Feb 14 08:35:23 CET 2006


On Mon, Feb 13, 2006 at 10:20:24PM -0800, Corey Hickey wrote:
> On Mon, February 13, 2006 20:48, Loren Merritt wrote:
> > So your factor of
> > 10^8 should still by 10^5 times bigger than tex, and make the equation
> > equivalent to vrc_eq="mcVar^qComp". Which is a valid choice, but is it
> > what you meant?
> 
> I suppose having tex in there is nearly irrelevant at this point, but it
> does seem to make a slight difference. I just tested the following on a
> small test file:
> 
> (1) mcVar^qComp
> (2) (10^8*mcVar)^qComp
> (3) (tex+10^8*mcVar)^qComp
> 
> (1) and (2) are identical, but (3) is different. I had to go all the way up
> to (10^10*mcVar)^qComp to get an identical file. This correlates with real
> differences I was seeing; 10^8 looked very slightly better than 10^7,
> overall, and 10^9 looked substantially worse.
> 
> At this point, I'm rather murky in my understanding of how the ratecontrol
> equation works. I hadn't expected (1) to be the same as (2). Can you give me
> a rough explanation? At this point, writing down my own speculation wouldn't
> be very helpful, since it doesn't match the observed behavior.

I've never looked at the code myself, so I am only guessing here, but I 
think the general idea is:

Your equation gives each frame a "score". Now, the rate control knows how 
many bits it has and how much quantizer it can spend. It takes all scores, 
sums them, and then by looking at each frame's score and the total sum it 
can decide how many bits to spend on it. the higher the score, the more 
bits are spent.

Giving a 10^8 multiplication constant does nothing, because the score of 
ALL frames is risen by this const, and the relative scores stay exactly the 
same. The interesting part here is the relative score between other frames, 
not the absoloute value of the score for a single frame.

Say the scores are:
1, 2, 1, 1, 1

It'll spend twice as many bits on the second frame as all the other frames.
multiplying by a constant gives:
10, 20, 10, 10, 10

Same exact result...


This is all speculation though, I've never looked at lavc internals..

- ods15





More information about the ffmpeg-devel mailing list