shithub: libvpx

Download patch

ref: 4ddae8f5240199067c9b7071695660ccd35bf3d9
parent: eff68a3a4df99b8f475a1e3e5eb842bcb928fe00
parent: 360217a233bf67f78a3ab60a6a36e75b20cef816
author: Jerome Jiang <[email protected]>
date: Tue Nov 15 17:50:58 EST 2016

Merge "vp9: Speed 8: More aggresive golden skip for low res."

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -742,9 +742,12 @@
           continue;
 
         if ((*this_mi)->sb_type == BLOCK_32X32) {
-          if (vt->split[i].part_variances.none.variance < (thresholds[1] >> 1))
+          int64_t threshold_32x32 = cpi->sf.short_circuit_low_temp_var == 3
+                                        ? ((3 * thresholds[1]) >> 2)
+                                        : (thresholds[1] >> 1);
+          if (vt->split[i].part_variances.none.variance < threshold_32x32)
             x->variance_low[i + 5] = 1;
-        } else if (cpi->sf.short_circuit_low_temp_var == 2) {
+        } else if (cpi->sf.short_circuit_low_temp_var >= 2) {
           // For 32x16 and 16x32 blocks, the flag is set on each 16x16 block
           // inside.
           if ((*this_mi)->sb_type == BLOCK_16X16 ||
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1490,6 +1490,10 @@
   if (cpi->sf.short_circuit_low_temp_var) {
     force_skip_low_temp_var =
         get_force_skip_low_temp_var(&x->variance_low[0], mi_row, mi_col, bsize);
+    // In the most aggresive short circuit, skip golden in any mode
+    if (cpi->sf.short_circuit_low_temp_var == 3 && force_skip_low_temp_var) {
+      usable_ref_frame = LAST_FRAME;
+    }
   }
 
   if (!((cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) &&
@@ -1558,7 +1562,7 @@
       continue;
     }
 
-    if (cpi->sf.short_circuit_low_temp_var == 2 && force_skip_low_temp_var &&
+    if (cpi->sf.short_circuit_low_temp_var >= 2 && force_skip_low_temp_var &&
         ref_frame == LAST_FRAME && this_mode == NEWMV) {
       continue;
     }
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -506,6 +506,10 @@
         content != VP9E_CONTENT_SCREEN) {
       // More aggressive short circuit for speed 8.
       sf->short_circuit_low_temp_var = 2;
+      // More aggressive short circuit for low resolution
+      if (cm->width <= 352 && cm->height <= 288) {
+        sf->short_circuit_low_temp_var = 3;
+      }
     }
     sf->limit_newmv_early_exit = 0;
   }
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -457,6 +457,7 @@
   // 2: Skip golden non-zeromv and newmv-last for bsize >= 16x16, skip ALL
   // INTRA for bsize >= 32x32 and vert/horz INTRA for bsize 16x16, 16x32 and
   // 32x16.
+  // 3: Same as (2), also skip golden in any mode for low res
   int short_circuit_low_temp_var;
 
   // Limits the rd-threshold update for early exit for the newmv-last mode,