changeset 5748:37e0b00adeec

rd: remove unnecessary sbaccoder loads
author Deepthi Devaki <deepthidevaki@multicorewareinc.com>
date Tue, 17 Dec 2013 14:53:18 +0530
parents 119d09b54b95
children 6edecf959a30
files source/Lib/TLibEncoder/TEncCu.h source/encoder/compress.cpp
diffstat 2 files changed, 4 insertions(+-), 16 deletions(-) [+]
line wrap: on
line diff
--- a/source/Lib/TLibEncoder/TEncCu.h	Tue Dec 17 12:40:04 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.h	Tue Dec 17 14:53:18 2013 +0530
@@ -174,7 +174,7 @@ protected:
     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, uint32_t partIndex);
+    void encodeResidue(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);
--- a/source/encoder/compress.cpp	Tue Dec 17 12:40:04 2013 +0530
+++ b/source/encoder/compress.cpp	Tue Dec 17 14:53:18 2013 +0530
@@ -830,7 +830,7 @@ void TEncCu::xCompressInterCU(TComDataCU
 
     if (m_cfg->param.rdLevel == 0 && depth == 0)
     {
-        encodeResidue(outBestCU, outBestCU, 0, 0, 0);
+        encodeResidue(outBestCU, outBestCU, 0, 0);
     }
     else
     {
@@ -847,25 +847,13 @@ void TEncCu::xCompressInterCU(TComDataCU
     assert(outBestCU->m_totalCost != MAX_DOUBLE);
 }
 
-void TEncCu::encodeResidue(TComDataCU* lcu, TComDataCU* cu, uint32_t absPartIdx, UChar depth, uint32_t partIndex)
+void TEncCu::encodeResidue(TComDataCU* lcu, TComDataCU* cu, uint32_t absPartIdx, UChar depth)
 {
     UChar nextDepth = (UChar)(depth + 1);
     TComDataCU* subTempPartCU = m_tempCU[nextDepth];
     TComPic* pic = cu->getPic();
     TComSlice* slice = cu->getPic()->getSlice();
 
-    if (depth != 0)
-    {
-        if (0 == partIndex) //initialize RD with previous depth buffer
-        {
-            m_rdSbacCoders[depth][CI_CURR_BEST]->load(m_rdSbacCoders[depth - 1][CI_CURR_BEST]);
-        }
-        else
-        {
-            m_rdSbacCoders[depth][CI_CURR_BEST]->load(m_rdSbacCoders[depth][CI_NEXT_BEST]);
-        }
-    }
-
     if (((depth < lcu->getDepth(absPartIdx)) && (depth < (g_maxCUDepth - g_addCUDepth))))
     {
         uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;
@@ -877,7 +865,7 @@ void TEncCu::encodeResidue(TComDataCU* l
             if (bInSlice && (lpelx < slice->getSPS()->getPicWidthInLumaSamples()) && (tpely < slice->getSPS()->getPicHeightInLumaSamples()))
             {
                 subTempPartCU->copyToSubCU(cu, partUnitIdx, depth + 1);
-                encodeResidue(lcu, subTempPartCU, absPartIdx, depth + 1, partUnitIdx);
+                encodeResidue(lcu, subTempPartCU, absPartIdx, depth + 1);
             }
         }