]> granicus.if.org Git - libvpx/commitdiff
vp9: Fix condition for disabling adaptive_rd_thresh.
authorJerome Jiang <jianj@google.com>
Thu, 27 Apr 2017 19:56:52 +0000 (12:56 -0700)
committerJerome Jiang <jianj@google.com>
Fri, 28 Apr 2017 17:26:20 +0000 (10:26 -0700)
Add speed constrains for disabling adaptive_rd_thresh when
row_mt_bit_exact is set.

Change-Id: I2445115c2f9a2e46b8a0966031a0fea488d4964e

vp9/encoder/vp9_speed_features.c
vp9/encoder/vp9_speed_features.h

index ca8b55b8df17beaaaab5202a5e8d62d6cac48460..24c15d4b5028ccdd030ee666a83b61e42911ebf0 100644 (file)
@@ -162,6 +162,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi,
 
   sf->tx_size_search_breakout = 1;
   sf->adaptive_rd_thresh = 1;
+  sf->adaptive_rd_thresh_row_mt = 0;
   sf->allow_skip_recode = 1;
   sf->less_rectangular_check = 1;
   sf->use_square_partition_only = !frame_is_boosted(cpi);
@@ -603,11 +604,6 @@ static void set_rt_speed_feature_framesize_independent(
     sf->limit_newmv_early_exit = 0;
     if (cm->width > 320 && cm->height > 240) sf->use_simple_block_yrd = 1;
   }
-  // Turn off adaptive_rd_thresh if row_mt is on for speed 5, 6, 7.
-  if (speed >= 5 && speed < 8 && cpi->row_mt && cpi->num_workers > 1) {
-    sf->adaptive_rd_thresh = 0;
-    sf->adaptive_rd_thresh_row_mt = 0;
-  }
 }
 
 void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) {
@@ -647,8 +643,9 @@ void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) {
   // With row based multi-threading, the following speed features
   // have to be disabled to guarantee that bitstreams encoded with single thread
   // and multiple threads match.
-  // It can be used since adaptive_rd_thresh is defined per-row for REALTIME.
-  if (oxcf->mode != REALTIME && cpi->row_mt_bit_exact)
+  // It can be used in realtime when adaptive_rd_thresh_row_mt is enabled since
+  // adaptive_rd_thresh is defined per-row for non-rd pickmode.
+  if (!sf->adaptive_rd_thresh_row_mt && cpi->row_mt_bit_exact)
     sf->adaptive_rd_thresh = 0;
 
   // This is only used in motion vector unit test.
@@ -803,8 +800,9 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
   // With row based multi-threading, the following speed features
   // have to be disabled to guarantee that bitstreams encoded with single thread
   // and multiple threads match.
-  // It can be used since adaptive_rd_thresh is defined per-row for REALTIME.
-  if (oxcf->mode != REALTIME && cpi->row_mt_bit_exact)
+  // It can be used in realtime when adaptive_rd_thresh_row_mt is enabled since
+  // adaptive_rd_thresh is defined per-row for non-rd pickmode.
+  if (!sf->adaptive_rd_thresh_row_mt && cpi->row_mt_bit_exact)
     sf->adaptive_rd_thresh = 0;
 
   // This is only used in motion vector unit test.
index f41a725e6b4be3858974723af0a38b90e17593a9..ee485a35f4d2dd96aa6c2e3db4edea59a1a173e6 100644 (file)
@@ -231,9 +231,11 @@ typedef struct SPEED_FEATURES {
 
   // This variable is used to cap the maximum number of times we skip testing a
   // mode to be evaluated. A high value means we will be faster.
+  // Turned off when (row_mt_bit_exact == 1 && adaptive_rd_thresh_row_mt == 0).
   int adaptive_rd_thresh;
 
-  // Flag to use adaptive_rd_thresh when row-mt it enabled.
+  // Flag to use adaptive_rd_thresh when row-mt it enabled, only for non-rd
+  // pickmode.
   int adaptive_rd_thresh_row_mt;
 
   // Enables skipping the reconstruction step (idct, recon) in the