[x265] reduce context

Satoshi Nakagawa nakagawa424 at oki.com
Mon Feb 3 04:39:38 CET 2014


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1391398599 -32400
#      Mon Feb 03 12:36:39 2014 +0900
# Node ID 5de4b0b966b4be12cb6aed75bd742402db62c027
# Parent  aab88ed133647b779b0a1ca33a1e20584103ef7d
reduce context

diff -r aab88ed13364 -r 5de4b0b966b4 source/Lib/TLibCommon/ContextTables.h
--- a/source/Lib/TLibCommon/ContextTables.h	Sun Feb 02 13:09:26 2014 -0600
+++ b/source/Lib/TLibCommon/ContextTables.h	Mon Feb 03 12:36:39 2014 +0900
@@ -48,8 +48,6 @@
 // Constants
 // ====================================================================================================================
 
-#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 aab88ed13364 -r 5de4b0b966b4 source/Lib/TLibCommon/TComTrQuant.h
--- a/source/Lib/TLibCommon/TComTrQuant.h	Sun Feb 02 13:09:26 2014 -0600
+++ b/source/Lib/TLibCommon/TComTrQuant.h	Mon Feb 03 12:36:39 2014 +0900
@@ -63,13 +63,13 @@
 {
     int significantCoeffGroupBits[NUM_SIG_CG_FLAG_CTX][2];
     int significantBits[NUM_SIG_FLAG_CTX][2];
-    int lastXBits[32];
-    int lastYBits[32];
+    int lastXBits[10];
+    int lastYBits[10];
     int greaterOneBits[NUM_ONE_FLAG_CTX][2];
     int levelAbsBits[NUM_ABS_FLAG_CTX][2];
 
     int blockCbpBits[NUM_QT_CBF_CTX][2];
-    int blockRootCbpBits[4][2];
+    int blockRootCbpBits[NUM_QT_ROOT_CBF_CTX][2];
 } estBitsSbacStruct;
 
 // ====================================================================================================================
diff -r aab88ed13364 -r 5de4b0b966b4 source/Lib/TLibEncoder/TEncSbac.cpp
--- a/source/Lib/TLibEncoder/TEncSbac.cpp	Sun Feb 02 13:09:26 2014 -0600
+++ b/source/Lib/TLibEncoder/TEncSbac.cpp	Mon Feb 03 12:36:39 2014 +0900
@@ -186,8 +186,6 @@
     , m_binIf(NULL)
     , m_coeffCost(0)
 {
-    assert(MAX_OFF_CTX_MOD <= MAX_NUM_CTX_MOD);
-
     memset(m_contextModels, 0, sizeof(m_contextModels));
 }
 
@@ -2468,7 +2466,7 @@
 
     ctx = &m_contextModels[OFF_QT_ROOT_CBF_CTX];
 
-    for (uint32_t ctxInc = 0; ctxInc < 4; ctxInc++)
+    for (uint32_t ctxInc = 0; ctxInc < NUM_QT_ROOT_CBF_CTX; ctxInc++)
     {
         estBitsSbac->blockRootCbpBits[ctxInc][0] = sbacGetEntropyBits(ctx[ctxInc].m_state, 0);
         estBitsSbac->blockRootCbpBits[ctxInc][1] = sbacGetEntropyBits(ctx[ctxInc].m_state, 1);
diff -r aab88ed13364 -r 5de4b0b966b4 source/Lib/TLibEncoder/TEncSbac.h
--- a/source/Lib/TLibEncoder/TEncSbac.h	Sun Feb 02 13:09:26 2014 -0600
+++ b/source/Lib/TLibEncoder/TEncSbac.h	Mon Feb 03 12:36:39 2014 +0900
@@ -191,7 +191,7 @@
 private:
 
     uint32_t                 m_lastQp;
-    ContextModel         m_contextModels[MAX_NUM_CTX_MOD];
+    ContextModel         m_contextModels[MAX_OFF_CTX_MOD];
 };
 }
 //! \}


More information about the x265-devel mailing list