[x265] [PATCH] uhdbd: fix sourceHeight check

mahesh at multicorewareinc.com mahesh at multicorewareinc.com
Wed Jun 1 13:22:30 CEST 2016


# HG changeset patch
# User Mahesh Pittala <mahesh at multicorewareinc.com>
# Date 1461582611 -19800
#      Mon Apr 25 16:40:11 2016 +0530
# Node ID 21f10161f0a31a7cbec66a16ced9cb5c095fe543
# Parent  6d3849d648f0be5a8e334f1d75a2f7cf93c86cb3
uhdbd: fix sourceHeight check

when sourceHeight is 1080, it is padded by some value to become multiple of the
minimum CU size(for ex- 1088) so just moved down those calculations after uhd-bd.

diff -r 6d3849d648f0 -r 21f10161f0a3 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Sun May 29 21:50:25 2016 +0800
+++ b/source/encoder/encoder.cpp	Mon Apr 25 16:40:11 2016 +0530
@@ -1851,16 +1851,6 @@
         m_conformanceWindow.rightOffset = padsize;
     }
 
-    /* set pad size if height is not multiple of the minimum CU size */
-    if (p->sourceHeight & (p->minCUSize - 1))
-    {
-        uint32_t rem = p->sourceHeight & (p->minCUSize - 1);
-        uint32_t padsize = p->minCUSize - rem;
-        p->sourceHeight += padsize;
-
-        m_conformanceWindow.bEnabled = true;
-        m_conformanceWindow.bottomOffset = padsize;
-    }
     if (p->bEnableRdRefine && (p->rdLevel < 5 || !p->rc.aqMode))
     {
         p->bEnableRdRefine = false;
@@ -1889,6 +1879,8 @@
         p->bEnableAccessUnitDelimiters = 1;
         p->vui.aspectRatioIdc = 1;
         p->bEmitHRDSEI = 1;
+        p->levelIdc = 51;
+        p->bHighTier = 1;
         int disableUhdBd = 0;
         if (!p->bRepeatHeaders)
         {
@@ -1967,6 +1959,16 @@
         }
     }
 
+    /* set pad size if height is not multiple of the minimum CU size */
+    if (p->sourceHeight & (p->minCUSize - 1))
+    {
+        uint32_t rem = p->sourceHeight & (p->minCUSize - 1);
+        uint32_t padsize = p->minCUSize - rem;
+        p->sourceHeight += padsize;
+
+        m_conformanceWindow.bEnabled = true;
+        m_conformanceWindow.bottomOffset = padsize;
+    }
 
     if (p->bLogCuStats)
         x265_log(p, X265_LOG_WARNING, "--cu-stats option is now deprecated\n");
diff -r 6d3849d648f0 -r 21f10161f0a3 source/encoder/level.cpp
--- a/source/encoder/level.cpp	Sun May 29 21:50:25 2016 +0800
+++ b/source/encoder/level.cpp	Mon Apr 25 16:40:11 2016 +0530
@@ -133,7 +133,7 @@
     }
     else for (i = 0; i < NumLevels; i++)
     {
-        if (param.uhdBluray && levels[i].levelIdc != 51)
+        if (param.uhdBluray && levels[i].levelIdc != param.levelIdc)
         {
             continue;
         }
@@ -209,7 +209,7 @@
         else
             vps.ptl.tierFlag = Level::MAIN;
 #undef CHECK_RANGE
-        if (param.uhdBluray || param.bHighTier)
+        if (param.bHighTier)
             vps.ptl.tierFlag = Level::HIGH;
         vps.ptl.levelIdc = levels[i].levelEnum;
         vps.ptl.minCrForLevel = levels[i].minCompressionRatio;


More information about the x265-devel mailing list