Remove compound-segment/wedge config flags
Change-Id: I39cfbb135add0553cadf64481b13786831fbdddd
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,