<div dir="ltr">In this patch, while calculating the B-slice qp, the frameSizePlanned calculation in non-vbv case is fixed and the frameSizePlanned is calculated from the predictors for vbv case.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 7:36 PM, Divya Manivannan <span dir="ltr"><<a href="mailto:divya@multicorewareinc.com" target="_blank">divya@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Divya Manivannan <<a href="mailto:divya@multicorewareinc.com">divya@multicorewareinc.com</a>><br>
# Date 1464265165 -19800<br>
#      Thu May 26 17:49:25 2016 +0530<br>
# Node ID be8836157d4506770427d8de6d97e5b97231d536<br>
# Parent  aeade2e8d8688ebffb8455b8948d89d6a72e2c38<br>
rc: remove vbv condition for updating framesizePlanned<br>
<br>
diff -r aeade2e8d868 -r be8836157d45 source/encoder/ratecontrol.cpp<br>
--- a/source/encoder/ratecontrol.cpp    Thu May 26 16:45:09 2016 +0530<br>
+++ b/source/encoder/ratecontrol.cpp    Thu May 26 17:49:25 2016 +0530<br>
@@ -1619,15 +1619,18 @@<br>
                 if (m_pred[m_predType].count == 1)<br>
                     qScale = x265_clip3(lmin, lmax, qScale);<br>
                 m_lastQScaleFor[m_sliceType] = qScale;<br>
-                rce->frameSizePlanned = predictSize(&m_pred[m_predType], qScale, (double)m_currentSatd);<br>
             }<br>
-            else<br>
-                rce->frameSizePlanned = qScale2bits(rce, qScale);<br>
+        }<br>
<br>
-            /* Limit planned size by MinCR */<br>
+        if (m_2pass)<br>
+            rce->frameSizePlanned = qScale2bits(rce, qScale);<br>
+        else<br>
+            rce->frameSizePlanned = predictSize(&m_pred[m_predType], qScale, (double)m_currentSatd);<br>
+<br>
+        /* Limit planned size by MinCR */<br>
+        if (m_isVbv)<br>
             rce->frameSizePlanned = X265_MIN(rce->frameSizePlanned, rce->frameSizeMaximum);<br>
-            rce->frameSizeEstimated = rce->frameSizePlanned;<br>
-        }<br>
+        rce->frameSizeEstimated = rce->frameSizePlanned;<br>
<br>
         rce->newQScale = qScale;<br>
         if(rce->bLastMiniGopBFrame)<br>
@@ -1834,7 +1837,7 @@<br>
         if ((m_curSlice->m_poc == 0 || m_lastQScaleFor[P_SLICE] < q) && !(m_2pass && !m_isVbv))<br>
             m_lastQScaleFor[P_SLICE] = q * fabs(m_param->rc.ipFactor);<br>
<br>
-        if (m_2pass && m_isVbv)<br>
+        if (m_2pass)<br>
             rce->frameSizePlanned = qScale2bits(rce, q);<br>
         else<br>
             rce->frameSizePlanned = predictSize(&m_pred[m_predType], q, (double)m_currentSatd);<br>
</blockquote></div><br></div>