[x265] [PATCH] rc: fix average P-frame qp in 2-pass
Divya Manivannan
divya at multicorewareinc.com
Thu Sep 22 07:35:36 CEST 2016
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1474457686 -19800
# Wed Sep 21 17:04:46 2016 +0530
# Branch stable
# Node ID e76d00a928b2c37299ad99defee3ba5217191419
# Parent eceb4f1ee953237781d68be333ee0b7a69d42448
rc: fix average P-frame qp in 2-pass
diff -r eceb4f1ee953 -r e76d00a928b2 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Wed Sep 21 10:46:14 2016 +0530
+++ b/source/encoder/ratecontrol.cpp Wed Sep 21 17:04:46 2016 +0530
@@ -1718,6 +1718,15 @@
q = X265_MIN(x265_qp2qScale(ABR_INIT_QP_GRAIN_MAX), q);
rce->qpNoVbv = x265_qScale2qp(q);
+ if ((m_sliceType == I_SLICE && m_param->keyframeMax > 1
+ && m_lastNonBPictType != I_SLICE && !m_isAbrReset) || (m_isNextGop && !m_framesDone))
+ m_avgPFrameQp = 0;
+ if (m_sliceType == P_SLICE)
+ {
+ m_avgPFrameQp = m_avgPFrameQp == 0 ? rce->qpNoVbv : m_avgPFrameQp;
+ m_avgPFrameQp = (m_avgPFrameQp + rce->qpNoVbv) / 2;
+ }
+
if (m_isVbv)
{
/* Do not overflow vbv */
More information about the x265-devel
mailing list