[x265] [PATCH 2 of 3] rc: use actual bits to update vbv buffer

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Thu Jun 5 05:59:24 CEST 2014


# HG changeset patch
# User Aarthi Thirumalai
# Date 1401940698 -19800
#      Thu Jun 05 09:28:18 2014 +0530
# Branch stable
# Node ID 641274167691f037c955ab0145822db961fb1bb9
# Parent  a076f4fc8d36229c908a6d69b20dee88b2feaa61
rc: use actual bits to update vbv buffer

diff -r a076f4fc8d36 -r 641274167691 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Wed Jun 04 19:17:06 2014 +0530
+++ b/source/encoder/ratecontrol.cpp	Thu Jun 05 09:28:18 2014 +0530
@@ -1039,6 +1039,7 @@
 /* After encoding one frame, update rate control state */
 int RateControl::rateControlEnd(TComPic* pic, int64_t bits, RateControlEntry* rce)
 {
+    double actualBits = bits;
     if (isAbr)
     {
         if (param->rc.rateControlMode == X265_RC_ABR)
@@ -1123,7 +1124,7 @@
     {
         if (rce->sliceType == B_SLICE)
         {
-            bframeBits += (int)bits;
+            bframeBits += (int)actualBits;
             if (rce->bLastMiniGopBFrame)
             {
                 if (rce->bframes != 0)
@@ -1131,7 +1132,7 @@
                 bframeBits = 0;
             }
         }
-        updateVbv(bits, rce);
+        updateVbv(actualBits, rce);
     }
     rce->isActive = false;
     return 0;


More information about the x265-devel mailing list