changeset 12631:6cb4a24acac3

zone: Enable strict VBV conformance for zone encode as per requirement
author Snehaa Giridharan <snehaa@multicorewareinc.com>
date Thu, 13 Feb 2020 10:26:47 +0530
parents 98ffcd578e08
children 9879e83852b5
files source/encoder/ratecontrol.cpp
diffstat 1 files changed, 3 insertions(+-), 0 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/ratecontrol.cpp	Mon Mar 23 20:03:41 2020 +0530
+++ b/source/encoder/ratecontrol.cpp	Thu Feb 13 10:26:47 2020 +0530
@@ -781,6 +781,8 @@ void RateControl::initHRD(SPS& sps)
     // Init HRD
     HRDInfo* hrd = &sps.vuiParameters.hrdParameters;
     hrd->cbrFlag = m_isCbr;
+    if (m_param->reconfigWindowSize)
+        hrd->cbrFlag = 0;
 
     // normalize HRD size and rate to the value / scale notation
     hrd->bitRateScale = x265_clip3(0, 15, calcScale(vbvMaxBitrate) - BR_SHIFT);
@@ -1279,6 +1281,7 @@ int RateControl::rateControlStart(Frame*
                 m_param->rc.vbvMaxBitrate = m_param->rc.zones[i].zoneParam->rc.vbvMaxBitrate;
                 memcpy(m_relativeComplexity, m_param->rc.zones[i].relativeComplexity, sizeof(double) * m_param->reconfigWindowSize);
                 reconfigureRC();
+                m_isCbr = 1; /* Always vbvmaxrate == bitrate here*/
                 m_top->zoneReadCount[i].incr();
             }
         }