[x265] move tables from .h to .cpp

Satoshi Nakagawa nakagawa424 at oki.com
Mon Mar 28 13:52:10 CEST 2016


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1459165671 -32400
#      Mon Mar 28 20:47:51 2016 +0900
# Node ID 68099f6e3cd9a8911b6e559a0387c8ff485f5afe
# Parent  5dbd6a0c8e17481a0c4d31243ebc8b46ad59e15d
move tables from .h to .cpp

diff -r 5dbd6a0c8e17 -r 68099f6e3cd9 source/common/contexts.h
--- a/source/common/contexts.h	Mon Mar 28 12:53:40 2016 +0530
+++ b/source/common/contexts.h	Mon Mar 28 20:47:51 2016 +0900
@@ -117,196 +117,8 @@
 #define sbacGetEntropyBits(S, V) (g_entropyBits[(S) ^ (V)])
 #define sbacGetEntropyBitsTrm(V) (g_entropyBits[126 ^ (V)])
 
-#define MAX_NUM_CHANNEL_TYPE     2
+static const uint32_t ctxCbf[3][5] = { { 1, 0, 0, 0, 0 }, { 2, 3, 4, 5, 6 }, { 2, 3, 4, 5, 6 } };
 
-static const uint32_t ctxCbf[3][5] = { { 1, 0, 0, 0, 0 }, { 2, 3, 4, 5, 6 }, { 2, 3, 4, 5, 6 } };
-static const uint32_t significanceMapContextSetStart[MAX_NUM_CHANNEL_TYPE][3] = { { 0,  9, 21 }, { 0,  9, 12 } };
-static const uint32_t significanceMapContextSetSize[MAX_NUM_CHANNEL_TYPE][3]  = { { 9, 12,  6 }, { 9,  3,  3 } };
-static const uint32_t nonDiagonalScan8x8ContextOffset[MAX_NUM_CHANNEL_TYPE]   = {  6, 0  };
-static const uint32_t notFirstGroupNeighbourhoodContextOffset[MAX_NUM_CHANNEL_TYPE] = { 3, 0 };
-
-// initial probability for cu_transquant_bypass flag
-static const uint8_t INIT_CU_TRANSQUANT_BYPASS_FLAG[3][NUM_TQUANT_BYPASS_FLAG_CTX] =
-{
-    { 154 },
-    { 154 },
-    { 154 },
-};
-
-// initial probability for split flag
-static const uint8_t INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] =
-{
-    { 107,  139,  126, },
-    { 107,  139,  126, },
-    { 139,  141,  157, },
-};
-
-static const uint8_t INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] =
-{
-    { 197,  185,  201, },
-    { 197,  185,  201, },
-    { CNU,  CNU,  CNU, },
-};
-
-static const uint8_t INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] =
-{
-    { 154, },
-    { 110, },
-    { CNU, },
-};
-
-static const uint8_t INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] =
-{
-    { 137, },
-    { 122, },
-    { CNU, },
-};
-
-static const uint8_t INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] =
-{
-    { 154,  139,  154, 154 },
-    { 154,  139,  154, 154 },
-    { 184,  CNU,  CNU, CNU },
-};
-
-static const uint8_t INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] =
-{
-    { 134, },
-    { 149, },
-    { CNU, },
-};
-
-static const uint8_t INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] =
-{
-    { 183, },
-    { 154, },
-    { 184, },
-};
-
-static const uint8_t INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] =
-{
-    { 152,  139, },
-    { 152,  139, },
-    {  63,  139, },
-};
-
-static const uint8_t INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] =
-{
-    {  95,   79,   63,   31,  31, },
-    {  95,   79,   63,   31,  31, },
-    { CNU,  CNU,  CNU,  CNU, CNU, },
-};
-
-static const uint8_t INIT_MVD[3][NUM_MV_RES_CTX] =
-{
-    { 169,  198, },
-    { 140,  198, },
-    { CNU,  CNU, },
-};
-
-static const uint8_t INIT_REF_PIC[3][NUM_REF_NO_CTX] =
-{
-    { 153,  153 },
-    { 153,  153 },
-    { CNU,  CNU },
-};
-
-static const uint8_t INIT_DQP[3][NUM_DELTA_QP_CTX] =
-{
-    { 154,  154,  154, },
-    { 154,  154,  154, },
-    { 154,  154,  154, },
-};
-
-static const uint8_t INIT_QT_CBF[3][NUM_QT_CBF_CTX] =
-{
-    { 153,  111,  149,   92,  167,  154,  154 },
-    { 153,  111,  149,  107,  167,  154,  154 },
-    { 111,  141,   94,  138,  182,  154,  154 },
-};
-
-static const uint8_t INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] =
-{
-    {  79, },
-    {  79, },
-    { CNU, },
-};
-
-static const uint8_t INIT_LAST[3][NUM_CTX_LAST_FLAG_XY] =
-{
-    { 125,  110,  124,  110,   95,   94,  125,  111,  111,   79,  125,  126,  111,  111,   79,
-      108,  123,   93 },
-    { 125,  110,   94,  110,   95,   79,  125,  111,  110,   78,  110,  111,  111,   95,   94,
-      108,  123,  108 },
-    { 110,  110,  124,  125,  140,  153,  125,  127,  140,  109,  111,  143,  127,  111,   79,
-      108,  123,   63 },
-};
-
-static const uint8_t INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] =
-{
-    { 121,  140,
-      61,  154, },
-    { 121,  140,
-      61,  154, },
-    {  91,  171,
-       134,  141, },
-};
-
-static const uint8_t INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] =
-{
-    { 170,  154,  139,  153,  139,  123,  123,   63,  124,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  170,  153,  138,  138,  122,  121,  122,  121,  167,  151,  183,  140,  151,  183,  140,  },
-    { 155,  154,  139,  153,  139,  123,  123,   63,  153,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  170,  153,  123,  123,  107,  121,  107,  121,  167,  151,  183,  140,  151,  183,  140,  },
-    { 111,  111,  125,  110,  110,   94,  124,  108,  124,  107,  125,  141,  179,  153,  125,  107,  125,  141,  179,  153,  125,  107,  125,  141,  179,  153,  125,  140,  139,  182,  182,  152,  136,  152,  136,  153,  136,  139,  111,  136,  139,  111,  },
-};
-
-static const uint8_t INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] =
-{
-    { 154,  196,  167,  167,  154,  152,  167,  182,  182,  134,  149,  136,  153,  121,  136,  122,  169,  208,  166,  167,  154,  152,  167,  182, },
-    { 154,  196,  196,  167,  154,  152,  167,  182,  182,  134,  149,  136,  153,  121,  136,  137,  169,  194,  166,  167,  154,  167,  137,  182, },
-    { 140,   92,  137,  138,  140,  152,  138,  139,  153,   74,  149,   92,  139,  107,  122,  152,  140,  179,  166,  182,  140,  227,  122,  197, },
-};
-
-static const uint8_t INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] =
-{
-    { 107,  167,   91,  107,  107,  167, },
-    { 107,  167,   91,  122,  107,  167, },
-    { 138,  153,  136,  167,  152,  152, },
-};
-
-static const uint8_t INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] =
-{
-    { 168 },
-    { 168 },
-    { CNU },
-};
-
-static const uint8_t INIT_SAO_MERGE_FLAG[3][NUM_SAO_MERGE_FLAG_CTX] =
-{
-    { 153,  },
-    { 153,  },
-    { 153,  },
-};
-
-static const uint8_t INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] =
-{
-    { 160, },
-    { 185, },
-    { 200, },
-};
-
-static const uint8_t INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] =
-{
-    { 224,  167,  122, },
-    { 124,  138,   94, },
-    { 153,  138,  138, },
-};
-
-static const uint8_t INIT_TRANSFORMSKIP_FLAG[3][2 * NUM_TRANSFORMSKIP_FLAG_CTX] =
-{
-    { 139,  139 },
-    { 139,  139 },
-    { 139,  139 },
-};
 }
 
 #endif // ifndef X265_CONTEXTS_H
diff -r 5dbd6a0c8e17 -r 68099f6e3cd9 source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Mon Mar 28 12:53:40 2016 +0530
+++ b/source/encoder/entropy.cpp	Mon Mar 28 20:47:51 2016 +0900
@@ -38,6 +38,189 @@
 
 namespace X265_NS {
 
+// initial probability for cu_transquant_bypass flag
+static const uint8_t INIT_CU_TRANSQUANT_BYPASS_FLAG[3][NUM_TQUANT_BYPASS_FLAG_CTX] =
+{
+    { 154 },
+    { 154 },
+    { 154 },
+};
+
+// initial probability for split flag
+static const uint8_t INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] =
+{
+    { 107,  139,  126, },
+    { 107,  139,  126, },
+    { 139,  141,  157, },
+};
+
+static const uint8_t INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] =
+{
+    { 197,  185,  201, },
+    { 197,  185,  201, },
+    { CNU,  CNU,  CNU, },
+};
+
+static const uint8_t INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] =
+{
+    { 154, },
+    { 110, },
+    { CNU, },
+};
+
+static const uint8_t INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] =
+{
+    { 137, },
+    { 122, },
+    { CNU, },
+};
+
+static const uint8_t INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] =
+{
+    { 154,  139,  154, 154 },
+    { 154,  139,  154, 154 },
+    { 184,  CNU,  CNU, CNU },
+};
+
+static const uint8_t INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] =
+{
+    { 134, },
+    { 149, },
+    { CNU, },
+};
+
+static const uint8_t INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] =
+{
+    { 183, },
+    { 154, },
+    { 184, },
+};
+
+static const uint8_t INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] =
+{
+    { 152,  139, },
+    { 152,  139, },
+    {  63,  139, },
+};
+
+static const uint8_t INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] =
+{
+    {  95,   79,   63,   31,  31, },
+    {  95,   79,   63,   31,  31, },
+    { CNU,  CNU,  CNU,  CNU, CNU, },
+};
+
+static const uint8_t INIT_MVD[3][NUM_MV_RES_CTX] =
+{
+    { 169,  198, },
+    { 140,  198, },
+    { CNU,  CNU, },
+};
+
+static const uint8_t INIT_REF_PIC[3][NUM_REF_NO_CTX] =
+{
+    { 153,  153 },
+    { 153,  153 },
+    { CNU,  CNU },
+};
+
+static const uint8_t INIT_DQP[3][NUM_DELTA_QP_CTX] =
+{
+    { 154,  154,  154, },
+    { 154,  154,  154, },
+    { 154,  154,  154, },
+};
+
+static const uint8_t INIT_QT_CBF[3][NUM_QT_CBF_CTX] =
+{
+    { 153,  111,  149,   92,  167,  154,  154 },
+    { 153,  111,  149,  107,  167,  154,  154 },
+    { 111,  141,   94,  138,  182,  154,  154 },
+};
+
+static const uint8_t INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] =
+{
+    {  79, },
+    {  79, },
+    { CNU, },
+};
+
+static const uint8_t INIT_LAST[3][NUM_CTX_LAST_FLAG_XY] =
+{
+    { 125,  110,  124,  110,   95,   94,  125,  111,  111,   79,  125,  126,  111,  111,   79,
+      108,  123,   93 },
+    { 125,  110,   94,  110,   95,   79,  125,  111,  110,   78,  110,  111,  111,   95,   94,
+      108,  123,  108 },
+    { 110,  110,  124,  125,  140,  153,  125,  127,  140,  109,  111,  143,  127,  111,   79,
+      108,  123,   63 },
+};
+
+static const uint8_t INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] =
+{
+    { 121,  140,
+      61,  154, },
+    { 121,  140,
+      61,  154, },
+    {  91,  171,
+       134,  141, },
+};
+
+static const uint8_t INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] =
+{
+    { 170,  154,  139,  153,  139,  123,  123,   63,  124,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  170,  153,  138,  138,  122,  121,  122,  121,  167,  151,  183,  140,  151,  183,  140,  },
+    { 155,  154,  139,  153,  139,  123,  123,   63,  153,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  166,  183,  140,  136,  153,  154,  170,  153,  123,  123,  107,  121,  107,  121,  167,  151,  183,  140,  151,  183,  140,  },
+    { 111,  111,  125,  110,  110,   94,  124,  108,  124,  107,  125,  141,  179,  153,  125,  107,  125,  141,  179,  153,  125,  107,  125,  141,  179,  153,  125,  140,  139,  182,  182,  152,  136,  152,  136,  153,  136,  139,  111,  136,  139,  111,  },
+};
+
+static const uint8_t INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] =
+{
+    { 154,  196,  167,  167,  154,  152,  167,  182,  182,  134,  149,  136,  153,  121,  136,  122,  169,  208,  166,  167,  154,  152,  167,  182, },
+    { 154,  196,  196,  167,  154,  152,  167,  182,  182,  134,  149,  136,  153,  121,  136,  137,  169,  194,  166,  167,  154,  167,  137,  182, },
+    { 140,   92,  137,  138,  140,  152,  138,  139,  153,   74,  149,   92,  139,  107,  122,  152,  140,  179,  166,  182,  140,  227,  122,  197, },
+};
+
+static const uint8_t INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] =
+{
+    { 107,  167,   91,  107,  107,  167, },
+    { 107,  167,   91,  122,  107,  167, },
+    { 138,  153,  136,  167,  152,  152, },
+};
+
+static const uint8_t INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] =
+{
+    { 168 },
+    { 168 },
+    { CNU },
+};
+
+static const uint8_t INIT_SAO_MERGE_FLAG[3][NUM_SAO_MERGE_FLAG_CTX] =
+{
+    { 153,  },
+    { 153,  },
+    { 153,  },
+};
+
+static const uint8_t INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] =
+{
+    { 160, },
+    { 185, },
+    { 200, },
+};
+
+static const uint8_t INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] =
+{
+    { 224,  167,  122, },
+    { 124,  138,   94, },
+    { 153,  138,  138, },
+};
+
+static const uint8_t INIT_TRANSFORMSKIP_FLAG[3][2 * NUM_TRANSFORMSKIP_FLAG_CTX] =
+{
+    { 139,  139 },
+    { 139,  139 },
+    { 139,  139 },
+};
+
 Entropy::Entropy()
 {
     markValid();


More information about the x265-devel mailing list