vp9: use nonrd pick_intra for small blocks on keyframes.
authorJerome Jiang <jianj@google.com>
Thu, 12 Oct 2017 00:13:39 +0000 (17:13 -0700)
committerJerome Jiang <jianj@google.com>
Thu, 12 Oct 2017 04:38:01 +0000 (21:38 -0700)
Keyframe encoding is more than 2x faster.
Disabled on Speed 8.

Change-Id: I2157318b6ac8253fa5398322c72d98cd7fa9b2b6

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

index dee17ad..aa298ac 100644 (file)
@@ -3489,7 +3489,7 @@ static TX_MODE select_tx_mode(const VP9_COMP *cpi, MACROBLOCKD *const xd) {
 static void hybrid_intra_mode_search(VP9_COMP *cpi, MACROBLOCK *const x,
                                      RD_COST *rd_cost, BLOCK_SIZE bsize,
                                      PICK_MODE_CONTEXT *ctx) {
-  if (bsize < BLOCK_16X16)
+  if (!cpi->sf.nonrd_keyframe && bsize < BLOCK_16X16)
     vp9_rd_pick_intra_mode_sb(cpi, x, rd_cost, bsize, ctx, INT64_MAX);
   else
     vp9_pick_intra_mode(cpi, x, rd_cost, bsize, ctx);
index 4d4a579..6984cda 100644 (file)
@@ -366,6 +366,7 @@ static void set_rt_speed_feature_framesize_independent(
   sf->use_simple_block_yrd = 0;
   sf->adapt_partition_source_sad = 0;
   sf->use_altref_onepass = 0;
+  sf->nonrd_keyframe = 0;
 
   if (speed >= 1) {
     sf->allow_txfm_domain_distortion = 1;
@@ -598,6 +599,7 @@ static void set_rt_speed_feature_framesize_independent(
   if (speed >= 8) {
     sf->adaptive_rd_thresh = 4;
     sf->skip_encode_sb = 1;
+    sf->nonrd_keyframe = 1;
     if (!cpi->use_svc) cpi->max_copied_frame = 4;
     if (cpi->row_mt && cpi->oxcf.max_threads > 1)
       sf->adaptive_rd_thresh_row_mt = 1;
index 517369d..9e5bf9a 100644 (file)
@@ -499,6 +499,9 @@ typedef struct SPEED_FEATURES {
 
   // Enable use of alt-refs in 1 pass VBR.
   int use_altref_onepass;
+
+  // Always use nonrd_pick_intra for all block sizes on keyframes.
+  int nonrd_keyframe;
 } SPEED_FEATURES;
 
 struct VP9_COMP;