]> granicus.if.org Git - libvpx/commitdiff
Refactor test_candidate_kf()
authorangiebird <angiebird@google.com>
Tue, 22 Oct 2019 00:56:54 +0000 (17:56 -0700)
committerangiebird <angiebird@google.com>
Tue, 22 Oct 2019 00:56:54 +0000 (17:56 -0700)
Replace detect_flash() by detect_flash_from_frame_stats()

Change-Id: Ia4eca1ca553fdb2f4f63ff6f683c79d92fc52556

vp9/encoder/vp9_firstpass.c

index c6ec67ef19d916d0907ac6e433ed5e5407a88bcb..8e58011f62547c22947179411fde6b8baa55ef5a 100644 (file)
@@ -2954,7 +2954,9 @@ static int test_candidate_kf(TWO_PASS *twopass,
   // Does the frame satisfy the primary criteria of a key frame?
   // 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) &&
+  detect_flash_from_frame_stats(next_frame);
+  if (!detect_flash_from_frame_stats(this_frame) &&
+      !detect_flash_from_frame_stats(next_frame) &&
       (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)) ||