]> granicus.if.org Git - libvpx/commitdiff
Fix key frame detection
authorJingning Han <jingning@google.com>
Wed, 8 May 2019 20:16:10 +0000 (13:16 -0700)
committerJingning Han <jingning@google.com>
Wed, 8 May 2019 20:16:10 +0000 (13:16 -0700)
This solves the regression issue seen in certain animation clips.

BUG=b/132108583

Change-Id: Ib28413c95160a5f15fbcf9ea6a322fd4f69a57ce

vp9/encoder/vp9_firstpass.c

index d8c6da1136417fb8f89697f0920f7bb63c31290a..2d08602478888d6fc216b4996556205b941ab98e 100644 (file)
@@ -2827,7 +2827,7 @@ static int test_candidate_kf(TWO_PASS *twopass,
   // See above for an explanation of the test criteria.
   // If so, then examine how well it predicts subsequent frames.
   if (!detect_flash(twopass, -1) && !detect_flash(twopass, 0) &&
-      (next_frame->pcnt_second_ref < SECOND_REF_USEAGE_THRESH) &&
+      (this_frame->pcnt_second_ref < SECOND_REF_USEAGE_THRESH) &&
       ((this_frame->pcnt_inter < VERY_LOW_INTER_THRESH) ||
        (slide_transition(this_frame, last_frame, next_frame)) ||
        (intra_step_transition(this_frame, last_frame, next_frame)) ||