[x265] [PATCH] rc: qpvbv is between qpMin and prevRowQp when specifies the rfConstantMin

gopu at multicorewareinc.com gopu at multicorewareinc.com
Thu May 8 08:30:14 CEST 2014


# HG changeset patch
# User Gopu Govindaswamy
# Date 1399530575 -19800
#      Thu May 08 11:59:35 2014 +0530
# Node ID 06991c82909f631e86fead3dbe0a408552b0c4a0
# Parent  6871636e99cb7d26d1d693415d7f8bf52cd190cf
rc: qpvbv is between qpMin and prevRowQp when specifies the rfConstantMin

diff -r 6871636e99cb -r 06991c82909f source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Thu May 08 10:10:53 2014 +0530
+++ b/source/encoder/ratecontrol.cpp	Thu May 08 11:59:35 2014 +0530
@@ -859,7 +859,7 @@
         qpAbsoluteMax = X265_MIN(qpAbsoluteMax, rce->qpNoVbv + rateFactorMaxIncrement);
 
     if (rateFactorMaxDecrement)
-        qpAbsoluteMin = X265_MAX(qpAbsoluteMin, rce->qpNoVbv - rateFactorMaxIncrement);
+        qpAbsoluteMin = X265_MAX(qpAbsoluteMin, rce->qpNoVbv - rateFactorMaxDecrement);
 
     double qpMax = X265_MIN(prevRowQp + param->rc.qpStep, qpAbsoluteMax);
     double qpMin = X265_MAX(prevRowQp - param->rc.qpStep, qpAbsoluteMin);
@@ -931,10 +931,13 @@
             return -1;
         }
 
-        if (qpVbv < qpMin && prevRowQp > qpMin && canReencodeRow)
+        if (param->rc.rfConstantMin)
         {
-            qpVbv = Clip3(prevRowQp + 1.0f, (prevRowQp + qpVbv) * 0.5, qpMin);
-            return -1;
+            if (qpVbv < qpMin && prevRowQp > qpMin && canReencodeRow)
+            {
+                qpVbv = Clip3(qpMin, prevRowQp ,(prevRowQp + qpVbv) * 0.5);
+                return -1;
+            }
         }
     }
     else


More information about the x265-devel mailing list