[x265] [PATCH] level: Both bitrate and VBV constraints need to be respected at each level

deepthi at multicorewareinc.com deepthi at multicorewareinc.com
Fri May 22 12:08:05 CEST 2015


# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1432288845 -19800
#      Fri May 22 15:30:45 2015 +0530
# Node ID 6434da6ee537158c6dc43902d340ce5a587a31c7
# Parent  836e78398d98876e27c3c86a51b50c19235449ec
level: Both bitrate and VBV constraints need to be respected at each level

diff -r 836e78398d98 -r 6434da6ee537 source/encoder/level.cpp
--- a/source/encoder/level.cpp	Fri May 22 14:55:40 2015 +0530
+++ b/source/encoder/level.cpp	Fri May 22 15:30:45 2015 +0530
@@ -162,11 +162,10 @@
             return;
         }
 
-#define CHECK_RANGE(value, main, high) (value > main && value <= high)
+#define CHECK_RANGE(value, main, high) (high != MAX_UINT && value > main && value <= high)
 
-        if (CHECK_RANGE(bitrate, levels[i].maxBitrateMain, levels[i].maxBitrateHigh) &&
-            CHECK_RANGE((uint32_t)param.rc.vbvBufferSize, levels[i].maxCpbSizeMain, levels[i].maxCpbSizeHigh) &&
-            levels[i].maxBitrateHigh != MAX_UINT)
+        if (CHECK_RANGE(bitrate, levels[i].maxBitrateMain, levels[i].maxBitrateHigh) ||
+            CHECK_RANGE((uint32_t)param.rc.vbvBufferSize, levels[i].maxCpbSizeMain, levels[i].maxCpbSizeHigh))
         {
             /* If the user has not enabled high tier, continue looking to see if we can encode at a higher level, main tier */
             if (!param.bHighTier && (levels[i].levelIdc < param.levelIdc))


More information about the x265-devel mailing list