[x265] [PATCH 1/6] cleanup: unused code m_bUseNIF
Min Chen
chenm003 at 163.com
Tue Jun 18 18:43:33 CEST 2013
---
source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp | 36 +------------------
source/Lib/TLibCommon/TComSampleAdaptiveOffset.h | 1 -
.../Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp | 41 +---------------------
3 files changed, 2 insertions(+), 76 deletions(-)
diff --git a/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp b/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
index e93ee25..499f2ad 100644
--- a/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
+++ b/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
@@ -547,37 +547,7 @@ Void TComSampleAdaptiveOffset::destroyPicSaoInfo()
*/
Void TComSampleAdaptiveOffset::processSaoCu(Int iAddr, Int iSaoType, Int iYCbCr)
{
- if (!m_bUseNIF)
- {
- processSaoCuOrg(iAddr, iSaoType, iYCbCr);
- }
- else
- {
- Int isChroma = (iYCbCr != 0) ? 1 : 0;
- Int stride = (iYCbCr != 0) ? (m_pcPic->getCStride()) : (m_pcPic->getStride());
- Pel* pPicRest = getPicYuvAddr(m_pcPic->getPicYuvRec(), iYCbCr);
- Pel* pPicDec = getPicYuvAddr(m_pcYuvTmp, iYCbCr);
-
- std::vector<NDBFBlockInfo>& vFilterBlocks = *(m_pcPic->getCU(iAddr)->getNDBFilterBlocks());
-
- //variables
- UInt xPos, yPos, width, height;
- Bool* pbBorderAvail;
- UInt posOffset;
-
- for (Int i = 0; i < vFilterBlocks.size(); i++)
- {
- xPos = vFilterBlocks[i].posX >> isChroma;
- yPos = vFilterBlocks[i].posY >> isChroma;
- width = vFilterBlocks[i].width >> isChroma;
- height = vFilterBlocks[i].height >> isChroma;
- pbBorderAvail = vFilterBlocks[i].isBorderAvailable;
-
- posOffset = (yPos * stride) + xPos;
-
- processSaoBlock(pPicDec + posOffset, pPicRest + posOffset, stride, iSaoType, width, height, pbBorderAvail, iYCbCr);
- }
- }
+ processSaoCuOrg(iAddr, iSaoType, iYCbCr);
}
/** Perform SAO for non-cross-slice or non-cross-tile process
@@ -1067,10 +1037,6 @@ Void TComSampleAdaptiveOffset::SAOProcess(SAOParam* pcSaoParam)
m_uiSaoBitIncreaseY = max(g_bitDepthY - 10, 0);
m_uiSaoBitIncreaseC = max(g_bitDepthC - 10, 0);
- if (m_bUseNIF)
- {
- m_pcPic->getPicYuvRec()->copyToPic(m_pcYuvTmp);
- }
if (m_saoLcuBasedOptimization)
{
pcSaoParam->oneUnitFlag[0] = 0;
diff --git a/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h b/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
index e93fc82..10292d7 100644
--- a/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
+++ b/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
@@ -95,7 +95,6 @@ protected:
Int *m_iUpBuff2;
Int *m_iUpBufft;
Int *ipSwap;
- Bool m_bUseNIF; //!< true for performing non-cross slice boundary ALF
TComPicYuv* m_pcYuvTmp; //!< temporary picture buffer pointer when non-across slice/tile boundary SAO is enabled
Pel* m_pTmpU1;
diff --git a/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp b/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
index 4ccac36..ed4dbfe 100644
--- a/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
+++ b/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
@@ -894,41 +894,7 @@ Void TEncSampleAdaptiveOffset::calcSaoStatsBlock(Pel* pRecStart, Pel* pOrgStart,
*/
Void TEncSampleAdaptiveOffset::calcSaoStatsCu(Int iAddr, Int iPartIdx, Int iYCbCr)
{
- if (!m_bUseNIF)
- {
- calcSaoStatsCuOrg(iAddr, iPartIdx, iYCbCr);
- }
- else
- {
- Int64** ppStats = m_iOffsetOrg[iPartIdx];
- Int64** ppCount = m_iCount[iPartIdx];
-
- //parameters
- Int isChroma = (iYCbCr != 0) ? 1 : 0;
- Int stride = (iYCbCr != 0) ? (m_pcPic->getCStride()) : (m_pcPic->getStride());
- Pel* pPicOrg = getPicYuvAddr(m_pcPic->getPicYuvOrg(), iYCbCr);
- Pel* pPicRec = getPicYuvAddr(m_pcYuvTmp, iYCbCr);
-
- std::vector<NDBFBlockInfo>& vFilterBlocks = *(m_pcPic->getCU(iAddr)->getNDBFilterBlocks());
-
- //variables
- UInt xPos, yPos, width, height;
- Bool* pbBorderAvail;
- UInt posOffset;
-
- for (Int i = 0; i < vFilterBlocks.size(); i++)
- {
- xPos = vFilterBlocks[i].posX >> isChroma;
- yPos = vFilterBlocks[i].posY >> isChroma;
- width = vFilterBlocks[i].width >> isChroma;
- height = vFilterBlocks[i].height >> isChroma;
- pbBorderAvail = vFilterBlocks[i].isBorderAvailable;
-
- posOffset = (yPos * stride) + xPos;
-
- calcSaoStatsBlock(pPicRec + posOffset, pPicOrg + posOffset, stride, ppStats, ppCount, width, height, pbBorderAvail, iYCbCr);
- }
- }
+ calcSaoStatsCuOrg(iAddr, iPartIdx, iYCbCr);
}
/** Calculate SAO statistics for current LCU without non-crossing slice
@@ -1619,11 +1585,6 @@ Void TEncSampleAdaptiveOffset::resetStats()
*/
Void TEncSampleAdaptiveOffset::SAOProcess(SAOParam *pcSaoParam, Double dLambdaLuma, Double dLambdaChroma, Int depth)
{
- if (m_bUseNIF)
- {
- m_pcPic->getPicYuvRec()->copyToPic(m_pcYuvTmp);
- }
-
m_uiSaoBitIncreaseY = max(g_bitDepthY - 10, 0);
m_uiSaoBitIncreaseC = max(g_bitDepthC - 10, 0);
m_iOffsetThY = 1 << min(g_bitDepthY - 5, 5);
--
1.8.3.msysgit.0
More information about the x265-devel
mailing list