ref: f60a1178c6329c15c675ea52606c311be7c53601
parent: f0e0d01e94f951dd21834dd80db1e1220d34b01b
author: Alex Converse <[email protected]>
date: Tue Jul 1 09:02:05 EDT 2014
Cleanup motion search speed features. * Replace max_step_search_steps with constant MAX_MVSEARCH_STEPS * Fold (reduce_first_step_size + speed > 5) into reduce_first_step_size replacing uses of reduce_first_step_size that don't add the speed check with zero. Change-Id: Iae46395dbf3eaca138bf4d18b838a9e364b5a198
--- a/vp9/encoder/vp9_mbgraph.c
+++ b/vp9/encoder/vp9_mbgraph.c
@@ -36,9 +36,8 @@
MV ref_full;
// Further step/diamond searches as necessary
- int step_param = mv_sf->reduce_first_step_size +
- (cpi->oxcf.speed > 5 ? 1 : 0);
- step_param = MIN(step_param, mv_sf->max_step_search_steps - 2);
+ int step_param = mv_sf->reduce_first_step_size;
+ step_param = MIN(step_param, MAX_MVSEARCH_STEPS - 2);
vp9_set_mv_search_range(x, ref_mv);
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -60,8 +60,7 @@
while ((size << sr) < MAX_FULL_PEL_VAL)
sr++;
- sr += sf->mv.reduce_first_step_size;
- sr = MIN(sr, (sf->mv.max_step_search_steps - 2));
+ sr = MIN(sr, MAX_MVSEARCH_STEPS - 2);
return sr;
}
@@ -1627,8 +1626,7 @@
break;
case NSTEP:
var = vp9_full_pixel_diamond(cpi, x, mvp_full, step_param, error_per_bit,
- (sf->mv.max_step_search_steps - 1) -
- step_param,
+ MAX_MVSEARCH_STEPS - 1 - step_param,
1, fn_ptr, ref_mv, tmp_mv);
break;
default:
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -149,6 +149,9 @@
}
cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
}
+ if (speed >= 6) {
+ sf->mv.reduce_first_step_size = 1;
+ }
}
static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
@@ -280,6 +283,8 @@
// Increase mode checking threshold for NEWMV.
sf->elevate_newmv_thresh = 2000;
+
+ sf->mv.reduce_first_step_size = 1;
}
if (speed >= 7) {
sf->use_quant_fp = cm->frame_type == KEY_FRAME ? 0 : 1;
@@ -312,7 +317,6 @@
sf->optimize_coefficients = !is_lossless_requested(&cpi->oxcf);
sf->mv.reduce_first_step_size = 0;
sf->mv.auto_mv_step_size = 0;
- sf->mv.max_step_search_steps = MAX_MVSEARCH_STEPS;
sf->mv.fullpel_search_step_param = 6;
sf->comp_inter_joint_search_thresh = BLOCK_4X4;
sf->adaptive_rd_thresh = 0;
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -139,10 +139,6 @@
// Motion search method (Diamond, NSTEP, Hex, Big Diamond, Square, etc).
SEARCH_METHODS search_method;
- // This parameter controls the number of steps we'll do in a diamond
- // search.
- int max_step_search_steps;
-
// This parameter controls which step in the n-step process we start at.
// It's changed adaptively based on circumstances.
int reduce_first_step_size;
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -163,8 +163,8 @@
xd->plane[0].pre[0].buf = frame_ptr_buf;
xd->plane[0].pre[0].stride = stride;
- step_param = mv_sf->reduce_first_step_size + (cpi->oxcf.speed > 5 ? 1 : 0);
- step_param = MIN(step_param, mv_sf->max_step_search_steps - 2);
+ step_param = mv_sf->reduce_first_step_size;
+ step_param = MIN(step_param, MAX_MVSEARCH_STEPS - 2);
// Ignore mv costing by sending NULL pointer instead of cost arrays
vp9_hex_search(x, &best_ref_mv1_full, step_param, sadpb, 1,