[x265] cleanup m_pattern

Satoshi Nakagawa nakagawa424 at oki.com
Mon Mar 17 11:30:40 CET 2014


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1395052131 -32400
#      Mon Mar 17 19:28:51 2014 +0900
# Node ID d879aec68dc08a438c009bf57d2c99d2ed2af14f
# Parent  8d5deb7cafd83ac554489deb8577f905a0cda6b3
cleanup m_pattern

diff -r 8d5deb7cafd8 -r d879aec68dc0 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Mon Mar 17 00:47:24 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Mon Mar 17 19:28:51 2014 +0900
@@ -87,7 +87,6 @@
     m_iPCMSampleY = NULL;
     m_iPCMSampleCb = NULL;
     m_iPCMSampleCr = NULL;
-    m_pattern = NULL;
     m_cuAboveLeft = NULL;
     m_cuAboveRight = NULL;
     m_cuAbove = NULL;
@@ -157,7 +156,6 @@
     CHECKED_MALLOC(m_iPCMSampleY, Pel, width * height);
     CHECKED_MALLOC(m_iPCMSampleCb, Pel, (width >> m_hChromaShift) * (height >> m_vChromaShift));
     CHECKED_MALLOC(m_iPCMSampleCr, Pel, (width >> m_hChromaShift) * (height >> m_vChromaShift));
-    CHECKED_MALLOC(m_pattern, TComPattern, 1);
 
     memset(m_partSizes, SIZE_NONE, numPartition * sizeof(*m_partSizes));
     return ok;
@@ -169,7 +167,6 @@
 
 void TComDataCU::destroy()
 {
-    X265_FREE(m_pattern);
     X265_FREE(m_qp);
     X265_FREE(m_depth);
     X265_FREE(m_cuSize);
diff -r 8d5deb7cafd8 -r d879aec68dc0 source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h	Mon Mar 17 00:47:24 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.h	Mon Mar 17 19:28:51 2014 +0900
@@ -86,7 +86,6 @@
 
     TComPic*      m_pic;            ///< picture class pointer
     TComSlice*    m_slice;          ///< slice header pointer
-    TComPattern*  m_pattern;        ///< neighbor access class pointer
 
     // -------------------------------------------------------------------------------------------------------------------
     // CU description
@@ -217,8 +216,6 @@
 
     uint32_t      getCUPelY()                      { return m_cuPelY; }
 
-    TComPattern*  getPattern()                     { return m_pattern; }
-
     UChar*        getDepth()                       { return m_depth; }
 
     UChar         getDepth(uint32_t idx)           { return m_depth[idx]; }
diff -r 8d5deb7cafd8 -r d879aec68dc0 source/Lib/TLibCommon/TComPattern.h
--- a/source/Lib/TLibCommon/TComPattern.h	Mon Mar 17 00:47:24 2014 -0500
+++ b/source/Lib/TLibCommon/TComPattern.h	Mon Mar 17 19:28:51 2014 +0900
@@ -68,29 +68,29 @@
     // -------------------------------------------------------------------------------------------------------------------
 
     /// set parameters from pixel buffers for accessing neighboring pixels
-    void initAdiPattern(TComDataCU* cu, uint32_t zOrderIdxInPart, uint32_t partDepth, pixel* adiBuf,
-                        int strideOrig, int heightOrig, pixel* refAbove, pixel* refLeft,
-                        pixel* refAboveFlt, pixel* refLeftFlt);
+    static void initAdiPattern(TComDataCU* cu, uint32_t zOrderIdxInPart, uint32_t partDepth, pixel* adiBuf,
+                               int strideOrig, int heightOrig, pixel* refAbove, pixel* refLeft,
+                               pixel* refAboveFlt, pixel* refLeftFlt);
 
     /// set luma parameters from CU data for accessing ADI data
-    void  initAdiPattern(TComDataCU* cu, uint32_t zOrderIdxInPart, uint32_t partDepth, pixel* adiBuf,
-                         int strideOrig, int heightOrig);
+    static void  initAdiPattern(TComDataCU* cu, uint32_t zOrderIdxInPart, uint32_t partDepth, pixel* adiBuf,
+                                int strideOrig, int heightOrig);
 
     /// set chroma parameters from CU data for accessing ADI data
-    void  initAdiPatternChroma(TComDataCU* cu, uint32_t zOrderIdxInPart, uint32_t partDepth,
-                               pixel* adiBuf, int strideOrig, int heightOrig, int chromaId);
+    static void  initAdiPatternChroma(TComDataCU* cu, uint32_t zOrderIdxInPart, uint32_t partDepth,
+                                      pixel* adiBuf, int strideOrig, int heightOrig, int chromaId);
 
 private:
 
     /// padding of unavailable reference samples for intra prediction
-    void fillReferenceSamples(pixel* roiOrigin, pixel* adiTemp, bool* bNeighborFlags, int numIntraNeighbor, int unitSize, int numUnitsInCU, int totalUnits, uint32_t cuWidth, uint32_t cuHeight, uint32_t width, uint32_t height, int picStride);
+    static void fillReferenceSamples(pixel* roiOrigin, pixel* adiTemp, bool* bNeighborFlags, int numIntraNeighbor, int unitSize, int numUnitsInCU, int totalUnits, uint32_t cuWidth, uint32_t cuHeight, uint32_t width, uint32_t height, int picStride);
 
     /// constrained intra prediction
-    bool  isAboveLeftAvailable(TComDataCU* cu, uint32_t partIdxLT);
-    int   isAboveAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxRT, bool* bValidFlags);
-    int   isLeftAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxLB, bool* bValidFlags);
-    int   isAboveRightAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxRT, bool* bValidFlags);
-    int   isBelowLeftAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxLB, bool* bValidFlags);
+    static bool  isAboveLeftAvailable(TComDataCU* cu, uint32_t partIdxLT);
+    static int   isAboveAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxRT, bool* bValidFlags);
+    static int   isLeftAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxLB, bool* bValidFlags);
+    static int   isAboveRightAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxRT, bool* bValidFlags);
+    static int   isBelowLeftAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxLB, bool* bValidFlags);
 };
 }
 //! \}
diff -r 8d5deb7cafd8 -r d879aec68dc0 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Mar 17 00:47:24 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Mar 17 19:28:51 2014 +0900
@@ -416,7 +416,7 @@
     if (!bReusePred)
     {
         //===== init availability pattern =====
-        cu->getPattern()->initAdiPattern(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt);
+        TComPattern::initAdiPattern(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt);
         uint32_t lumaPredMode = cu->getLumaIntraDir(absPartIdx);
         //===== get prediction signal =====
         predIntraLumaAng(lumaPredMode, pred, stride, width);
@@ -527,7 +527,7 @@
     if (!bReusePred)
     {
         //===== init availability pattern =====
-        cu->getPattern()->initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, chromaId);
+        TComPattern::initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, chromaId);
         Pel* chromaPred = TComPattern::getAdiChromaBuf(chromaId, height, m_predBuf);
 
         uint32_t chromaPredMode = cu->getChromaIntraDir(absPartIdx);
@@ -878,7 +878,7 @@
 
         //===== init availability pattern =====
 
-        cu->getPattern()->initAdiPattern(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt);
+        TComPattern::initAdiPattern(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt);
         //===== get prediction signal =====
         predIntraLumaAng(lumaPredMode, pred, stride, width);
 
@@ -1388,7 +1388,7 @@
                 chromaPredMode = cu->getLumaIntraDir(0);
             }
             //===== init availability pattern =====
-            cu->getPattern()->initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, chromaId);
+            TComPattern::initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, chromaId);
             Pel* chromaPred = TComPattern::getAdiChromaBuf(chromaId, height, m_predBuf);
 
             //===== get prediction signal =====
@@ -1495,7 +1495,7 @@
     for (uint32_t pu = 0; pu < numPU; pu++, partOffset += qNumParts)
     {
         // Reference sample smoothing
-        cu->getPattern()->initAdiPattern(cu, partOffset, initTrDepth, m_predBuf, m_predBufStride, m_predBufHeight, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt);
+        TComPattern::initAdiPattern(cu, partOffset, initTrDepth, m_predBuf, m_predBufStride, m_predBufHeight, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt);
 
         //===== determine set of modes to be tested (using prediction signal only) =====
         const int numModesAvailable = 35; //total number of Intra modes
@@ -1765,8 +1765,8 @@
         costShift = 2;
     }
 
-    cu->getPattern()->initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, 0);
-    cu->getPattern()->initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, 1);
+    TComPattern::initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, 0);
+    TComPattern::initAdiPatternChroma(cu, absPartIdx, trDepth, m_predBuf, m_predBufStride, m_predBufHeight, 1);
     cu->getAllowedChromaDir(0, modeList);
     //----- check chroma modes -----
     for (uint32_t mode = minMode; mode < maxMode; mode++)
diff -r 8d5deb7cafd8 -r d879aec68dc0 source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Mon Mar 17 00:47:24 2014 -0500
+++ b/source/encoder/compress.cpp	Mon Mar 17 19:28:51 2014 +0900
@@ -86,9 +86,9 @@
     uint32_t partOffset  = 0;
 
     // Reference sample smoothing
-    cu->getPattern()->initAdiPattern(cu, partOffset, initTrDepth, m_search->m_predBuf, m_search->m_predBufStride,
-                                     m_search->m_predBufHeight, m_search->m_refAbove, m_search->m_refLeft,
-                                     m_search->m_refAboveFlt, m_search->m_refLeftFlt);
+    TComPattern::initAdiPattern(cu, partOffset, initTrDepth, m_search->m_predBuf, m_search->m_predBufStride,
+                                m_search->m_predBufHeight, m_search->m_refAbove, m_search->m_refLeft,
+                                m_search->m_refAboveFlt, m_search->m_refLeftFlt);
 
     Pel* fenc   = m_origYuv[depth]->getLumaAddr();
     uint32_t stride = m_modePredYuv[5][depth]->getStride();


More information about the x265-devel mailing list