"CRF-max" support with VBV
This is a rather curious feature that may have more use than is initially obvious. In CRF mode with VBV enabled, CRF-max allows the user to specify a quality level which the encoder will never go below, even due to the effects of VBV. This is not the same as qpmax, which is not aware of issues like scene complexity. Setting this WILL cause VBV underflows in any situation where the encoder would have needed to exceed the relevant CRF to avoid underflow. Why might one want to do this even if it would cause VBV underflows? In the case of streaming, particularly ultra-low-latency streaming, it may be preferable to drop frames than to display frames that are of too low a quality. Thus, in extremely complex scenes, rather than display completely awful video, the streaming server could simply drop to a lower framerate. Scenecuts, which normally look terrible under situations like single-frame VBV, could be handled by just displaying them a bit later and dropping frames to compensate. In other words, it's better to see the scenecut 150ms delayed than for it to look like a blocky mess for 150ms. On the caller-side, this would be handled by detecting the output size of x264's frames and dropping future frames to compensate if necessary. This can also be used in normal encoding simply to ensure that VBV does not hurt quality too much (at the cost of potentially causing underflows). This can help quite a lot when using single-frame VBV and sliced threads, where VBV can often be somewhat unstable.
Showing with 34 additions and 4 deletions