[x265-commits] [x265] PSNR: row-by-row PSNR measurement with SSD accumulators i...

Santhoshini Sekar santhoshini at multicorewareinc.com
Tue Oct 15 23:43:49 CEST 2013


details:   http://hg.videolan.org/x265/rev/404528f1ed26
branches:  
changeset: 4457:404528f1ed26
user:      Santhoshini Sekar <santhoshini at multicorewareinc.com>
date:      Tue Oct 15 15:18:48 2013 +0530
description:
PSNR: row-by-row PSNR measurement with SSD accumulators in TComPic
Subject: [x265] y4m: make file reading threaded

details:   http://hg.videolan.org/x265/rev/dd78cc895f2d
branches:  
changeset: 4458:dd78cc895f2d
user:      Kavitha Sampath <kavitha at multicorewareinc.com>
date:      Tue Oct 15 14:02:07 2013 +0530
description:
y4m: make file reading threaded
Subject: [x265] pixel-sse41.cpp: Modified PROCESS_SSE_SS4x1 macro with faster intrinsics

details:   http://hg.videolan.org/x265/rev/352781943ca8
branches:  
changeset: 4459:352781943ca8
user:      Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
date:      Tue Oct 15 14:04:29 2013 +0530
description:
pixel-sse41.cpp: Modified PROCESS_SSE_SS4x1 macro with faster intrinsics
Subject: [x265] primitives: add chroma partition widths and interpolation function def

details:   http://hg.videolan.org/x265/rev/d011ba82c852
branches:  
changeset: 4460:d011ba82c852
user:      Praveen Tiwari
date:      Tue Oct 15 20:57:54 2013 +0530
description:
primitives: add chroma partition widths and interpolation function def
Subject: [x265] cleanup:reduce ContextModel3DBuffer to 1D

details:   http://hg.videolan.org/x265/rev/e4f130853d90
branches:  
changeset: 4461:e4f130853d90
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 15 20:30:43 2013 +0800
description:
cleanup:reduce ContextModel3DBuffer to 1D
Subject: [x265] cabac: writeByte() for faster CABAC output

details:   http://hg.videolan.org/x265/rev/7bd38dc97fa1
branches:  
changeset: 4462:7bd38dc97fa1
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 15 20:31:05 2013 +0800
description:
cabac: writeByte() for faster CABAC output
Subject: [x265] faster grow buffer size to reduce number of memcpy

details:   http://hg.videolan.org/x265/rev/f66122e4565e
branches:  
changeset: 4463:f66122e4565e
user:      Min Chen <chenm003 at 163.com>
date:      Tue Oct 15 20:31:24 2013 +0800
description:
faster grow buffer size to reduce number of memcpy
Subject: [x265] api: pass presentation timestamp through the encoder

details:   http://hg.videolan.org/x265/rev/7c8c591908ac
branches:  
changeset: 4464:7c8c591908ac
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 15 16:00:08 2013 -0500
description:
api: pass presentation timestamp through the encoder
Subject: [x265] cmake: fix gcc 16bpp build

details:   http://hg.videolan.org/x265/rev/b04d75ceb182
branches:  
changeset: 4465:b04d75ceb182
user:      Steve Borho <steve at borho.org>
date:      Tue Oct 15 16:40:55 2013 -0500
description:
cmake: fix gcc 16bpp build

diffstat:

 source/Lib/TLibCommon/ContextModel.h           |   12 +-
 source/Lib/TLibCommon/ContextModel3DBuffer.cpp |    6 +-
 source/Lib/TLibCommon/ContextModel3DBuffer.h   |   18 +-
 source/Lib/TLibCommon/ContextTables.h          |    2 +-
 source/Lib/TLibCommon/TComBitCounter.h         |    1 +
 source/Lib/TLibCommon/TComBitStream.cpp        |   10 +-
 source/Lib/TLibCommon/TComBitStream.h          |    2 +
 source/Lib/TLibCommon/TComPic.cpp              |    3 +
 source/Lib/TLibCommon/TComPic.h                |    5 +
 source/Lib/TLibCommon/TypeDef.h                |    1 -
 source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp   |   12 +-
 source/Lib/TLibEncoder/TEncSbac.cpp            |  196 +++++++++++-----------
 source/common/CMakeLists.txt                   |    2 +-
 source/common/primitives.h                     |   20 ++-
 source/common/vec/pixel-sse41.cpp              |   64 ++++---
 source/encoder/encoder.cpp                     |  119 +-------------
 source/encoder/frameencoder.cpp                |    4 +
 source/encoder/framefilter.cpp                 |  138 ++++++++++++++++
 source/encoder/framefilter.h                   |    1 +
 source/input/input.h                           |    8 +
 source/input/y4m.cpp                           |  210 +++++++++++++++++++-----
 source/input/y4m.h                             |   40 ++++-
 source/x265.h                                  |   13 +-
 23 files changed, 555 insertions(+), 332 deletions(-)

diffs (truncated from 1878 to 300 lines):

diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/ContextModel.h
--- a/source/Lib/TLibCommon/ContextModel.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/ContextModel.h	Tue Oct 15 16:40:55 2013 -0500
@@ -56,7 +56,7 @@ class ContextModel
 {
 public:
 
-    ContextModel()   { m_state = 0; m_binsCoded = 0; }
+    ContextModel()   { m_state = 0; bBinsCoded = 0; }
 
     ~ContextModel()  {}
 
@@ -64,8 +64,6 @@ public:
 
     UChar getMps()   { return m_state  & 1; } ///< get curret MPS
 
-    void  setStateAndMps(UChar ucState, UChar ucMPS) { m_state = (ucState << 1) + ucMPS; } ///< set state and MPS
-
     void init(int qp, int initValue);   ///< initialize state with initial probability
 
     void updateLPS()
@@ -78,7 +76,7 @@ public:
         m_state = s_nextStateMPS[m_state];
     }
 
-    int getEntropyBits(short val) { return s_entropyBits[m_state ^ val]; }
+    int getEntropyBits(UInt val) { return s_entropyBits[m_state ^ val]; }
 
     void update(int binVal)
     {
@@ -88,18 +86,18 @@ public:
     static void buildNextStateTable();
     static int getEntropyBitsTrm(int val) { return s_entropyBits[126 ^ val]; }
 
-    void setBinsCoded(UInt val)   { m_binsCoded = val;  }
+    void setBinsCoded(UInt val)   { bBinsCoded = (UChar)val;  }
 
-    UInt getBinsCoded()           { return m_binsCoded;   }
+    UInt getBinsCoded()           { return bBinsCoded;   }
 
 private:
 
     UChar         m_state;  ///< internal state variable
+    UChar         bBinsCoded;
     static const UChar s_nextStateMPS[128];
     static const UChar s_nextStateLPS[128];
     static const int   s_entropyBits[128];
     static UChar  m_nextState[128][2];
-    UInt          m_binsCoded;
 };
 }
 //! \}
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/ContextModel3DBuffer.cpp
--- a/source/Lib/TLibCommon/ContextModel3DBuffer.cpp	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/ContextModel3DBuffer.cpp	Tue Oct 15 16:40:55 2013 -0500
@@ -46,10 +46,8 @@ using namespace x265;
 // Constructor / destructor / initialization / destroy
 // ====================================================================================================================
 
-ContextModel3DBuffer::ContextModel3DBuffer(UInt uiSizeZ, UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, int &count)
-    : m_sizeX(uiSizeX)
-    , m_sizeXY(uiSizeX * uiSizeY)
-    , m_sizeXYZ(uiSizeX * uiSizeY * uiSizeZ)
+ContextModel3DBuffer::ContextModel3DBuffer(UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, int &count)
+    : m_sizeXYZ(uiSizeX * uiSizeY)
 {
     // allocate 3D buffer
     m_contextModel = basePtr;
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/ContextModel3DBuffer.h
--- a/source/Lib/TLibCommon/ContextModel3DBuffer.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/ContextModel3DBuffer.h	Tue Oct 15 16:40:55 2013 -0500
@@ -62,31 +62,19 @@ class ContextModel3DBuffer
 protected:
 
     ContextModel* m_contextModel; ///< array of context models
-    const UInt    m_sizeX;      ///< X size of 3D buffer
-    const UInt    m_sizeXY;     ///< X times Y size of 3D buffer
     const UInt    m_sizeXYZ;    ///< total size of 3D buffer
 
     ContextModel3DBuffer& operator =(const ContextModel3DBuffer&);
 
 public:
 
-    ContextModel3DBuffer(UInt uiSizeZ, UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, int &count);
+    ContextModel3DBuffer(UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, int &count);
     ~ContextModel3DBuffer() {}
 
     // access functions
-    ContextModel& get(UInt uiZ, UInt uiY, UInt uiX)
+    ContextModel& get(UInt uiX)
     {
-        return m_contextModel[uiZ * m_sizeXY + uiY * m_sizeX + uiX];
-    }
-
-    ContextModel* get(UInt uiZ, UInt uiY)
-    {
-        return &m_contextModel[uiZ * m_sizeXY + uiY * m_sizeX];
-    }
-
-    ContextModel* get(UInt uiZ)
-    {
-        return &m_contextModel[uiZ * m_sizeXY];
+        return m_contextModel[uiX];
     }
 
     // initialization & copy functions
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/ContextTables.h
--- a/source/Lib/TLibCommon/ContextTables.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/ContextTables.h	Tue Oct 15 16:40:55 2013 -0500
@@ -46,7 +46,7 @@
 // Constants
 // ====================================================================================================================
 
-#define MAX_NUM_CTX_MOD             512       ///< maximum number of supported contexts
+#define MAX_NUM_CTX_MOD             256       ///< maximum number of supported contexts
 
 #define NUM_SPLIT_FLAG_CTX            3       ///< number of context models for split flag
 #define NUM_SKIP_FLAG_CTX             3       ///< number of context models for skip flag
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/TComBitCounter.h
--- a/source/Lib/TLibCommon/TComBitCounter.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/TComBitCounter.h	Tue Oct 15 16:40:55 2013 -0500
@@ -64,6 +64,7 @@ public:
     virtual ~TComBitCounter()   {}
 
     void        write(UInt /*uiBits*/, UInt uiNumberOfBits)  { m_uiBitCounter += uiNumberOfBits; }
+    void        writeByte(UInt /*val*/)                      { m_uiBitCounter += 8; }
 
     void        resetBits()                                  { m_uiBitCounter = 0; }
 
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/TComBitStream.cpp
--- a/source/Lib/TLibCommon/TComBitStream.cpp	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/TComBitStream.cpp	Tue Oct 15 16:40:55 2013 -0500
@@ -128,6 +128,14 @@ void TComOutputBitstream::write(UInt uiB
     m_num_held_bits = next_num_held_bits;
 }
 
+void TComOutputBitstream::writeByte(UInt val)
+{
+    // NOTE: we are here only in Cabac
+    assert(m_num_held_bits == 0);
+
+    push_back(val);
+}
+
 void TComOutputBitstream::writeAlignOne()
 {
     UInt num_bits = getNumBitsUntilByteAligned();
@@ -204,7 +212,7 @@ void TComOutputBitstream::push_back(uint
     }
     else
     {
-        buffsize += MIN_FIFO_SIZE;
+        buffsize *= 2;
         /**  FIFO size is Reached into MIN_FIFO_SIZE then Reallocate the FIFO and Copy the fifo to new memory
         location and continue to push encoded bit streams */
         uint8_t *temp = (uint8_t *)X265_MALLOC(uint8_t, buffsize);
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/TComBitStream.h
--- a/source/Lib/TLibCommon/TComBitStream.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/TComBitStream.h	Tue Oct 15 16:40:55 2013 -0500
@@ -64,6 +64,7 @@ public:
     virtual void        writeAlignZero() {}
 
     virtual void        write(UInt uiBits, UInt uiNumberOfBits)  = 0;
+    virtual void        writeByte(UInt val)                      = 0;
     virtual void        resetBits()                              = 0;
     virtual UInt getNumberOfWrittenBits() const = 0;
     virtual ~TComBitIf() {}
@@ -103,6 +104,7 @@ public:
      * the current bitstream
      */
     void        write(UInt uiBits, UInt uiNumberOfBits);
+    void        writeByte(UInt val);
 
     /** insert one bits until the bitstream is byte-aligned */
     void        writeAlignOne();
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/TComPic.cpp
--- a/source/Lib/TLibCommon/TComPic.cpp	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/TComPic.cpp	Tue Oct 15 16:40:55 2013 -0500
@@ -61,6 +61,9 @@ TComPic::TComPic()
     memset(&m_lowres, 0, sizeof(m_lowres));
     m_next = NULL;
     m_prev = NULL;
+    m_SSDY = 0;
+    m_SSDU = 0;
+    m_SSDV = 0;
 }
 
 TComPic::~TComPic()
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/TComPic.h
--- a/source/Lib/TLibCommon/TComPic.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/TComPic.h	Tue Oct 15 16:40:55 2013 -0500
@@ -78,12 +78,17 @@ public:
     volatile uint32_t     m_countRefEncoders;   // count of FrameEncoder threads monitoring m_reconRowCount
     Event                 m_reconRowWait;       // event triggered m_countRefEncoders times each time a recon row is completed
     void*                 m_userData;           // user provided pointer passed in with this picture
+    int64_t               m_pts;                // user provided presentation time stamp
 
     Lowres                m_lowres;
 
     TComPic*              m_next;
     TComPic*              m_prev;
 
+    UInt64                m_SSDY;
+    UInt64                m_SSDU;
+    UInt64                m_SSDV;
+
     TComPic();
     virtual ~TComPic();
 
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibCommon/TypeDef.h
--- a/source/Lib/TLibCommon/TypeDef.h	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibCommon/TypeDef.h	Tue Oct 15 16:40:55 2013 -0500
@@ -126,7 +126,6 @@ enum TextType
     TEXT_CHROMA_U,      ///< chroma U
     TEXT_CHROMA_V,      ///< chroma V
     TEXT_ALL,           ///< Y+U+V
-    TEXT_NONE = 15
 };
 
 /// reference list index
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
--- a/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	Tue Oct 15 16:40:55 2013 -0500
@@ -85,10 +85,10 @@ void TEncBinCABAC::finish()
     {
         //assert( m_numBufferedBytes > 0 );
         //assert( m_bufferedByte != 0xff );
-        m_pcTComBitIf->write(m_bufferedByte + 1, 8);
+        m_pcTComBitIf->writeByte(m_bufferedByte + 1);
         while (m_numBufferedBytes > 1)
         {
-            m_pcTComBitIf->write(0x00, 8);
+            m_pcTComBitIf->writeByte(0x00);
             m_numBufferedBytes--;
         }
 
@@ -98,11 +98,11 @@ void TEncBinCABAC::finish()
     {
         if (m_numBufferedBytes > 0)
         {
-            m_pcTComBitIf->write(m_bufferedByte, 8);
+            m_pcTComBitIf->writeByte(m_bufferedByte);
         }
         while (m_numBufferedBytes > 1)
         {
-            m_pcTComBitIf->write(0xff, 8);
+            m_pcTComBitIf->writeByte(0xff);
             m_numBufferedBytes--;
         }
     }
@@ -361,12 +361,12 @@ void TEncBinCABAC::writeOut()
             UInt carry = leadByte >> 8;
             UInt byte = m_bufferedByte + carry;
             m_bufferedByte = leadByte & 0xff;
-            m_pcTComBitIf->write(byte, 8);
+            m_pcTComBitIf->writeByte(byte);
 
             byte = (0xff + carry) & 0xff;
             while (m_numBufferedBytes > 1)
             {
-                m_pcTComBitIf->write(byte, 8);
+                m_pcTComBitIf->writeByte(byte);
                 m_numBufferedBytes--;
             }
         }
diff -r 1a85d8814346 -r b04d75ceb182 source/Lib/TLibEncoder/TEncSbac.cpp
--- a/source/Lib/TLibEncoder/TEncSbac.cpp	Tue Oct 15 12:45:58 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncSbac.cpp	Tue Oct 15 16:40:55 2013 -0500
@@ -53,33 +53,33 @@ TEncSbac::TEncSbac()
     , m_pcBinIf(NULL)
     , m_uiCoeffCost(0)
     , m_numContextModels(0)
-    , m_cCUSplitFlagSCModel(1,             1,               NUM_SPLIT_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUSkipFlagSCModel(1,             1,               NUM_SKIP_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUMergeFlagExtSCModel(1,             1,               NUM_MERGE_FLAG_EXT_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUMergeIdxExtSCModel(1,             1,               NUM_MERGE_IDX_EXT_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUPartSizeSCModel(1,             1,               NUM_PART_SIZE_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUPredModeSCModel(1,             1,               NUM_PRED_MODE_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUIntraPredSCModel(1,             1,               NUM_ADI_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUChromaPredSCModel(1,             1,               NUM_CHROMA_PRED_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUDeltaQpSCModel(1,             1,               NUM_DELTA_QP_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUInterDirSCModel(1,             1,               NUM_INTER_DIR_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCURefPicSCModel(1,             1,               NUM_REF_NO_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUMvdSCModel(1,             1,               NUM_MV_RES_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUQtCbfSCModel(1,             2,               NUM_QT_CBF_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUTransSubdivFlagSCModel(1,             1,               NUM_TRANS_SUBDIV_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUQtRootCbfSCModel(1,             1,               NUM_QT_ROOT_CBF_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUSigCoeffGroupSCModel(1,             2,               NUM_SIG_CG_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUSigSCModel(1,             1,               NUM_SIG_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCuCtxLastX(1,             2,               NUM_CTX_LAST_FLAG_XY, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCuCtxLastY(1,             2,               NUM_CTX_LAST_FLAG_XY, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUOneSCModel(1,             1,               NUM_ONE_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUAbsSCModel(1,             1,               NUM_ABS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cMVPIdxSCModel(1,             1,               NUM_MVP_IDX_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cCUAMPSCModel(1,             1,               NUM_CU_AMP_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cSaoMergeSCModel(1,             1,               NUM_SAO_MERGE_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cSaoTypeIdxSCModel(1,             1,               NUM_SAO_TYPE_IDX_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_cTransformSkipSCModel(1,             2,               NUM_TRANSFORMSKIP_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
-    , m_CUTransquantBypassFlagSCModel(1,          1,               NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
+    , m_cCUSplitFlagSCModel(1,          NUM_SPLIT_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)


More information about the x265-commits mailing list