View Full Version : H264 CRF/CQ modes - size as settings testing parameter ?
Poutnik
25th August 2009, 15:26
In X264 2pass fixed size mode, there is known trade off of settings speed versus quality.
Also parameter usage description is aimed usually toward 2pass result.
In CQ mode, for parameter testing purposes,
I suppose there is trade off speed versus smaller size by more efficient encoding, with quality given by Q.
Or are there settings, causing changing of quality, that would be be misevaluated comparing speed and size ?
What about CRF ?
there is said some settings make better quality for same size, other smaller size for same quality, some even both.
Does make sense here comparing settings by time and final size ?
Can be gain/price (size/speed] results from CQ testing be used in CRF encoding ?
PS: BTW, I agree 2pass would give better results for size=final size of CRF.
but if exact size doesnot matter and if I use saved time for slower, more efficient settings....
J_Darnley
25th August 2009, 15:34
2-pass and crf are (nearly) equivalent in quality at the same bitrate. You can use the same settings for both the second pass and crf. Nobody should use constant quantiser for anything but testing.
[EDIT] Altering the encoding settings does affect the quality crf produces so you cannot say that changing setting X results in Y loss of compression.
Also, to clarify, neither 2-pass or crf are better than the other because they both have benefits. 2-pass has the benefit of better direct prediction but crf has the benefit of using the lookahead MV predictors.
akupenguin
25th August 2009, 16:32
Just do your tradeoff testing in 2pass, and the same conclusions will apply to CRF too. CQP will not be identical, because CRF predictably raises QP on some frames and lowers it on others, which will be correlated with the frame contents, which in turn affect which features are important.
Caveats: slicetype and mbtree spend their cputime on the 1st pass, whereas all other options should be measured by 2nd pass speed, if you want to predict their effect on CRF speed. Measurements of threading efficiency also depend on what's done when, so those can't be generalized from 2 to 1 pass.
Otoh, speed depends on bitrate (though less so than in a decoder), so even though CRF's quality isn't sufficiently constant to measure just size, you might get more accuracy by measuring CRF's speed and 2pass's quality on each option set.
Poutnik
26th August 2009, 19:46
Hmm, nice, I had no idea how dynamic CRF is.
I could find 16-35 in the same frame, and 20-30 is typical.
Poutnik
28th August 2009, 17:42
Just do your tradeoff testing in 2pass, and the same conclusions will apply to CRF too. CQP will not be identical, because CRF predictably raises QP on some frames and lowers it on others, which will be correlated with the frame contents, which in turn affect which features are important.
Caveats: slicetype and mbtree spend their cputime on the 1st pass, whereas all other options should be measured by 2nd pass speed, if you want to predict their effect on CRF speed. Measurements of threading efficiency also depend on what's done when, so those can't be generalized from 2 to 1 pass.
Otoh, speed depends on bitrate (though less so than in a decoder), so even though CRF's quality isn't sufficiently constant to measure just size, you might get more accuracy by measuring CRF's speed and 2pass's quality on each option set.
It seems to me results of settings tweak tests
for CQ cannot easily be applied to CRF as CRF changes quality,
for 2pass cannot easily be applied to CRF as CRF changes size.
I would say one can choose his favorite fast, balanced and HQ settings on 2pass,
and then for these settings balance CRF-Q to produce roughly same size.
E.g. my slow settings for CRFQ25 produce for same source about same size as CRFQ26 wit default settings. ( well, it is source dependent ).
akupenguin
28th August 2009, 17:52
It seems to me results of settings tweak tests
for CQ cannot easily be applied to CRF as CRF changes quality,
for 2pass cannot easily be applied to CRF as CRF changes size.
So? Speed-vs-compression settings have the same speed-vs-compression effects, regardless of what ratecontrol mode you use.
Poutnik
29th August 2009, 03:17
Nothing against your conclusion.
I may be wrong, but I think it is not mutually excluding with my post.
foxyshadis
29th August 2009, 03:28
Poutnik, what's meant is that when you test settings in 2-pass mode, if you set a crf with those settings to end up with the same size, you'll get the same quality. Each set of settings would be a different crf, in this case - use it once you're happy with quality or you'll go mad finding the magic numbers. Your method works, it's just unnecessarily tedious and wasteful attempting to find it the values in reverse.
Poutnik
29th August 2009, 05:44
Thanky you, foxyshadis, for your comment. I think the same.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.