[x264-devel] Change the predictors update algorithm

Anton Mitrofanov git at videolan.org
Sun Oct 11 19:01:08 CEST 2015


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue Sep 22 18:58:24 2015 +0300| [e0d722f85f8599e324be2bebef9430155b25c329] | committer: Henrik Gramner

Change the predictors update algorithm

Keep predictor offsets more stable. This should fix VBV misprediction in frames
with a large difference in complexity between the top and bottom parts.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e0d722f85f8599e324be2bebef9430155b25c329
---

 encoder/ratecontrol.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index d49e2a2..78051cc 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -2089,7 +2089,8 @@ static void update_predictor( predictor_t *p, float q, float var, float bits )
     if( var < 10 )
         return;
     float old_coeff = p->coeff / p->count;
-    float new_coeff = X264_MAX( bits*q / var, p->coeff_min );
+    float old_offset = p->offset / p->count;
+    float new_coeff = X264_MAX( (bits*q - old_offset) / var, p->coeff_min );
     float new_coeff_clipped = x264_clip3f( new_coeff, old_coeff/range, old_coeff*range );
     float new_offset = bits*q - new_coeff_clipped * var;
     if( new_offset >= 0 )



More information about the x264-devel mailing list