]> granicus.if.org Git - libvpx/commitdiff
vp9-rtc: Speed feature for filter_search in nonrd_pickmode.
authorMarco Paniconi <marpan@google.com>
Mon, 8 Apr 2019 21:29:40 +0000 (14:29 -0700)
committerMarco Paniconi <marpan@google.com>
Wed, 10 Apr 2019 03:57:25 +0000 (20:57 -0700)
Use chessboard search only for certain speeds/resolns
(speed >= 8) for real-time speed features.

Disable chessboard search for speeds <= 7.
~2.5 gain on rtc set for speed 7.
~1% slowdown.

Change-Id: Ic6898aa475817e128154f691413c73f65306e2a8

vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_speed_features.c

index e0168633a94142277eace0c4191738e19c9c3a8d..2b401eccfab93a8f1d5e9101fa9bd3c29e4733b1 100644 (file)
@@ -1643,13 +1643,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
   const int denoise_recheck_zeromv = 0;
 #endif
   INTERP_FILTER filter_ref;
-  const int bsl = mi_width_log2_lookup[bsize];
-  const int pred_filter_search =
-      cm->interp_filter == SWITCHABLE
-          ? (((mi_row + mi_col) >> bsl) +
-             get_chessboard_index(cm->current_video_frame)) &
-                0x1
-          : 0;
+  int pred_filter_search = cm->interp_filter == SWITCHABLE;
   int const_motion[MAX_REF_FRAMES] = { 0 };
   const int bh = num_4x4_blocks_high_lookup[bsize] << 2;
   const int bw = num_4x4_blocks_wide_lookup[bsize] << 2;
@@ -1780,6 +1774,14 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
   x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
   x->skip = 0;
 
+  if (cpi->sf.cb_pred_filter_search) {
+    const int bsl = mi_width_log2_lookup[bsize];
+    pred_filter_search = cm->interp_filter == SWITCHABLE
+                             ? (((mi_row + mi_col) >> bsl) +
+                                get_chessboard_index(cm->current_video_frame)) &
+                                   0x1
+                             : 0;
+  }
   // Instead of using vp9_get_pred_context_switchable_interp(xd) to assign
   // filter_ref, we use a less strict condition on assigning filter_ref.
   // This is to reduce the probabily of entering the flow of not assigning
index 0a0434064c3aaab1d6a5040f8041c7ce98a56a81..8c52312d083c1cdd09a09ce859e8f05cb9deed1c 100644 (file)
@@ -452,6 +452,7 @@ static void set_rt_speed_feature_framesize_independent(
   sf->use_accurate_subpel_search = USE_2_TAPS;
   sf->nonrd_use_ml_partition = 0;
   sf->variance_part_thresh_mult = 1;
+  sf->cb_pred_filter_search = 0;
 
   if (speed >= 1) {
     sf->allow_txfm_domain_distortion = 1;
@@ -749,9 +750,11 @@ static void set_rt_speed_feature_framesize_independent(
     }
     sf->limit_newmv_early_exit = 0;
     sf->use_simple_block_yrd = 1;
+    if (cm->width * cm->height > 352 * 288) sf->cb_pred_filter_search = 1;
   }
 
   if (speed >= 9) {
+    sf->cb_pred_filter_search = 1;
     sf->mv.enable_adaptive_subpel_force_stop = 1;
     sf->mv.adapt_subpel_force_stop.mv_thresh = 1;
     sf->mv.adapt_subpel_force_stop.force_stop_below = QUARTER_PEL;