shithub: libvpx

Download patch

ref: f67b2b8929e2edd242c68a3aeac555f1e79587ab
parent: 1c0857d648c1e2eb13de3d2e717b1848bbc602d9
author: Marco Paniconi <marpan@google.com>
date: Fri Mar 29 11:18:14 EDT 2019

vp9-rtc: Speed feature changes for speed 9.

Add threshold multipler for variance partitioning
as speed feature, and increase it by 2x for speed >= 9
for resoln >= VGA. Also only allow simple_interpol
filter when avg_low_motion is below threshold.

Better tradeoff of speed/quality comparing to speed 8.

Change-Id: I6bd29ad3cced470b32d04f60771120531112a5d9

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -555,7 +555,8 @@
                                int content_state) {
   VP9_COMMON *const cm = &cpi->common;
   const int is_key_frame = frame_is_intra_only(cm);
-  const int threshold_multiplier = is_key_frame ? 20 : 1;
+  const int threshold_multiplier =
+      is_key_frame ? 20 : cpi->sf.variance_part_thresh_mult;
   int64_t threshold_base =
       (int64_t)(threshold_multiplier * cpi->y_dequant[q][1]);
 
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -451,6 +451,7 @@
   sf->enhanced_full_pixel_motion_search = 0;
   sf->use_accurate_subpel_search = USE_2_TAPS;
   sf->nonrd_use_ml_partition = 0;
+  sf->variance_part_thresh_mult = 1;
 
   if (speed >= 1) {
     sf->allow_txfm_domain_distortion = 1;
@@ -760,7 +761,8 @@
       sf->disable_16x16part_nonkey = 1;
     // Allow for disabling GOLDEN reference, for CBR mode.
     if (cpi->oxcf.rc_mode == VPX_CBR) sf->disable_golden_ref = 1;
-    sf->default_interp_filter = BILINEAR;
+    if (cpi->rc.avg_frame_low_motion < 70) sf->default_interp_filter = BILINEAR;
+    if (cm->width * cm->height >= 640 * 360) sf->variance_part_thresh_mult = 2;
   }
 
   if (sf->nonrd_use_ml_partition)
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -605,6 +605,9 @@
 
   // Use machine learning based partition search.
   int nonrd_use_ml_partition;
+
+  // Multiplier for base thresold for variance partitioning.
+  int variance_part_thresh_mult;
 } SPEED_FEATURES;
 
 struct VP9_COMP;