]> granicus.if.org Git - libvpx/commitdiff
vp9: Speed 8: More aggresive golden skip for low res.
authorJerome Jiang <jianj@google.com>
Tue, 15 Nov 2016 18:37:12 +0000 (10:37 -0800)
committerJerome Jiang <jianj@google.com>
Tue, 15 Nov 2016 21:56:27 +0000 (13:56 -0800)
Add a new, more aggresive short circuit: short_circuit_low_temp_var = 3 to skip
golden of any mode when variance is lower than threshold for low res.
This change only affects speed = 8, low resolution.

Metrics for avgPSNR/SSIM on rtc_derf (low resolution) show loss of
0.27/0.31%.
On Nexus 6, the encoding time is reduced by ~2.3% on average across all
low-res clips.

Visually little change on rtc_derf clips.

Change-Id: Ia8f7366fc2d49181a96733a380b4dbd7390246ec

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_speed_features.c
vp9/encoder/vp9_speed_features.h

index 3ab05375ff74e20ec4750b268275a747ba5d6e5c..5f1175bb70bce46100b07e9402625bca1d49c704 100644 (file)
@@ -742,9 +742,12 @@ static void set_low_temp_var_flag(VP9_COMP *cpi, MACROBLOCK *x, MACROBLOCKD *xd,
           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 ||
index 2b7ddbcd94870295bd13dc3ef1bdabd0202cd81d..8b84c3825e7fd4730f66b40073592356b6070c77 100644 (file)
@@ -1490,6 +1490,10 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
   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 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
       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;
     }
index 3e1ed50a6d2a368560bf6e062fe1a940dafcc6e2..67526e5b7565c3cccf78dad92dba3733877f5606 100644 (file)
@@ -506,6 +506,10 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, int speed,
         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;
   }
index 6d0b9420a1d0fc00a2a29137f3e3fe33e92d510d..05044376554b900128f841a71b13590504966376 100644 (file)
@@ -457,6 +457,7 @@ typedef struct SPEED_FEATURES {
   // 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,