[x265-commits] [x265] encodeQP: cleanup

Deepthi Nandakumar deepthi at multicorewareinc.com
Wed Mar 12 22:28:33 CET 2014


details:   http://hg.videolan.org/x265/rev/94d3dfe14558
branches:  
changeset: 6471:94d3dfe14558
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Wed Mar 12 13:45:50 2014 +0530
description:
encodeQP: cleanup
Subject: [x265] TComDataCU: cleanup

details:   http://hg.videolan.org/x265/rev/cc3d77015d1e
branches:  
changeset: 6472:cc3d77015d1e
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Wed Mar 12 15:43:59 2014 +0530
description:
TComDataCU: cleanup
Subject: [x265] Merge

details:   http://hg.videolan.org/x265/rev/4fdcea7426f1
branches:  
changeset: 6473:4fdcea7426f1
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Wed Mar 12 17:11:44 2014 +0530
description:
Merge
Subject: [x265] TEncSearch: refactor predInterSearch to use simple structure

details:   http://hg.videolan.org/x265/rev/7c8b9445bec6
branches:  
changeset: 6474:7c8b9445bec6
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 04:19:19 2014 -0500
description:
TEncSearch: refactor predInterSearch to use simple structure

This removes the need for keep every possible MVP and MVP idx around, and it
hopefully makes the code a lot more readable.
Subject: [x265] TEncSearch: MV0 bidir bitcost not based on list costs, so no need to remove them

details:   http://hg.videolan.org/x265/rev/524fdbaed8d0
branches:  
changeset: 6475:524fdbaed8d0
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 04:56:12 2014 -0500
description:
TEncSearch: MV0 bidir bitcost not based on list costs, so no need to remove them
Subject: [x265] TEncSearch: remove unused adaptive search range array

details:   http://hg.videolan.org/x265/rev/87ad1232188f
branches:  
changeset: 6476:87ad1232188f
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 13:40:27 2014 -0500
description:
TEncSearch: remove unused adaptive search range array
Subject: [x265] TEncSearch: use HEVC MVP candidates as motion candidates [CHANGES OUTPUTS]

details:   http://hg.videolan.org/x265/rev/99441b4af293
branches:  
changeset: 6477:99441b4af293
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 14:08:12 2014 -0500
description:
TEncSearch: use HEVC MVP candidates as motion candidates [CHANGES OUTPUTS]
Subject: [x265] TEncSearch: nit

details:   http://hg.videolan.org/x265/rev/9e554cec74ab
branches:  
changeset: 6478:9e554cec74ab
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 14:12:50 2014 -0500
description:
TEncSearch: nit
Subject: [x265] TEncSearch: replace UChar with uint8_t

details:   http://hg.videolan.org/x265/rev/999e3120deda
branches:  
changeset: 6479:999e3120deda
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 14:57:47 2014 -0500
description:
TEncSearch: replace UChar with uint8_t
Subject: [x265] optimize: reduce scan table size by uint32_t -> uint16_t

details:   http://hg.videolan.org/x265/rev/aedad0264282
branches:  
changeset: 6480:aedad0264282
user:      Min Chen <chenm003 at 163.com>
date:      Wed Mar 12 11:01:09 2014 -0700
description:
optimize: reduce scan table size by uint32_t -> uint16_t
Subject: [x265] optimize: use UChar on g_convertToBit to avoid signed extend

details:   http://hg.videolan.org/x265/rev/41ea3d34f224
branches:  
changeset: 6481:41ea3d34f224
user:      Min Chen <chenm003 at 163.com>
date:      Wed Mar 12 11:01:32 2014 -0700
description:
optimize: use UChar on g_convertToBit to avoid signed extend
Subject: [x265] TComRom: UChar to uint8_t

details:   http://hg.videolan.org/x265/rev/f88f6543ca26
branches:  
changeset: 6482:f88f6543ca26
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 15:39:31 2014 -0500
description:
TComRom: UChar to uint8_t
Subject: [x265] TypeDef: UChar to uint8_t

details:   http://hg.videolan.org/x265/rev/661f6a49b956
branches:  
changeset: 6483:661f6a49b956
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 15:40:00 2014 -0500
description:
TypeDef: UChar to uint8_t
Subject: [x265] TypeDef: explicit 32bit type for TCoeff

details:   http://hg.videolan.org/x265/rev/892b8325ed6c
branches:  
changeset: 6484:892b8325ed6c
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 15:40:52 2014 -0500
description:
TypeDef: explicit 32bit type for TCoeff
Subject: [x265] optimize: simplify operators on loop sigCoeffGroupFlag

details:   http://hg.videolan.org/x265/rev/d3e218ecc33f
branches:  
changeset: 6485:d3e218ecc33f
user:      Min Chen <chenm003 at 163.com>
date:      Wed Mar 12 11:02:24 2014 -0700
description:
optimize: simplify operators on loop sigCoeffGroupFlag
Subject: [x265] optimize: reduce memory and improvement performance by replace sigCoeffGroupFlag[] to sigCoeffGroupFlag64

details:   http://hg.videolan.org/x265/rev/68601cdea577
branches:  
changeset: 6486:68601cdea577
user:      Min Chen <chenm003 at 163.com>
date:      Wed Mar 12 11:09:14 2014 -0700
description:
optimize: reduce memory and improvement performance by replace sigCoeffGroupFlag[] to sigCoeffGroupFlag64
Subject: [x265] TComPicYuv: disambiguate variable names

details:   http://hg.videolan.org/x265/rev/5328eec59554
branches:  
changeset: 6487:5328eec59554
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 16:01:25 2014 -0500
description:
TComPicYuv: disambiguate variable names

Now with 75% less insanity!

diffstat:

 source/Lib/TLibCommon/TComDataCU.cpp   |    6 +-
 source/Lib/TLibCommon/TComDataCU.h     |    2 +-
 source/Lib/TLibCommon/TComPicYuv.cpp   |   90 ++++----
 source/Lib/TLibCommon/TComRom.cpp      |   16 +-
 source/Lib/TLibCommon/TComRom.h        |   12 +-
 source/Lib/TLibCommon/TComTrQuant.cpp  |   44 ++-
 source/Lib/TLibCommon/TComTrQuant.h    |    4 +-
 source/Lib/TLibCommon/TypeDef.h        |    8 +-
 source/Lib/TLibEncoder/TEncCu.cpp      |    2 +-
 source/Lib/TLibEncoder/TEncEntropy.cpp |    7 +-
 source/Lib/TLibEncoder/TEncEntropy.h   |    2 +-
 source/Lib/TLibEncoder/TEncSbac.cpp    |   34 +-
 source/Lib/TLibEncoder/TEncSearch.cpp  |  356 ++++++++++++++++----------------
 source/Lib/TLibEncoder/TEncSearch.h    |   11 +-
 source/common/common.h                 |   17 -
 source/encoder/api.cpp                 |    4 -
 source/encoder/encoder.cpp             |    1 -
 source/encoder/encoder.h               |    1 -
 source/encoder/frameencoder.cpp        |   20 -
 19 files changed, 292 insertions(+), 345 deletions(-)

diffs (truncated from 1277 to 300 lines):

diff -r c24eda418b5c -r 5328eec59554 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Wed Mar 12 16:01:25 2014 -0500
@@ -1288,11 +1288,11 @@ void TComDataCU::setCbfSubParts(uint32_t
     setSubPart<UChar>(uiCbf, m_cbf[ttype], absPartIdx, depth, partIdx);
 }
 
-void TComDataCU::setDepthSubParts(uint32_t depth, uint32_t absPartIdx)
+void TComDataCU::setDepthSubParts(uint32_t depth)
 {
+    /*All 4x4 partitions in current CU have the CU depth saved*/
     uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);
-
-    memset(m_depth + absPartIdx, depth, sizeof(UChar) * curPartNum);
+    memset(m_depth, depth, sizeof(UChar) * curPartNum);
 }
 
 bool TComDataCU::isFirstAbsZorderIdxInDepth(uint32_t absPartIdx, uint32_t depth)
diff -r c24eda418b5c -r 5328eec59554 source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.h	Wed Mar 12 16:01:25 2014 -0500
@@ -223,7 +223,7 @@ public:
 
     UChar         getDepth(uint32_t idx)           { return m_depth[idx]; }
 
-    void          setDepthSubParts(uint32_t depth, uint32_t absPartIdx);
+    void          setDepthSubParts(uint32_t depth);
 
     // -------------------------------------------------------------------------------------------------------------------
     // member functions for CU data
diff -r c24eda418b5c -r 5328eec59554 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Wed Mar 12 16:01:25 2014 -0500
@@ -185,83 +185,83 @@ void TComPicYuv::copyFromPicture(const x
         /* 8bit input, 10bit internal depth. Do a simple up-shift of 2 bits */
         assert(X265_DEPTH == 10);
 
-        pixel *Y = getLumaAddr();
-        pixel *U = getCbAddr();
-        pixel *V = getCrAddr();
+        pixel *yPixel = getLumaAddr();
+        pixel *uPixel = getCbAddr();
+        pixel *vPixel = getCrAddr();
 
-        uint8_t *y = (uint8_t*)pic.planes[0];
-        uint8_t *u = (uint8_t*)pic.planes[1];
-        uint8_t *v = (uint8_t*)pic.planes[2];
+        uint8_t *yChar = (uint8_t*)pic.planes[0];
+        uint8_t *uChar = (uint8_t*)pic.planes[1];
+        uint8_t *vChar = (uint8_t*)pic.planes[2];
 
         for (int r = 0; r < height; r++)
         {
             for (int c = 0; c < width; c++)
             {
-                Y[c] = ((pixel)y[c]) << 2;
+                yPixel[c] = ((pixel)yChar[c]) << 2;
             }
 
-            Y += getStride();
-            y += pic.stride[0] / sizeof(*y);
+            yPixel += getStride();
+            yChar += pic.stride[0] / sizeof(*yChar);
         }
 
         for (int r = 0; r < height >> m_vChromaShift; r++)
         {
             for (int c = 0; c < width >> m_hChromaShift; c++)
             {
-                U[c] = ((pixel)u[c]) << 2;
-                V[c] = ((pixel)v[c]) << 2;
+                uPixel[c] = ((pixel)uChar[c]) << 2;
+                vPixel[c] = ((pixel)vChar[c]) << 2;
             }
 
-            U += getCStride();
-            V += getCStride();
-            u += pic.stride[1] / sizeof(*u);
-            v += pic.stride[2] / sizeof(*v);
+            uPixel += getCStride();
+            vPixel += getCStride();
+            uChar += pic.stride[1] / sizeof(*uChar);
+            vChar += pic.stride[2] / sizeof(*vChar);
         }
     }
     else if (pic.bitDepth == 8)
     {
-        pixel *Y = getLumaAddr();
-        pixel *U = getCbAddr();
-        pixel *V = getCrAddr();
+        pixel *yPixel = getLumaAddr();
+        pixel *uPixel = getCbAddr();
+        pixel *vPixel = getCrAddr();
 
-        uint8_t *y = (uint8_t*)pic.planes[0];
-        uint8_t *u = (uint8_t*)pic.planes[1];
-        uint8_t *v = (uint8_t*)pic.planes[2];
+        uint8_t *yChar = (uint8_t*)pic.planes[0];
+        uint8_t *uChar = (uint8_t*)pic.planes[1];
+        uint8_t *vChar = (uint8_t*)pic.planes[2];
 
         for (int r = 0; r < height; r++)
         {
             for (int c = 0; c < width; c++)
             {
-                Y[c] = (pixel)y[c];
+                yPixel[c] = (pixel)yChar[c];
             }
 
-            Y += getStride();
-            y += pic.stride[0] / sizeof(*y);
+            yPixel += getStride();
+            yChar += pic.stride[0] / sizeof(*yChar);
         }
 
         for (int r = 0; r < height >> m_vChromaShift; r++)
         {
             for (int c = 0; c < width >> m_hChromaShift; c++)
             {
-                U[c] = (pixel)u[c];
-                V[c] = (pixel)v[c];
+                uPixel[c] = (pixel)uChar[c];
+                vPixel[c] = (pixel)vChar[c];
             }
 
-            U += getCStride();
-            V += getCStride();
-            u += pic.stride[1] / sizeof(*u);
-            v += pic.stride[2] / sizeof(*v);
+            uPixel += getCStride();
+            vPixel += getCStride();
+            uChar += pic.stride[1] / sizeof(*uChar);
+            vChar += pic.stride[2] / sizeof(*vChar);
         }
     }
     else /* pic.bitDepth > 8 */
     {
-        pixel *Y = getLumaAddr();
-        pixel *U = getCbAddr();
-        pixel *V = getCrAddr();
+        pixel *yPixel = getLumaAddr();
+        pixel *uPixel = getCbAddr();
+        pixel *vPixel = getCrAddr();
 
-        uint16_t *y = (uint16_t*)pic.planes[0];
-        uint16_t *u = (uint16_t*)pic.planes[1];
-        uint16_t *v = (uint16_t*)pic.planes[2];
+        uint16_t *yShort = (uint16_t*)pic.planes[0];
+        uint16_t *uShort = (uint16_t*)pic.planes[1];
+        uint16_t *vShort = (uint16_t*)pic.planes[2];
 
         /* defensive programming, mask off bits that are supposed to be zero */
         uint16_t mask = (1 << X265_DEPTH) - 1;
@@ -272,25 +272,25 @@ void TComPicYuv::copyFromPicture(const x
         {
             for (int c = 0; c < width; c++)
             {
-                Y[c] = (pixel)((y[c] >> shift) & mask);
+                yPixel[c] = (pixel)((yShort[c] >> shift) & mask);
             }
 
-            Y += getStride();
-            y += pic.stride[0] / sizeof(*y);
+            yPixel += getStride();
+            yShort += pic.stride[0] / sizeof(*yShort);
         }
 
         for (int r = 0; r < height >> m_vChromaShift; r++)
         {
             for (int c = 0; c < width >> m_hChromaShift; c++)
             {
-                U[c] = (pixel)((u[c] >> shift) & mask);
-                V[c] = (pixel)((v[c] >> shift) & mask);
+                uPixel[c] = (pixel)((uShort[c] >> shift) & mask);
+                vPixel[c] = (pixel)((vShort[c] >> shift) & mask);
             }
 
-            U += getCStride();
-            V += getCStride();
-            u += pic.stride[1] / sizeof(*u);
-            v += pic.stride[2] / sizeof(*v);
+            uPixel += getCStride();
+            vPixel += getCStride();
+            uShort += pic.stride[1] / sizeof(*uShort);
+            vShort += pic.stride[2] / sizeof(*vShort);
         }
     }
 
diff -r c24eda418b5c -r 5328eec59554 source/Lib/TLibCommon/TComRom.cpp
--- a/source/Lib/TLibCommon/TComRom.cpp	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/Lib/TLibCommon/TComRom.cpp	Wed Mar 12 16:01:25 2014 -0500
@@ -43,7 +43,7 @@ namespace x265 {
 //! \ingroup TLibCommon
 //! \{
 // scanning order table
-uint32_t* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_DEPTH];
+uint16_t* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_DEPTH];
 
 class ScanGenerator
 {
@@ -155,7 +155,7 @@ void initROM()
         for (uint32_t scanTypeIndex = 0; scanTypeIndex < SCAN_NUMBER_OF_TYPES; scanTypeIndex++)
         {
             const COEFF_SCAN_TYPE scanType = COEFF_SCAN_TYPE(scanTypeIndex);
-            g_scanOrder[SCAN_UNGROUPED][scanType][log2BlockSize] = X265_MALLOC(uint32_t, totalValues);
+            g_scanOrder[SCAN_UNGROUPED][scanType][log2BlockSize] = X265_MALLOC(uint16_t, totalValues);
             ScanGenerator fullBlockScan(blockWidth, blockHeight, blockWidth, scanType);
 
             for (uint32_t scanPosition = 0; scanPosition < totalValues; scanPosition++)
@@ -177,7 +177,7 @@ void initROM()
         {
             const COEFF_SCAN_TYPE scanType = COEFF_SCAN_TYPE(scanTypeIndex);
 
-            g_scanOrder[SCAN_GROUPED_4x4][scanType][log2BlockSize] = X265_MALLOC(uint32_t, totalValues);
+            g_scanOrder[SCAN_GROUPED_4x4][scanType][log2BlockSize] = X265_MALLOC(uint16_t, totalValues);
 
             ScanGenerator fullBlockScan(widthInGroups, heightInGroups, groupWidth, scanType);
 
@@ -406,7 +406,7 @@ const int16_t g_t32[32][32] =
     {  9, -25, 43, -57, 70, -80, 87, -90, 90, -87, 80, -70, 57, -43, 25, -9, -9, 25, -43, 57, -70, 80, -87, 90, -90, 87, -80, 70, -57, 43, -25,  9 },
     {  4, -13, 22, -31, 38, -46, 54, -61, 67, -73, 78, -82, 85, -88, 90, -90, 90, -90, 88, -85, 82, -78, 73, -67, 61, -54, 46, -38, 31, -22, 13, -4 }
 };
-const UChar g_chromaScale[NUM_CHROMA_FORMAT][chromaQPMappingTableSize] =
+const uint8_t g_chromaScale[NUM_CHROMA_FORMAT][chromaQPMappingTableSize] =
 {
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 },
@@ -418,7 +418,7 @@ const UChar g_chromaScale[NUM_CHROMA_FOR
 // Misc.
 // ====================================================================================================================
 
-char g_convertToBit[MAX_CU_SIZE + 1];
+uint8_t g_convertToBit[MAX_CU_SIZE + 1];
 
 #if ENC_DEC_TRACE
 FILE*  g_hTrace = NULL;
@@ -505,7 +505,7 @@ const double x265_lambda2_non_I[MAX_MAX_
     288625.9859, 363645.9408, 458165.1574, 577251.9032, 727291.7952
 };
 
-const UChar g_lpsTable[64][4] =
+const uint8_t g_lpsTable[64][4] =
 {
     { 128, 176, 208, 240 },
     { 128, 167, 197, 227 },
@@ -573,7 +573,7 @@ const UChar g_lpsTable[64][4] =
     {   2,   2,   2,   2 }
 };
 
-const UChar g_renormTable[32] =
+const uint8_t g_renormTable[32] =
 {
     6,  5,  4,  4,
     3,  3,  3,  3,
@@ -585,7 +585,7 @@ const UChar g_renormTable[32] =
     1,  1,  1,  1
 };
 
-const UChar x265_exp2_lut[64] =
+const uint8_t x265_exp2_lut[64] =
 {
     0,  3,  6,  8,  11, 14,  17,  20,  23,  26,  29,  32,  36,  39,  42,  45,
     48,  52,  55,  58,  62,  65,  69,  72,  76,  80,  83,  87,  91,  94,  98,  102,
diff -r c24eda418b5c -r 5328eec59554 source/Lib/TLibCommon/TComRom.h
--- a/source/Lib/TLibCommon/TComRom.h	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/Lib/TLibCommon/TComRom.h	Wed Mar 12 16:01:25 2014 -0500
@@ -69,14 +69,14 @@ void destroyROM();
 // ====================================================================================================================
 static const int chromaQPMappingTableSize = 58;
 
-extern const UChar  g_chromaScale[NUM_CHROMA_FORMAT][chromaQPMappingTableSize];
+extern const uint8_t g_chromaScale[NUM_CHROMA_FORMAT][chromaQPMappingTableSize];
 // Data structure related table & variable
 // ====================================================================================================================
 
 // flexible conversion from relative to absolute index
 extern uint32_t g_zscanToRaster[MAX_NUM_SPU_W * MAX_NUM_SPU_W];
 extern uint32_t g_rasterToZscan[MAX_NUM_SPU_W * MAX_NUM_SPU_W];
-extern uint32_t*  g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_DEPTH];
+extern uint16_t*  g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_DEPTH];
 void initZscanToRaster(int maxDepth, int depth, uint32_t startVal, uint32_t*& curIdx);
 void initRasterToZscan(uint32_t maxCUWidth, uint32_t maxCUHeight, uint32_t maxCUDepth);
 
@@ -153,7 +153,7 @@ inline T Clip3(T minVal, T maxVal, T a) 
 // Misc.
 // ====================================================================================================================
 
-extern char g_convertToBit[MAX_CU_SIZE + 1]; // from width to log2(width)-2
+extern uint8_t g_convertToBit[MAX_CU_SIZE + 1]; // from width to log2(width)-2
 
 #ifndef ENC_DEC_TRACE
 # define ENC_DEC_TRACE 0
@@ -271,9 +271,9 @@ extern const int g_winUnitY[MAX_CHROMA_F
 extern const double x265_lambda2_tab_I[MAX_MAX_QP + 1];
 extern const double x265_lambda2_non_I[MAX_MAX_QP + 1];
 // CABAC tables
-extern const UChar g_lpsTable[64][4];
-extern const UChar g_renormTable[32];
-extern const UChar x265_exp2_lut[64];
+extern const uint8_t g_lpsTable[64][4];


More information about the x265-commits mailing list