Remove compound-segment/wedge config flags

Change-Id: I39cfbb135add0553cadf64481b13786831fbdddd
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 6fc5d55..f2ef095 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -76,9 +76,7 @@
 #if CONFIG_INTERINTRA
 static struct av1_token interintra_mode_encodings[INTERINTRA_MODES];
 #endif
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 static struct av1_token compound_type_encodings[COMPOUND_TYPES];
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 #if CONFIG_LOOP_RESTORATION
 static void loop_restoration_write_sb_coeffs(const AV1_COMMON *const cm,
                                              MACROBLOCKD *xd,
@@ -110,9 +108,7 @@
   av1_tokens_from_tree(inter_singleref_comp_mode_encodings,
                        av1_inter_singleref_comp_mode_tree);
 #endif  // CONFIG_COMPOUND_SINGLEREF
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
   av1_tokens_from_tree(compound_type_encodings, av1_compound_type_tree);
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 }
 
 static void write_intra_mode_kf(const AV1_COMMON *cm, FRAME_CONTEXT *frame_ctx,
@@ -1757,34 +1753,26 @@
         mbmi->motion_mode == SIMPLE_TRANSLATION &&
 #endif  // CONFIG_MOTION_VAR
         is_any_masked_compound_used(bsize)) {
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 #if CONFIG_JNT_COMP
       if (cm->allow_masked_compound && mbmi->compound_idx)
 #else
       if (cm->allow_masked_compound)
 #endif  // CONFIG_JNT_COMP
       {
-#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
         if (!is_interinter_compound_used(COMPOUND_WEDGE, bsize))
           aom_write_bit(w, mbmi->interinter_compound_type == COMPOUND_AVERAGE);
         else
-#endif  // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
           aom_write_symbol(w, mbmi->interinter_compound_type,
                            ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES);
-#if CONFIG_WEDGE
         if (is_interinter_compound_used(COMPOUND_WEDGE, bsize) &&
             mbmi->interinter_compound_type == COMPOUND_WEDGE) {
           aom_write_literal(w, mbmi->wedge_index, get_wedge_bits_lookup(bsize));
           aom_write_bit(w, mbmi->wedge_sign);
         }
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
         if (mbmi->interinter_compound_type == COMPOUND_SEG) {
           aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
         }
-#endif  // CONFIG_COMPOUND_SEGMENT
       }
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
     }
 
     write_mb_interp_filter(cpi, xd, w);
@@ -3824,7 +3812,6 @@
     assert(cm->allow_interintra_compound == 0);
   }
 #endif  // CONFIG_INTERINTRA
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
 #if CONFIG_COMPOUND_SINGLEREF
   if (!frame_is_intra_only(cm)) {
 #else   // !CONFIG_COMPOUND_SINGLEREF
@@ -3834,7 +3821,6 @@
   } else {
     assert(cm->allow_masked_compound == 0);
   }
-#endif  // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
 }
 
 static void write_global_motion_params(const WarpedMotionParams *params,
@@ -4615,7 +4601,7 @@
         }
       }
 #endif
-#if CONFIG_WEDGE && !CONFIG_NEW_MULTISYMBOL
+#if !CONFIG_NEW_MULTISYMBOL
 #if CONFIG_EXT_PARTITION_TYPES
       int block_sizes_to_update = BLOCK_SIZES_ALL;
 #else
@@ -4626,7 +4612,7 @@
           av1_cond_prob_diff_update(header_bc, &fc->wedge_interintra_prob[i],
                                     cm->counts.wedge_interintra[i], probwt);
       }
-#endif  // CONFIG_WEDGE && CONFIG_NEW_MULTISYMBOL
+#endif  // !CONFIG_NEW_MULTISYMBOL
     }
 #endif  // CONFIG_INTERINTRA
 
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index b0d43f5..2381c77 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1261,18 +1261,12 @@
             && mbmi->motion_mode == SIMPLE_TRANSLATION
 #endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
             ) {
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
-#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
           if (is_interinter_compound_used(COMPOUND_WEDGE, bsize)) {
-#endif
             counts
                 ->compound_interinter[bsize][mbmi->interinter_compound_type]++;
             update_cdf(fc->compound_type_cdf[bsize],
                        mbmi->interinter_compound_type, COMPOUND_TYPES);
-#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
           }
-#endif
-#endif  // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
         }
       }
     }
@@ -4026,14 +4020,12 @@
   if (frame_is_intra_only(cm) || cm->reference_mode == COMPOUND_REFERENCE)
     cm->allow_interintra_compound = 0;
 #endif  // CONFIG_INTERINTRA
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 #if CONFIG_COMPOUND_SINGLEREF
   if (frame_is_intra_only(cm))
 #else   // !CONFIG_COMPOUND_SINGLEREF
   if (frame_is_intra_only(cm) || cm->reference_mode == SINGLE_REFERENCE)
 #endif  // CONFIG_COMPOUND_SINGLEREF
     cm->allow_masked_compound = 0;
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 }
 
 void av1_encode_frame(AV1_COMP *cpi) {
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 259798d..e0476fb 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -2435,9 +2435,7 @@
 #if CONFIG_INTERINTRA
   cm->allow_interintra_compound = 1;
 #endif  // CONFIG_INTERINTRA
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
   cm->allow_masked_compound = 1;
-#endif  // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
 }
 
 void av1_change_config(struct AV1_COMP *cpi, const AV1EncoderConfig *oxcf) {
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 607745d..8dcaa88 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -367,11 +367,9 @@
     for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
       av1_cost_tokens_from_cdf(x->inter_compound_mode_cost[i],
                                fc->inter_compound_mode_cdf[i], NULL);
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
     for (i = 0; i < BLOCK_SIZES_ALL; ++i)
       av1_cost_tokens_from_cdf(x->compound_type_cost[i],
                                fc->compound_type_cdf[i], NULL);
-#endif  // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
 #if CONFIG_COMPOUND_SINGLEREF
     for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
       av1_cost_tokens_from_cdf(x->inter_singleref_comp_mode_cost[i],
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 174d7cf..e3d8219 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -2500,7 +2500,6 @@
   return 0;
 }
 
-#if (CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT || CONFIG_INTERINTRA)
 static int64_t estimate_yrd_for_sb(const AV1_COMP *const cpi, BLOCK_SIZE bs,
                                    MACROBLOCK *x, int *r, int64_t *d, int *s,
                                    int64_t *sse, int64_t ref_best_rd) {
@@ -2513,7 +2512,6 @@
   *sse = rd_stats.sse;
   return rd;
 }
-#endif  // (CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT)
 
 static void choose_largest_tx_size(const AV1_COMP *const cpi, MACROBLOCK *x,
                                    RD_STATS *rd_stats, int64_t ref_best_rd,
@@ -5667,22 +5665,16 @@
   }
 }
 
-#if (CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT)
 static int get_interinter_compound_type_bits(BLOCK_SIZE bsize,
                                              COMPOUND_TYPE comp_type) {
   (void)bsize;
   switch (comp_type) {
     case COMPOUND_AVERAGE: return 0;
-#if CONFIG_WEDGE
     case COMPOUND_WEDGE: return get_interinter_wedge_bits(bsize);
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
     case COMPOUND_SEG: return 1;
-#endif  // CONFIG_COMPOUND_SEGMENT
     default: assert(0); return 0;
   }
 }
-#endif  // (CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT)
 
 typedef struct {
   int eobs;
@@ -7007,7 +6999,6 @@
                                 ref_idx);
 }
 
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 static void do_masked_motion_search_indexed(
     const AV1_COMP *const cpi, MACROBLOCK *x, const int_mv *const cur_mv,
     const INTERINTER_COMPOUND_DATA *const comp_data, BLOCK_SIZE bsize,
@@ -7056,7 +7047,6 @@
 #endif  // CONFIG_COMPOUND_SINGLEREF
     tmp_mv[1].as_int = frame_mv[rf[1]].as_int;
 }
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 
 // In some situations we want to discount the apparent cost of a new motion
 // vector. Where there is a subtle motion field and especially where there is
@@ -7088,7 +7078,6 @@
            xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN);
 }
 
-#if CONFIG_WEDGE
 static int estimate_wedge_sign(const AV1_COMP *cpi, const MACROBLOCK *x,
                                const BLOCK_SIZE bsize, const uint8_t *pred0,
                                int stride0, const uint8_t *pred1, int stride1) {
@@ -7131,7 +7120,6 @@
        (int64_t)(esq[0][3] + esq[0][1] + esq[0][2]);
   return (tl + br > 0);
 }
-#endif  // CONFIG_WEDGE
 
 #if !CONFIG_DUAL_FILTER
 static InterpFilter predict_interp_filter(
@@ -7218,7 +7206,6 @@
 #endif  // !CONFIG_DUAL_FILTER
 
 // Choose the best wedge index and sign
-#if CONFIG_WEDGE
 static int64_t pick_wedge(const AV1_COMP *const cpi, const MACROBLOCK *const x,
                           const BLOCK_SIZE bsize, const uint8_t *const p0,
                           const uint8_t *const p1, int *const best_wedge_sign,
@@ -7391,9 +7378,7 @@
   mbmi->wedge_index = wedge_index;
   return rd;
 }
-#endif  // CONFIG_WEDGE
 
-#if CONFIG_COMPOUND_SEGMENT
 static int64_t pick_interinter_seg(const AV1_COMP *const cpi,
                                    MACROBLOCK *const x, const BLOCK_SIZE bsize,
                                    const uint8_t *const p0,
@@ -7477,9 +7462,8 @@
 
   return best_rd;
 }
-#endif  // CONFIG_COMPOUND_SEGMENT
 
-#if CONFIG_WEDGE && CONFIG_INTERINTRA
+#if CONFIG_INTERINTRA
 static int64_t pick_interintra_wedge(const AV1_COMP *const cpi,
                                      const MACROBLOCK *const x,
                                      const BLOCK_SIZE bsize,
@@ -7500,9 +7484,8 @@
   mbmi->interintra_wedge_index = wedge_index;
   return rd;
 }
-#endif  // CONFIG_WEDGE && CONFIG_INTERINTRA
+#endif  // CONFIG_INTERINTRA
 
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 static int64_t pick_interinter_mask(const AV1_COMP *const cpi, MACROBLOCK *x,
                                     const BLOCK_SIZE bsize,
                                     const uint8_t *const p0,
@@ -7510,12 +7493,8 @@
   const COMPOUND_TYPE compound_type =
       x->e_mbd.mi[0]->mbmi.interinter_compound_type;
   switch (compound_type) {
-#if CONFIG_WEDGE
     case COMPOUND_WEDGE: return pick_interinter_wedge(cpi, x, bsize, p0, p1);
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
     case COMPOUND_SEG: return pick_interinter_seg(cpi, x, bsize, p0, p1);
-#endif  // CONFIG_COMPOUND_SEGMENT
     default: assert(0); return 0;
   }
 }
@@ -7528,14 +7507,7 @@
   int_mv tmp_mv[2];
   int tmp_rate_mv = 0;
   const INTERINTER_COMPOUND_DATA compound_data = {
-#if CONFIG_WEDGE
-    mbmi->wedge_index,
-    mbmi->wedge_sign,
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
-    mbmi->mask_type,
-    xd->seg_mask,
-#endif  // CONFIG_COMPOUND_SEGMENT
+    mbmi->wedge_index, mbmi->wedge_sign, mbmi->mask_type, xd->seg_mask,
     mbmi->interinter_compound_type
   };
 #if CONFIG_COMPOUND_SINGLEREF
@@ -7623,7 +7595,6 @@
   }
   return best_rd_cur;
 }
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
 
 typedef struct {
 #if CONFIG_MOTION_VAR
@@ -8318,9 +8289,7 @@
   int_mv cur_mv[2];
   int rate_mv = 0;
   int pred_exists = 1;
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT || CONFIG_INTERINTRA
   const int bw = block_size_wide[bsize];
-#endif  // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
   int_mv single_newmv[TOTAL_REFS_PER_FRAME];
 #if CONFIG_INTERINTRA
   const int *const interintra_mode_cost =
@@ -8357,10 +8326,8 @@
   int compmode_interintra_cost = 0;
   mbmi->use_wedge_interintra = 0;
 #endif
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
   int compmode_interinter_cost = 0;
   mbmi->interinter_compound_type = COMPOUND_AVERAGE;
-#endif
 #if CONFIG_LGT_FROM_PRED
   mbmi->use_lgt = 0;
 #endif
@@ -8590,7 +8557,6 @@
   rate_mv_bmc = rate_mv;
 #endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
 #if CONFIG_COMPOUND_SINGLEREF
   if (is_comp_pred || is_singleref_comp_mode)
 #else
@@ -8616,19 +8582,15 @@
     int strides[1] = { bw };
     int tmp_rate_mv;
     int masked_compound_used = is_any_masked_compound_used(bsize);
-#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
     masked_compound_used = masked_compound_used && cm->allow_masked_compound;
-#endif  // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
     COMPOUND_TYPE cur_type;
     int best_compmode_interinter_cost = 0;
 
     best_mv[0].as_int = cur_mv[0].as_int;
     best_mv[1].as_int = cur_mv[1].as_int;
     memset(&best_compound_data, 0, sizeof(best_compound_data));
-#if CONFIG_COMPOUND_SEGMENT
     uint8_t tmp_mask_buf[2 * MAX_SB_SQUARE];
     best_compound_data.seg_mask = tmp_mask_buf;
-#endif  // CONFIG_COMPOUND_SEGMENT
 
 #if CONFIG_COMPOUND_SINGLEREF
     // TODO(zoeliu): To further check whether the following setups are needed.
@@ -8657,11 +8619,9 @@
       mbmi->interinter_compound_type = cur_type;
       int masked_type_cost = 0;
       if (masked_compound_used) {
-#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
         if (!is_interinter_compound_used(COMPOUND_WEDGE, bsize))
           masked_type_cost += av1_cost_literal(1);
         else
-#endif  // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
           masked_type_cost +=
               x->compound_type_cost[bsize][mbmi->interinter_compound_type];
       }
@@ -8681,7 +8641,6 @@
             best_rd_cur = RDCOST(x->rdmult, rs2 + rate_mv + rate_sum, dist_sum);
           best_rd_compound = best_rd_cur;
           break;
-#if CONFIG_WEDGE
         case COMPOUND_WEDGE:
           if (x->source_variance > cpi->sf.disable_wedge_search_var_thresh &&
               best_rd_compound / 3 < ref_best_rd) {
@@ -8690,8 +8649,6 @@
                 &tmp_rate_mv, preds0, preds1, strides, mi_row, mi_col);
           }
           break;
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
         case COMPOUND_SEG:
           if (x->source_variance > cpi->sf.disable_wedge_search_var_thresh &&
               best_rd_compound / 3 < ref_best_rd) {
@@ -8700,21 +8657,16 @@
                 &tmp_rate_mv, preds0, preds1, strides, mi_row, mi_col);
           }
           break;
-#endif  // CONFIG_COMPOUND_SEGMENT
         default: assert(0); return 0;
       }
 
       if (best_rd_cur < best_rd_compound) {
         best_rd_compound = best_rd_cur;
-#if CONFIG_WEDGE
         best_compound_data.wedge_index = mbmi->wedge_index;
         best_compound_data.wedge_sign = mbmi->wedge_sign;
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
         best_compound_data.mask_type = mbmi->mask_type;
         memcpy(best_compound_data.seg_mask, xd->seg_mask,
                2 * MAX_SB_SQUARE * sizeof(uint8_t));
-#endif  // CONFIG_COMPOUND_SEGMENT
         best_compound_data.interinter_compound_type =
             mbmi->interinter_compound_type;
         best_compmode_interinter_cost = rs2;
@@ -8733,15 +8685,11 @@
       mbmi->mv[0].as_int = cur_mv[0].as_int;
       mbmi->mv[1].as_int = cur_mv[1].as_int;
     }
-#if CONFIG_WEDGE
     mbmi->wedge_index = best_compound_data.wedge_index;
     mbmi->wedge_sign = best_compound_data.wedge_sign;
-#endif  // CONFIG_WEDGE
-#if CONFIG_COMPOUND_SEGMENT
     mbmi->mask_type = best_compound_data.mask_type;
     memcpy(xd->seg_mask, best_compound_data.seg_mask,
            2 * MAX_SB_SQUARE * sizeof(uint8_t));
-#endif  // CONFIG_COMPOUND_SEGMENT
     mbmi->interinter_compound_type =
         best_compound_data.interinter_compound_type;
     if (have_newmv_in_inter_mode(this_mode)) {
@@ -8764,7 +8712,6 @@
 
     compmode_interinter_cost = best_compmode_interinter_cost;
   }
-#endif  // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
 
 #if CONFIG_INTERINTRA
   if (is_comp_interintra_pred) {
@@ -8826,7 +8773,6 @@
       // Don't need to call restore_dst_buf here
       return INT64_MAX;
     }
-#if CONFIG_WEDGE
     if (is_interintra_wedge_used(bsize)) {
       int64_t best_interintra_rd_nowedge = INT64_MAX;
       int64_t best_interintra_rd_wedge = INT64_MAX;
@@ -8895,7 +8841,6 @@
         mbmi->use_wedge_interintra = 0;
       }
     }
-#endif  // CONFIG_WEDGE
 
     pred_exists = 0;
     compmode_interintra_cost = x->interintra_cost[size_group_lookup[bsize]][1] +
@@ -8956,9 +8901,7 @@
   rate2_bmc_nocoeff += compmode_interintra_cost;
 #endif
 #endif
-#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
   rd_stats->rate += compmode_interinter_cost;
-#endif
 
   ret_val = motion_mode_rd(
       cpi, x, bsize, rd_stats, rd_stats_y, rd_stats_uv, disable_skip, mode_mv,