[x265] [PATCH] tcomdatacu: Removed Un-used NDBFBlockInfo - Non-deblocking filter processing block information
Gopu Govindaswamy
gopu at multicorewareinc.com
Mon Oct 7 09:18:45 CEST 2013
# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1381130312 -19800
# Node ID ec5a502fafac3e6bc264dde1d962c7e21f9361fd
# Parent c010342f7605c86867824f5b525a8f84c0d2de1c
tcomdatacu: Removed Un-used NDBFBlockInfo - Non-deblocking filter processing block information
1.setNDBFilterBlockBorderAvailability()
2.createNonDBFilterInfo()
3.createNonDBFilterInfoLCU()
4.destroyNonDBFilterInfo()
All the above methods are used to set and destroy the NDBFBlockInformation, but NDBFBlockInfo m_vNDFBlock is not getting
used encoding process
diff -r c010342f7605 -r ec5a502fafac source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp Sun Oct 06 02:09:00 2013 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp Mon Oct 07 12:48:32 2013 +0530
@@ -210,23 +210,6 @@
m_cuMvField[1].destroy();
}
-const NDBFBlockInfo& NDBFBlockInfo::operator =(const NDBFBlockInfo& src)
-{
- this->sliceID = src.sliceID;
- this->startSU = src.startSU;
- this->endSU = src.endSU;
- this->widthSU = src.widthSU;
- this->heightSU = src.heightSU;
- this->posX = src.posX;
- this->posY = src.posY;
- this->width = src.width;
- this->height = src.height;
- ::memcpy(this->isBorderAvailable, src.isBorderAvailable, sizeof(bool) * ((int)NUM_SGU_BORDER));
- this->allBordersAvailable = src.allBordersAvailable;
-
- return *this;
-}
-
// ====================================================================================================================
// Public member functions
// ====================================================================================================================
@@ -3181,190 +3164,4 @@
return (m_cuAddr) * (1 << (m_slice->getSPS()->getMaxCUDepth() << 1)) + m_absIdxInLCU;
}
-/** Set neighboring blocks availabilities for non-deblocked filtering
- * \param numLCUInPicWidth number of LCUs in picture width
- * \param numLCUInPicHeight number of LCUs in picture height
- * \param numSUInLCUWidth number of SUs in LCU width
- * \param numSUInLCUHeight number of SUs in LCU height
- * \param picWidth picture width
- * \param picHeight picture height
- * \param bIndependentSliceBoundaryEnabled true for independent slice boundary enabled
- * \param bTopTileBoundary true means that top boundary coincides tile boundary
- * \param bDownTileBoundary true means that bottom boundary coincides tile boundary
- * \param bLeftTileBoundary true means that left boundary coincides tile boundary
- * \param bRightTileBoundary true means that right boundary coincides tile boundary
- * \param bIndependentTileBoundaryEnabled true for independent tile boundary enabled
- */
-void TComDataCU::setNDBFilterBlockBorderAvailability(UInt /*numLCUInPicWidth*/, UInt /*numLCUInPicHeight*/, UInt numSUInLCUWidth, UInt numSUInLCUHeight,
- UInt picWidth, UInt picHeight, bool bTopTileBoundary, bool bDownTileBoundary, bool bLeftTileBoundary,
- bool bRightTileBoundary, bool bIndependentTileBoundaryEnabled)
-{
- UInt lpelx, tpely;
- UInt width, height;
- bool bPicRBoundary, bPicBBoundary, bPicTBoundary, bPicLBoundary;
- bool bLCURBoundary = false, bLCUBBoundary = false, bLCUTBoundary = false, bLCULBoundary = false;
- bool* bAvailBorder;
- bool* bAvail;
- UInt rTLSU, rBRSU, widthSU;
- UInt numSGU = (UInt)m_vNDFBlock.size();
-
- for (int i = 0; i < numSGU; i++)
- {
- NDBFBlockInfo& rSGU = m_vNDFBlock[i];
-
- lpelx = rSGU.posX;
- tpely = rSGU.posY;
- width = rSGU.width;
- height = rSGU.height;
- rTLSU = g_zscanToRaster[rSGU.startSU];
- rBRSU = g_zscanToRaster[rSGU.endSU];
- widthSU = rSGU.widthSU;
-
- bAvailBorder = rSGU.isBorderAvailable;
-
- bPicTBoundary = (tpely == 0) ? (true) : (false);
- bPicLBoundary = (lpelx == 0) ? (true) : (false);
- bPicRBoundary = (!(lpelx + width < picWidth)) ? (true) : (false);
- bPicBBoundary = (!(tpely + height < picHeight)) ? (true) : (false);
-
- bLCULBoundary = (rTLSU % numSUInLCUWidth == 0) ? (true) : (false);
- bLCURBoundary = ((rTLSU + widthSU) % numSUInLCUWidth == 0) ? (true) : (false);
- bLCUTBoundary = ((UInt)(rTLSU / numSUInLCUWidth) == 0) ? (true) : (false);
- bLCUBBoundary = ((UInt)(rBRSU / numSUInLCUWidth) == (numSUInLCUHeight - 1)) ? (true) : (false);
-
- // SGU_L
- bAvail = &(bAvailBorder[SGU_L]);
- if (bPicLBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_R
- bAvail = &(bAvailBorder[SGU_R]);
- if (bPicRBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_T
- bAvail = &(bAvailBorder[SGU_T]);
- if (bPicTBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_B
- bAvail = &(bAvailBorder[SGU_B]);
- if (bPicBBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_TL
- bAvail = &(bAvailBorder[SGU_TL]);
- if (bPicTBoundary || bPicLBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_TR
- bAvail = &(bAvailBorder[SGU_TR]);
- if (bPicTBoundary || bPicRBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_BL
- bAvail = &(bAvailBorder[SGU_BL]);
- if (bPicBBoundary || bPicLBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- // SGU_BR
- bAvail = &(bAvailBorder[SGU_BR]);
- if (bPicBBoundary || bPicRBoundary)
- {
- *bAvail = false;
- }
- else
- {
- *bAvail = true;
- }
-
- if (bIndependentTileBoundaryEnabled)
- {
- //left LCU boundary
- if (!bPicLBoundary && bLCULBoundary)
- {
- if (bLeftTileBoundary)
- {
- bAvailBorder[SGU_L] = bAvailBorder[SGU_TL] = bAvailBorder[SGU_BL] = false;
- }
- }
- //right LCU boundary
- if (!bPicRBoundary && bLCURBoundary)
- {
- if (bRightTileBoundary)
- {
- bAvailBorder[SGU_R] = bAvailBorder[SGU_TR] = bAvailBorder[SGU_BR] = false;
- }
- }
- //top LCU boundary
- if (!bPicTBoundary && bLCUTBoundary)
- {
- if (bTopTileBoundary)
- {
- bAvailBorder[SGU_T] = bAvailBorder[SGU_TL] = bAvailBorder[SGU_TR] = false;
- }
- }
- //down LCU boundary
- if (!bPicBBoundary && bLCUBBoundary)
- {
- if (bDownTileBoundary)
- {
- bAvailBorder[SGU_B] = bAvailBorder[SGU_BL] = bAvailBorder[SGU_BR] = false;
- }
- }
- }
- rSGU.allBordersAvailable = true;
- for (int b = 0; b < NUM_SGU_BORDER; b++)
- {
- if (bAvailBorder[b] == false)
- {
- rSGU.allBordersAvailable = false;
- break;
- }
- }
- }
-}
-
//! \}
diff -r c010342f7605 -r ec5a502fafac source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h Sun Oct 06 02:09:00 2013 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.h Mon Oct 07 12:48:32 2013 +0530
@@ -76,26 +76,6 @@
NUM_SGU_BORDER
};
-/// Non-deblocking filter processing block information
-struct NDBFBlockInfo
-{
- int sliceID; //!< slice ID
- UInt startSU; //!< starting SU z-scan address in LCU
- UInt endSU; //!< ending SU z-scan address in LCU
- UInt widthSU; //!< number of SUs in width
- UInt heightSU; //!< number of SUs in height
- UInt posX; //!< top-left X coordinate in picture
- UInt posY; //!< top-left Y coordinate in picture
- UInt width; //!< number of pixels in width
- UInt height; //!< number of pixels in height
- bool isBorderAvailable[NUM_SGU_BORDER]; //!< the border availabilities
- bool allBordersAvailable;
-
- NDBFBlockInfo() : sliceID(0), startSU(0), endSU(0) {} //!< constructor
-
- const NDBFBlockInfo& operator =(const NDBFBlockInfo& src); //!< "=" operator
-};
-
// ====================================================================================================================
// Class definition
// ====================================================================================================================
@@ -148,8 +128,6 @@
Pel* m_iPCMSampleCb; ///< PCM sample buffer (Cb)
Pel* m_iPCMSampleCr; ///< PCM sample buffer (Cr)
- std::vector<NDBFBlockInfo> m_vNDFBlock;
-
// -------------------------------------------------------------------------------------------------------------------
// neighbor access variables
// -------------------------------------------------------------------------------------------------------------------
@@ -416,11 +394,6 @@
void setIPCMFlagSubParts(bool bIpcmFlag, UInt absPartIdx, UInt depth);
- std::vector<NDBFBlockInfo>* getNDBFilterBlocks() { return &m_vNDFBlock; }
-
- void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight
- , bool bTopTileBoundary, bool bDownTileBoundary, bool bLeftTileBoundary, bool bRightTileBoundary
- , bool bIndependentTileBoundaryEnabled);
// -------------------------------------------------------------------------------------------------------------------
// member functions for accessing partition information
// -------------------------------------------------------------------------------------------------------------------
diff -r c010342f7605 -r ec5a502fafac source/Lib/TLibCommon/TComPic.cpp
--- a/source/Lib/TLibCommon/TComPic.cpp Sun Oct 06 02:09:00 2013 -0500
+++ b/source/Lib/TLibCommon/TComPic.cpp Mon Oct 07 12:48:32 2013 +0530
@@ -111,191 +111,4 @@
m_lowres.destroy(bframes);
}
-/** Create non-deblocked filter information
- * \param pSliceStartAddress array for storing slice start addresses
- * \param numSlices number of slices in picture
- * \param sliceGranularityDepth slice granularity
- * \param bNDBFilterCrossSliceBoundary cross-slice-boundary in-loop filtering; true for "cross".
- * \param numTiles number of tiles in picture
- */
-void TComPic::createNonDBFilterInfo(int lastSlicecuAddr, int sliceGranularityDepth)
-{
- UInt maxNumSUInLCU = getNumPartInCU();
- UInt numLCUInPic = getNumCUsInFrame();
- UInt picWidth = getSlice()->getSPS()->getPicWidthInLumaSamples();
- UInt picHeight = getSlice()->getSPS()->getPicHeightInLumaSamples();
- int numLCUsInPicWidth = getFrameWidthInCU();
- int numLCUsInPicHeight = getFrameHeightInCU();
- UInt maxNumSUInLCUWidth = getNumPartInWidth();
- UInt maxNumSUInLCUHeight = getNumPartInHeight();
-
- for (UInt cuAddr = 0; cuAddr < numLCUInPic; cuAddr++)
- {
- TComDataCU* cu = getCU(cuAddr);
- cu->getNDBFilterBlocks()->clear();
- }
-
- UInt startAddr, endAddr, firstCUInStartLCU, startLCU, endLCU, lastCUInEndLCU, uiAddr;
- UInt LPelX, TPelY, LCUX, LCUY;
- UInt currSU;
- UInt startSU, endSU;
-
- //1st step: decide the real start address
- startAddr = 0;
- endAddr = lastSlicecuAddr - 1;
-
- startLCU = startAddr / maxNumSUInLCU;
- firstCUInStartLCU = startAddr % maxNumSUInLCU;
-
- endLCU = endAddr / maxNumSUInLCU;
- lastCUInEndLCU = endAddr % maxNumSUInLCU;
-
- uiAddr = (startLCU);
-
- LCUX = getCU(uiAddr)->getCUPelX();
- LCUY = getCU(uiAddr)->getCUPelY();
- LPelX = LCUX + g_rasterToPelX[g_zscanToRaster[firstCUInStartLCU]];
- TPelY = LCUY + g_rasterToPelY[g_zscanToRaster[firstCUInStartLCU]];
- currSU = firstCUInStartLCU;
-
- bool bMoveToNextLCU = false;
-
- while (!(LPelX < picWidth) || !(TPelY < picHeight))
- {
- currSU++;
-
- if (currSU >= maxNumSUInLCU)
- {
- bMoveToNextLCU = true;
- break;
- }
-
- LPelX = LCUX + g_rasterToPelX[g_zscanToRaster[currSU]];
- TPelY = LCUY + g_rasterToPelY[g_zscanToRaster[currSU]];
- }
-
- if (currSU != firstCUInStartLCU)
- {
- if (!bMoveToNextLCU)
- {
- firstCUInStartLCU = currSU;
- }
- else
- {
- startLCU++;
- firstCUInStartLCU = 0;
- assert(startLCU < getNumCUsInFrame());
- }
- assert(startLCU * maxNumSUInLCU + firstCUInStartLCU < endAddr);
- }
-
- //2nd step: assign NonDBFilterInfo to each processing block
- for (UInt i = startLCU; i <= endLCU; i++)
- {
- startSU = (i == startLCU) ? (firstCUInStartLCU) : (0);
- endSU = (i == endLCU) ? (lastCUInEndLCU) : (maxNumSUInLCU - 1);
- TComDataCU* cu = getCU(i);
- createNonDBFilterInfoLCU(0, cu, startSU, endSU, sliceGranularityDepth, picWidth, picHeight);
- }
-
- //step 3: border availability
- for (UInt i = startLCU; i <= endLCU; i++)
- {
- getCU(i)->setNDBFilterBlockBorderAvailability(numLCUsInPicWidth, numLCUsInPicHeight, maxNumSUInLCUWidth, maxNumSUInLCUHeight, picWidth, picHeight, false, false, false, false, false);
- }
-}
-
-/** Create non-deblocked filter information for LCU
- * \param tileID tile index
- * \param sliceID slice index
- * \param cu CU data pointer
- * \param startSU start SU index in LCU
- * \param endSU end SU index in LCU
- * \param sliceGranularyDepth slice granularity
- * \param picWidth picture width
- * \param picHeight picture height
- */
-void TComPic::createNonDBFilterInfoLCU(int sliceID, TComDataCU* cu, UInt startSU, UInt endSU, int sliceGranularyDepth, UInt picWidth, UInt picHeight)
-{
- UInt LCUX = cu->getCUPelX();
- UInt LCUY = cu->getCUPelY();
- UInt maxNumSUInLCU = getNumPartInCU();
- UInt maxNumSUInSGU = maxNumSUInLCU >> (sliceGranularyDepth << 1);
- UInt maxNumSUInLCUWidth = getNumPartInWidth();
- UInt LPelX, TPelY;
- UInt curSU;
-
- //get the number of valid NBFilterBLock
- curSU = startSU;
- while (curSU <= endSU)
- {
- LPelX = LCUX + g_rasterToPelX[g_zscanToRaster[curSU]];
- TPelY = LCUY + g_rasterToPelY[g_zscanToRaster[curSU]];
-
- while (!(LPelX < picWidth) || !(TPelY < picHeight))
- {
- curSU += maxNumSUInSGU;
- if (curSU >= maxNumSUInLCU || curSU > endSU)
- {
- break;
- }
- LPelX = LCUX + g_rasterToPelX[g_zscanToRaster[curSU]];
- TPelY = LCUY + g_rasterToPelY[g_zscanToRaster[curSU]];
- }
-
- if (curSU >= maxNumSUInLCU || curSU > endSU)
- {
- break;
- }
-
- NDBFBlockInfo NDBFBlock;
-
- NDBFBlock.sliceID = sliceID;
- NDBFBlock.posY = TPelY;
- NDBFBlock.posX = LPelX;
- NDBFBlock.startSU = curSU;
-
- UInt lastValidSU = curSU;
- UInt idx, lpelXSU, tpelYSU;
- for (idx = curSU; idx < curSU + maxNumSUInSGU; idx++)
- {
- if (idx > endSU)
- {
- break;
- }
- lpelXSU = LCUX + g_rasterToPelX[g_zscanToRaster[idx]];
- tpelYSU = LCUY + g_rasterToPelY[g_zscanToRaster[idx]];
- if (!(lpelXSU < picWidth) || !(tpelYSU < picHeight))
- {
- continue;
- }
- lastValidSU = idx;
- }
-
- NDBFBlock.endSU = lastValidSU;
-
- UInt rTLSU = g_zscanToRaster[NDBFBlock.startSU];
- UInt rBRSU = g_zscanToRaster[NDBFBlock.endSU];
- NDBFBlock.widthSU = (rBRSU % maxNumSUInLCUWidth) - (rTLSU % maxNumSUInLCUWidth) + 1;
- NDBFBlock.heightSU = (UInt)(rBRSU / maxNumSUInLCUWidth) - (UInt)(rTLSU / maxNumSUInLCUWidth) + 1;
- NDBFBlock.width = NDBFBlock.widthSU * getMinCUWidth();
- NDBFBlock.height = NDBFBlock.heightSU * getMinCUHeight();
-
- cu->getNDBFilterBlocks()->push_back(NDBFBlock);
-
- curSU += maxNumSUInSGU;
- }
-}
-
-/** destroy non-deblocked filter information for LCU
- */
-void TComPic::destroyNonDBFilterInfo()
-{
- for (UInt cuAddr = 0; cuAddr < getNumCUsInFrame(); cuAddr++)
- {
- TComDataCU* cu = getCU(cuAddr);
- cu->getNDBFilterBlocks()->clear();
- }
-}
-
//! \}
diff -r c010342f7605 -r ec5a502fafac source/Lib/TLibCommon/TComPic.h
--- a/source/Lib/TLibCommon/TComPic.h Sun Oct 06 02:09:00 2013 -0500
+++ b/source/Lib/TLibCommon/TComPic.h Mon Oct 07 12:48:32 2013 +0530
@@ -140,9 +140,6 @@
Window& getDefDisplayWindow() { return m_defaultDisplayWindow; }
- void createNonDBFilterInfo(int lastSliceCUAddr, int sliceGranularityDepth);
- void createNonDBFilterInfoLCU(int sliceID, TComDataCU* cu, UInt startSU, UInt endSU, int sliceGranularyDepth, UInt picWidth, UInt picHeight);
- void destroyNonDBFilterInfo();
}; // END CLASS DEFINITION TComPic
}
//! \}
diff -r c010342f7605 -r ec5a502fafac source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Sun Oct 06 02:09:00 2013 -0500
+++ b/source/encoder/frameencoder.cpp Mon Oct 07 12:48:32 2013 +0530
@@ -447,11 +447,6 @@
cntIntraNxN = 0;
#endif // if CU_STAT_LOGFILE
- if (m_sps.getUseSAO())
- {
- m_pic->createNonDBFilterInfo(slice->getSliceCurEndCUAddr(), 0);
- }
-
// Analyze CTU rows, most of the hard work is done here
// frame is compressed in a wave-front pattern if WPP is enabled. Loop filter runs as a
// wave-front behind the CU compression and reconstruction
@@ -666,7 +661,6 @@
if (m_sps.getUseSAO())
{
m_frameFilter.end();
- m_pic->destroyNonDBFilterInfo();
}
// TODO: merge into compress loop, need some time to verify, remove later
More information about the x265-devel
mailing list