From 0df9a18edfe5969a3981ac65b7034480f36e8fe9 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Wed, 8 May 2019 13:16:10 -0700 Subject: [PATCH] Fix key frame detection This solves the regression issue seen in certain animation clips. BUG=b/132108583 Change-Id: Ib28413c95160a5f15fbcf9ea6a322fd4f69a57ce --- vp9/encoder/vp9_firstpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index d8c6da113..2d0860247 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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)) || -- 2.40.0