Turn on ml_var_partition_pruning for speed 1
authorHui Su <huisu@google.com>
Tue, 2 Oct 2018 21:40:27 +0000 (14:40 -0700)
committerHui Su <huisu@google.com>
Fri, 5 Oct 2018 18:45:49 +0000 (18:45 +0000)
Coding loss:
lowres 0.08%; midres 0.11%; hdres 0.07%

Average encoding speedup is about 6%.

Change-Id: I950291cf0f1d610bcdedeb150bcbefea2f5579bc

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_speed_features.c

index ad30951..72dc137 100644 (file)
@@ -3405,30 +3405,29 @@ static void ml_predict_var_rd_paritioning(VP9_COMP *cpi, MACROBLOCK *x,
   MODE_INFO *mi = xd->mi[0];
   const NN_CONFIG *nn_config = NULL;
   DECLARE_ALIGNED(16, uint8_t, pred_buf[64 * 64]);
+  const int speed = cpi->oxcf.speed;
   int i;
-  float thresh_low = -1.0f;
-  float thresh_high = 0.0f;
+  float thresh = 0.0f;
 
   switch (bsize) {
     case BLOCK_64X64:
       nn_config = &vp9_var_rd_part_nnconfig_64;
-      thresh_low = -3.0f;
-      thresh_high = 3.0f;
+      thresh = speed > 0 ? 3.5f : 3.0f;
       break;
     case BLOCK_32X32:
       nn_config = &vp9_var_rd_part_nnconfig_32;
-      thresh_low = -3.0;
-      thresh_high = 3.0f;
+      thresh = speed > 0 ? 3.5f : 3.0f;
       break;
     case BLOCK_16X16:
       nn_config = &vp9_var_rd_part_nnconfig_16;
-      thresh_low = -4.0;
-      thresh_high = 4.0f;
+      thresh = speed > 0 ? 3.5f : 4.0f;
       break;
     case BLOCK_8X8:
       nn_config = &vp9_var_rd_part_nnconfig_8;
-      thresh_low = -2.0;
-      thresh_high = 2.0f;
+      if (cm->width >= 720 && cm->height >= 720)
+        thresh = speed > 0 ? 2.5f : 2.0f;
+      else
+        thresh = speed > 0 ? 3.5f : 2.0f;
       break;
     default: assert(0 && "Unexpected block size."); return;
   }
@@ -3520,8 +3519,8 @@ static void ml_predict_var_rd_paritioning(VP9_COMP *cpi, MACROBLOCK *x,
     // partition is better than the non-split partition. So if the score is
     // high enough, we skip the none-split partition search; if the score is
     // low enough, we skip the split partition search.
-    if (score > thresh_high) *none = 0;
-    if (score < thresh_low) *split = 0;
+    if (score > thresh) *none = 0;
+    if (score < -thresh) *split = 0;
   }
 }
 #undef FEATURES
index 4490923..8bf9909 100644 (file)
@@ -242,7 +242,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi,
 
   if (speed >= 1) {
     sf->enable_tpl_model = 0;
-    sf->ml_var_partition_pruning = 0;
+    sf->ml_var_partition_pruning = !boosted;
     sf->ml_prune_rect_partition_threhold[1] = 200;
     sf->ml_prune_rect_partition_threhold[2] = 200;
     sf->ml_prune_rect_partition_threhold[3] = 200;
@@ -291,6 +291,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi,
   }
 
   if (speed >= 2) {
+    sf->ml_var_partition_pruning = 0;
     if (oxcf->vbr_corpus_complexity)
       sf->recode_loop = ALLOW_RECODE_FIRST;
     else