Commits

nandaku2 committed ca8c57f

RD merge: remove earlyDetectionSkip, output is unchanged.

Comments (0)

Files changed (2)

source/Lib/TLibEncoder/TEncCu.h

     void xComputeCostIntraInInter(TComDataCU* cu, PartSize partSize);
     void xCheckRDCostInter(TComDataCU*& outBestCU, TComDataCU*& outTempCU, PartSize partSize, bool bUseMRG = false);
     void xComputeCostInter(TComDataCU* outTempCU, TComYuv* outPredYUV, PartSize partSize, bool bUseMRG = false);
-    void xComputeCostMerge2Nx2N(TComDataCU*& outBestCU, TComDataCU*& outTempCU, bool* earlyDetectionSkip, TComYuv*& bestPredYuv, TComYuv*& tmpPredYuv);
+    void xComputeCostMerge2Nx2N(TComDataCU*& outBestCU, TComDataCU*& outTempCU, TComYuv*& bestPredYuv, TComYuv*& tmpPredYuv);
     void xEncodeIntraInInter(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* outResiYuv, TComYuv* outReconYuv);
     void xCheckRDCostIntra(TComDataCU*& outBestCU, TComDataCU*& outTempCU, PartSize partSize);
     void xCheckRDCostIntraInInter(TComDataCU*& outBestCU, TComDataCU*& outTempCU, PartSize partSize);

source/encoder/compress.cpp

     outTempCU->m_totalCost = m_rdCost->calcRdSADCost(distortion, outTempCU->m_totalBits);
 }
 
-void TEncCu::xComputeCostMerge2Nx2N(TComDataCU*& outBestCU, TComDataCU*& outTempCU, bool* earlyDetectionSkip, TComYuv*& bestPredYuv, TComYuv*& yuvReconBest)
+void TEncCu::xComputeCostMerge2Nx2N(TComDataCU*& outBestCU, TComDataCU*& outTempCU, TComYuv*& bestPredYuv, TComYuv*& yuvReconBest)
 {
     assert(outTempCU->getSlice()->getSliceType() != I_SLICE);
     TComMvField mvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
         yuvReconBest = m_tmpRecoYuv[depth];
         m_tmpRecoYuv[depth] = yuv;
     }
-
-    if (m_cfg->param.bEnableEarlySkip)
-    {
-        if (outBestCU->getQtRootCbf(0) == 0)
-        {
-            if (outBestCU->getMergeFlag(0))
-            {
-                *earlyDetectionSkip = true;
-            }
-            else
-            {
-                bool allZero = true;
-                for (uint32_t list = 0; list < 2; list++)
-                {
-                    if (outBestCU->getSlice()->getNumRefIdx(list) > 0)
-                    {
-                        allZero &= !outBestCU->getCUMvField(list)->getMvd(0).word;
-                    }
-                }
-
-                if (allZero)
-                {
-                    *earlyDetectionSkip = true;
-                }
-            }
-        }
-    }
-
     m_tmpResiYuv[depth]->clear();
     x265_emms();
 }
             }
 
             /* Compute  Merge Cost */
-            bool earlyDetectionSkip = false;
-            xComputeCostMerge2Nx2N(m_bestMergeCU[depth], m_mergeCU[depth], &earlyDetectionSkip, m_modePredYuv[3][depth], m_bestMergeRecoYuv[depth]);
+            xComputeCostMerge2Nx2N(m_bestMergeCU[depth], m_mergeCU[depth], m_modePredYuv[3][depth], m_bestMergeRecoYuv[depth]);
 
-            if (!earlyDetectionSkip)
+            if (!m_bestMergeCU[depth]->isSkipped(0))
             {
                 /*Compute 2Nx2N mode costs*/
                 {