[x265] [PATCH] search: cleanup and remove redundant variable in checkintra

gopu at multicorewareinc.com gopu at multicorewareinc.com
Thu Sep 18 09:29:59 CEST 2014


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1411017604 -19800
#      Thu Sep 18 10:50:04 2014 +0530
# Node ID e32bc023f232e10d0384d0cf4eec53f14419dabd
# Parent  86686bd153db547c33cfe23407f32e5e050f9d62
search: cleanup and remove redundant variable in checkintra

diff -r 86686bd153db -r e32bc023f232 source/encoder/search.cpp
--- a/source/encoder/search.cpp	Wed Sep 17 12:52:38 2014 +0200
+++ b/source/encoder/search.cpp	Thu Sep 18 10:50:04 2014 +0530
@@ -1218,9 +1218,10 @@
     uint32_t log2TrSize   = cu->getLog2CUSize(0) - initTrDepth;
     uint32_t tuSize       = 1 << log2TrSize;
     uint32_t qNumParts    = cu->getTotalNumPart() >> 2;
-    uint32_t totalDist    = 0;
     uint32_t sizeIdx      = log2TrSize - 2;
     uint32_t partOffset   = 0;
+    uint32_t srcstride   = reconYuv->getStride();
+    uint32_t dststride   = cu->m_pic->getPicYuvRec()->getStride();
 
     // loop over partitions
     for (uint32_t pu = 0; pu < numPU; pu++, partOffset += qNumParts)
@@ -1353,7 +1354,8 @@
         cu->setLumaIntraDirSubParts(bmode, partOffset, depth + initTrDepth);
         m_entropyCoder->load(m_rdEntropyCoders[depth][CI_CURR_BEST]);
 
-        totalDist += xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, true, cost, bits, depthRange);
+        // update distortion (rate and r-d costs are determined later)
+        cu->m_totalDistortion += xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, true, cost, bits, depthRange);
 
         xSetIntraResultQT(cu, initTrDepth, partOffset, reconYuv);
 
@@ -1362,9 +1364,7 @@
         {
             uint32_t zorder      = cu->getZorderIdxInCU() + partOffset;
             pixel*   dst         = cu->m_pic->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder);
-            uint32_t dststride   = cu->m_pic->getPicYuvRec()->getStride();
             pixel*   src         = reconYuv->getLumaAddr(partOffset);
-            uint32_t srcstride   = reconYuv->getStride();
             primitives.square_copy_pp[log2TrSize - 2](dst, dststride, src, srcstride);
         }
     }
@@ -1374,7 +1374,7 @@
         uint32_t combCbfY = 0;
         uint32_t partIdx  = 0;
         for (uint32_t part = 0; part < 4; part++, partIdx += qNumParts)
-            combCbfY |= cu->getCbf(partIdx, TEXT_LUMA,     1);
+            combCbfY |= cu->getCbf(partIdx, TEXT_LUMA, 1);
 
         for (uint32_t offs = 0; offs < 4 * qNumParts; offs++)
             cu->getCbf(TEXT_LUMA)[offs] |= combCbfY;
@@ -1383,9 +1383,6 @@
     // reset context models
     m_entropyCoder->load(m_rdEntropyCoders[depth][CI_CURR_BEST]);
 
-    // set distortion (rate and r-d costs are determined later)
-    cu->m_totalDistortion = totalDist;
-
     x265_emms();
 }
 


More information about the x265-devel mailing list