shithub: libvpx

Download patch

ref: 04de501229a57e9f78574fe660be7eb3b162036c
parent: 43e0e082d15b1066a1641501362de25ade00a62b
author: Jerome Jiang <jianj@google.com>
date: Thu Apr 27 08:56:52 EDT 2017

vp9: Fix condition for disabling adaptive_rd_thresh.

Add speed constrains for disabling adaptive_rd_thresh when
row_mt_bit_exact is set.

Change-Id: I2445115c2f9a2e46b8a0966031a0fea488d4964e

--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -162,6 +162,7 @@
 
   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 @@
     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 @@
   // 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 @@
   // 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.
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -231,9 +231,11 @@
 
   // 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