[x265] cleanup unused
Satoshi Nakagawa
nakagawa424 at oki.com
Mon Feb 10 10:07:18 CET 2014
# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1392023050 -32400
# Mon Feb 10 18:04:10 2014 +0900
# Node ID 6a930059078707bf0f56e6ccbe3715e34f39f1bf
# Parent 2fc9c0a085347bf67e7f2865d8ea434d93b82a86
cleanup unused
diff -r 2fc9c0a08534 -r 6a9300590787 source/Lib/TLibCommon/TComPattern.cpp
--- a/source/Lib/TLibCommon/TComPattern.cpp Sat Feb 08 22:50:38 2014 +0900
+++ b/source/Lib/TLibCommon/TComPattern.cpp Mon Feb 10 18:04:10 2014 +0900
@@ -45,19 +45,6 @@
//! \{
// ====================================================================================================================
-// Tables
-// ====================================================================================================================
-
-const UChar TComPattern::m_intraFilter[5] =
-{
- 10, //4x4
- 7, //8x8
- 1, //16x16
- 0, //32x32
- 10, //64x64
-};
-
-// ====================================================================================================================
// Public member functions (TComPattern)
// ====================================================================================================================
@@ -436,56 +423,6 @@
}
}
-Pel* TComPattern::getAdiOrgBuf(int /*cuWidth*/, int /*cuHeight*/, Pel* adiBuf)
-{
- return adiBuf;
-}
-
-Pel* TComPattern::getAdiCbBuf(int /*cuWidth*/, int /*cuHeight*/, Pel* adiBuf)
-{
- return adiBuf;
-}
-
-Pel* TComPattern::getAdiCrBuf(int /*cuWidth*/, int cuHeight, Pel* adiBuf)
-{
- return adiBuf + ADI_BUF_STRIDE * (cuHeight * 2 + 1);
-}
-
-/** Get pointer to reference samples for intra prediction
- * \param dirMode prediction mode index
- * \param log2BlkSize size of block (2 = 4x4, 3 = 8x8, 4 = 16x16, 5 = 32x32, 6 = 64x64)
- * \param adiBuf pointer to unfiltered reference samples
- * \return pointer to (possibly filtered) reference samples
- *
- * The prediction mode index is used to determine whether a smoothed reference sample buffer is returned.
- */
-Pel* TComPattern::getPredictorPtr(uint32_t dirMode, uint32_t log2BlkSize, Pel* adiBuf)
-{
- Pel* src;
-
- assert(log2BlkSize >= 2 && log2BlkSize < 7);
- int diff = std::min<int>(abs((int)dirMode - HOR_IDX), abs((int)dirMode - VER_IDX));
- UChar ucFiltIdx = diff > m_intraFilter[log2BlkSize - 2] ? 1 : 0;
- if (dirMode == DC_IDX)
- {
- ucFiltIdx = 0; //no smoothing for DC or LM chroma
- }
-
- assert(ucFiltIdx <= 1);
-
- int width = 1 << log2BlkSize;
- int height = 1 << log2BlkSize;
-
- src = getAdiOrgBuf(width, height, adiBuf);
-
- if (ucFiltIdx)
- {
- src += ADI_BUF_STRIDE * (2 * height + 1);
- }
-
- return src;
-}
-
bool TComPattern::isAboveLeftAvailable(TComDataCU* cu, uint32_t partIdxLT)
{
bool bAboveLeftFlag;
diff -r 2fc9c0a08534 -r 6a9300590787 source/Lib/TLibCommon/TComPattern.h
--- a/source/Lib/TLibCommon/TComPattern.h Sat Feb 08 22:50:38 2014 +0900
+++ b/source/Lib/TLibCommon/TComPattern.h Mon Feb 10 18:04:10 2014 +0900
@@ -56,18 +56,10 @@
/// neighboring pixel access class for all components
class TComPattern
{
-private:
-
- static const UChar m_intraFilter[5];
-
public:
// access functions of ADI buffers
- Pel* getAdiOrgBuf(int cuWidth, int cuHeight, Pel* adiBuf);
- Pel* getAdiCbBuf(int cuWidth, int cuHeight, Pel* adiBuf);
- Pel* getAdiCrBuf(int cuWidth, int cuHeight, Pel* adiBuf);
-
- Pel* getPredictorPtr(uint32_t dirMode, uint32_t uiWidthBits, Pel* adiBuf);
+ static Pel* getAdiChromaBuf(int chromaId, int cuHeight, Pel* adiBuf) { return adiBuf + (chromaId == 0 ? 0 : ADI_BUF_STRIDE * (cuHeight * 2 + 1)); }
// -------------------------------------------------------------------------------------------------------------------
// initialization functions
diff -r 2fc9c0a08534 -r 6a9300590787 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp Sat Feb 08 22:50:38 2014 +0900
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Mon Feb 10 18:04:10 2014 +0900
@@ -340,7 +340,6 @@
/** \param rpcCU pointer of CU data class
*/
-bool mergeFlag = 0;
void TEncCu::compressCU(TComDataCU* cu)
{
@@ -740,11 +739,9 @@
xCheckRDCostInter(outBestCU, outTempCU, SIZE_2Nx2N);
outTempCU->initEstData(depth, qp); // by competition for inter_2Nx2N
}
- mergeFlag = 1;
// by Merge for inter_2Nx2N
xCheckRDCostMerge2Nx2N(outBestCU, outTempCU, &earlyDetectionSkipMode, m_bestPredYuv[depth], m_bestRecoYuv[depth]);
- mergeFlag = 0;
outTempCU->initEstData(depth, qp);
if (!m_cfg->param.bEnableEarlySkip)
diff -r 2fc9c0a08534 -r 6a9300590787 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Sat Feb 08 22:50:38 2014 +0900
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Mon Feb 10 18:04:10 2014 +0900
@@ -564,7 +564,7 @@
if (default0Save1Load2 != 2)
{
cu->getPattern()->initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight);
- Pel* chromaPred = (chromaId > 0 ? cu->getPattern()->getAdiCrBuf(width, height, m_predBuf) : cu->getPattern()->getAdiCbBuf(width, height, m_predBuf));
+ Pel* chromaPred = TComPattern::getAdiChromaBuf(chromaId, height, m_predBuf);
//===== get prediction signal =====
predIntraChromaAng(chromaPred, chromaPredMode, pred, stride, width);
@@ -1647,7 +1647,7 @@
}
//===== init availability pattern =====
cu->getPattern()->initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight);
- Pel* chromaPred = (chromaId > 0 ? cu->getPattern()->getAdiCrBuf(width, height, m_predBuf) : cu->getPattern()->getAdiCbBuf(width, height, m_predBuf));
+ Pel* chromaPred = TComPattern::getAdiChromaBuf(chromaId, height, m_predBuf);
//===== get prediction signal =====
predIntraChromaAng(chromaPred, chromaPredMode, pred, stride, width);
@@ -1737,8 +1737,8 @@
//===== init pattern =====
assert(width == height);
cu->getPattern()->initAdiPatternChroma(cu, 0, 0, m_predBuf, m_predBufStride, m_predBufHeight);
- Pel* patChromaU = cu->getPattern()->getAdiCbBuf(width, height, m_predBuf);
- Pel* patChromaV = cu->getPattern()->getAdiCrBuf(width, height, m_predBuf);
+ Pel* patChromaU = TComPattern::getAdiChromaBuf(0, height, m_predBuf);
+ Pel* patChromaV = TComPattern::getAdiChromaBuf(1, height, m_predBuf);
//===== get best prediction modes (using SAD) =====
uint32_t minMode = 0;
@@ -2141,7 +2141,7 @@
Pel* fenc = (chromaId > 0 ? fencYuv->getCrAddr(absPartIdx) : fencYuv->getCbAddr(absPartIdx));
Pel* pred = (chromaId > 0 ? predYuv->getCrAddr(absPartIdx) : predYuv->getCbAddr(absPartIdx));
- Pel* chromaPred = (chromaId > 0 ? cu->getPattern()->getAdiCrBuf(width, height, m_predBuf) : cu->getPattern()->getAdiCbBuf(width, height, m_predBuf));
+ Pel* chromaPred = TComPattern::getAdiChromaBuf(chromaId, height, m_predBuf);
//===== get prediction signal =====
predIntraChromaAng(chromaPred, chromaPredMode, pred, stride, width);
More information about the x265-devel
mailing list