[x265] [PATCH 1 of 2] rd: Rename rd encode functions

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue Dec 24 06:06:57 CET 2013


# HG changeset patch
# User Sumalatha Polureddy
# Date 1387858651 -19800
# Node ID d23e0552587db4879b6e362d4084f3db4bfd8f0d
# Parent  d74f2e0856b443d05ccffd87f86fc942b58a2588
rd: Rename rd encode functions

encodeResNoRD -- encode the residue without doing rd calculations in rd levels lessthan 2
encodeResAndCalcRD -- encode residue with rd calcualtions
recurEncodeResNoRD -- enocode residue recursively on lcu for final best modes, used in rd 0.

diff -r d74f2e0856b4 -r d23e0552587d source/Lib/TLibEncoder/TEncCu.h
--- a/source/Lib/TLibEncoder/TEncCu.h	Tue Dec 24 08:29:01 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.h	Tue Dec 24 09:47:31 2013 +0530
@@ -173,8 +173,8 @@
     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, TComYuv*& bestPredYuv, TComYuv*& tmpPredYuv);
-    void xEncodeIntraInInter(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* outResiYuv, TComYuv* outReconYuv);
-    void encodeResidue(TComDataCU* lcu, TComDataCU* cu, uint32_t absPartIdx, UChar depth);
+    void encodeResAndCalcRDIntraInInter(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* outResiYuv, TComYuv* outReconYuv);
+    void recurEncodeResNoRD(TComDataCU* lcu, TComDataCU* cu, uint32_t absPartIdx, UChar depth);
     void xCheckRDCostIntra(TComDataCU*& outBestCU, TComDataCU*& outTempCU, PartSize partSize);
     void xCheckRDCostIntraInInter(TComDataCU*& outBestCU, TComDataCU*& outTempCU, PartSize partSize);
     void xCheckDQP(TComDataCU* cu);
diff -r d74f2e0856b4 -r d23e0552587d source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Dec 24 08:29:01 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Dec 24 09:47:31 2013 +0530
@@ -3225,7 +3225,7 @@
     cu->setQPSubParts(qpBest, 0, cu->getDepth(0));
 }
 
-void TEncSearch::generateCoeffRecon(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* resiYuv, TComYuv* reconYuv, bool skipRes)
+void TEncSearch::encodeResNoRD(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* resiYuv, TComYuv* reconYuv, bool skipRes)
 {
     if (skipRes && cu->getPredictionMode(0) == MODE_INTER && cu->getMergeFlag(0) && cu->getPartitionSize(0) == SIZE_2Nx2N)
     {
diff -r d74f2e0856b4 -r d23e0552587d source/Lib/TLibEncoder/TEncSearch.h
--- a/source/Lib/TLibEncoder/TEncSearch.h	Tue Dec 24 08:29:01 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.h	Tue Dec 24 09:47:31 2013 +0530
@@ -170,7 +170,7 @@
                              uint64_t& dRDCost);
     void xSetIntraResultQT(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, bool bLumaOnly, TComYuv* reconYuv);
 
-    void generateCoeffRecon(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* resiYuv, TComYuv* reconYuv, bool skipRes);
+    void encodeResNoRD(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* resiYuv, TComYuv* reconYuv, bool skipRes);
 
     void xEstimateResidualQT(TComDataCU* cu, uint32_t absPartIdx, uint32_t absTUPartIdx, TShortYUV* resiYuv, uint32_t depth,
                              uint64_t &rdCost, uint32_t &outBits, uint32_t &outDist, uint32_t *puiZeroDist, bool curUseRDOQ = true);
diff -r d74f2e0856b4 -r d23e0552587d source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Tue Dec 24 08:29:01 2013 +0530
+++ b/source/encoder/compress.cpp	Tue Dec 24 09:47:31 2013 +0530
@@ -31,7 +31,7 @@
 
 using namespace x265;
 
-void TEncCu::xEncodeIntraInInter(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv,  TShortYUV* outResiYuv, TComYuv* outReconYuv)
+void TEncCu::encodeResAndCalcRDIntraInInter(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv,  TShortYUV* outResiYuv, TComYuv* outReconYuv)
 {
     uint64_t puCost = 0;
     uint32_t puDistY = 0;
@@ -427,7 +427,7 @@
                     }
 
                     m_bestMergeCU[depth]->setSkipFlagSubParts(true, 0, depth);
-                    m_search->generateCoeffRecon(m_bestMergeCU[depth], m_origYuv[depth], m_modePredYuv[3][depth], m_tmpResiYuv[depth], m_bestMergeRecoYuv[depth], true);
+                    m_search->encodeResNoRD(m_bestMergeCU[depth], m_origYuv[depth], m_modePredYuv[3][depth], m_tmpResiYuv[depth], m_bestMergeRecoYuv[depth], true);
                     earlyskip = true;
                 }
             }
@@ -528,7 +528,7 @@
                         xComputeCostIntraInInter(m_intraInInterCU[depth], SIZE_2Nx2N);
                         if (m_cfg->param.rdLevel > 2)
                         {
-                            xEncodeIntraInInter(m_intraInInterCU[depth], m_origYuv[depth], m_modePredYuv[5][depth],
+                            encodeResAndCalcRDIntraInInter(m_intraInInterCU[depth], m_origYuv[depth], m_modePredYuv[5][depth],
                                                 m_tmpResiYuv[depth],  m_tmpRecoYuv[depth]);
                         }
                         if (m_intraInInterCU[depth]->m_totalCost < outBestCU->m_totalCost)
@@ -562,16 +562,16 @@
                         else if (m_cfg->param.rdLevel == 1)
                         {
                             m_tmpResiYuv[depth]->subtract(m_origYuv[depth], m_bestPredYuv[depth], 0, outBestCU->getWidth(0));
-                            m_search->generateCoeffRecon(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
+                            m_search->encodeResNoRD(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
                         }
                     }
                     else
                     {
                         if (m_cfg->param.rdLevel == 2)
-                            xEncodeIntraInInter(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth],  m_bestRecoYuv[depth]);
+                            encodeResAndCalcRDIntraInInter(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth],  m_bestRecoYuv[depth]);
                         else if (m_cfg->param.rdLevel == 1)
                         {
-                            m_search->generateCoeffRecon(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
+                            m_search->encodeResNoRD(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
                         }
                     }
                     //Check Merge-skip
@@ -826,7 +826,7 @@
 
     if (m_cfg->param.rdLevel == 0 && depth == 0)
     {
-        encodeResidue(outBestCU, outBestCU, 0, 0);
+        recurEncodeResNoRD(outBestCU, outBestCU, 0, 0);
     }
     else if(m_cfg->param.rdLevel != 0)
     {
@@ -843,7 +843,7 @@
     assert(outBestCU->m_totalCost != MAX_DOUBLE);
 }
 
-void TEncCu::encodeResidue(TComDataCU* lcu, TComDataCU* cu, uint32_t absPartIdx, UChar depth)
+void TEncCu::recurEncodeResNoRD(TComDataCU* lcu, TComDataCU* cu, uint32_t absPartIdx, UChar depth)
 {
     UChar nextDepth = (UChar)(depth + 1);
     TComDataCU* subTempPartCU = m_tempCU[nextDepth];
@@ -861,7 +861,7 @@
             if (bInSlice && (lpelx < slice->getSPS()->getPicWidthInLumaSamples()) && (tpely < slice->getSPS()->getPicHeightInLumaSamples()))
             {
                 subTempPartCU->copyToSubCU(cu, partUnitIdx, depth + 1);
-                encodeResidue(lcu, subTempPartCU, absPartIdx, depth + 1);
+                recurEncodeResNoRD(lcu, subTempPartCU, absPartIdx, depth + 1);
             }
         }
 
@@ -956,7 +956,7 @@
     else
     {
         m_origYuv[0]->copyPartToYuv(m_origYuv[depth], absPartIdx);
-        m_search->generateCoeffRecon(cu, m_origYuv[depth], m_modePredYuv[5][depth], m_tmpResiYuv[depth],  m_tmpRecoYuv[depth], false);
+        m_search->encodeResNoRD(cu, m_origYuv[depth], m_modePredYuv[5][depth], m_tmpResiYuv[depth],  m_tmpRecoYuv[depth], false);
         xCheckDQP(cu);
         m_tmpRecoYuv[depth]->copyToPicYuv(cu->getPic()->getPicYuvRec(), lcu->getAddr(), absPartIdx);
         cu->copyCodedToPic(depth);


More information about the x265-devel mailing list