Make FPMT code related to mv_stats and max_mv_magnitude default FPMT code related to updates of mv_stats and max_mv_magnitude are merged to the default path. Change-Id: Ie539dd65c87edd0c84e9db6ae4207c50a2cdc510
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 67d7e7a..38ef8c9 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c
@@ -3776,10 +3776,8 @@ int do_max_mv_magnitude_update = 1; cpi->rc.coefficient_size += td->coefficient_size; -#if CONFIG_FRAME_PARALLEL_ENCODE // Disable max_mv_magnitude update for parallel frames based on update flag. if (!cpi->do_frame_data_update) do_max_mv_magnitude_update = 0; -#endif if (cpi->sf.mv_sf.auto_mv_step_size && do_max_mv_magnitude_update) cpi->mv_search_params.max_mv_magnitude =
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c index 636e103..c03ad54 100644 --- a/av1/encoder/encode_strategy.c +++ b/av1/encoder/encode_strategy.c
@@ -1299,9 +1299,9 @@ cpi->ppi->p_rc.rate_correction_factors[i]; } } +#endif // copy mv_stats from ppi to frame_level cpi. cpi->mv_stats = cpi->ppi->mv_stats; -#endif av1_get_second_pass_params(cpi, &frame_params, *frame_flags); #if CONFIG_COLLECT_COMPONENT_TIMING end_timing(cpi, av1_get_second_pass_params_time);
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 5a2ffce..14c052f 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c
@@ -1769,12 +1769,8 @@ mv_search_params->mv_step_param = av1_init_search_range( AOMMIN(max_mv_def, 2 * mv_search_params->max_mv_magnitude)); } -#if CONFIG_FRAME_PARALLEL_ENCODE // Reset max_mv_magnitude based on update flag. if (cpi->do_frame_data_update) mv_search_params->max_mv_magnitude = -1; -#else - mv_search_params->max_mv_magnitude = -1; -#endif } } } @@ -2777,19 +2773,13 @@ // transform / motion compensation build reconstruction frame av1_encode_frame(cpi); -#if CONFIG_FRAME_PARALLEL_ENCODE // Disable mv_stats collection for parallel frames based on update flag. if (!cpi->do_frame_data_update) do_mv_stats_collection = 0; -#endif // CONFIG_FRAME_PARALLEL_ENCODE - // Reset the mv_stats in case we are interrupted by an intraframe or an - // overlay frame. -#if CONFIG_FRAME_PARALLEL_ENCODE + // Reset the mv_stats in case we are interrupted by an intraframe or an + // overlay frame. if (cpi->mv_stats.valid && do_mv_stats_collection) av1_zero(cpi->mv_stats); -#else - if (cpi->ppi->mv_stats.valid && do_mv_stats_collection) - av1_zero(cpi->ppi->mv_stats); -#endif + // Gather the mv_stats for the next frame if (cpi->sf.hl_sf.high_precision_mv_usage == LAST_MV_DATA && av1_frame_allows_smart_mv(cpi) && do_mv_stats_collection) { @@ -4227,10 +4217,8 @@ cpi->ppi->filter_level_v = lf->filter_level_v; } } -#if CONFIG_FRAME_PARALLEL_ENCODE // Store frame level mv_stats from cpi to ppi. cpi->ppi->mv_stats = cpi->mv_stats; -#endif } // Updates frame level stats related to global motion
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h index 76d873f..cf1891d 100644 --- a/av1/encoder/encoder.h +++ b/av1/encoder/encoder.h
@@ -3230,13 +3230,12 @@ */ ExtPartController ext_part_controller; -#if CONFIG_FRAME_PARALLEL_ENCODE /*! * Motion vector stats of the current encoded frame, used to update the * ppi->mv_stats during postencode. */ MV_STATS mv_stats; -#if CONFIG_FRAME_PARALLEL_ENCODE_2 +#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FRAME_PARALLEL_ENCODE_2 /*! * Stores the reference refresh index for the current frame. */ @@ -3263,8 +3262,7 @@ int wanted_fb; #endif -#endif // CONFIG_FRAME_PARALLEL_ENCODE_2 -#endif // CONFIG_FRAME_PARALLEL_ENCODE +#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FRAME_PARALLEL_ENCODE_2 /*! * A flag to indicate frames that will update their data to the primary
diff --git a/av1/encoder/mv_prec.c b/av1/encoder/mv_prec.c index 2ff713d..b64f4dc 100644 --- a/av1/encoder/mv_prec.c +++ b/av1/encoder/mv_prec.c
@@ -346,12 +346,7 @@ } void av1_collect_mv_stats(AV1_COMP *cpi, int current_q) { - MV_STATS *mv_stats; -#if CONFIG_FRAME_PARALLEL_ENCODE - mv_stats = &cpi->mv_stats; -#else - mv_stats = &cpi->ppi->mv_stats; -#endif + MV_STATS *mv_stats = &cpi->mv_stats; const AV1_COMMON *cm = &cpi->common; const int tile_cols = cm->tiles.cols; const int tile_rows = cm->tiles.rows; @@ -416,12 +411,7 @@ void av1_pick_and_set_high_precision_mv(AV1_COMP *cpi, int qindex) { int use_hp = qindex < HIGH_PRECISION_MV_QTHRESH; #if !CONFIG_REALTIME_ONLY - MV_STATS *mv_stats; -#if CONFIG_FRAME_PARALLEL_ENCODE - mv_stats = &cpi->mv_stats; -#else - mv_stats = &cpi->ppi->mv_stats; -#endif + MV_STATS *mv_stats = &cpi->mv_stats; #endif // !CONFIG_REALTIME_ONLY if (cpi->sf.hl_sf.high_precision_mv_usage == QTR_ONLY) {