From 4398e0151109c16b531ed49bcd2686860ab193b3 Mon Sep 17 00:00:00 2001 From: angiebird Date: Fri, 11 Oct 2019 16:11:23 -0700 Subject: Simplify the if clause in define_gf_group Change-Id: I70a06a4f48c5a215831d8b6e918eebc3041ef65a --- vp9/encoder/vp9_firstpass.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 6f91836e7..d3600e582 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2643,17 +2643,19 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { // such as a fade, the arf group spanning the transition may not be coded // at a very high quality and hence this frame (with its overlay) is a // poor golden frame to use for an extended group. - if (((i >= active_max_gf_interval) && - ((zero_motion_accumulator < 0.995) || (rc->source_alt_ref_active))) || - ( - // Don't break out with a very short interval. - (i >= active_min_gf_interval) && - // If possible dont break very close to a kf - ((rc->frames_to_key - i) >= rc->min_gf_interval) && (i & 0x01) && - (!flash_detected) && - ((mv_ratio_accumulator > mv_ratio_accumulator_thresh) || - (abs_mv_in_out_accumulator > abs_mv_in_out_thresh) || - (sr_accumulator > gop_intra_factor * next_frame.intra_error)))) { + if ((i >= active_max_gf_interval) && + ((zero_motion_accumulator < 0.995) || (rc->source_alt_ref_active))) { + break; + } + if ( + // Don't break out with a very short interval. + (i >= active_min_gf_interval) && + // If possible dont break very close to a kf + ((rc->frames_to_key - i) >= rc->min_gf_interval) && (i & 0x01) && + (!flash_detected) && + ((mv_ratio_accumulator > mv_ratio_accumulator_thresh) || + (abs_mv_in_out_accumulator > abs_mv_in_out_thresh) || + (sr_accumulator > gop_intra_factor * next_frame.intra_error))) { break; } -- cgit v1.2.3