shithub: libvpx

Download patch

ref: 693c9a70f056289aa56fda3fa59576fbdb836519
parent: 3ac2b57015000dde5731ceb9fc824e86747c5945
author: Hui Su <huisu@google.com>
date: Fri Jun 8 09:41:05 EDT 2018

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

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3305,6 +3305,7 @@
   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);