[x265] [PATCH] fix preset placebo option crash for 444 color format

ashok at multicorewareinc.com ashok at multicorewareinc.com
Mon Apr 21 13:59:13 CEST 2014


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1398081502 -19800
#      Mon Apr 21 17:28:22 2014 +0530
# Node ID c956c6666ef6aed438c6bef60d9c376861a9d9c2
# Parent  ccfd0819b5c3f5ab3bb153a318b3e57e1033b771
fix preset placebo option crash for 444 color format

diff -r ccfd0819b5c3 -r c956c6666ef6 source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp	Mon Apr 21 18:33:32 2014 +0800
+++ b/source/Lib/TLibCommon/TComYuv.cpp	Mon Apr 21 17:28:22 2014 +0530
@@ -203,8 +203,6 @@
 {
     int part = splitIntoSubTUs ? NUM_CHROMA_PARTITIONS422 : partitionFromSizes(lumaSize, lumaSize);
 
-    assert(lumaSize != 4);
-
     if (chromaId == 1)
     {
         pixel*   srcU = getCbAddr(partIdx);
diff -r ccfd0819b5c3 -r c956c6666ef6 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Apr 21 18:33:32 2014 +0800
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Apr 21 17:28:22 2014 +0530
@@ -1026,7 +1026,7 @@
         uint32_t qtlayer    = cu->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - trSizeLog2;
 
         bool bChromaSame = false;
-        if (trSizeLog2 == 2)
+        if (trSizeLog2 == 2 && !(cu->getChromaFormat() == CHROMA_444))
         {
             assert(trDepth > 0);
             trDepth--;
@@ -1075,7 +1075,7 @@
         uint32_t qtlayer    = cu->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - trSizeLog2;
 
         bool bChromaSame = false;
-        if (trSizeLog2 == 2)
+        if (trSizeLog2 == 2 && !(cu->getChromaFormat() == CHROMA_444))
         {
             assert(trDepth > 0);
             trDepth--;
@@ -1198,10 +1198,15 @@
             }
         }
 
-        checkTransformSkip &= (trSizeLog2 <= 3);
+        uint32_t width  = cu->getCUSize(0)  >> (actualTrDepth + m_hChromaShift);
+        uint32_t height = cu->getCUSize(0)  >> (actualTrDepth + m_vChromaShift);
+        const bool splitIntoSubTUs = width != height;
+
+        checkTransformSkip &= (width <= 4);
+
         if (m_cfg->param->bEnableTSkipFast)
         {
-            checkTransformSkip &= (trSizeLog2 < 3);
+            checkTransformSkip &= ((cu->getCUSize(0) >> trDepth) <= 4);
             if (checkTransformSkip)
             {
                 int nbLumaSkip = 0;
@@ -1216,9 +1221,6 @@
 
         for (int chromaId = TEXT_CHROMA; chromaId < MAX_NUM_COMPONENT; chromaId++)
         {
-            uint32_t width          = cu->getCUSize(0)  >> (actualTrDepth + m_hChromaShift);
-            uint32_t height         = cu->getCUSize(0)  >> (actualTrDepth + m_vChromaShift);
-            const bool splitIntoSubTUs = width != height;
             TComTURecurse tuIterator;
             uint32_t curPartNum = cu->getPic()->getNumPartInCU() >> ((cu->getDepth(0) +  actualTrDepth) << 1);
             initSection(&tuIterator, splitIntoSubTUs ? VERTICAL_SPLIT : DONT_SPLIT, curPartNum, absPartIdx);


More information about the x265-devel mailing list