From 693c9a70f056289aa56fda3fa59576fbdb836519 Mon Sep 17 00:00:00 2001 From: Hui Su Date: Fri, 8 Jun 2018 13:41:05 -0700 Subject: [PATCH] Small speedup of ml_pruning_partition() Terminate early and skip neural net model when linear score is already high enough, which indicates that we should not skip split and rectangular partitions. No changes on compression; encoding speed improves slightly. Change-Id: I4e0995090200eb4889344da905d2f7048673af5f --- vp9/encoder/vp9_encodeframe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index cfa832207..6d1d455fc 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -3305,6 +3305,7 @@ static int ml_pruning_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd, linear_weights = &partition_linear_weights[offset]; linear_score = linear_weights[7]; for (i = 0; i < 7; ++i) linear_score += linear_weights[i] * features[i]; + if (linear_score > 0.1f) return 0; // Predict using neural net model. nn_predict(features, nn_config, &nn_score); -- 2.49.0