[x265] [PATCH 1 of 2] rc: recompute planned frame size when using vbv with --qpfile

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Fri Mar 13 06:03:52 CET 2015


# HG changeset patch
# User Aarthi Thirumalai
# Date 1426095355 -19800
#      Wed Mar 11 23:05:55 2015 +0530
# Node ID 29daf84c63f4d219988c81dc668706a5d7c20cde
# Parent  3187844f4a7f86b1751eaddbb0f0ed926f767eeb
rc: recompute planned frame size when using vbv with --qpfile

diff -r 3187844f4a7f -r 29daf84c63f4 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Mon Mar 09 14:35:20 2015 +0530
+++ b/source/encoder/ratecontrol.cpp	Wed Mar 11 23:05:55 2015 +0530
@@ -1068,6 +1068,14 @@
         m_qp = (int32_t)(curFrame->m_forceqp + 0.5) - 1;
         m_qp = x265_clip3(QP_MIN, QP_MAX_MAX, m_qp);
         rce->qpaRc = curEncData.m_avgQpRc = curEncData.m_avgQpAq = m_qp;
+        if (m_isAbr)
+        {
+            rce->qpNoVbv = rce->qpaRc;
+            m_lastQScaleFor[m_sliceType] = x265_qp2qScale(rce->qpaRc);
+            if (rce->poc == 0)
+                 m_lastQScaleFor[P_SLICE] = m_lastQScaleFor[m_sliceType] * fabs(m_param->rc.ipFactor);
+            rce->frameSizePlanned = predictSize(&m_pred[m_sliceType], m_qp, (double)m_currentSatd);
+        }
     }
     // Do not increment m_startEndOrder here. Make rateControlEnd of previous thread
     // to wait until rateControlUpdateStats of this frame is called


More information about the x265-devel mailing list