[x265] reduce addClip

Satoshi Nakagawa nakagawa424 at oki.com
Thu Feb 20 06:01:47 CET 2014


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1392872381 -32400
#      Thu Feb 20 13:59:41 2014 +0900
# Node ID 588adfc60b27190e5d595611c3d34c49e381d9ae
# Parent  3389061b75a486e004409ab628c46fed39d03b72
reduce addClip

diff -r 3389061b75a4 -r 588adfc60b27 source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h	Wed Feb 19 17:03:21 2014 -0600
+++ b/source/Lib/TLibCommon/TComDataCU.h	Thu Feb 20 13:59:41 2014 +0900
@@ -312,7 +312,7 @@
 
     void          setCbf(uint32_t idx, TextType ttype, UChar uh)     { m_cbf[ttype][idx] = uh; }
 
-    UChar         getQtRootCbf(uint32_t idx)           { return getCbf(idx, TEXT_LUMA, 0) || getCbf(idx, TEXT_CHROMA_U, 0) || getCbf(idx, TEXT_CHROMA_V, 0); }
+    UChar         getQtRootCbf(uint32_t idx)           { return getCbf(idx, TEXT_LUMA) || getCbf(idx, TEXT_CHROMA_U) || getCbf(idx, TEXT_CHROMA_V); }
 
     void          setCbfSubParts(uint32_t cbfY, uint32_t cbfU, uint32_t cbfV, uint32_t absPartIdx, uint32_t depth);
     void          setCbfSubParts(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t depth);
diff -r 3389061b75a4 -r 588adfc60b27 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Wed Feb 19 17:03:21 2014 -0600
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Thu Feb 20 13:59:41 2014 +0900
@@ -3210,7 +3210,14 @@
 
     assert(bcost != MAX_INT64);
 
-    outReconYuv->addClip(predYuv, outBestResiYuv, 0, width);
+    if (cu->getQtRootCbf(0))
+    {
+        outReconYuv->addClip(predYuv, outBestResiYuv, 0, width);
+    }
+    else
+    {
+        predYuv->copyToPartYuv(outReconYuv, 0);
+    }
 
     // update with clipped distortion and cost (qp estimation loop uses unclipped values)
     int part = partitionFromSizes(width, height);
@@ -3246,12 +3253,19 @@
     {
         residualTransformQuantInter(cu, 0, 0, resiYuv, cu->getDepth(0), true);
         uint32_t width  = cu->getWidth(0);
-        reconYuv->addClip(predYuv, resiYuv, 0, width);
-
-        if (cu->getMergeFlag(0) && cu->getPartitionSize(0) == SIZE_2Nx2N && cu->getQtRootCbf(0) == 0)
+        if (cu->getQtRootCbf(0))
         {
-            cu->setSkipFlagSubParts(true, 0, cu->getDepth(0));
+            reconYuv->addClip(predYuv, resiYuv, 0, width);
         }
+        else
+        {
+            predYuv->copyToPartYuv(reconYuv, 0);
+            if (cu->getMergeFlag(0) && cu->getPartitionSize(0) == SIZE_2Nx2N)
+            {
+                cu->setSkipFlagSubParts(true, 0, cu->getDepth(0));
+            }
+        }
+
     }
     else if (cu->getPredictionMode(0) == MODE_INTRA)
     {


More information about the x265-devel mailing list