[x265] [PATCH] rc: correct the threshold for resetABR function

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Wed Oct 1 21:16:59 CEST 2014


# HG changeset patch
# User Aarthi Thirumalai
# Date 1412190970 -19800
#      Thu Oct 02 00:46:10 2014 +0530
# Node ID 715f6cd617955e1e6100653e224e4a294d369f69
# Parent  07b9168a967236e84abe2decf3f26bab463f9d89
rc: correct the threshold for resetABR function

diff -r 07b9168a9672 -r 715f6cd61795 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Thu Oct 02 00:14:13 2014 +0530
+++ b/source/encoder/ratecontrol.cpp	Thu Oct 02 00:46:10 2014 +0530
@@ -1620,9 +1620,9 @@
         if (!m_isAbrReset && rce->movingAvgSum > 0)
         {
             // Reset ABR if prev frames are blank to prevent further sudden overflows/ high bit rate spikes.
-            double underflow = 1.0 + (m_totalBits - m_wantedBitsWindow) / abrBuffer;
-            const float epsilon = 0.1f;
-            if (fabs (underflow - 0.9f) < epsilon && !isFrameDone)
+            double underflow = (m_totalBits - m_wantedBitsWindow) / abrBuffer;
+            const double epsilon = 0.0001f;
+            if (underflow < epsilon && !isFrameDone)
             {
                 init(m_curSlice->m_sps);
                 m_shortTermCplxSum = rce->lastSatd / (CLIP_DURATION(m_frameDuration) / BASE_FRAME_DURATION);


More information about the x265-devel mailing list