[x265] [PATCH] csv: print the correct value for BufferFill column in csv

gopi.satykrishna at multicorewareinc.com gopi.satykrishna at multicorewareinc.com
Thu Apr 13 07:05:42 CEST 2017


# HG changeset patch
# User Gopi Satykrishna Akisetty <gopi.satykrishna at multicorewareinc.com>
# Date 1491978866 -19800
#      Wed Apr 12 12:04:26 2017 +0530
# Node ID 8e1f2e00dd9d2f7af2904f1774fc87a254ee36ea
# Parent  0b7d54dbb71a87a0c6514fee04a51c4b29d5d704
csv: print the correct value for BufferFill column in csv

diff -r 0b7d54dbb71a -r 8e1f2e00dd9d source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Wed Apr 12 19:01:00 2017 +0530
+++ b/source/encoder/ratecontrol.cpp	Wed Apr 12 12:04:26 2017 +0530
@@ -2550,25 +2550,25 @@
     m_bufferFillFinal = X265_MAX(m_bufferFillFinal, 0);
     m_bufferFillFinal += m_bufferRate;
 
-    if (m_bufferFillFinal > m_bufferSize) 
+    if (m_param->rc.bStrictCbr)
     {
-        if (m_param->rc.bStrictCbr)
+        if (m_bufferFillFinal > m_bufferSize)
         {
             filler = (int)(m_bufferFillFinal - m_bufferSize);
             filler += FILLER_OVERHEAD * 8;
-            m_bufferFillFinal -= filler;
-            bufferBits = X265_MIN(bits + filler + m_bufferExcess, m_bufferRate);
-            m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits + filler, 0);
-            m_bufferFillActual += bufferBits - bits - filler;
         }
-        else
-        {
-            m_bufferFillFinal = X265_MIN(m_bufferFillFinal, m_bufferSize);
-            bufferBits = X265_MIN(bits + m_bufferExcess, m_bufferRate);
-            m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits, 0);
-            m_bufferFillActual += bufferBits - bits;
-            m_bufferFillActual = X265_MIN(m_bufferFillActual, m_bufferSize);
-        }
+        m_bufferFillFinal -= filler;
+        bufferBits = X265_MIN(bits + filler + m_bufferExcess, m_bufferRate);
+        m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits + filler, 0);
+        m_bufferFillActual += bufferBits - bits - filler;
+    }
+    else
+    {
+        m_bufferFillFinal = X265_MIN(m_bufferFillFinal, m_bufferSize);
+        bufferBits = X265_MIN(bits + m_bufferExcess, m_bufferRate);
+        m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits, 0);
+        m_bufferFillActual += bufferBits - bits;
+        m_bufferFillActual = X265_MIN(m_bufferFillActual, m_bufferSize);
     }
     return filler;
 }


More information about the x265-devel mailing list