Replace initial_dimensions with cm->width and height Change-Id: Idefbd127d730f747d8947f4ce0752f6b98d7e11c (cherry picked from commit a3f937bae0136bd8c09e409e8aa05d0b09361cf9)
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c index 7ddc3e3..3631113 100644 --- a/av1/encoder/firstpass.c +++ b/av1/encoder/firstpass.c
@@ -252,9 +252,9 @@ // Refine the motion search range according to the frame dimension // for first pass test. -static int get_search_range(const InitialDimensions *initial_dimensions) { +static int get_search_range(int width, int height) { int sr = 0; - const int dim = AOMMIN(initial_dimensions->width, initial_dimensions->height); + const int dim = AOMMIN(width, height); while ((dim << sr) < MAX_FULL_PEL_VAL) ++sr; return sr; @@ -293,18 +293,19 @@ const MV *ref_mv, FULLPEL_MV *best_mv, int *best_motion_err) { + AV1_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; FULLPEL_MV start_mv = get_fullmv_from_mv(ref_mv); int tmp_err; const BLOCK_SIZE bsize = xd->mi[0]->bsize; const int new_mv_mode_penalty = NEW_MV_MODE_PENALTY; - const int sr = get_search_range(&cpi->initial_dimensions); + const int sr = get_search_range(cm->width, cm->height); const int step_param = cpi->sf.fp_sf.reduce_mv_step_param + sr; const search_site_config *first_pass_search_sites = av1_get_first_pass_search_site_config(cpi, x, NSTEP); const int fine_search_interval = - cpi->is_screen_content_type && cpi->common.features.allow_intrabc; + cpi->is_screen_content_type && cm->features.allow_intrabc; FULLPEL_MOTION_SEARCH_PARAMS ms_params; av1_make_default_fullpel_ms_params(&ms_params, cpi, x, bsize, ref_mv, start_mv, first_pass_search_sites, NSTEP,
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c index 3641c8b..d85440d 100644 --- a/av1/encoder/pass2_strategy.c +++ b/av1/encoder/pass2_strategy.c
@@ -999,10 +999,9 @@ GF_GROUP_STATS *gf_stats) { RATE_CONTROL *const rc = &cpi->rc; TWO_PASS *const twopass = &cpi->ppi->twopass; - InitialDimensions *const initial_dimensions = &cpi->initial_dimensions; + AV1_COMMON *const cm = &cpi->common; // Motion breakout threshold for loop below depends on image size. - const double mv_ratio_accumulator_thresh = - (initial_dimensions->height + initial_dimensions->width) / 4.0; + const double mv_ratio_accumulator_thresh = (cm->height + cm->width) / 4.0; if (!flash_detected) { // Break clause to detect very still sections after motion. For example,