[x265] [PATCH] rc: check scenecut flag for resetting abr
Divya Manivannan
divya at multicorewareinc.com
Tue May 3 15:28:27 CEST 2016
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1462281215 -19800
# Tue May 03 18:43:35 2016 +0530
# Node ID 0107457fd62c5ebfcf6448c916bf658a068a1404
# Parent 00ea3784bd36c164c5f799c998d7a09f2cb244bf
rc: check scenecut flag for resetting abr
diff -r 00ea3784bd36 -r 0107457fd62c source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Thu Apr 28 09:59:30 2016 +0200
+++ b/source/encoder/ratecontrol.cpp Tue May 03 18:43:35 2016 +0530
@@ -1123,11 +1123,13 @@
copyRceData(rce, &m_rce2Pass[index]);
}
rce->isActive = true;
+ rce->scenecut = false;
bool isRefFrameScenecut = m_sliceType!= I_SLICE && m_curSlice->m_refFrameList[0][0]->m_lowres.bScenecut;
m_isFirstMiniGop = m_sliceType == I_SLICE ? true : m_isFirstMiniGop;
if (curFrame->m_lowres.bScenecut)
{
m_isSceneTransition = true;
+ rce->scenecut = true;
m_lastPredictorReset = rce->encodeOrder;
initFramePredictors();
@@ -1922,7 +1924,7 @@
double abrBuffer = 2 * m_rateTolerance * m_bitrate;
// Check if current Slice is a scene cut that follows low detailed/blank frames
- if (rce->lastSatd > 4 * rce->movingAvgSum)
+ if (rce->lastSatd > 4 * rce->movingAvgSum || rce->scenecut)
{
if (!m_isAbrReset && rce->movingAvgSum > 0
&& (m_isPatternPresent || !m_param->bframes))
diff -r 00ea3784bd36 -r 0107457fd62c source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h Thu Apr 28 09:59:30 2016 +0200
+++ b/source/encoder/ratecontrol.h Tue May 03 18:43:35 2016 +0530
@@ -107,6 +107,7 @@
int miscBits;
int coeffBits;
bool keptAsRef;
+ bool scenecut;
SEIPictureTiming *picTimingSEI;
HRDTiming *hrdTiming;
More information about the x265-devel
mailing list