[x265] [PATCH] tencsao: remove unused calcSaoStatsBlock

gopu at multicorewareinc.com gopu at multicorewareinc.com
Mon Mar 3 09:18:35 CET 2014


# HG changeset patch
# User Gopu Govindaswamy
# Date 1393834706 -19800
#      Mon Mar 03 13:48:26 2014 +0530
# Node ID 0b0023af2e7f13f2218678209e05963aaac0398b
# Parent  288a83d7e28999798859eba6b2f38c952cac7547
tencsao: remove unused calcSaoStatsBlock

diff -r 288a83d7e289 -r 0b0023af2e7f source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
--- a/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp	Sun Mar 02 18:57:46 2014 -0600
+++ b/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp	Mon Mar 03 13:48:26 2014 +0530
@@ -541,264 +541,6 @@
     return (x >> 31) | ((int)((((uint32_t)-x)) >> 31));
 }
 
-/** Calculate SAO statistics for non-cross-slice or non-cross-tile processing
- * \param  recStart to-be-filtered block buffer pointer
- * \param  orgStart original block buffer pointer
- * \param  stride picture buffer stride
- * \param  ppStat statistics buffer
- * \param  counts counter buffer
- * \param  width block width
- * \param  height block height
- * \param  bBorderAvail availabilities of block border pixels
- */
-void TEncSampleAdaptiveOffset::calcSaoStatsBlock(Pel* recStart, Pel* orgStart, int stride, int64_t** stats, int64_t** counts, uint32_t width, uint32_t height, bool* bBorderAvail, int yCbCr)
-{
-    int64_t *stat, *count;
-    int classIdx, posShift, startX, endX, startY, endY, signLeft, signRight, signDown, signDown1;
-    Pel *fenc, *pRec;
-    uint32_t edgeType;
-    int x, y;
-    Pel *pTableBo = (yCbCr == 0) ? m_lumaTableBo : m_chromaTableBo;
-    int32_t *tmp_swap;
-
-    //--------- Band offset-----------//
-    stat = stats[SAO_BO];
-    count = counts[SAO_BO];
-    fenc  = orgStart;
-    pRec  = recStart;
-    for (y = 0; y < height; y++)
-    {
-        for (x = 0; x < width; x++)
-        {
-            classIdx = pTableBo[pRec[x]];
-            if (classIdx)
-            {
-                stat[classIdx] += (fenc[x] - pRec[x]);
-                count[classIdx]++;
-            }
-        }
-
-        fenc += stride;
-        pRec += stride;
-    }
-
-    //---------- Edge offset 0--------------//
-    stat = stats[SAO_EO_0];
-    count = counts[SAO_EO_0];
-    fenc  = orgStart;
-    pRec  = recStart;
-
-    startX = (bBorderAvail[SGU_L]) ? 0 : 1;
-    endX   = (bBorderAvail[SGU_R]) ? width : (width - 1);
-    for (y = 0; y < height; y++)
-    {
-        signLeft = xSign(pRec[startX] - pRec[startX - 1]);
-        for (x = startX; x < endX; x++)
-        {
-            signRight = xSign(pRec[x] - pRec[x + 1]);
-            edgeType = signRight + signLeft + 2;
-            signLeft = -signRight;
-
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-        }
-
-        pRec  += stride;
-        fenc += stride;
-    }
-
-    //---------- Edge offset 1--------------//
-    stat = stats[SAO_EO_1];
-    count = counts[SAO_EO_1];
-    fenc  = orgStart;
-    pRec  = recStart;
-
-    startY = (bBorderAvail[SGU_T]) ? 0 : 1;
-    endY   = (bBorderAvail[SGU_B]) ? height : height - 1;
-    if (!bBorderAvail[SGU_T])
-    {
-        pRec += stride;
-        fenc += stride;
-    }
-
-    for (x = 0; x < width; x++)
-    {
-        m_upBuff1[x] = xSign(pRec[x] - pRec[x - stride]);
-    }
-
-    for (y = startY; y < endY; y++)
-    {
-        for (x = 0; x < width; x++)
-        {
-            signDown = xSign(pRec[x] - pRec[x + stride]);
-            edgeType = signDown + m_upBuff1[x] + 2;
-            m_upBuff1[x] = -signDown;
-
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-        }
-
-        fenc += stride;
-        pRec += stride;
-    }
-
-    //---------- Edge offset 2--------------//
-    stat = stats[SAO_EO_2];
-    count = counts[SAO_EO_2];
-    fenc   = orgStart;
-    pRec   = recStart;
-
-    posShift = stride + 1;
-
-    startX = (bBorderAvail[SGU_L]) ? 0 : 1;
-    endX   = (bBorderAvail[SGU_R]) ? width : (width - 1);
-
-    //prepare 2nd line upper sign
-    pRec += stride;
-    for (x = startX; x < endX + 1; x++)
-    {
-        m_upBuff1[x] = xSign(pRec[x] - pRec[x - posShift]);
-    }
-
-    //1st line
-    pRec -= stride;
-    if (bBorderAvail[SGU_TL])
-    {
-        x = 0;
-        edgeType = xSign(pRec[x] - pRec[x - posShift]) - m_upBuff1[x + 1] + 2;
-        stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-        count[m_eoTable[edgeType]]++;
-    }
-    if (bBorderAvail[SGU_T])
-    {
-        for (x = 1; x < endX; x++)
-        {
-            edgeType = xSign(pRec[x] - pRec[x - posShift]) - m_upBuff1[x + 1] + 2;
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-        }
-    }
-    pRec += stride;
-    fenc += stride;
-
-    //middle lines
-    for (y = 1; y < height - 1; y++)
-    {
-        for (x = startX; x < endX; x++)
-        {
-            signDown1 = xSign(pRec[x] - pRec[x + posShift]);
-            edgeType = signDown1 + m_upBuff1[x] + 2;
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-
-            m_upBufft[x + 1] = -signDown1;
-        }
-
-        m_upBufft[startX] = xSign(pRec[stride + startX] - pRec[startX - 1]);
-
-        tmp_swap  = m_upBuff1;
-        m_upBuff1 = m_upBufft;
-        m_upBufft = tmp_swap;
-
-        pRec  += stride;
-        fenc  += stride;
-    }
-
-    //last line
-    if (bBorderAvail[SGU_B])
-    {
-        for (x = startX; x < width - 1; x++)
-        {
-            edgeType = xSign(pRec[x] - pRec[x + posShift]) + m_upBuff1[x] + 2;
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-        }
-    }
-    if (bBorderAvail[SGU_BR])
-    {
-        x = width - 1;
-        edgeType = xSign(pRec[x] - pRec[x + posShift]) + m_upBuff1[x] + 2;
-        stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-        count[m_eoTable[edgeType]]++;
-    }
-
-    //---------- Edge offset 3--------------//
-
-    stat = stats[SAO_EO_3];
-    count = counts[SAO_EO_3];
-    fenc  = orgStart;
-    pRec  = recStart;
-
-    posShift = stride - 1;
-    startX = (bBorderAvail[SGU_L]) ? 0 : 1;
-    endX   = (bBorderAvail[SGU_R]) ? width : (width - 1);
-
-    //prepare 2nd line upper sign
-    pRec += stride;
-    for (x = startX - 1; x < endX; x++)
-    {
-        m_upBuff1[x] = xSign(pRec[x] - pRec[x - posShift]);
-    }
-
-    //first line
-    pRec -= stride;
-    if (bBorderAvail[SGU_T])
-    {
-        for (x = startX; x < width - 1; x++)
-        {
-            edgeType = xSign(pRec[x] - pRec[x - posShift]) - m_upBuff1[x - 1] + 2;
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-        }
-    }
-    if (bBorderAvail[SGU_TR])
-    {
-        x = width - 1;
-        edgeType = xSign(pRec[x] - pRec[x - posShift]) - m_upBuff1[x - 1] + 2;
-        stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-        count[m_eoTable[edgeType]]++;
-    }
-    pRec += stride;
-    fenc += stride;
-
-    //middle lines
-    for (y = 1; y < height - 1; y++)
-    {
-        for (x = startX; x < endX; x++)
-        {
-            signDown1 = xSign(pRec[x] - pRec[x + posShift]);
-            edgeType = signDown1 + m_upBuff1[x] + 2;
-
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-            m_upBuff1[x - 1] = -signDown1;
-        }
-
-        m_upBuff1[endX - 1] = xSign(pRec[endX - 1 + stride] - pRec[endX]);
-
-        pRec  += stride;
-        fenc  += stride;
-    }
-
-    //last line
-    if (bBorderAvail[SGU_BL])
-    {
-        x = 0;
-        edgeType = xSign(pRec[x] - pRec[x + posShift]) + m_upBuff1[x] + 2;
-        stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-        count[m_eoTable[edgeType]]++;
-    }
-    if (bBorderAvail[SGU_B])
-    {
-        for (x = 1; x < endX; x++)
-        {
-            edgeType = xSign(pRec[x] - pRec[x + posShift]) + m_upBuff1[x] + 2;
-            stat[m_eoTable[edgeType]] += (fenc[x] - pRec[x]);
-            count[m_eoTable[edgeType]]++;
-        }
-    }
-}
-
 /** Calculate SAO statistics for current LCU without non-crossing slice
  * \param  addr,  partIdx,  yCbCr
  */
diff -r 288a83d7e289 -r 0b0023af2e7f source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h
--- a/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h	Sun Mar 02 18:57:46 2014 -0600
+++ b/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h	Mon Mar 03 13:48:26 2014 +0530
@@ -101,7 +101,6 @@
     void disablePartTree(SAOQTPart *psQTPart, int partIdx);
     void getSaoStats(SAOQTPart *psQTPart, int yCbCr);
     void calcSaoStatsCu(int addr, int partIdx, int yCbCr);
-    void calcSaoStatsBlock(Pel* recStart, Pel* orgStart, int stride, int64_t** stats, int64_t** counts, uint32_t width, uint32_t height, bool* bBorderAvail, int yCbCr);
     void calcSaoStatsRowCus_BeforeDblk(TComPic* pic, int idxY);
     void destroyEncBuffer();
     void createEncBuffer();


More information about the x265-devel mailing list