[x265-commits] [x265] TComPrediction: cleanup, remove unused buffers

Deepthi Nandakumar deepthi at multicorewareinc.com
Mon Nov 18 23:46:57 CET 2013


details:   http://hg.videolan.org/x265/rev/58f4e30dbe8f
branches:  
changeset: 5137:58f4e30dbe8f
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Mon Nov 18 12:42:52 2013 +0530
description:
TComPrediction: cleanup, remove unused buffers
Subject: [x265] Adding asm function declarations and initializations for chroma hps filter functions.

details:   http://hg.videolan.org/x265/rev/ac9e64d8a80b
branches:  
changeset: 5138:ac9e64d8a80b
user:      Nabajit Deka
date:      Mon Nov 18 12:26:44 2013 +0530
description:
Adding asm function declarations and initializations for chroma hps filter functions.
Subject: [x265] Encoder statistics: Inter[% (2Nx2N %2NxN %Nx2N %AMP)] Intra[% (%DC %PLANAR %ANG)] Split[%] Skip[%]

details:   http://hg.videolan.org/x265/rev/2321ebe0bf64
branches:  
changeset: 5139:2321ebe0bf64
user:      Kavitha Sampath <kavitha at multicorewareinc.com>
date:      Mon Nov 18 11:32:06 2013 +0530
description:
Encoder statistics: Inter[% (2Nx2N %2NxN %Nx2N %AMP)] Intra[% (%DC %PLANAR %ANG)] Split[%] Skip[%]
Subject: [x265] asm: fix the bug caused on 32-bit linux due to satd routines.

details:   http://hg.videolan.org/x265/rev/690f6534d310
branches:  
changeset: 5140:690f6534d310
user:      Yuvaraj Venkatesh <yuvaraj at multicorewareinc.com>
date:      Mon Nov 18 15:39:07 2013 +0530
description:
asm: fix the bug caused on 32-bit linux due to satd routines.
Subject: [x265] TShortYUV: asm code integration for pixelsub_ps

details:   http://hg.videolan.org/x265/rev/58646537ce29
branches:  
changeset: 5141:58646537ce29
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Mon Nov 18 17:51:16 2013 +0530
description:
TShortYUV: asm code integration for pixelsub_ps
Subject: [x265] Test bench code for transpose routine

details:   http://hg.videolan.org/x265/rev/301f9f86ae23
branches:  
changeset: 5142:301f9f86ae23
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Mon Nov 18 18:59:20 2013 +0530
description:
Test bench code for transpose routine
Subject: [x265] TComYuv::copyPartToPartYuv, blockcopy_pp asm integration

details:   http://hg.videolan.org/x265/rev/ad5dff9a2374
branches:  
changeset: 5143:ad5dff9a2374
user:      Praveen Tiwari
date:      Mon Nov 18 19:15:32 2013 +0530
description:
TComYuv::copyPartToPartYuv, blockcopy_pp asm integration
Subject: [x265] frameencoder: fix initialization order to prevent warnings

details:   http://hg.videolan.org/x265/rev/cfd834ba8e4f
branches:  
changeset: 5144:cfd834ba8e4f
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 18 16:35:02 2013 -0600
description:
frameencoder: fix initialization order to prevent warnings
Subject: [x265] cli: add aq-strength to cli input options, add validations for aq mode

details:   http://hg.videolan.org/x265/rev/6a068b264c84
branches:  
changeset: 5145:6a068b264c84
user:      Aarthi Thirumalai<aarthi at multicorewareinc.com>
date:      Mon Nov 18 22:04:07 2013 +0530
description:
cli: add aq-strength to cli input options, add validations for aq mode
Subject: [x265] preset: return superfast/ultrafast lookahead depths to 10

details:   http://hg.videolan.org/x265/rev/628be479be44
branches:  
changeset: 5146:628be479be44
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 18 16:41:31 2013 -0600
description:
preset: return superfast/ultrafast lookahead depths to 10
Subject: [x265] log: do not show aq-strength if AQ is disabled

details:   http://hg.videolan.org/x265/rev/2f5f538d2cbc
branches:  
changeset: 5147:2f5f538d2cbc
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 18 16:44:31 2013 -0600
description:
log: do not show aq-strength if AQ is disabled

diffstat:

 source/Lib/TLibCommon/TComPrediction.cpp |   23 -
 source/Lib/TLibCommon/TComPrediction.h   |    6 -
 source/Lib/TLibCommon/TComYuv.cpp        |   15 +-
 source/Lib/TLibCommon/TComYuv.h          |    4 +-
 source/Lib/TLibEncoder/TEncCu.cpp        |   84 +---
 source/Lib/TLibEncoder/TEncCu.h          |   23 +
 source/Lib/TLibEncoder/TEncSearch.cpp    |   14 -
 source/common/TShortYUV.cpp              |   20 +-
 source/common/TShortYUV.h                |    6 +-
 source/common/common.cpp                 |   23 +-
 source/common/common.h                   |    2 -
 source/common/pixel.cpp                  |    2 +-
 source/common/primitives.h               |    2 +-
 source/common/x86/asm-primitives.cpp     |   35 +-
 source/common/x86/ipfilter8.h            |    1 +
 source/common/x86/pixel-a.asm            |  556 +++++++++++++++---------------
 source/encoder/compress.cpp              |   72 +--
 source/encoder/encoder.cpp               |  102 +++++
 source/encoder/frameencoder.cpp          |   52 +--
 source/encoder/frameencoder.h            |    4 +-
 source/test/pixelharness.cpp             |   56 ++-
 source/test/pixelharness.h               |    1 +
 source/x265.cpp                          |   16 +-
 23 files changed, 582 insertions(+), 537 deletions(-)

diffs (truncated from 2116 to 300 lines):

diff -r e2895ce7bbeb -r 2f5f538d2cbc source/Lib/TLibCommon/TComPrediction.cpp
--- a/source/Lib/TLibCommon/TComPrediction.cpp	Sun Nov 17 11:24:13 2013 -0600
+++ b/source/Lib/TLibCommon/TComPrediction.cpp	Mon Nov 18 16:44:31 2013 -0600
@@ -86,35 +86,12 @@ TComPrediction::~TComPrediction()
     if (m_immedVals)
         X265_FREE(m_immedVals);
 
-    int i, j;
-    for (i = 0; i < 4; i++)
-    {
-        for (j = 0; j < 4; j++)
-        {
-            m_filteredBlock[i][j].destroy();
-        }
-
-        m_filteredBlockTmp[i].destroy();
-    }
 }
 
 void TComPrediction::initTempBuff(int csp)
 {
     if (m_predBuf == NULL)
     {
-        int extWidth  = MAX_CU_SIZE + 16;
-        int extHeight = MAX_CU_SIZE + 1;
-        int i, j;
-        for (i = 0; i < 4; i++)
-        {
-            m_filteredBlockTmp[i].create(extWidth, extHeight + 7, csp);
-
-            for (j = 0; j < 4; j++)
-            {
-                m_filteredBlock[i][j].create(extWidth, extHeight, csp);
-            }
-        }
-
         m_predBufHeight  = ((MAX_CU_SIZE + 2) << 4);
         m_predBufStride = ((MAX_CU_SIZE  + 8) << 4);
         m_predBuf = new Pel[m_predBufStride * m_predBufHeight];
diff -r e2895ce7bbeb -r 2f5f538d2cbc source/Lib/TLibCommon/TComPrediction.h
--- a/source/Lib/TLibCommon/TComPrediction.h	Sun Nov 17 11:24:13 2013 -0600
+++ b/source/Lib/TLibCommon/TComPrediction.h	Mon Nov 18 16:44:31 2013 -0600
@@ -73,12 +73,6 @@ protected:
     TShortYUV m_predShortYuv[2];
     TComYuv   m_predTempYuv;
 
-    /* This holds final interpolated pixel values (0-255). Hence memory is stored as Pel. */
-    TComYuv   m_filteredBlock[4][4];
-
-    /* This holds intermediate values for filtering operations which need to maintain short precision */
-    TShortYUV m_filteredBlockTmp[4];
-
     int16_t*    m_immedVals;
     Pel*      m_lumaRecBuffer; ///< array for down-sampled reconstructed luma sample
     int       m_lumaRecStride; ///< stride of m_lumaRecBuffer
diff -r e2895ce7bbeb -r 2f5f538d2cbc source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp	Sun Nov 17 11:24:13 2013 -0600
+++ b/source/Lib/TLibCommon/TComYuv.cpp	Mon Nov 18 16:44:31 2013 -0600
@@ -244,10 +244,12 @@ void TComYuv::copyPartToChroma(TComYuv* 
 
 void TComYuv::copyPartToPartYuv(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma, bool bChroma)
 {
+    int part = partitionFromSizes(width, height);
+
     if (bLuma)
-        copyPartToPartLuma(dstPicYuv, partIdx, width, height);
+        copyPartToPartLuma(dstPicYuv, partIdx, part);
     if (bChroma)
-        copyPartToPartChroma(dstPicYuv, partIdx, width >> m_hChromaShift, height >> m_vChromaShift);
+        copyPartToPartChroma(dstPicYuv, partIdx, part);
 }
 
 void TComYuv::copyPartToPartYuv(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma, bool bChroma)
@@ -258,7 +260,7 @@ void TComYuv::copyPartToPartYuv(TShortYU
         copyPartToPartChroma(dstPicYuv, partIdx, width >> m_hChromaShift, height >> m_vChromaShift);
 }
 
-void TComYuv::copyPartToPartLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height)
+void TComYuv::copyPartToPartLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part)
 {
     Pel* src = getLumaAddr(partIdx);
     Pel* dst = dstPicYuv->getLumaAddr(partIdx);
@@ -268,7 +270,6 @@ void TComYuv::copyPartToPartLuma(TComYuv
     uint32_t srcstride = getStride();
     uint32_t dststride = dstPicYuv->getStride();
 
-    int part = partitionFromSizes(width, height);
     primitives.luma_copy_pp[part](dst, dststride, src, srcstride);
 }
 
@@ -284,7 +285,7 @@ void TComYuv::copyPartToPartLuma(TShortY
     primitives.luma_copy_ps[part](dst, dststride, src, srcstride);
 }
 
-void TComYuv::copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height)
+void TComYuv::copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part)
 {
     Pel* srcU = getCbAddr(partIdx);
     Pel* srcV = getCrAddr(partIdx);
@@ -296,8 +297,8 @@ void TComYuv::copyPartToPartChroma(TComY
     uint32_t srcstride = getCStride();
     uint32_t dststride = dstPicYuv->getCStride();
 
-    primitives.blockcpy_pp(width, height, dstU, dststride, srcU, srcstride);
-    primitives.blockcpy_pp(width, height, dstV, dststride, srcV, srcstride);
+    primitives.chroma_copy_pp[m_csp][part](dstU, dststride, srcU, srcstride);
+    primitives.chroma_copy_pp[m_csp][part](dstV, dststride, srcV, srcstride);
 }
 
 void TComYuv::copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height)
diff -r e2895ce7bbeb -r 2f5f538d2cbc source/Lib/TLibCommon/TComYuv.h
--- a/source/Lib/TLibCommon/TComYuv.h	Sun Nov 17 11:24:13 2013 -0600
+++ b/source/Lib/TLibCommon/TComYuv.h	Mon Nov 18 16:44:31 2013 -0600
@@ -139,9 +139,9 @@ public:
     //  Copy YUV partition buffer to other YUV partition buffer
     void    copyPartToPartYuv(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma = true, bool bChroma = true);
     void    copyPartToPartYuv(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma = true, bool bChroma = true);
-    void    copyPartToPartLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height);
+    void    copyPartToPartLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part);
     void    copyPartToPartLuma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height);
-    void    copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height);
+    void    copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part);
     void    copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height);
 
     void    copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, uint32_t chromaId);
diff -r e2895ce7bbeb -r 2f5f538d2cbc source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Sun Nov 17 11:24:13 2013 -0600
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Mon Nov 18 16:44:31 2013 -0600
@@ -343,25 +343,13 @@ void TEncCu::init(Encoder* top)
 
 /** \param  rpcCU pointer of CU data class
  */
-#if CU_STAT_LOGFILE
-extern int totalCU;
-extern int cntInter[4], cntIntra[4], cntSplit[4], cntIntraNxN;
-extern  int cuInterDistribution[4][4], cuIntraDistribution[4][3];
-extern  int cntSkipCu[4],  cntTotalCu[4];
-extern FILE* fp1;
 bool mergeFlag = 0;
-#endif
 
 void TEncCu::compressCU(TComDataCU* cu)
 {
     // initialize CU data
     m_bestCU[0]->initCU(cu->getPic(), cu->getAddr());
     m_tempCU[0]->initCU(cu->getPic(), cu->getAddr());
-#if CU_STAT_LOGFILE
-    totalCU++;
-    if (cu->getSlice()->getSliceType() != I_SLICE)
-        fprintf(fp1, "\n CU number : %d ", totalCU);
-#endif
 
     m_addSADDepth      = 0;
     m_LCUPredictionSAD = 0;
@@ -479,10 +467,8 @@ void TEncCu::xCompressIntraCU(TComDataCU
 {
     //PPAScopeEvent(TEncCu_xCompressIntraCU + depth);
 
-#if CU_STAT_LOGFILE
-    cntTotalCu[depth]++;
+    m_log->cntTotalCu[depth]++;
     int boundaryCu = 0;
-#endif
     m_abortFlag = false;
     TComPic* pic = outBestCU->getPic();
 
@@ -550,9 +536,7 @@ void TEncCu::xCompressIntraCU(TComDataCU
         // Early CU determination
         if (outBestCU->isSkipped(0))
         {
-#if CU_STAT_LOGFILE
-            cntSkipCu[depth]++;
-#endif
+            m_log->cntSkipCu[depth]++;
             bSubBranch = false;
         }
         else
@@ -609,9 +593,7 @@ void TEncCu::xCompressIntraCU(TComDataCU
             {
                 subBestPartCU[partUnitIdx]->copyToPic(nextDepth);
                 outTempCU->copyPartFrom(subBestPartCU[partUnitIdx], partUnitIdx, nextDepth);
-#if CU_STAT_LOGFILE
                 boundaryCu++;
-#endif
             }
         }
 
@@ -651,22 +633,18 @@ void TEncCu::xCompressIntraCU(TComDataCU
         }
 
         m_rdSbacCoders[nextDepth][CI_NEXT_BEST]->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
-#if CU_STAT_LOGFILE
         if (outBestCU->m_totalCost < outTempCU->m_totalCost)
         {
-            cntIntra[depth]++;
-            cntIntra[depth + 1] = cntIntra[depth + 1] - 4 + boundaryCu;
+            m_log->cntIntra[depth]++;
+            m_log->cntIntra[depth + 1] = m_log->cntIntra[depth + 1] - 4 + boundaryCu;
         }
-#endif
         xCheckBestMode(outBestCU, outTempCU, depth); // RD compare current prediction with split prediction.
     }
 
-#if CU_STAT_LOGFILE
-    if (depth == 3 && bSubBranch)
+    if (depth == g_maxCUDepth - 1 && bSubBranch)
     {
-        cntIntra[depth]++;
+        m_log->cntIntra[depth]++;
     }
-#endif
     outBestCU->copyToPic(depth); // Copy Best data to Picture for next partition prediction.
 
     // Copy Yuv data to picture Yuv
@@ -685,9 +663,7 @@ void TEncCu::xCompressCU(TComDataCU*& ou
 {
     //PPAScopeEvent(TEncCu_xCompressCU + depth);
 
-#if CU_STAT_LOGFILE
-    cntTotalCu[depth]++;
-#endif
+    m_log->cntTotalCu[depth]++;
     TComPic* pic = outBestCU->getPic();
     m_abortFlag = false;
 
@@ -738,15 +714,11 @@ void TEncCu::xCompressCU(TComDataCU*& ou
                 xCheckRDCostInter(outBestCU, outTempCU, SIZE_2Nx2N);
                 outTempCU->initEstData(depth, qp); // by competition for inter_2Nx2N
             }
-#if CU_STAT_LOGFILE
             mergeFlag = 1;
-#endif
             // by Merge for inter_2Nx2N
             xCheckRDCostMerge2Nx2N(outBestCU, outTempCU, &earlyDetectionSkipMode, m_bestPredYuv[depth], m_bestRecoYuv[depth]);
 
-#if CU_STAT_LOGFILE
             mergeFlag = 0;
-#endif
             outTempCU->initEstData(depth, qp);
 
             if (!m_cfg->param.bEnableEarlySkip)
@@ -940,9 +912,7 @@ void TEncCu::xCompressCU(TComDataCU*& ou
         // Early CU determination
         if (outBestCU->isSkipped(0))
         {
-#if CU_STAT_LOGFILE
-            cntSkipCu[depth]++;
-#endif
+            m_log->cntSkipCu[depth]++;
             bSubBranch = false;
         }
         else
@@ -1046,80 +1016,76 @@ void TEncCu::xCompressCU(TComDataCU*& ou
         }
 
         m_rdSbacCoders[nextDepth][CI_NEXT_BEST]->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
-#if  CU_STAT_LOGFILE
         if (outBestCU->m_totalCost < outTempCU->m_totalCost)
         {
             if (outBestCU->getPredictionMode(0) == MODE_INTER)
             {
-                cntInter[depth]++;
-                if (outBestCU->getPartitionSize(0) < 3)
+                m_log->cntInter[depth]++;
+                if (outBestCU->getPartitionSize(0) < AMP_ID)
                 {
-                    cuInterDistribution[depth][outBestCU->getPartitionSize(0)]++;
+                    m_log->cuInterDistribution[depth][outBestCU->getPartitionSize(0)]++;
                 }
                 else
                 {
-                    cuInterDistribution[depth][3]++;
+                    m_log->cuInterDistribution[depth][AMP_ID]++;
                 }
             }
             else if (outBestCU->getPredictionMode(0) == MODE_INTRA)
             {
-                cntIntra[depth]++;
+                m_log->cntIntra[depth]++;
                 if (outBestCU->getLumaIntraDir()[0] > 1)
                 {
-                    cuIntraDistribution[depth][2]++;
+                    m_log->cuIntraDistribution[depth][ANGULAR_MODE_ID]++;
                 }
                 else
                 {
-                    cuIntraDistribution[depth][outBestCU->getLumaIntraDir()[0]]++;
+                    m_log->cuIntraDistribution[depth][outBestCU->getLumaIntraDir()[0]]++;
                 }
             }
         }
         else
         {
-            cntSplit[depth]++;
+            m_log->cntSplit[depth]++;
         }
-#endif // if  LOGGING
         xCheckBestMode(outBestCU, outTempCU, depth); // RD compare current CU against split
     }
-#if CU_STAT_LOGFILE


More information about the x265-commits mailing list