http://hg.videolan.org/x265/rev/d178be3b2b67
连续多个b帧cost相同,判断为blank帧,那接下来的帧也成为场景切换帧,在checkAndResetABR()函数内,满足条件的情况下选择缩放m_cplxrSum
官方的解释是为了降低blank帧后面帧的qp,提升质量
Reduce QP for the scene changes that is followed by black frames During a scenecut, the transition from black frames to a different sequence gives a high QP value. Reducing tune complexity factor for the scene change in ABR reduces QP.
--- a/source/encoder/ratecontrol.cpp Fri Aug 23 11:33:05 2019 +0530
+++ b/source/encoder/ratecontrol.cpp Sun Mar 17 15:29:45 2019 +0530
@@ -2116,6 +2116,9 @@ void RateControl::checkAndResetABR(RateC
if ((underflow < epsilon || rce->isFadeEnd) && !isFrameDone)
{
init(*m_curSlice->m_sps);
+ // Reduce tune complexity factor for scenes that follow blank frames
+ double tuneCplxFactor = (m_ncu > 3600 && m_param->rc.cuTree && !m_param->rc.hevcAq) ? 2.5 : m_param->rc.hevcAq ? 1.5 : m_isGrainEnabled ? 1.9 : 1.0;
+ m_cplxrSum /= tuneCplxFactor;
m_shortTermCplxSum = rce->lastSatd / (CLIP_DURATION(m_frameDuration) / BASE_FRAME_DURATION);
m_shortTermCplxCount = 1;
m_isAbrReset = true;