From: Paul Wilkins Date: Tue, 23 Jul 2013 11:49:55 +0000 (-0700) Subject: Merge "Reworked the auto_mv_step_size speed feature" X-Git-Tag: v1.3.0~772 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c134bc0cdad93bf2b6037ca56e91a6af74eadba;p=libvpx Merge "Reworked the auto_mv_step_size speed feature" --- 7c134bc0cdad93bf2b6037ca56e91a6af74eadba diff --cc vp9/encoder/vp9_onyx_if.c index fe276fa6b,548f70baa..8d846e0fb --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@@ -2585,8 -2557,26 +2583,26 @@@ static void encode_frame_to_data_rate(V } // 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) {