Log in

View Full Version : CRF ratio calculation


jeffy
14th July 2008, 10:28
Is there a way to calculate a good approximation of the filesize of a file encoded at eg. CRF 18 when I know it has a certain size at CRF 20? In other words, is there some equation for a simple ratio calculation, eg. the filesize at CRF 18 equals 1.15 × the filesize at CRF 20? All settings remain the same.

I'm sorry if this was answered before, if yes, just give me the link, please. Thank you.

stax76
14th July 2008, 10:46
I would guess difference between 18 and 20 will be 20%-30% percent.

Dark Shikari
14th July 2008, 14:51
Dropping CRF by 6 will double filesize. Dropping CRF by 1 will raise filesize by 12.5%.

Roughly. Its quite possible to have a case where this guideline is totally wrong.

ajp_anton
14th July 2008, 15:25
If dropping by 6 means 2x increase, shouldn't dropping by 1 increase filesize by [2^(1/6)]x ~ 12.2% ?
Yeah I know, who cares... =)

Dark Shikari
14th July 2008, 15:27
If dropping by 6 means 2x increase, shouldn't dropping by 1 increase filesize by [2^(1/6)]x ~ 12.2% ?
Yeah I know, who cares... =)The 2x increase is an approximation, the 12.5% is an exact definition from the quantizer definition in the H.264 standard.

Of course, neither would guarantee exactly that change in bit cost.

jeffy
14th July 2008, 23:39
Thank you to all, and especially to Dark Shikari for the exact definition.

Sergey A. Sablin
15th July 2008, 12:09
12.5% actually came from Ian Richardson (not from standard) - http://www.vcodex.com/files/h264_transform.pdf
"Note that Qstep doubles in size for every increment of 6 in QP; Qstep increases by 12.5% for each increment of 1 in QP."

But if you'll look at the Table 2-1 Quantization step sizes in H.264 CODEC

QP 0 1 2 3 4 5 6 ...
QStep 0.625 0.6875 0.8125 0.875 1 1.125 1.25 ...


it's clear that quant step exactly doubles at each increment QP by 6 and increment QP by 1 changes quant step by 7.6658% .. 18.1818% depending on actual QP value.

While in general increase of quant step by X% should drop file size by ~X% - it's only valid for medium and high bitrates, cause at low bitrates this model behaves non-linearly because of many macroblocks without coefficients.

jeffy
15th July 2008, 20:45
@Sergey A. Sablin: Thank you for the link.