diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index beb21177b01f5ff85e16ccf0aacaa31906a41996..dc572aa9de329d1496db8e6d0a403343b2a89f1c 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2096,7 +2096,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, cm->lf.mode_ref_delta_update = 0; // Initialize cpi->mv_step_param to default based on max resolution. - cpi->mv_step_param = vp9_init_search_range(sf, max_mv_def); + cpi->mv_step_param = vp9_init_search_range(max_mv_def); // Initialize cpi->max_mv_magnitude and cpi->mv_step_param if appropriate. if (sf->mv.auto_mv_step_size) { if (frame_is_intra_only(cm)) { @@ -2108,7 +2108,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, // Allow mv_steps to correspond to twice the max mv magnitude found // in the previous frame, capped by the default max_mv_magnitude based // on resolution. - cpi->mv_step_param = vp9_init_search_range(sf, MIN(max_mv_def, 2 * + cpi->mv_step_param = vp9_init_search_range(MIN(max_mv_def, 2 * cpi->max_mv_magnitude)); cpi->max_mv_magnitude = 0; } diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index 4a3f895f83bbd66230f5b695898c0d33e62db37f..ae924d59645587a851eef32909c59a1a10c0ca59 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -51,9 +51,8 @@ void vp9_set_mv_search_range(MACROBLOCK *x, const MV *mv) { x->mv_row_max = row_max; } -int vp9_init_search_range(const SPEED_FEATURES *sf, int size) { +int vp9_init_search_range(int size) { int sr = 0; - // Minimum search size no matter what the passed in value. size = MAX(16, size); diff --git a/vp9/encoder/vp9_mcomp.h b/vp9/encoder/vp9_mcomp.h index 366f9af3cc2f8bcc8265fb309e7b78ee1d873d7b..298fbb6c935aff20dba03b64d13e673c8e92a11d 100644 --- a/vp9/encoder/vp9_mcomp.h +++ b/vp9/encoder/vp9_mcomp.h @@ -64,7 +64,7 @@ int vp9_get_mvpred_av_var(const MACROBLOCK *x, struct VP9_COMP; struct SPEED_FEATURES; -int vp9_init_search_range(const struct SPEED_FEATURES *sf, int size); +int vp9_init_search_range(int size); // Runs sequence of diamond searches in smaller steps for RD int vp9_full_pixel_diamond(const struct VP9_COMP *cpi, MACROBLOCK *x, diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 998fb3cf683689b5df789f010b1d05053fe9102f..b597d3b48eb3de7522e55feae950010513bab86a 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1367,7 +1367,7 @@ static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x, // Take wtd average of the step_params based on the last frame's // max mv magnitude and the best ref mvs of the current block for // the given reference. - step_param = (vp9_init_search_range(&cpi->sf, max_mv) + + step_param = (vp9_init_search_range(max_mv) + cpi->mv_step_param) / 2; } else { step_param = cpi->mv_step_param; @@ -1779,7 +1779,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, // Take wtd average of the step_params based on the last frame's // max mv magnitude and that based on the best ref mvs of the current // block for the given reference. - step_param = (vp9_init_search_range(&cpi->sf, x->max_mv_context[ref]) + + step_param = (vp9_init_search_range(x->max_mv_context[ref]) + cpi->mv_step_param) / 2; } else { step_param = cpi->mv_step_param;