[x265] [PATCH] rc: record RF details in csv for 2 pass CRF
aarthi at multicorewareinc.com
aarthi at multicorewareinc.com
Tue Nov 24 18:03:29 CET 2015
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1448384595 -19800
# Tue Nov 24 22:33:15 2015 +0530
# Branch stable
# Node ID 08156f38d64e054b7f4a12c8eb9577b50dec1c33
# Parent 0c49c9cc75e4c1ef9534a28b49b97b9107636f5d
rc: record RF details in csv for 2 pass CRF
diff -r 0c49c9cc75e4 -r 08156f38d64e source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Mon Nov 23 14:06:10 2015 +0530
+++ b/source/encoder/ratecontrol.cpp Tue Nov 24 22:33:15 2015 +0530
@@ -1141,6 +1141,7 @@
}
if (!m_isAbr && m_2pass && m_param->rc.rateControlMode == X265_RC_CRF)
{
+ rce->oldQScale = rce->qScale;
rce->qScale = rce->newQScale;
rce->qpaRc = curEncData.m_avgQpRc = curEncData.m_avgQpAq = x265_qScale2qp(rce->newQScale);
m_qp = int(rce->qpaRc + 0.5);
@@ -2337,10 +2338,12 @@
{
if (m_param->rc.rateControlMode == X265_RC_ABR && !m_param->rc.bStatRead)
checkAndResetABR(rce, true);
+ }
- if (m_param->rc.rateControlMode == X265_RC_CRF)
+ if (m_param->rc.rateControlMode == X265_RC_CRF)
{
- if (int(curEncData.m_avgQpRc + 0.5) == slice->m_sliceQp)
+ if ((int(curEncData.m_avgQpRc + 0.5) == slice->m_sliceQp && !m_2pass) ||
+ (rce->oldQScale == rce->qScale))
curEncData.m_rateFactor = m_rateFactorConstant;
else
{
@@ -2351,7 +2354,6 @@
x265_qp2qScale(int(curEncData.m_avgQpRc + 0.5) + mbtree_offset);
}
}
- }
if (m_isAbr && !m_isAbrReset)
{
diff -r 0c49c9cc75e4 -r 08156f38d64e source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h Mon Nov 23 14:06:10 2015 +0530
+++ b/source/encoder/ratecontrol.h Tue Nov 24 22:33:15 2015 +0530
@@ -101,6 +101,7 @@
double qScale;
double newQScale;
double newQp;
+ double oldQScale;
int mvBits;
int miscBits;
int coeffBits;
More information about the x265-devel
mailing list