View Full Version : golden ratio for b-frames?
drcl
30th August 2006, 14:18
I read the thread about recommendations for XVID presets
There it was suggested that b-frame ratio of 1.62 (close to geometric golden ratio) and offset of 0 gave better results than the defaults.
Is there any testing/evidence for this?
sysKin
30th August 2006, 15:38
There it was suggested that b-frame ratio of 1.62 (close to geometric golden ratio) and offset of 0 gave better results than the defaults.
Sounds like fantasy, as geometry is irrelevant here and quantizers are rounded to nearest integer anyway. For all useful bitrates, 1.62 is equivalent to 1.5.
Is there any testing/evidence for this?
Effects of b-frames are highly subjective and can't be "proven" in any way, other than a large-scale blind test - and even then, they would only be true for that particular clip that was tested.
So, don't look for evidence, see what you like more.
Didée
30th August 2006, 21:11
Well, the myth was invented by me ... :o :D
Truth is that the properties of golden ratio are nearly irrelevant here. The aim for that setting was: to stay very close to the standard settings' quant distribution, BUT achieve lower B-quants for the P-quants '2' and '3'. Why? Because, when doing a "rather high" bitrate encoding, perhaps even with a "high bitrate" matrix, the gain achieved by the big P-frames gets sort of nihilized by the still-to-small B-frames.
P 2 3 4 5 6 7 8 9 10 11 12 .....
-------------------------------------------
B 4 5 7 8 10 11 13 14 16 17 19 1.5/1
B 3 4 6 7 9 10 12 13 15 16 18 1.5/0
B 3 4 6 8 9 11 12 14 16 17 19 1.6/0
By the way, the golden ratio is geometry is irrelevant here not only related to geometry. Nature itself uses the golden ratio a lot. Vegetables (e.g. cactuses), animals (e.g. shells), ... golden ratio is everywhere.
Effects of b-frames are highly subjective and can't be "proven" in any way, other than a large-scale blind test - and even then, they would only be true for that particular clip that was tested.
So, don't look for evidence, see what you like more.
Yup. However, in dark & low contrast scenes with (not only panning) motion, standard B-frame settings don't stand a chance. It could even be a good idea to modulate B-frame senitivity in relation to average frame luminosity, to achieve less B-frames in those difficult scenes:
Currently, reducing senitivity will prevent B-frames in bright & high contrast scenes at first (where B-frames offer the most compressibility gain). In the dark scenes, where compression gain is small, but observed quality is critical, even with a "normally reduced" sensitivity like -5 to -10, XviD still will happily put 2 consecutive B-frames, and quantize away those small bits that (would) make the scene look real.
sysKin
31st August 2006, 03:33
The aim for that setting was: to stay very close to the standard settings' quant distribution, BUT achieve lower B-quants for the P-quants '2' and '3'. Now *that*'s what I call a perfectly good reasoning :)
It could even be a good idea to modulate B-frame senitivity in relation to average frame luminosity, to achieve less B-frames in those difficult scenes:
Currently, reducing senitivity will prevent B-frames in bright & high contrast scenes at first (where B-frames offer the most compressibility gain). In the dark scenes, where compression gain is small, but observed quality is critical, even with a "normally reduced" sensitivity like -5 to -10, XviD still will happily put 2 consecutive B-frames, and quantize away those small bits that (would) make the scene look real.
Aha. Do you think you could put all this into some kind of semi-formal algorithm? I'm quite aware of the mistakes P/B decision makes, and good ideas how to solve them are very much appreciated. I volunteer to code whatever you invent.
Just please try to avoid "dark" and "bright" terms because (1) brightness data is not available for the decision currently [not that it would stop me from coding it if needed] and (2) because everything that applies to dark scenes also applies to foggy scenes, which suggests that it's not brightness level that counts but contrast/detail level (which IS available to P/B decision code).
:)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.