changeset 1221:cd5e5e2498d8

Merged multicoreware/xhevc into default
author Deepthi Devaki Akkoorath <deepthidevaki@multicorewareinc.com>
date Wed, 08 May 2013 10:27:35 +0530
parents bb747fc0379d (current diff) b4702c569e73 (diff)
children 4470f5f36d76 770006a69dfa
files source/Lib/TLibCommon/TComPicYuv.cpp
diffstat 11 files changed, 54 insertions(+-), 23 deletions(-) [+]
line wrap: on
line diff
--- a/cfg/encoder_I_15P.cfg	Tue May 07 16:46:55 2013 +0530
+++ b/cfg/encoder_I_15P.cfg	Wed May 08 10:27:35 2013 +0530
@@ -18,10 +18,10 @@ IntraPeriod                   : 16      
 DecodingRefreshType           : 0           # Random Accesss 0:none, 1:CDR, 2:IDR
 GOPSize                       : 4           # GOP Size (number of B slice = GOPSize-1)
 #        Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2  temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs 
-Frame1:  P    1   3        0.4624   0            0               0           1                1         -1       		    0
-Frame2:  P    2   2        0.4624   0            0               0           1                1         -1    			    1      -1       2         0 1 
-Frame3:  P    3   3        0.4624   0            0               0           1                1         -1        		    1      -1       2         0 1           
-Frame4:  P    4   1        0.578    0            0               0           1                1         -1        		    1      -1       2         0 1 
+Frame1:  P    1   3        0.4624   0            0               0           1                1         -1                  0
+Frame2:  P    2   2        0.4624   0            0               0           1                1         -1                  1      -1       2         0 1 
+Frame3:  P    3   3        0.4624   0            0               0           1                1         -1                  1      -1       2         0 1           
+Frame4:  P    4   1        0.578    0            0               0           1                1         -1                  1      -1       2         0 1 
 
 #=========== Motion Search =============
 FastSearch                    : 1           # 0:Full search  1:TZ search
@@ -52,6 +52,7 @@ InternalBitDepth              : 8       
 #=========== Coding Tools =================
 SAO                           : 0           # Sample adaptive offset  (0: OFF, 1: ON)
 AMP                           : 1           # Asymmetric motion partitions (0: OFF, 1: ON)
+AMP_REFINE                    : 1           # Asymmetric refine motion partitions Nx2N and 2NxN(0: OFF, 1: ON)
 TransformSkip                 : 1           # Transform skipping (0: OFF, 1: ON)
 TransformSkipFast             : 1           # Fast Transform skipping (0: OFF, 1: ON)
 SAOLcuBoundary                : 0           # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
--- a/cfg/encoder_all_I.cfg	Tue May 07 16:46:55 2013 +0530
+++ b/cfg/encoder_all_I.cfg	Wed May 08 10:27:35 2013 +0530
@@ -47,6 +47,7 @@ InternalBitDepth              : 8       
 #=========== Coding Tools =================
 SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
 AMP                           : 1           # Asymmetric motion partitions (0: OFF, 1: ON)
+AMP_REFINE                    : 1           # Asymmetric refine motion partitions Nx2N and 2NxN(0: OFF, 1: ON)
 TransformSkip                 : 1           # Transform skipping (0: OFF, 1: ON)
 TransformSkipFast             : 1           # Fast Transform skipping (0: OFF, 1: ON)
 SAOLcuBoundary                : 0           # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Tue May 07 16:46:55 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Wed May 08 10:27:35 2013 +0530
@@ -40,6 +40,7 @@
 #include <memory.h>
 #include "InterpolationFilter.h"
 #include "primitives.h"
+#include "PPA/ppa.h"
 
 using namespace x265;
 
@@ -244,7 +245,7 @@ Void  TComPicYuv::copyToPicCr(TComPicYuv
 Void TComPicYuv::extendPicBorder()
 {
     if (m_bIsBorderExtended) return;
-
+    PPAScopeEvent(TComPicYUV_extendPicBorder);
     xExtendPicCompBorder(getLumaAddr(), getStride(), getWidth(),     getHeight(),      m_iLumaMarginX,   m_iLumaMarginY);
     xExtendPicCompBorder(getCbAddr(), getCStride(), getWidth() >> 1, getHeight() >> 1, m_iChromaMarginX, m_iChromaMarginY);
     xExtendPicCompBorder(getCrAddr(), getCStride(), getWidth() >> 1, getHeight() >> 1, m_iChromaMarginX, m_iChromaMarginY);
--- a/source/Lib/TLibCommon/TComSlice.h	Tue May 07 16:46:55 2013 +0530
+++ b/source/Lib/TLibCommon/TComSlice.h	Wed May 08 10:27:35 2013 +0530
@@ -905,6 +905,7 @@ private:
     UInt        m_pcmLog2MaxSize;
     UInt        m_uiPCMLog2MinSize;
     Bool        m_useAMP;
+    Bool        m_useAMPRefine;
 
     // Parameter
     Int         m_bitDepthY;
@@ -926,6 +927,7 @@ private:
     UInt        m_uiMaxTrSize;
 
     Int m_iAMPAcc[MAX_CU_DEPTH];
+    Int m_iAMPRefineAcc[MAX_CU_DEPTH];
     Bool        m_bUseSAO;
 
     Bool        m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
@@ -1032,6 +1034,10 @@ public:
 
     Void setUseAMP(Bool b) { m_useAMP = b; }
 
+    Bool getUseAMPRefine() { return m_useAMPRefine; }
+
+    Void setUseAMPRefine(Bool b) { m_useAMPRefine = b; }
+
     Void setQuadtreeTULog2MaxSize(UInt u) { m_uiQuadtreeTULog2MaxSize = u;    }
 
     UInt getQuadtreeTULog2MaxSize()         { return m_uiQuadtreeTULog2MaxSize; }
@@ -1078,6 +1084,10 @@ public:
 
     Void      setAMPAcc(UInt uiDepth, Int iAccu) { assert(uiDepth < g_uiMaxCUDepth);  m_iAMPAcc[uiDepth] = iAccu; }
 
+    Int       getAMPRefineAcc(UInt uiDepth) { return m_iAMPRefineAcc[uiDepth]; }
+
+    Void      setAMPRefineAcc(UInt uiDepth, Int iAccu) { assert(uiDepth < g_uiMaxCUDepth);  m_iAMPRefineAcc[uiDepth] = iAccu; }
+
     // Bit-depth
     Int      getBitDepthY() { return m_bitDepthY; }
 
--- a/source/Lib/TLibEncoder/TEncCfg.h	Tue May 07 16:46:55 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncCfg.h	Wed May 08 10:27:35 2013 +0530
@@ -139,6 +139,7 @@ protected:
 
     Int       m_maxTempLayer;                    ///< Max temporal layer
     Bool      m_useAMP;
+    Bool      m_useAMPRefine;
 
     //======= Transform =============
     UInt      m_uiQuadtreeTULog2MaxSize;
@@ -392,6 +393,8 @@ public:
 
     Void setUseAMP(Bool b) { m_useAMP = b; }
 
+    Void setUseAMPRefine(Bool b) { m_useAMPRefine = b; }
+
     //====== Loop/Deblock Filter ========
     Void      setLoopFilterDisable(Bool b)      { m_bLoopFilterDisable       = b; }
 
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Tue May 07 16:46:55 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Wed May 08 10:27:35 2013 +0530
@@ -539,29 +539,36 @@ Void TEncCu::xCompressCU(TComDataCU*& rp
                         }
                     }
 
-                    // 2NxN, Nx2N
-                    if (doNotBlockPu)
-                    {
-                        xCheckRDCostInter(rpcBestCU, rpcTempCU, SIZE_Nx2N);
-                        rpcTempCU->initEstData(uiDepth, iQP);
-                        if (m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_Nx2N)
-                        {
-                            doNotBlockPu = rpcBestCU->getQtRootCbf(0) != 0;
-                        }
+                    if (pcPic->getSlice(0)->getSPS()->getAMPRefineAcc(uiDepth))
+                    {    
+                        //assert(0);
+                        // 2NxN, Nx2N
+                        if (doNotBlockPu)
+                            {
+                                xCheckRDCostInter(rpcBestCU, rpcTempCU, SIZE_Nx2N);
+                                rpcTempCU->initEstData(uiDepth, iQP);
+                                if (m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_Nx2N)
+                                    {
+                                        doNotBlockPu = rpcBestCU->getQtRootCbf(0) != 0;
+                                    }
+                            }
+                        if (doNotBlockPu)
+                            {
+                                xCheckRDCostInter(rpcBestCU, rpcTempCU, SIZE_2NxN);
+                                rpcTempCU->initEstData(uiDepth, iQP);
+                                if (m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxN)
+                                {
+                                    doNotBlockPu = rpcBestCU->getQtRootCbf(0) != 0;
+                                }
+                            
+                            }
                     }
-                    if (doNotBlockPu)
-                    {
-                        xCheckRDCostInter(rpcBestCU, rpcTempCU, SIZE_2NxN);
-                        rpcTempCU->initEstData(uiDepth, iQP);
-                        if (m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxN)
-                        {
-                            doNotBlockPu = rpcBestCU->getQtRootCbf(0) != 0;
-                        }
-                    }
+
 
                     //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
                     if (pcPic->getSlice(0)->getSPS()->getAMPAcc(uiDepth))
                     {
+                        //assert(0);
                         Bool bTestAMP_Hor = false, bTestAMP_Ver = false;
                         Bool bTestMergeAMP_Hor = false, bTestMergeAMP_Ver = false;
 
--- a/source/Lib/TLibEncoder/TEncTop.cpp	Tue May 07 16:46:55 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncTop.cpp	Wed May 08 10:27:35 2013 +0530
@@ -494,14 +494,18 @@ Void TEncTop::xInitSPS()
     for (i = 0; i < g_uiMaxCUDepth - g_uiAddCUDepth; i++)
     {
         m_cSPS.setAMPAcc(i, m_useAMP);
+        m_cSPS.setAMPRefineAcc(i, m_useAMP);
         //m_cSPS.setAMPAcc( i, 1 );
     }
 
     m_cSPS.setUseAMP(m_useAMP);
+    m_cSPS.setUseAMPRefine(m_useAMPRefine);
+
 
     for (i = g_uiMaxCUDepth - g_uiAddCUDepth; i < g_uiMaxCUDepth; i++)
     {
         m_cSPS.setAMPAcc(i, 0);
+        m_cSPS.setAMPRefineAcc(i, 0);
     }
 
     m_cSPS.setBitDepthY(g_bitDepthY);
--- a/source/PPA/ppaCPUEvents.h	Tue May 07 16:46:55 2013 +0530
+++ b/source/PPA/ppaCPUEvents.h	Wed May 08 10:27:35 2013 +0530
@@ -9,3 +9,4 @@ PPA_REGISTER_CPU_EVENT(TEncCu_xCompressC
 PPA_REGISTER_CPU_EVENT(TEncSearch_xMotionEstimation)
 PPA_REGISTER_CPU_EVENT(TEncCU_xCheckRDCostIntra)
 PPA_REGISTER_CPU_EVENT(TEncCU_xCheckIntraPCM)
+PPA_REGISTER_CPU_EVENT(TComPicYUV_extendPicBorder)
--- a/source/x265.h	Tue May 07 16:46:55 2013 +0530
+++ b/source/x265.h	Wed May 08 10:27:35 2013 +0530
@@ -111,6 +111,7 @@ typedef struct
     int       m_useTransformSkip;                 ///< flag for enabling intra transform skipping
     int       m_useTransformSkipFast;             ///< flag for enabling fast intra transform skipping
     int       m_enableAMP;
+    int       m_enableAMPRefine;
 
     // coding quality
     int       m_iQP;                              ///< QP value of key-picture (integer)
--- a/source/x265cfg.cpp	Tue May 07 16:46:55 2013 +0530
+++ b/source/x265cfg.cpp	Wed May 08 10:27:35 2013 +0530
@@ -384,6 +384,7 @@ Bool TAppEncCfg::parseCfg(Int argc, Char
 
         // Coding tools
         ("AMP",                      m_enableAMP,                 1,  "Enable asymmetric motion partitions")
+        ("AMP_REFINE",               m_enableAMPRefine,          1,  "Enable asymmetric refinement motion partitions like include Nx2N and 2NxN")
         ("TransformSkip",            m_useTransformSkip,          0,  "Intra transform skipping")
         ("TransformSkipFast",        m_useTransformSkipFast,      0,  "Fast intra transform skipping")
         ("SAO",                      m_bUseSAO,                   1,  "Enable Sample Adaptive Offset")
--- a/source/x265enc.cpp	Tue May 07 16:46:55 2013 +0530
+++ b/source/x265enc.cpp	Wed May 08 10:27:35 2013 +0530
@@ -121,6 +121,7 @@ Void TAppEncTop::xInitLibCfg()
 
     m_cTEncTop.setMaxTempLayer(m_maxTempLayer);
     m_cTEncTop.setUseAMP(m_enableAMP);
+    m_cTEncTop.setUseAMPRefine(m_enableAMPRefine);
 
     //===== Slice ========