History

Localize zero_motion_accumulator

angiebird committed 7 years ago

Commit d1124ad1 parent ab7974d1 file · +3 −4Browse files

Unified · Split

vp9/encoder/vp9_firstpass.c+3−4
@@ -2496,8 +2496,6 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) { · 2495 unmodified lines
24962496 double gf_group_inter = 0.0;
24972497 double gf_group_motion = 0.0;
24982498
2499− double zero_motion_accumulator = 1.0;
2500−
25012499 unsigned int allow_alt_ref = is_altref_enabled(cpi);
25022500
25032501 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
25842582 // Motion breakout threshold for loop below depends on image size.
25852583 double mv_ratio_accumulator_thresh =
25862584 (cpi->initial_height + cpi->initial_width) / 4.0;
2585+ double zero_motion_accumulator = 1.0;
25872586
25882587 while (i < rc->static_scene_max_gf_interval && i < rc->frames_to_key) {
25892588 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
26702669 break;
26712670 }
26722671 }
2672+ allow_alt_ref &= zero_motion_accumulator < 0.995;
26732673 }
26742674
26752675 // Was the group length constrained by the requirement for a new KF?
26762676 rc->constrained_gf_group = (i >= rc->frames_to_key) ? 1 : 0;
26772677
26782678 // 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) &&
26812680 (i < cpi->oxcf.lag_in_frames) && (i >= rc->min_gf_interval)) {
26822681 const int f_frames = (rc->frames_to_key - i >= i - 1)
26832682 ? i - 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t