shithub: libvpx

Download patch

ref: d24a72ef737a91aee6cff56625e789fc283d6f15
parent: d1832eab193c173e7008524f991d377e3b30a395
author: angiebird <angiebird@google.com>
date: Mon Oct 21 13:56:54 EDT 2019

Refactor test_candidate_kf()

Replace detect_flash() by detect_flash_from_frame_stats()

Change-Id: Ia4eca1ca553fdb2f4f63ff6f683c79d92fc52556

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2954,7 +2954,9 @@
   // 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)) ||