[x265] cleanup unused arg

Satoshi Nakagawa nakagawa424 at oki.com
Fri May 16 06:08:33 CEST 2014


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1400213085 -32400
#      Fri May 16 13:04:45 2014 +0900
# Node ID 0de12bdf3e52b3ca9e269fccd4397e4ed38b8228
# Parent  7533425d506042bd8e7260167e1f8c364e45debf
cleanup unused arg

diff -r 7533425d5060 -r 0de12bdf3e52 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Fri May 16 08:00:23 2014 +0530
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Fri May 16 13:04:45 2014 +0900
@@ -1304,13 +1304,13 @@
     return getDepth(absPartIdx);
 }
 
-void TComDataCU::setCbfSubParts(uint32_t cbfY, uint32_t cbfU, uint32_t cbfV, uint32_t absPartIdx, uint32_t depth)
+void TComDataCU::clearCbf(uint32_t absPartIdx, uint32_t depth)
 {
     uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);
 
-    memset(m_cbf[0] + absPartIdx, cbfY, sizeof(uint8_t) * curPartNum);
-    memset(m_cbf[1] + absPartIdx, cbfU, sizeof(uint8_t) * curPartNum);
-    memset(m_cbf[2] + absPartIdx, cbfV, sizeof(uint8_t) * curPartNum);
+    memset(m_cbf[0] + absPartIdx, 0, sizeof(uint8_t) * curPartNum);
+    memset(m_cbf[1] + absPartIdx, 0, sizeof(uint8_t) * curPartNum);
+    memset(m_cbf[2] + absPartIdx, 0, sizeof(uint8_t) * curPartNum);
 }
 
 void TComDataCU::setCbfSubParts(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t depth)
@@ -1320,19 +1320,6 @@
     memset(m_cbf[ttype] + absPartIdx, cbf, sizeof(uint8_t) * curPartNum);
 }
 
-/** Sets a coded block flag for all sub-partitions of a partition
- * \param uiCbf The value of the coded block flag to be set
- * \param ttype
- * \param absPartIdx
- * \param partIdx
- * \param depth
- * \returns void
- */
-void TComDataCU::setCbfSubParts(uint32_t uiCbf, TextType ttype, uint32_t absPartIdx, uint32_t partIdx, uint32_t depth)
-{
-    setSubPart<uint8_t>(uiCbf, m_cbf[ttype], absPartIdx, depth, partIdx);
-}
-
 void TComDataCU::setCbfPartRange(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t coveredPartIdxes)
 {
     memset(m_cbf[ttype] + absPartIdx, cbf, sizeof(uint8_t) * coveredPartIdxes);
diff -r 7533425d5060 -r 0de12bdf3e52 source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h	Fri May 16 08:00:23 2014 +0530
+++ b/source/Lib/TLibCommon/TComDataCU.h	Fri May 16 13:04:45 2014 +0900
@@ -300,9 +300,8 @@
 
     uint8_t       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          clearCbf(uint32_t absPartIdx, uint32_t depth);
     void          setCbfSubParts(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t depth);
-    void          setCbfSubParts(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t partIdx, uint32_t depth);
     void          setCbfPartRange(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t coveredPartIdxes);
     void          setTransformSkipPartRange(uint32_t useTransformSkip, TextType ttype, uint32_t absPartIdx, uint32_t coveredPartIdxes);
 
diff -r 7533425d5060 -r 0de12bdf3e52 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Fri May 16 08:00:23 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Fri May 16 13:04:45 2014 +0900
@@ -1193,7 +1193,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = getdQPFlag();
-    m_entropyCoder->encodeCoeff(cu, absPartIdx, depth, cu->getCUSize(absPartIdx), cu->getCUSize(absPartIdx), bCodeDQP);
+    m_entropyCoder->encodeCoeff(cu, absPartIdx, depth, cu->getCUSize(absPartIdx), bCodeDQP);
     setdQPFlag(bCodeDQP);
 
     // --- write terminating bit ---
@@ -1385,7 +1385,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = getdQPFlag();
-    m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), outTempCU->getCUSize(0), bCodeDQP);
+    m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), bCodeDQP);
 
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();
@@ -1435,7 +1435,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = getdQPFlag();
-    m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), outTempCU->getCUSize(0), bCodeDQP);
+    m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), bCodeDQP);
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();
 
diff -r 7533425d5060 -r 0de12bdf3e52 source/Lib/TLibEncoder/TEncEntropy.cpp
--- a/source/Lib/TLibEncoder/TEncEntropy.cpp	Fri May 16 08:00:23 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncEntropy.cpp	Fri May 16 13:04:45 2014 +0900
@@ -209,7 +209,7 @@
     tuIterator->m_absPartIdxStep    = absPartIdxStep >> partIdxStepShift[splitMode];
 }
 
-void TEncEntropy::xEncodeTransform(TComDataCU* cu, uint32_t offsetLuma, uint32_t offsetChroma, uint32_t absPartIdx, uint32_t absPartIdxStep, uint32_t depth, uint32_t width, uint32_t height, uint32_t trIdx, bool& bCodeDQP)
+void TEncEntropy::xEncodeTransform(TComDataCU* cu, uint32_t offsetLuma, uint32_t offsetChroma, uint32_t absPartIdx, uint32_t absPartIdxStep, uint32_t depth, uint32_t tuSize, uint32_t trIdx, bool& bCodeDQP)
 {
     const uint32_t subdiv = cu->getTransformIdx(absPartIdx) + cu->getDepth(absPartIdx) > depth;
     const uint32_t log2TrafoSize = g_convertToBit[cu->getSlice()->getSPS()->getMaxCUSize()] + 2 - depth;
@@ -276,7 +276,7 @@
     const bool bFirstCbfOfCU = trDepthCurr == 0;
 
     bool mCodeAll = true;
-    const uint32_t numPels = (width >> hChromaShift) * (height >> vChromaShift);
+    const uint32_t numPels = (tuSize * tuSize) >> (hChromaShift + vChromaShift);
     if (numPels < (MIN_TU_SIZE * MIN_TU_SIZE))
     {
         mCodeAll = false;
@@ -286,11 +286,11 @@
     {
         if (bFirstCbfOfCU || cu->getCbf(absPartIdx, TEXT_CHROMA_U, trDepthCurr - 1))
         {
-            m_entropyCoderIf->codeQtCbf(cu, absPartIdx, TEXT_CHROMA_U, trDepthCurr, absPartIdxStep, (width  >> hChromaShift), (height >> vChromaShift), (subdiv == 0));
+            m_entropyCoderIf->codeQtCbf(cu, absPartIdx, TEXT_CHROMA_U, trDepthCurr, absPartIdxStep, (tuSize >> hChromaShift), (tuSize >> vChromaShift), (subdiv == 0));
         }
         if (bFirstCbfOfCU || cu->getCbf(absPartIdx, TEXT_CHROMA_V, trDepthCurr - 1))
         {
-            m_entropyCoderIf->codeQtCbf(cu, absPartIdx, TEXT_CHROMA_V, trDepthCurr, absPartIdxStep, (width  >> hChromaShift), (height >> vChromaShift), (subdiv == 0));
+            m_entropyCoderIf->codeQtCbf(cu, absPartIdx, TEXT_CHROMA_V, trDepthCurr, absPartIdxStep, (tuSize >> hChromaShift), (tuSize >> vChromaShift), (subdiv == 0));
         }
     }
     else
@@ -301,31 +301,30 @@
 
     if (subdiv)
     {
-        uint32_t size;
-        width  >>= 1;
-        height >>= 1;
-        size = width * height;
+        tuSize >>= 1;
+        uint32_t numCoeff  = tuSize * tuSize;
+        uint32_t numCoeffC = (numCoeff >> (hChromaShift + vChromaShift));
         trIdx++;
         ++depth;
-        absPartIdxStep    = absPartIdxStep >> partIdxStepShift[QUAD_SPLIT];
+        absPartIdxStep >>= 2;
         const uint32_t partNum = cu->getPic()->getNumPartInCU() >> (depth << 1);
 
-        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, width, height, trIdx, bCodeDQP);
+        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, tuSize, trIdx, bCodeDQP);
 
         absPartIdx += partNum;
-        offsetLuma += size;
-        offsetChroma += (size >> (hChromaShift + vChromaShift));
-        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, width, height, trIdx, bCodeDQP);
+        offsetLuma += numCoeff;
+        offsetChroma += numCoeffC;
+        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, tuSize, trIdx, bCodeDQP);
 
         absPartIdx += partNum;
-        offsetLuma += size;
-        offsetChroma += (size >> (hChromaShift + vChromaShift));
-        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, width, height, trIdx, bCodeDQP);
+        offsetLuma += numCoeff;
+        offsetChroma += numCoeffC;
+        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, tuSize, trIdx, bCodeDQP);
 
         absPartIdx += partNum;
-        offsetLuma += size;
-        offsetChroma += (size >> (hChromaShift + vChromaShift));
-        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, width, height, trIdx, bCodeDQP);
+        offsetLuma += numCoeff;
+        offsetChroma += numCoeffC;
+        xEncodeTransform(cu, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, tuSize, trIdx, bCodeDQP);
     }
     else
     {
@@ -346,7 +345,7 @@
         }
         else
         {
-            m_entropyCoderIf->codeQtCbf(cu, absPartIdx, TEXT_LUMA, cu->getTransformIdx(absPartIdx), absPartIdxStep, width, height, (subdiv == 0));
+            m_entropyCoderIf->codeQtCbf(cu, absPartIdx, TEXT_LUMA, cu->getTransformIdx(absPartIdx), absPartIdxStep, tuSize, tuSize, (subdiv == 0));
         }
 
         if (cbfY || cbfU || cbfV)
@@ -363,7 +362,7 @@
         }
         if (cbfY)
         {
-            m_entropyCoderIf->codeCoeffNxN(cu, (cu->getCoeffY() + offsetLuma), absPartIdx, width, depth, TEXT_LUMA);
+            m_entropyCoderIf->codeCoeffNxN(cu, (cu->getCoeffY() + offsetLuma), absPartIdx, tuSize, depth, TEXT_LUMA);
         }
 
         int chFmt = cu->getChromaFormat();
@@ -397,8 +396,8 @@
         }
         else
         {
-            uint32_t trWidthC  = width  >> hChromaShift;
-            uint32_t trHeightC = height >> vChromaShift;
+            uint32_t trWidthC  = tuSize >> hChromaShift;
+            uint32_t trHeightC = tuSize >> vChromaShift;
             const bool splitIntoSubTUs = (chFmt == CHROMA_422);
             trHeightC = splitIntoSubTUs ? trHeightC >> 1 : trHeightC;
             uint32_t curPartNum = cu->getPic()->getNumPartInCU() >> (depth << 1);
@@ -588,7 +587,7 @@
  * \param width
  * \param height
  */
-void TEncEntropy::encodeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, uint32_t width, uint32_t height, bool& bCodeDQP)
+void TEncEntropy::encodeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, uint32_t cuSize, bool& bCodeDQP)
 {
     uint32_t lumaOffset   = absPartIdx << cu->getPic()->getLog2UnitSize() * 2;
     uint32_t chromaOffset = lumaOffset >> (cu->getHorzChromaShift() + cu->getVertChromaShift());
@@ -613,7 +612,7 @@
     }
 
     uint32_t absPartIdxStep = cu->getPic()->getNumPartInCU() >> (depth << 1);
-    xEncodeTransform(cu, lumaOffset, chromaOffset, absPartIdx, absPartIdxStep, depth, width, height, 0, bCodeDQP);
+    xEncodeTransform(cu, lumaOffset, chromaOffset, absPartIdx, absPartIdxStep, depth, cuSize, 0, bCodeDQP);
 }
 
 void TEncEntropy::encodeCoeffNxN(TComDataCU* cu, coeff_t* coeff, uint32_t absPartIdx, uint32_t trWidth, uint32_t trHeight, uint32_t depth, TextType ttype)
diff -r 7533425d5060 -r 0de12bdf3e52 source/Lib/TLibEncoder/TEncEntropy.h
--- a/source/Lib/TLibEncoder/TEncEntropy.h	Fri May 16 08:00:23 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncEntropy.h	Fri May 16 13:04:45 2014 +0900
@@ -198,11 +198,11 @@
 
 private:
 
-    void xEncodeTransform(TComDataCU* cu, uint32_t offsetLumaOffset, uint32_t offsetChroma, uint32_t absPartIdx, uint32_t absPartIdxStep, uint32_t depth, uint32_t width, uint32_t height, uint32_t uiTrIdx, bool& bCodeDQP);
+    void xEncodeTransform(TComDataCU* cu, uint32_t offsetLumaOffset, uint32_t offsetChroma, uint32_t absPartIdx, uint32_t absPartIdxStep, uint32_t depth, uint32_t tuSize, uint32_t uiTrIdx, bool& bCodeDQP);
 
 public:
 
-    void encodeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, uint32_t width, uint32_t height, bool& bCodeDQP);
+    void encodeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, uint32_t cuSize, bool& bCodeDQP);
 
     void encodeCoeffNxN(TComDataCU* cu, coeff_t* pcCoeff, uint32_t absPartIdx, uint32_t trWidth, uint32_t trHeight, uint32_t depth, TextType ttype);
 
diff -r 7533425d5060 -r 0de12bdf3e52 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Fri May 16 08:00:23 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Fri May 16 13:04:45 2014 +0900
@@ -2695,7 +2695,7 @@
 
         m_rdGoOnSbacCoder->store(m_rdSbacCoders[cu->getDepth(0)][CI_TEMP_BEST]);
 
-        cu->setCbfSubParts(0, 0, 0, 0, cu->getDepth(0));
+        cu->clearCbf(0, cu->getDepth(0));
         cu->setTrIdxSubParts(0, 0, cu->getDepth(0));
         return;
     }
@@ -2793,7 +2793,7 @@
 
     if (cu->isSkipped(0))
     {
-        cu->setCbfSubParts(0, 0, 0, 0, cu->getDepth(0));
+        cu->clearCbf(0, cu->getDepth(0));
     }
 }
 
@@ -2802,9 +2802,7 @@
     if (skipRes && cu->getPredictionMode(0) == MODE_INTER && cu->getMergeFlag(0) && cu->getPartitionSize(0) == SIZE_2Nx2N)
     {
         predYuv->copyToPartYuv(reconYuv, 0);
-        cu->setCbfSubParts(0, TEXT_LUMA, 0, 0, cu->getDepth(0));
-        cu->setCbfSubParts(0, TEXT_CHROMA_U, 0, 0, cu->getDepth(0));
-        cu->setCbfSubParts(0, TEXT_CHROMA_V, 0, 0, cu->getDepth(0));
+        cu->clearCbf(0, cu->getDepth(0));
         return;
     }
     if (cu->getPredictionMode(0) == MODE_INTER)
@@ -4068,7 +4066,7 @@
         m_entropyCoder->encodePartSize(cu, 0, cu->getDepth(0));
         m_entropyCoder->encodePredInfo(cu, 0);
         bool bDummy = false;
-        m_entropyCoder->encodeCoeff(cu, 0, cu->getDepth(0), cu->getCUSize(0), cu->getCUSize(0), bDummy);
+        m_entropyCoder->encodeCoeff(cu, 0, cu->getDepth(0), cu->getCUSize(0), bDummy);
         return m_entropyCoder->getNumberOfWrittenBits();
     }
 }
diff -r 7533425d5060 -r 0de12bdf3e52 source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Fri May 16 08:00:23 2014 +0530
+++ b/source/encoder/compress.cpp	Fri May 16 13:04:45 2014 +0900
@@ -65,7 +65,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = getdQPFlag();
-    m_entropyCoder->encodeCoeff(cu, 0, depth, cu->getCUSize(0), cu->getCUSize(0), bCodeDQP);
+    m_entropyCoder->encodeCoeff(cu, 0, depth, cu->getCUSize(0), bCodeDQP);
 
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 


More information about the x265-devel mailing list