View Full Version : 2 B frames encoding time anomaly


OpasanNekiLik
3rd June 2011, 09:45
Could someone explain to me the anomaly why x264 encoder needs more time for encoding with 2 B frames than with 3 B frames?

I made test where I encoded a video sequence with various number [0..16] of B frames between keyframes. The best quality was achieved with 2 and 3 B frames but for some reason 2 B frames require more encoding time than 1 or 3 B frames.

Test can be found here (http://www.avcoding.com/2011/06/test-number-of-b-frames.html).

detmek
3rd June 2011, 11:38
New b-pyramid algorithm increases encoding speed, even for --b-adapt 2. If 3 B frames activates b-pyramid, maybe that is a reason.

akupenguin
5th June 2011, 01:23
Pyramid is slower than non-pyramid, because pyramid allows the use of more references, namely the 2nd future ref in disposable b-frames prior to the B-ref. Pyramid is enabled by default when B>=2. Pyramid with B==2 has a greater fraction of "disposable b-frames prior to the B-ref" than B==3 does. And indeed, the speed bump goes away if you set ref=1 and/or pyramid=none.

Pyramid=strict is faster than pyramid=normal because strict forbids the use of some refs that normal allows. This is not an optimization, just a loss of an opportunity.