Commit 061c666900 for aom
commit 061c6669008600e4a6eee52e51ad23af32335b96
Author: Lin Zheng <linzhen@google.com>
Date: Wed Mar 18 19:04:07 2026 +0000
Scenecut improvement for crossfade
Change-Id: Ie156a9c8b6603ab0d20048e9b2e401ac61df5d7c
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index 0c448cf7e5..f489317d04 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -2931,6 +2931,14 @@ static int test_candidate_kf(const FIRSTPASS_INFO *firstpass_info,
// Get the next frame details
const FIRSTPASS_STATS *local_next_frame =
av1_firstpass_info_peek(firstpass_info, this_stats_index + i);
+
+ if ((local_next_frame->intra_error - this_stats->intra_error) /
+ DOUBLE_DIVIDE_CHECK(this_stats->intra_error) >
+ 0.1 &&
+ this_stats->coded_error > local_next_frame->coded_error * 6) {
+ break;
+ }
+
double next_iiratio =
(BOOST_FACTOR * local_next_frame->intra_error /
DOUBLE_DIVIDE_CHECK(local_next_frame->coded_error));