Fix issue with short static KF groups.
authorPaul Wilkins <paulwilkins@google.com>
Fri, 20 Jul 2018 12:12:34 +0000 (13:12 +0100)
committerPaul Wilkins <paulwilkins@google.com>
Fri, 20 Jul 2018 15:38:32 +0000 (16:38 +0100)
Where a KF group is very short but static make sure
it is coded as a single GF group. Previously there was a
bug where such groups could be coded as an arf group
with the arf in the next scene.

Change-Id: I4504ae2b03c4877fcecfa58dd503879aa4eefac4

vp9/encoder/vp9_firstpass.c

index 8e6b3be..d130edf 100644 (file)
@@ -2917,6 +2917,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
 
   // Should we use the alternate reference frame.
   if ((zero_motion_accumulator < 0.995) && allow_alt_ref &&
+      (twopass->kf_zeromotion_pct < STATIC_KF_GROUP_THRESH) &&
       (i < cpi->oxcf.lag_in_frames) && (i >= rc->min_gf_interval)) {
     const int forward_frames = (rc->frames_to_key - i >= i - 1)
                                    ? i - 1