Remove CONFIG_AMVR
This tool is fully adopted.
Change-Id: Ia98710ba1e1cb0a06f937316521d8139a7b1f5f6
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 47250f3..d025682 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2697,7 +2697,6 @@
aom_wb_write_bit(wb, seq_params->force_screen_content_tools);
}
-#if CONFIG_AMVR
if (seq_params->force_screen_content_tools > 0) {
if (seq_params->force_integer_mv == 2) {
aom_wb_write_bit(wb, 1);
@@ -2708,7 +2707,6 @@
} else {
assert(seq_params->force_integer_mv == 2);
}
-#endif
#if CONFIG_EXPLICIT_ORDER_HINT
if (seq_params->enable_order_hint)
@@ -2878,7 +2876,6 @@
cm->seq_params.force_screen_content_tools);
}
-#if CONFIG_AMVR
if (cm->allow_screen_content_tools) {
if (cm->seq_params.force_integer_mv == 2) {
aom_wb_write_bit(wb, cm->cur_frame_force_integer_mv);
@@ -2888,7 +2885,6 @@
} else {
assert(cm->cur_frame_force_integer_mv == 0);
}
-#endif // CONFIG_AMVR
cm->invalid_delta_frame_id_minus1 = 0;
if (cm->seq_params.frame_id_numbers_present_flag) {
@@ -3056,15 +3052,11 @@
write_frame_size(cm, frame_size_override_flag, wb);
}
-#if CONFIG_AMVR
if (cm->cur_frame_force_integer_mv) {
cm->allow_high_precision_mv = 0;
} else {
aom_wb_write_bit(wb, cm->allow_high_precision_mv);
}
-#else
- aom_wb_write_bit(wb, cm->allow_high_precision_mv);
-#endif
fix_interp_filter(cm, cpi->td.counts);
write_frame_interp_filter(cm->interp_filter, wb);
aom_wb_write_bit(wb, cm->switchable_motion_mode);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 0ca0bc5..75fd03e 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -3458,9 +3458,7 @@
: 0;
seg_skip = segfeature_active(seg, segment_id, SEG_LVL_SKIP);
}
-#if CONFIG_AMVR
xd->cur_frame_force_integer_mv = cm->cur_frame_force_integer_mv;
-#endif
if (cm->delta_q_present_flag) {
// Test mode for delta quantization
diff --git a/av1/encoder/encodemv.c b/av1/encoder/encodemv.c
index a468a44..f62e677 100644
--- a/av1/encoder/encodemv.c
+++ b/av1/encoder/encodemv.c
@@ -123,11 +123,9 @@
nmv_context *mvctx, int usehp) {
const MV diff = { mv->row - ref->row, mv->col - ref->col };
const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
-#if CONFIG_AMVR
if (cpi->common.cur_frame_force_integer_mv) {
usehp = MV_SUBPEL_NONE;
}
-#endif
aom_write_symbol(w, j, mvctx->joints_cdf, MV_JOINTS);
if (mv_joint_vertical(j))
encode_mv_component(w, diff.row, &mvctx->comps[0], usehp);
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 2708322..98cc6d3 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -236,22 +236,13 @@
}
}
-static void set_high_precision_mv(AV1_COMP *cpi, int allow_high_precision_mv
-#if CONFIG_AMVR
- ,
- int cur_frame_force_integer_mv
-#endif
-) {
+static void set_high_precision_mv(AV1_COMP *cpi, int allow_high_precision_mv,
+ int cur_frame_force_integer_mv) {
MACROBLOCK *const mb = &cpi->td.mb;
-#if CONFIG_AMVR
cpi->common.allow_high_precision_mv =
allow_high_precision_mv && cur_frame_force_integer_mv == 0;
const int copy_hp =
cpi->common.allow_high_precision_mv && cur_frame_force_integer_mv == 0;
-#else
- cpi->common.allow_high_precision_mv = allow_high_precision_mv;
- const int copy_hp = cpi->common.allow_high_precision_mv;
-#endif
int *(*src)[2] = copy_hp ? &mb->nmvcost_hp : &mb->nmvcost;
mb->mv_cost_stack = *src;
}
@@ -900,18 +891,14 @@
cpi->ext_fb_idx = LAST_REF_FRAMES + 4;
for (fb_idx = 0; fb_idx < MAX_EXT_ARFS + 1; ++fb_idx)
cpi->arf_map[fb_idx] = LAST_REF_FRAMES + 2 + fb_idx;
-#if CONFIG_AMVR
cpi->rate_index = 0;
cpi->rate_size = 0;
cpi->cur_poc = -1;
-#endif
}
void init_seq_coding_tools(SequenceHeader *seq, const AV1EncoderConfig *oxcf) {
seq->force_screen_content_tools = 2;
-#if CONFIG_AMVR
seq->force_integer_mv = 2;
-#endif
#if CONFIG_EXPLICIT_ORDER_HINT
seq->order_hint_bits_minus1 = DEFAULT_EXPLICIT_ORDER_HINT_BITS - 1;
#endif // CONFIG_EXPLICIT_ORDER_HINT
@@ -2301,11 +2288,7 @@
aom_memalign(16, sizeof(*x->palette_buffer)));
}
av1_reset_segment_features(cm);
-#if CONFIG_AMVR
set_high_precision_mv(cpi, 1, 0);
-#else
- set_high_precision_mv(cpi, 1);
-#endif
set_rc_buffer_sizes(rc, &cpi->oxcf);
@@ -3634,12 +3617,8 @@
top_index);
if (!frame_is_intra_only(cm)) {
-#if CONFIG_AMVR
set_high_precision_mv(cpi, (*q) < HIGH_PRECISION_MV_QTHRESH,
cpi->common.cur_frame_force_integer_mv);
-#else
- set_high_precision_mv(cpi, (*q) < HIGH_PRECISION_MV_QTHRESH);
-#endif
}
// Configure experimental use of segmentation for enhanced coding of
@@ -5383,7 +5362,6 @@
}
#endif // CONFIG_INTERNAL_STATS
-#if CONFIG_AMVR
static int is_integer_mv(AV1_COMP *cpi, const YV12_BUFFER_CONFIG *cur_picture,
const YV12_BUFFER_CONFIG *last_picture,
hash_table *last_hash_table) {
@@ -5516,7 +5494,6 @@
return 0;
}
-#endif
int av1_get_compressed_data(AV1_COMP *cpi, unsigned int *frame_flags,
size_t *size, uint8_t *dest, int64_t *time_stamp,
@@ -5544,11 +5521,7 @@
cm->showable_frame = 0;
aom_usec_timer_start(&cmptimer);
-#if CONFIG_AMVR
set_high_precision_mv(cpi, ALTREF_HIGH_PRECISION_MV, 0);
-#else
- set_high_precision_mv(cpi, ALTREF_HIGH_PRECISION_MV);
-#endif
// Is multi-arf enabled.
// Note that at the moment multi_arf is only configured for 2 pass VBR
@@ -5826,7 +5799,6 @@
}
}
-#if CONFIG_AMVR
cpi->cur_poc++;
if (oxcf->pass != 1 && cpi->common.allow_screen_content_tools &&
!frame_is_intra_only(cm)) {
@@ -5845,7 +5817,6 @@
} else {
cpi->common.cur_frame_force_integer_mv = 0;
}
-#endif
if (oxcf->pass == 1) {
cpi->td.mb.e_mbd.lossless[0] = is_lossless_requested(oxcf);
@@ -5859,7 +5830,6 @@
return AOM_CODEC_ERROR;
}
if (oxcf->pass != 1 && cpi->common.allow_screen_content_tools) {
-#if CONFIG_AMVR
cpi->previous_hash_table = &cm->cur_frame->hash_table;
{
int l;
@@ -5875,7 +5845,6 @@
"Failed to find last frame original buffer");
}
}
-#endif
}
if (!cm->large_scale_tile) {
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 0c018d0..df7c434 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -378,7 +378,6 @@
// For a still frame, this flag is set to 1 to skip partition search.
int partition_search_skippable_frame;
-#if CONFIG_AMVR
double csm_rate_array[32];
double m_rate_array[32];
int rate_size;
@@ -386,7 +385,6 @@
hash_table *previous_hash_table;
int previous_index;
int cur_poc; // DebugInfo
-#endif
int scaled_ref_idx[REF_FRAMES];
int lst_fb_idxes[LAST_REF_FRAMES];
diff --git a/av1/encoder/mbgraph.c b/av1/encoder/mbgraph.c
index ec335e0..c3edd91 100644
--- a/av1/encoder/mbgraph.c
+++ b/av1/encoder/mbgraph.c
@@ -47,16 +47,12 @@
av1_hex_search(x, &ref_full, step_param, x->errorperbit, 0,
cond_cost_list(cpi, cost_list), &v_fn_ptr, 0, ref_mv);
-// Try sub-pixel MC
-// if (bestsme > error_thresh && bestsme < INT_MAX)
-#if CONFIG_AMVR
+ // Try sub-pixel MC
+ // if (bestsme > error_thresh && bestsme < INT_MAX)
if (cpi->common.cur_frame_force_integer_mv == 1) {
x->best_mv.as_mv.row *= 8;
x->best_mv.as_mv.col *= 8;
} else {
-#else
- {
-#endif
int distortion;
unsigned int sse;
cpi->find_fractional_mv_step(x, ref_mv, cpi->common.allow_high_precision_mv,
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index e8881cb..69b28ec 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -3145,13 +3145,9 @@
bestmv->row = maxr;
bestmv->col = maxc;
besterr = 0;
-// In the sub-pel motion search, if hp is not used, then the last bit of mv
-// has to be 0.
-#if CONFIG_AMVR
+ // In the sub-pel motion search, if hp is not used, then the last bit of mv
+ // has to be 0.
lower_mv_precision(bestmv, allow_hp, 0);
-#else
- lower_mv_precision(bestmv, allow_hp);
-#endif
return besterr;
}
// Return the minimum MV.
@@ -3173,12 +3169,8 @@
bestmv->row = minr;
bestmv->col = minc;
besterr = 0;
-// In the sub-pel motion search, if hp is not used, then the last bit of mv
-// has to be 0.
-#if CONFIG_AMVR
+ // In the sub-pel motion search, if hp is not used, then the last bit of mv
+ // has to be 0.
lower_mv_precision(bestmv, allow_hp, 0);
-#else
- lower_mv_precision(bestmv, allow_hp);
-#endif
return besterr;
}
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 480307e..29287af 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -529,7 +529,6 @@
set_block_thresholds(cm, rd);
-#if CONFIG_AMVR
if (cm->cur_frame_force_integer_mv) {
av1_build_nmv_cost_table(x->nmv_vec_cost, x->nmvcost, &cm->fc->nmvc,
MV_SUBPEL_NONE);
@@ -539,11 +538,6 @@
cm->allow_high_precision_mv ? x->nmvcost_hp : x->nmvcost, &cm->fc->nmvc,
cm->allow_high_precision_mv);
}
-#else
- av1_build_nmv_cost_table(
- x->nmv_vec_cost, cm->allow_high_precision_mv ? x->nmvcost_hp : x->nmvcost,
- &cm->fc->nmvc, cm->allow_high_precision_mv);
-#endif
x->mvcost = x->mv_cost_stack;
x->nmvjointcost = x->nmv_vec_cost;
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 0286c90..4da8bba 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -5170,12 +5170,8 @@
zeromv[cur_frm].as_int =
gm_get_motion_vector(&cpi->common.global_motion[ref_frames[cur_frm]],
cpi->common.allow_high_precision_mv, bsize,
- mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cpi->common.cur_frame_force_integer_mv
-#endif
- )
+ mi_col, mi_row,
+ cpi->common.cur_frame_force_integer_mv)
.as_int;
}
}
@@ -5379,16 +5375,11 @@
x->mv_limits = tmp_mv_limits;
-#if CONFIG_AMVR
if (cpi->common.cur_frame_force_integer_mv) {
x->best_mv.as_mv.row *= 8;
x->best_mv.as_mv.col *= 8;
}
- if (bestsme < INT_MAX && cpi->common.cur_frame_force_integer_mv == 0)
-#else
- if (bestsme < INT_MAX)
-#endif
- {
+ if (bestsme < INT_MAX && cpi->common.cur_frame_force_integer_mv == 0) {
int dis; /* TODO: use dis in distortion calculation later. */
unsigned int sse;
bestsme = cpi->find_fractional_mv_step(
@@ -5609,16 +5600,10 @@
mbmi_ext->ref_mv_stack, mbmi_ext->ref_mvs, mi_row, mi_col,
mbmi_ext->mode_context);
-// Candidate refinement carried out at encoder and decoder
-#if CONFIG_AMVR
+ // Candidate refinement carried out at encoder and decoder
av1_find_best_ref_mvs(cm->allow_high_precision_mv, candidates,
&frame_nearest_mv[ref_frame], &frame_near_mv[ref_frame],
cm->cur_frame_force_integer_mv);
-#else
- av1_find_best_ref_mvs(cm->allow_high_precision_mv, candidates,
- &frame_nearest_mv[ref_frame],
- &frame_near_mv[ref_frame]);
-#endif
// Further refinement that is encode side only to test the top few candidates
// in full and choose the best as the centre point for subsequent searches.
// The current implementation doesn't support scaling.
@@ -5749,16 +5734,12 @@
x->mv_limits = tmp_mv_limits;
-#if CONFIG_AMVR
if (cpi->common.cur_frame_force_integer_mv) {
x->best_mv.as_mv.row *= 8;
x->best_mv.as_mv.col *= 8;
}
const int use_fractional_mv =
bestsme < INT_MAX && cpi->common.cur_frame_force_integer_mv == 0;
-#else
- const int use_fractional_mv = bestsme < INT_MAX;
-#endif
if (use_fractional_mv) {
int dis; /* TODO: use dis in distortion calculation later. */
switch (mbmi->motion_mode) {
@@ -6004,16 +5985,12 @@
x->mv_limits = tmp_mv_limits;
-#if CONFIG_AMVR
if (cpi->common.cur_frame_force_integer_mv) {
x->best_mv.as_mv.row *= 8;
x->best_mv.as_mv.col *= 8;
}
const int use_fractional_mv =
bestsme < INT_MAX && cpi->common.cur_frame_force_integer_mv == 0;
-#else
- const int use_fractional_mv = bestsme < INT_MAX;
-#endif
if (use_fractional_mv) {
int dis; /* TODO: use dis in distortion calculation later. */
unsigned int sse;
@@ -7454,12 +7431,8 @@
if (this_mode == NEAREST_NEWMV) {
cur_mv[0] = mbmi_ext->ref_mv_stack[ref_frame_type][0].this_mv;
-#if CONFIG_AMVR
lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv,
cm->cur_frame_force_integer_mv);
-#else
- lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv);
-#endif
clamp_mv2(&cur_mv[0].as_mv, xd);
if (mv_check_bounds(&x->mv_limits, &cur_mv[0].as_mv)) {
early_terminate = INT64_MAX;
@@ -7471,12 +7444,8 @@
if (this_mode == NEW_NEARESTMV) {
cur_mv[1] = mbmi_ext->ref_mv_stack[ref_frame_type][0].comp_mv;
-#if CONFIG_AMVR
lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv,
cm->cur_frame_force_integer_mv);
-#else
- lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv);
-#endif
clamp_mv2(&cur_mv[1].as_mv, xd);
if (mv_check_bounds(&x->mv_limits, &cur_mv[1].as_mv)) {
early_terminate = INT64_MAX;
@@ -7491,12 +7460,8 @@
if (this_mode == NEAR_NEWMV || this_mode == NEAR_NEARMV) {
cur_mv[0] = mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_idx].this_mv;
-#if CONFIG_AMVR
lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv,
cm->cur_frame_force_integer_mv);
-#else
- lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv);
-#endif
clamp_mv2(&cur_mv[0].as_mv, xd);
if (mv_check_bounds(&x->mv_limits, &cur_mv[0].as_mv)) {
early_terminate = INT64_MAX;
@@ -7508,12 +7473,8 @@
if (this_mode == NEW_NEARMV || this_mode == NEAR_NEARMV) {
cur_mv[1] = mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_idx].comp_mv;
-#if CONFIG_AMVR
lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv,
cm->cur_frame_force_integer_mv);
-#else
- lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv);
-#endif
clamp_mv2(&cur_mv[1].as_mv, xd);
if (mv_check_bounds(&x->mv_limits, &cur_mv[1].as_mv)) {
early_terminate = INT64_MAX;
@@ -7840,11 +7801,7 @@
mbmi_ext->mode_context);
int_mv nearestmv, nearmv;
-#if CONFIG_AMVR
av1_find_best_ref_mvs(0, candidates, &nearestmv, &nearmv, 0);
-#else
- av1_find_best_ref_mvs(0, candidates, &nearestmv, &nearmv);
-#endif
int_mv dv_ref = nearestmv.as_int == 0 ? nearmv : nearestmv;
if (dv_ref.as_int == 0)
@@ -8467,22 +8424,14 @@
frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
frame_mv[GLOBALMV][ref_frame].as_int =
gm_get_motion_vector(&cm->global_motion[ref_frame],
- cm->allow_high_precision_mv, bsize, mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cm->cur_frame_force_integer_mv
-#endif
- )
+ cm->allow_high_precision_mv, bsize, mi_col, mi_row,
+ cm->cur_frame_force_integer_mv)
.as_int;
frame_mv[NEW_NEWMV][ref_frame].as_int = INVALID_MV;
frame_mv[GLOBAL_GLOBALMV][ref_frame].as_int =
gm_get_motion_vector(&cm->global_motion[ref_frame],
- cm->allow_high_precision_mv, bsize, mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cm->cur_frame_force_integer_mv
-#endif
- )
+ cm->allow_high_precision_mv, bsize, mi_col, mi_row,
+ cm->cur_frame_force_integer_mv)
.as_int;
}
@@ -8556,15 +8505,11 @@
// TODO(zoeliu): To further explore whether following needs to be done for
// BWDREF_FRAME as well.
mode_skip_mask[ALTREF_FRAME] = ~INTER_NEAREST_NEAR_ZERO;
- zeromv.as_int = gm_get_motion_vector(&cm->global_motion[ALTREF_FRAME],
- cm->allow_high_precision_mv, bsize,
- mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cm->cur_frame_force_integer_mv
-#endif
- )
- .as_int;
+ zeromv.as_int =
+ gm_get_motion_vector(&cm->global_motion[ALTREF_FRAME],
+ cm->allow_high_precision_mv, bsize, mi_col,
+ mi_row, cm->cur_frame_force_integer_mv)
+ .as_int;
if (frame_mv[NEARMV][ALTREF_FRAME].as_int != zeromv.as_int)
mode_skip_mask[ALTREF_FRAME] |= (1 << NEARMV);
if (frame_mv[NEARESTMV][ALTREF_FRAME].as_int != zeromv.as_int)
@@ -9702,24 +9647,16 @@
const uint8_t rf_type = av1_ref_frame_type(best_mbmode.ref_frame);
zeromv[0].as_int =
gm_get_motion_vector(&cm->global_motion[refs[0]],
- cm->allow_high_precision_mv, bsize, mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cm->cur_frame_force_integer_mv
-#endif
- )
+ cm->allow_high_precision_mv, bsize, mi_col, mi_row,
+ cm->cur_frame_force_integer_mv)
.as_int;
- zeromv[1].as_int = comp_pred_mode
- ? gm_get_motion_vector(&cm->global_motion[refs[1]],
- cm->allow_high_precision_mv,
- bsize, mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cm->cur_frame_force_integer_mv
-#endif
- )
- .as_int
- : 0;
+ zeromv[1].as_int =
+ comp_pred_mode
+ ? gm_get_motion_vector(&cm->global_motion[refs[1]],
+ cm->allow_high_precision_mv, bsize, mi_col,
+ mi_row, cm->cur_frame_force_integer_mv)
+ .as_int
+ : 0;
// Check if the global motion mode is non-translational.
int is_nontran_gm = cm->global_motion[refs[0]].wmtype <= TRANSLATION;
@@ -9909,12 +9846,8 @@
mbmi->ref_frame[1] = NONE_FRAME;
mbmi->mv[0].as_int =
gm_get_motion_vector(&cm->global_motion[mbmi->ref_frame[0]],
- cm->allow_high_precision_mv, bsize, mi_col, mi_row
-#if CONFIG_AMVR
- ,
- cm->cur_frame_force_integer_mv
-#endif
- )
+ cm->allow_high_precision_mv, bsize, mi_col, mi_row,
+ cm->cur_frame_force_integer_mv)
.as_int;
mbmi->tx_size = max_txsize_lookup[bsize];
x->skip = 1;
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
index 699e88f..aa26565 100644
--- a/av1/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -256,8 +256,7 @@
x->mv_limits = tmp_mv_limits;
-// Ignore mv costing by sending NULL pointer instead of cost array
-#if CONFIG_AMVR
+ // Ignore mv costing by sending NULL pointer instead of cost array
if (cpi->common.cur_frame_force_integer_mv == 1) {
const uint8_t *const src_address = x->plane[0].src.buf;
const int src_stride = x->plane[0].src.stride;
@@ -271,15 +270,12 @@
bestsme = cpi->fn_ptr[BLOCK_16X16].vf(y + offset, y_stride, src_address,
src_stride, &sse);
} else {
-#endif
bestsme = cpi->find_fractional_mv_step(
x, &best_ref_mv1, cpi->common.allow_high_precision_mv, x->errorperbit,
&cpi->fn_ptr[BLOCK_16X16], 0, mv_sf->subpel_iters_per_step,
cond_cost_list(cpi, cost_list), NULL, NULL, &distortion, &sse, NULL,
NULL, 0, 0, 0, 0, 0);
-#if CONFIG_AMVR
}
-#endif
x->e_mbd.mi[0]->mbmi.mv[0] = x->best_mv;