Remove WEDGE_IDX_ENTROPY_CODING macro

Change-Id: If823aa6b570b71856dcda4c5b9d1cadf60774b94
diff --git a/av1/common/entropy.c b/av1/common/entropy.c
index da9ddf2..b3e856e 100644
--- a/av1/common/entropy.c
+++ b/av1/common/entropy.c
@@ -92,9 +92,7 @@
   RESET_CDF_COUNTER(drl_cdf);
   RESET_CDF_COUNTER(inter_compound_mode_cdf);
   RESET_CDF_COUNTER(compound_type_cdf);
-#if WEDGE_IDX_ENTROPY_CODING
   RESET_CDF_COUNTER(wedge_idx_cdf);
-#endif
   RESET_CDF_COUNTER(interintra_cdf);
   RESET_CDF_COUNTER(wedge_interintra_cdf);
   RESET_CDF_COUNTER(interintra_mode_cdf);
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index 902bb3c..8d6e184 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -64,7 +64,6 @@
       { AOM_CDF2(16384) }
     };
 
-#if WEDGE_IDX_ENTROPY_CODING
 static const aom_cdf_prob default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)] =
     { { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432,
                   20480, 22528, 24576, 26624, 28672, 30720) },
@@ -110,7 +109,6 @@
                   20480, 22528, 24576, 26624, 28672, 30720) },
       { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432,
                   20480, 22528, 24576, 26624, 28672, 30720) } };
-#endif
 
 static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
     2)] = { { AOM_CDF2(128 * 128) },
@@ -1095,9 +1093,7 @@
   av1_copy(fc->obmc_cdf, default_obmc_cdf);
   av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf);
   av1_copy(fc->compound_type_cdf, default_compound_type_cdf);
-#if WEDGE_IDX_ENTROPY_CODING
   av1_copy(fc->wedge_idx_cdf, default_wedge_idx_cdf);
-#endif
   av1_copy(fc->interintra_cdf, default_interintra_cdf);
   av1_copy(fc->wedge_interintra_cdf, default_wedge_interintra_cdf);
   av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf);
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 53430c4..110531c 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -94,9 +94,7 @@
   aom_cdf_prob inter_compound_mode_cdf[INTER_MODE_CONTEXTS]
                                       [CDF_SIZE(INTER_COMPOUND_MODES)];
   aom_cdf_prob compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES - 1)];
-#if WEDGE_IDX_ENTROPY_CODING
   aom_cdf_prob wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)];
-#endif
   aom_cdf_prob interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(2)];
   aom_cdf_prob wedge_interintra_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)];
   aom_cdf_prob interintra_mode_cdf[BLOCK_SIZE_GROUPS]
@@ -222,9 +220,7 @@
   unsigned int drl_mode[DRL_MODE_CONTEXTS][2];
 
   unsigned int inter_compound_mode[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES];
-#if WEDGE_IDX_ENTROPY_CODING
   unsigned int wedge_idx[BLOCK_SIZES_ALL][16];
-#endif
   unsigned int interintra[BLOCK_SIZE_GROUPS][2];
   unsigned int interintra_mode[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
   unsigned int wedge_interintra[BLOCK_SIZES_ALL][2];
diff --git a/av1/common/enums.h b/av1/common/enums.h
index cf50289..9d9c5b9 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -67,13 +67,6 @@
 #define FRAME_LF_COUNT 4
 #define DEFAULT_DELTA_LF_MULTI 0
 
-#define WEDGE_IDX_ENTROPY_CODING 1
-#if WEDGE_IDX_ENTROPY_CODING
-#define II_WEDGE_IDX_ENTROPY_CODING 1
-#else
-#define II_WEDGE_IDX_ENTROPY_CODING 0
-#endif
-
 #define MAX_MODE_LF_DELTAS 2
 
 typedef enum COMPOUND_DIST_WEIGHT_MODE {
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index fa311ea..77a2a8c 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1496,13 +1496,8 @@
         mbmi->use_wedge_interintra = aom_read_symbol(
             r, ec_ctx->wedge_interintra_cdf[bsize], 2, ACCT_STR);
         if (mbmi->use_wedge_interintra) {
-#if II_WEDGE_IDX_ENTROPY_CODING
           mbmi->interintra_wedge_index =
               aom_read_symbol(r, ec_ctx->wedge_idx_cdf[bsize], 16, ACCT_STR);
-#else
-          mbmi->interintra_wedge_index =
-              aom_read_literal(r, get_wedge_bits_lookup(bsize), ACCT_STR);
-#endif
           mbmi->interintra_wedge_sign = 0;
         }
       }
@@ -1565,13 +1560,8 @@
 
       if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
         assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
-#if WEDGE_IDX_ENTROPY_CODING
         mbmi->wedge_index =
             aom_read_symbol(r, ec_ctx->wedge_idx_cdf[bsize], 16, ACCT_STR);
-#else
-        mbmi->wedge_index =
-            aom_read_literal(r, get_wedge_bits_lookup(bsize), ACCT_STR);
-#endif
         mbmi->wedge_sign = aom_read_bit(r, ACCT_STR);
       } else {
         assert(mbmi->interinter_compound_type == COMPOUND_SEG);
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 1b07e9a..0429f5a 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1116,13 +1116,8 @@
           aom_write_symbol(w, mbmi->use_wedge_interintra,
                            ec_ctx->wedge_interintra_cdf[bsize], 2);
           if (mbmi->use_wedge_interintra) {
-#if II_WEDGE_IDX_ENTROPY_CODING
             aom_write_symbol(w, mbmi->interintra_wedge_index,
                              ec_ctx->wedge_idx_cdf[bsize], 16);
-#else
-            aom_write_literal(w, mbmi->interintra_wedge_index,
-                              get_wedge_bits_lookup(bsize));
-#endif
             assert(mbmi->interintra_wedge_sign == 0);
           }
         }
@@ -1173,12 +1168,8 @@
 
         if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
           assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
-#if WEDGE_IDX_ENTROPY_CODING
           aom_write_symbol(w, mbmi->wedge_index, ec_ctx->wedge_idx_cdf[bsize],
                            16);
-#else
-          aom_write_literal(w, mbmi->wedge_index, get_wedge_bits_lookup(bsize));
-#endif
           aom_write_bit(w, mbmi->wedge_sign);
         } else {
           assert(mbmi->interinter_compound_type == COMPOUND_SEG);
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index 2c59e56..096f024 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -266,9 +266,7 @@
   int comp_bwdref_cost[REF_CONTEXTS][BWD_REFS - 1][2];
   int inter_compound_mode_cost[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES];
   int compound_type_cost[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1];
-#if WEDGE_IDX_ENTROPY_CODING
   int wedge_idx_cost[BLOCK_SIZES_ALL][16];
-#endif
   int interintra_cost[BLOCK_SIZE_GROUPS][2];
   int wedge_interintra_cost[BLOCK_SIZES_ALL][2];
   int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 0739f59..5ebeb05 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1177,7 +1177,6 @@
                 update_cdf(fc->wedge_interintra_cdf[bsize],
                            mbmi->use_wedge_interintra, 2);
               }
-#if II_WEDGE_IDX_ENTROPY_CODING
               if (mbmi->use_wedge_interintra) {
                 counts->wedge_idx[bsize][mbmi->interintra_wedge_index]++;
                 if (allow_update_cdf) {
@@ -1185,7 +1184,6 @@
                              mbmi->interintra_wedge_index, 16);
                 }
               }
-#endif
             }
           } else {
             counts->interintra[bsize_group][0]++;
@@ -1253,7 +1251,6 @@
             }
           }
         }
-#if WEDGE_IDX_ENTROPY_CODING
         if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
           if (is_interinter_compound_used(COMPOUND_WEDGE, bsize)) {
             counts->wedge_idx[bsize][mbmi->wedge_index]++;
@@ -1262,7 +1259,6 @@
             }
           }
         }
-#endif
       }
     }
 
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index a3e6654..28b25c3 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -280,14 +280,12 @@
     for (i = 0; i < BLOCK_SIZES_ALL; ++i)
       av1_cost_tokens_from_cdf(x->compound_type_cost[i],
                                fc->compound_type_cdf[i], NULL);
-#if WEDGE_IDX_ENTROPY_CODING
     for (i = 0; i < BLOCK_SIZES_ALL; ++i) {
       if (get_interinter_wedge_bits(i)) {
         av1_cost_tokens_from_cdf(x->wedge_idx_cost[i], fc->wedge_idx_cdf[i],
                                  NULL);
       }
     }
-#endif
     for (i = 0; i < BLOCK_SIZE_GROUPS; ++i) {
       av1_cost_tokens_from_cdf(x->interintra_cost[i], fc->interintra_cdf[i],
                                NULL);
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index b20a51d..ec03137 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -5062,7 +5062,6 @@
   }
 }
 
-#if WEDGE_IDX_ENTROPY_CODING
 static int get_interinter_compound_mask_rate(const MACROBLOCK *const x,
                                              const MB_MODE_INFO *const mbmi) {
   switch (mbmi->interinter_compound_type) {
@@ -5076,18 +5075,6 @@
     default: assert(0); return 0;
   }
 }
-#else
-static int get_interinter_compound_type_bits(BLOCK_SIZE bsize,
-                                             COMPOUND_TYPE comp_type) {
-  (void)bsize;
-  switch (comp_type) {
-    case COMPOUND_AVERAGE: return 0;
-    case COMPOUND_WEDGE: return get_interinter_wedge_bits(bsize);
-    case COMPOUND_SEG: return 1;
-    default: assert(0); return 0;
-  }
-}
-#endif
 
 typedef struct {
   int eobs;
@@ -6221,9 +6208,7 @@
     sse = ROUND_POWER_OF_TWO(sse, bd_round);
 
     model_rd_from_sse(cpi, xd, bsize, 0, sse, &rate, &dist);
-#if WEDGE_IDX_ENTROPY_CODING
     rate += x->wedge_idx_cost[bsize][wedge_index];
-#endif
     rd = RDCOST(x->rdmult, rate, dist);
 
     if (rd < best_rd) {
@@ -6233,12 +6218,8 @@
     }
   }
 
-#if WEDGE_IDX_ENTROPY_CODING
   return best_rd -
          RDCOST(x->rdmult, x->wedge_idx_cost[bsize][*best_wedge_index], 0);
-#else
-  return best_rd;
-#endif
 }
 
 // Choose the best wedge index the specified sign
@@ -6283,12 +6264,7 @@
     sse = ROUND_POWER_OF_TWO(sse, bd_round);
 
     model_rd_from_sse(cpi, xd, bsize, 0, sse, &rate, &dist);
-#if WEDGE_IDX_ENTROPY_CODING
-#if !II_WEDGE_IDX_ENTROPY_CODING
-    if (!is_interintra_mode(mbmi))
-#endif
-      rate += x->wedge_idx_cost[bsize][wedge_index];
-#endif
+    rate += x->wedge_idx_cost[bsize][wedge_index];
     rd = RDCOST(x->rdmult, rate, dist);
 
     if (rd < best_rd) {
@@ -6297,15 +6273,8 @@
     }
   }
 
-#if WEDGE_IDX_ENTROPY_CODING
-#if !II_WEDGE_IDX_ENTROPY_CODING
-  if (!is_interintra_mode(mbmi))
-#endif
-    return best_rd -
-           RDCOST(x->rdmult, x->wedge_idx_cost[bsize][*best_wedge_index], 0);
-#else
-  return best_rd;
-#endif
+  return best_rd -
+         RDCOST(x->rdmult, x->wedge_idx_cost[bsize][*best_wedge_index], 0);
 }
 
 static int64_t pick_interinter_wedge(const AV1_COMP *const cpi,
@@ -6489,12 +6458,7 @@
   const COMPOUND_TYPE compound_type = mbmi->interinter_compound_type;
 
   best_rd_cur = pick_interinter_mask(cpi, x, bsize, *preds0, *preds1);
-#if WEDGE_IDX_ENTROPY_CODING
   *rs2 += get_interinter_compound_mask_rate(x, mbmi);
-#else
-  *rs2 +=
-      av1_cost_literal(get_interinter_compound_type_bits(bsize, compound_type));
-#endif
   best_rd_cur += RDCOST(x->rdmult, *rs2 + rate_mv, 0);
 
   if (have_newmv_in_inter_mode(this_mode) &&
diff --git a/tools/aom_entropy_optimizer.c b/tools/aom_entropy_optimizer.c
index 1d88dff..933ccc7 100644
--- a/tools/aom_entropy_optimizer.c
+++ b/tools/aom_entropy_optimizer.c
@@ -300,13 +300,11 @@
                      "static const aom_cdf_prob default_compound_type_cdf"
                      "[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES - 1)]");
 
-#if WEDGE_IDX_ENTROPY_CODING
   cts_each_dim[0] = BLOCK_SIZES_ALL;
   cts_each_dim[1] = 16;
   optimize_cdf_table(&fc.wedge_idx[0][0], probsfile, 2, cts_each_dim,
                      "static const aom_cdf_prob "
                      "default_wedge_idx_cdf[BLOCK_SIZES_ALL][CDF_SIZE(16)]");
-#endif
 
   /* motion_var and warped_motion experiments */
   cts_each_dim[0] = BLOCK_SIZES_ALL;