Unified · Split
| @@ -2496,8 +2496,6 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) { · 2495 unmodified lines | ||
| 2496 | 2496 | double gf_group_inter = 0.0; |
| 2497 | 2497 | double gf_group_motion = 0.0; |
| 2498 | 2498 | |
| 2499 | − double zero_motion_accumulator = 1.0; | |
| 2500 | − | |
| 2501 | 2499 | unsigned int allow_alt_ref = is_altref_enabled(cpi); |
| 2502 | 2500 | |
| 2503 | 2501 | int active_max_gf_interval; |
| @@ -2584,6 +2582,7 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) { · 80 unmodified lines | ||
| 2584 | 2582 | // Motion breakout threshold for loop below depends on image size. |
| 2585 | 2583 | double mv_ratio_accumulator_thresh = |
| 2586 | 2584 | (cpi->initial_height + cpi->initial_width) / 4.0; |
| 2585 | + double zero_motion_accumulator = 1.0; | |
| 2587 | 2586 | |
| 2588 | 2587 | while (i < rc->static_scene_max_gf_interval && i < rc->frames_to_key) { |
| 2589 | 2588 | const FIRSTPASS_STATS *next_next_frame; |
| @@ -2670,14 +2669,14 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) { · 80 unmodified lines | ||
| 2670 | 2669 | break; |
| 2671 | 2670 | } |
| 2672 | 2671 | } |
| 2672 | + allow_alt_ref &= zero_motion_accumulator < 0.995; | |
| 2673 | 2673 | } |
| 2674 | 2674 | |
| 2675 | 2675 | // Was the group length constrained by the requirement for a new KF? |
| 2676 | 2676 | rc->constrained_gf_group = (i >= rc->frames_to_key) ? 1 : 0; |
| 2677 | 2677 | |
| 2678 | 2678 | // Should we use the alternate reference frame. |
| 2679 | − if ((zero_motion_accumulator < 0.995) && allow_alt_ref && | |
| 2680 | − (twopass->kf_zeromotion_pct < STATIC_KF_GROUP_THRESH) && | |
| 2679 | + if (allow_alt_ref && (twopass->kf_zeromotion_pct < STATIC_KF_GROUP_THRESH) && | |
| 2681 | 2680 | (i < cpi->oxcf.lag_in_frames) && (i >= rc->min_gf_interval)) { |
| 2682 | 2681 | const int f_frames = (rc->frames_to_key - i >= i - 1) |
| 2683 | 2682 | ? i - 1 |