}
// Set default state for segment based loop filter update flags
- xd->mode_ref_lf_delta_update = 0;
+ xd->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(cpi, max_mv_def);
+ // Initialize cpi->max_mv_magnitude and cpi->mv_step_param if appropriate.
+ if (sf->auto_mv_step_size) {
+ if ((cpi->common.frame_type == KEY_FRAME) || cpi->common.intra_only) {
+ // initialize max_mv_magnitude for use in the first INTER frame
+ // after a key/intra-only frame
+ cpi->max_mv_magnitude = max_mv_def;
+ } else {
+ if (cm->show_frame)
+ // 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(
+ cpi, MIN(max_mv_def, 2 * cpi->max_mv_magnitude));
+ cpi->max_mv_magnitude = 0;
+ }
+ }
// Set various flags etc to special state if it is a key frame
if (cm->frame_type == KEY_FRAME) {