]> granicus.if.org Git - libvpx/commitdiff
Using constants instead of plain numbers.
authorDmitry Kovalev <dkovalev@google.com>
Tue, 15 Oct 2013 03:33:37 +0000 (20:33 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 15 Oct 2013 03:33:37 +0000 (20:33 -0700)
Replacing
  22 with TREE_SIZE(MAX_ENTROPY_TOKENS)
  12 with MAX_ENTROPY_TOKENS

Change-Id: If24919336e8ace9cf64991bd5ae33fa6656f7b93

vp9/common/vp9_entropy.c
vp9/common/vp9_entropy.h

index 8ebe0e5fbee05d84384d33efca43bb0d07724724..aeff21cd98f67c7181bc79eb8f80bf673ff055f2 100644 (file)
@@ -56,7 +56,7 @@ DECLARE_ALIGNED(16, const uint8_t, vp9_pt_energy_class[MAX_ENTROPY_TOKENS]) = {
 
 /* Array indices are identical to previously-existing CONTEXT_NODE indices */
 
-const vp9_tree_index vp9_coef_tree[ 22] = {
+const vp9_tree_index vp9_coef_tree[TREE_SIZE(MAX_ENTROPY_TOKENS)] = {
   -DCT_EOB_TOKEN, 2,                          /* 0 = EOB */
   -ZERO_TOKEN, 4,                             /* 1 = ZERO */
   -ONE_TOKEN, 6,                              /* 2 = ONE */
@@ -274,7 +274,7 @@ static void init_bit_trees() {
   init_bit_tree(cat6, 14);
 }
 
-const vp9_extra_bit vp9_extra_bits[12] = {
+const vp9_extra_bit vp9_extra_bits[MAX_ENTROPY_TOKENS] = {
   { 0, 0, 0, 0},
   { 0, 0, 0, 1},
   { 0, 0, 0, 2},
index 02178b5794547b08eaa05f796b1f48e617b3b43b..518731df61c7fa59a72518317fb3c52da3c70464 100644 (file)
@@ -43,7 +43,7 @@
 extern DECLARE_ALIGNED(16, const uint8_t,
                        vp9_pt_energy_class[MAX_ENTROPY_TOKENS]);
 
-extern const vp9_tree_index vp9_coef_tree[];
+extern const vp9_tree_index vp9_coef_tree[TREE_SIZE(MAX_ENTROPY_TOKENS)];
 
 #define DCT_EOB_MODEL_TOKEN     3      /* EOB       Extra Bits 0+0 */
 extern const vp9_tree_index vp9_coefmodel_tree[];
@@ -57,7 +57,8 @@ typedef struct {
   int base_val;
 } vp9_extra_bit;
 
-extern const vp9_extra_bit vp9_extra_bits[12];    /* indexed by token value */
+// indexed by token value
+extern const vp9_extra_bit vp9_extra_bits[MAX_ENTROPY_TOKENS];
 
 #define MAX_PROB                255
 #define DCT_MAX_VALUE           16384