[x265] [PATCH 5 of 5] encode: avoid repetitive statements; no logic change

deepthi at multicorewareinc.com deepthi at multicorewareinc.com
Thu Mar 13 12:29:18 CET 2014


# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1394709625 -19800
# Node ID a9fbd8a9b188ad90298600263f591fa178e1459b
# Parent  37743f00b0efa5a7c3ad1db2c860d2470557db1d
encode: avoid repetitive statements; no logic change

diff -r 37743f00b0ef -r a9fbd8a9b188 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Thu Mar 13 16:24:41 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Thu Mar 13 16:50:25 2014 +0530
@@ -1146,13 +1146,15 @@
         bBoundary = true;
     }
 
+    if ((g_maxCUSize >> depth) >= cu->getSlice()->getPPS()->getMinCuDQPSize() && cu->getSlice()->getPPS()->getUseDQP())
+    {
+        setdQPFlag(true);
+    }
+
     if (((depth < cu->getDepth(absPartIdx)) && (depth < (g_maxCUDepth - g_addCUDepth))) || bBoundary)
     {
         uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;
-        if ((g_maxCUSize >> depth) == cu->getSlice()->getPPS()->getMinCuDQPSize() && cu->getSlice()->getPPS()->getUseDQP())
-        {
-            setdQPFlag(true);
-        }
+        
         for (uint32_t partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++, absPartIdx += qNumParts)
         {
             lpelx = cu->getCUPelX() + g_rasterToPelX[g_zscanToRaster[absPartIdx]];
@@ -1167,10 +1169,7 @@
         return;
     }
 
-    if ((g_maxCUSize >> depth) >= cu->getSlice()->getPPS()->getMinCuDQPSize() && cu->getSlice()->getPPS()->getUseDQP())
-    {
-        setdQPFlag(true);
-    }
+    
     if (cu->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     {
         m_entropyCoder->encodeCUTransquantBypassFlag(cu, absPartIdx);


More information about the x265-devel mailing list