[x265] [PATCH] rc: clip the qp in ratecontrolEnd

Divya Manivannan divya at multicorewareinc.com
Fri Apr 22 14:53:36 CEST 2016


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1461327961 -19800
#      Fri Apr 22 17:56:01 2016 +0530
# Node ID fada28c8ab42041e87d9da05d757ab884bf48c59
# Parent  02d79be487d7f825c961d15535a8681a201da3b1
rc: clip the qp in ratecontrolEnd

diff -r 02d79be487d7 -r fada28c8ab42 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Sun Apr 17 21:07:28 2016 +0000
+++ b/source/encoder/ratecontrol.cpp	Fri Apr 22 17:56:01 2016 +0530
@@ -2448,6 +2448,7 @@
                 curEncData.m_avgQpRc += curEncData.m_rowStat[i].sumQpRc;
 
             curEncData.m_avgQpRc /= slice->m_sps->numCUsInFrame;
+            curEncData.m_avgQpRc = x265_clip3((double)QP_MIN, (double)QP_MAX_MAX, curEncData.m_avgQpRc);
             rce->qpaRc = curEncData.m_avgQpRc;
         }
 
diff -r 02d79be487d7 -r fada28c8ab42 source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h	Sun Apr 17 21:07:28 2016 +0000
+++ b/source/encoder/ratecontrol.h	Fri Apr 22 17:56:01 2016 +0530
@@ -179,7 +179,7 @@
     bool    m_isPatternPresent;
     bool    m_isSceneTransition;
     int     m_lastPredictorReset;
-    double m_qpToEncodedBits[QP_MAX_MAX];
+    double  m_qpToEncodedBits[QP_MAX_MAX + 1];
     /* a common variable on which rateControlStart, rateControlEnd and rateControUpdateStats waits to
      * sync the calls to these functions. For example
      * -F2:


More information about the x265-devel mailing list