PDA

View Full Version : Another crf vs vbr question


desta
11th October 2008, 07:36
I recently experimented by doing a full setting crf encode, whilst generating a stats file for a VBR 2nd pass. Basically the equivalent of a slow 2 pass encode, with crf for the 1st. I used identical settings for the 2nd pass and the same bitrate as given from the crf, and kept the output from both.

Going on the logs alone, the 2nd pass had slightly better metrics for qp's, psnr and ssim, which is what I would've expected to a certain degree.

Analyzing both outputs in avinaptic obviously showed differing quant distribution between them. The '2nd pass' output encode actually raised the lowest qp and lowered the highest, in effect localizing them more centrally throughout. At the same time it also reduced the peak bitrate by about 6Mbs from that of the crf encode, and removed quite a few bitrate spikes.

Based purely on those results, that would lead me to believe that it had levelled the quality of the encode as a whole, and made it more constant.

However, comparing visually showed that whilst each encode had certain parts that were better/worse than the other, the crf output generally looked superior to the 2nd pass output, with some fairly apparent differences.

So after that fairly lengthy introduction, my question is should there theoretically be any benefit in doing a 2nd pass VBR encode from a crf pass of identical settings? Not wanting to use the term "best", but should the crf encode yield the most optimal results straight away, or should the 2nd pass refine them further?

In a way my question probably seems a bit redundant given what I've already said, but I'm just interested for my own peace of mind. I'm not suggesting people would or should do the same thing... god knows it turned out to be a pretty exhausting and non-conclusive experiment for me.

Audionut
11th October 2008, 08:24
Use --pass 2 if you want to hit a desired file size. Else --crf.

:search:

akupenguin
11th October 2008, 09:12
Based purely on those results, that would lead me to believe that it had levelled the quality of the encode as a whole, and made it more constant.
You should expect any ratecontrol change which reduces variation in bitrate to increase variation in quality, and vice versa. Maybe if you were comparing against a random number generator you could level both at once, but ratecontrol is about tradeoffs.

Quark.Fusion
11th October 2008, 09:52
However, comparing visually showed that whilst each encode had certain parts that were better/worse than the other, the crf output generally looked superior to the 2nd pass output, with some fairly apparent differences.
Can I ask another question: if we know crf value for a size and size for crf value what will give better quality — crf encode or 2-pass?

Dark Shikari
11th October 2008, 09:53
Can I ask another question: if we know crf value for a size and size for crf value what will give better quality — crf encode or 2-pass?In most cases, negligible difference.

With low --me settings, CRF, because CRF uses the predictors from lowres lookahead, which isn't done in unrestriced twopass mode.

desta
11th October 2008, 16:42
Use --pass 2 if you want to hit a desired file size. Else --crf.

:search:
I wasn't asking which is used for what. If you read my post, you'd see I used the same bitrate in the 2nd pass as taken from the crf. It was purely an experiment (as I said) to see if there would be any noticeable quality gain from a further pass.... not to try and hit a desired file size, of which I am well aware how to do.




Based purely on those results, that would lead me to believe that it had levelled the quality of the encode as a whole, and made it more constant.
You should expect any ratecontrol change which reduces variation in bitrate to increase variation in quality, and vice versa. Maybe if you were comparing against a random number generator you could level both at once, but ratecontrol is about tradeoffs.

Ah yeah, I hadn't thought of it like that. That makes perfect sense. :)