View Full Version : B-frames threshold formula ?
Pen-Pen
17th August 2003, 05:22
Could syskin (or any other person who knows it) give me the exact formula which involves B-frames threshold ? :)
I know negative values mean less b-frames, while positive values mean more b-frames, but I'm not satisfied with such an anti-mathematical explanation ;) I searched everywhere and couldn't find a precise answer
thx, I think it might interest a lot of people out here :)
superdump
17th August 2003, 11:25
Afaik, the b-frame quant equation is:
[previous p-frame quant*b-frame quant ratio] + b-frame offset = b-frame quant
Or at least it should be if all is working correctly. ;) I'm not sure how the rounding works however. I assume it's standard.
mf
17th August 2003, 11:26
Originally posted by superdump
[previous p-frame quant*b-frame quant ratio] + b-frame offset = b-frame quant
That's the quants. Pen-pen's asking about threshold (frametype decision).
superdump
17th August 2003, 15:14
D'oh. My apologies, another half-awake reply from me. :) I'll get sysKin on it.
sysKin
17th August 2003, 15:33
Originally posted by superdump
I'll get sysKin on it. And superdump did.
I was going to answer that many hours ago, but I couldn't find the right words. I'll try now:
There is no 'formula'. The P/B decision is basically based on a ratio between changes in the image (from reference image) and the complexity of the image itself. This ratio can be seen as multiplied by a constant to be somewhere in the range of 0..2000.
This ratio is then tested against two thresholds. First is hard-coded and discovers if there was a scenechange. It's the I part of P/B/I .
Second threshold is created using a hard-coded value, the "threshold" given in configuration, and the number of B-frames in a row so far. You can look into the real formula in the code, but since it's pretty difficult to guess anything from the way ratio is created (none of its components is simple) it won't help you anyway.
Radek
Pen-Pen
18th August 2003, 00:19
ok thx... think it will remain empirical then ;)
JasonFly
20th August 2003, 19:01
These days, I was also thinking about bframe threshold and I'll try to make some tests in the future.
The idea is: can we get better quality using more "maxbframe"(4/5 instead of 2/3) with a low bframe threshold(negative) than usual settings(2/3 bframe with an higher threshold(positive)).
The idea is that this should put max bframes for easy to encode scenes, and a little less with difficult scenes.
That's just an idea, so don't hit me.I'll try some test later
superdump
20th August 2003, 23:51
I have suggested something similar purely for credits encoding. In dev-api-4 (currently) zones can be defined with different settings. But only certain settings can be changed. Max. B-VOPS is one of them that cannot be changed due to memory allocation for b-frames being at the beginning of encoding. SysKin suggested the possibility of "soft" memory allocation where it searches all zones for the max. max. consecutive b-frames and and then allocates the memory for that. Afterwards each zone can use the memory that has been allocated as it is required. Max. consecutive B-Frame triggering may be interesting though.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.