[x265] [PATCH 2 of 4] cleanup: remove unused code TComSampleAdaptiveOffset::processSaoCu
Min Chen
chenm003 at 163.com
Thu Aug 15 19:35:50 CEST 2013
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1376588021 -28800
# Node ID f83b638aad70805ffc8646618bc43370bc802448
# Parent 8a995e2f6b776b4a07bab3b74ec75757b3714346
cleanup: remove unused code TComSampleAdaptiveOffset::processSaoCu
diff -r 8a995e2f6b77 -r f83b638aad70 source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
--- a/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp Fri Aug 16 01:33:08 2013 +0800
+++ b/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp Fri Aug 16 01:33:41 2013 +0800
@@ -550,239 +550,6 @@
processSaoCuOrg(addr, saoType, yCbCr);
}
-/** Perform SAO for non-cross-slice or non-cross-tile process
- * \param pDec to-be-filtered block buffer pointer
- * \param pRest filtered block buffer pointer
- * \param stride picture buffer stride
- * \param saoType SAO offset type
- * \param xPos x coordinate
- * \param yPos y coordinate
- * \param width block width
- * \param height block height
- * \param bBorderAvail availabilities of block border pixels
- */
-Void TComSampleAdaptiveOffset::processSaoBlock(Pel* dec, Pel* rest, Int stride, Int saoType, UInt width, UInt height, Bool* bBorderAvail, Int yCbCr)
-{
- //variables
- Int startX, startY, endX, endY, x, y;
- Int signLeft, signRight, signDown, signDown1;
- UInt edgeType;
- Pel *clipTbl = (yCbCr == 0) ? m_clipTable : m_chromaClipTable;
- Int *offsetBo = (yCbCr == 0) ? m_offsetBo : m_chromaOffsetBo;
-
- switch (saoType)
- {
- case SAO_EO_0: // dir: -
- {
- startX = (bBorderAvail[SGU_L]) ? 0 : 1;
- endX = (bBorderAvail[SGU_R]) ? width : (width - 1);
- for (y = 0; y < height; y++)
- {
- signLeft = xSign(dec[startX] - dec[startX - 1]);
- for (x = startX; x < endX; x++)
- {
- signRight = xSign(dec[x] - dec[x + 1]);
- edgeType = signRight + signLeft + 2;
- signLeft = -signRight;
-
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
-
- dec += stride;
- rest += stride;
- }
-
- break;
- }
- case SAO_EO_1: // dir: |
- {
- startY = (bBorderAvail[SGU_T]) ? 0 : 1;
- endY = (bBorderAvail[SGU_B]) ? height : height - 1;
- if (!bBorderAvail[SGU_T])
- {
- dec += stride;
- rest += stride;
- }
- for (x = 0; x < width; x++)
- {
- m_upBuff1[x] = xSign(dec[x] - dec[x - stride]);
- }
-
- for (y = startY; y < endY; y++)
- {
- for (x = 0; x < width; x++)
- {
- signDown = xSign(dec[x] - dec[x + stride]);
- edgeType = signDown + m_upBuff1[x] + 2;
- m_upBuff1[x] = -signDown;
-
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
-
- dec += stride;
- rest += stride;
- }
-
- break;
- }
- case SAO_EO_2: // dir: 135
- {
- Int posShift = stride + 1;
-
- startX = (bBorderAvail[SGU_L]) ? 0 : 1;
- endX = (bBorderAvail[SGU_R]) ? width : (width - 1);
-
- //prepare 2nd line upper sign
- dec += stride;
- for (x = startX; x < endX + 1; x++)
- {
- m_upBuff1[x] = xSign(dec[x] - dec[x - posShift]);
- }
-
- //1st line
- dec -= stride;
- if (bBorderAvail[SGU_TL])
- {
- x = 0;
- edgeType = xSign(dec[x] - dec[x - posShift]) - m_upBuff1[x + 1] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- if (bBorderAvail[SGU_T])
- {
- for (x = 1; x < endX; x++)
- {
- edgeType = xSign(dec[x] - dec[x - posShift]) - m_upBuff1[x + 1] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- }
- dec += stride;
- rest += stride;
-
- //middle lines
- for (y = 1; y < height - 1; y++)
- {
- for (x = startX; x < endX; x++)
- {
- signDown1 = xSign(dec[x] - dec[x + posShift]);
- edgeType = signDown1 + m_upBuff1[x] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
-
- m_upBufft[x + 1] = -signDown1;
- }
-
- m_upBufft[startX] = xSign(dec[stride + startX] - dec[startX - 1]);
-
- m_swap = m_upBuff1;
- m_upBuff1 = m_upBufft;
- m_upBufft = m_swap;
-
- dec += stride;
- rest += stride;
- }
-
- //last line
- if (bBorderAvail[SGU_B])
- {
- for (x = startX; x < width - 1; x++)
- {
- edgeType = xSign(dec[x] - dec[x + posShift]) + m_upBuff1[x] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- }
- if (bBorderAvail[SGU_BR])
- {
- x = width - 1;
- edgeType = xSign(dec[x] - dec[x + posShift]) + m_upBuff1[x] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- break;
- }
- case SAO_EO_3: // dir: 45
- {
- Int posShift = stride - 1;
- startX = (bBorderAvail[SGU_L]) ? 0 : 1;
- endX = (bBorderAvail[SGU_R]) ? width : (width - 1);
-
- //prepare 2nd line upper sign
- dec += stride;
- for (x = startX - 1; x < endX; x++)
- {
- m_upBuff1[x] = xSign(dec[x] - dec[x - posShift]);
- }
-
- //first line
- dec -= stride;
- if (bBorderAvail[SGU_T])
- {
- for (x = startX; x < width - 1; x++)
- {
- edgeType = xSign(dec[x] - dec[x - posShift]) - m_upBuff1[x - 1] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- }
- if (bBorderAvail[SGU_TR])
- {
- x = width - 1;
- edgeType = xSign(dec[x] - dec[x - posShift]) - m_upBuff1[x - 1] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- dec += stride;
- rest += stride;
-
- //middle lines
- for (y = 1; y < height - 1; y++)
- {
- for (x = startX; x < endX; x++)
- {
- signDown1 = xSign(dec[x] - dec[x + posShift]);
- edgeType = signDown1 + m_upBuff1[x] + 2;
-
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- m_upBuff1[x - 1] = -signDown1;
- }
-
- m_upBuff1[endX - 1] = xSign(dec[endX - 1 + stride] - dec[endX]);
-
- dec += stride;
- rest += stride;
- }
-
- //last line
- if (bBorderAvail[SGU_BL])
- {
- x = 0;
- edgeType = xSign(dec[x] - dec[x + posShift]) + m_upBuff1[x] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- if (bBorderAvail[SGU_B])
- {
- for (x = 1; x < endX; x++)
- {
- edgeType = xSign(dec[x] - dec[x + posShift]) + m_upBuff1[x] + 2;
- rest[x] = clipTbl[dec[x] + m_offsetEo[edgeType]];
- }
- }
- break;
- }
- case SAO_BO:
- {
- for (y = 0; y < height; y++)
- {
- for (x = 0; x < width; x++)
- {
- rest[x] = offsetBo[dec[x]];
- }
-
- rest += stride;
- dec += stride;
- }
-
- break;
- }
- default: break;
- }
-}
-
/** sample adaptive offset process for one LCU crossing LCU boundary
* \param addr, iSaoType, yCbCr
*/
diff -r 8a995e2f6b77 -r f83b638aad70 source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
--- a/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h Fri Aug 16 01:33:08 2013 +0800
+++ b/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h Fri Aug 16 01:33:41 2013 +0800
@@ -204,7 +204,6 @@
Void processSaoCuOrg(Int addr, Int partIdx, Int yCbCr); //!< LCU-basd SAO process without slice granularity
Void createPicSaoInfo(TComPic* pic);
Void destroyPicSaoInfo();
- Void processSaoBlock(Pel* dec, Pel* rest, Int stride, Int saoType, UInt width, UInt height, Bool* bBorderAvail, Int yCbCr);
Void resetLcuPart(SaoLcuParam* saoLcuParam);
Void convertQT2SaoUnit(SAOParam* saoParam, UInt partIdx, Int yCbCr);
More information about the x265-devel
mailing list