]> granicus.if.org Git - libvpx/commitdiff
vp9: Some speed feature settings for speed 9.
authorMarco Paniconi <marpan@google.com>
Tue, 15 May 2018 03:52:20 +0000 (20:52 -0700)
committerMarco Paniconi <marpan@google.com>
Tue, 15 May 2018 16:58:53 +0000 (09:58 -0700)
Disable 8x8 blocks for higher resolutions,
reduce mv_thresh for 1/2 subpel motion, and
disable golden reference at superblock level
based on source sad and motion content.

~6% loss in RTC metrics over current speed 9.
Speedup about ~10% for high motion clip on linux.

Change-Id: I7ff8f81ac93ee8a90d5a1f4837c955d000bd75e7

test/vp9_datarate_test.cc
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_speed_features.c
vp9/encoder/vp9_speed_features.h

index e50ebdacabaa89553b9ca87816ed60d79f32419b..a8bcc2a4337ebe4691b0ff9d5671465bf3393fc8 100644 (file)
@@ -266,7 +266,7 @@ TEST_P(DatarateTestVP9Large, BasicRateTargetingVBRLagZero) {
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.75)
       << " The datarate for the file is lower than target by too much!";
-  ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.35)
+  ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.36)
       << " The datarate for the file is greater than target by too much!";
 }
 
index 33fc02fc51e19f90e206e9f0aa338c0dc168babb..c7e9f9b2a0254cb6140f7c80498e09db56f07b62 100644 (file)
@@ -583,6 +583,7 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q,
     } else {
       thresholds[1] = (5 * threshold_base) >> 1;
     }
+    if (cpi->sf.disable_16x16part_nonkey) thresholds[2] = INT64_MAX;
   }
 }
 
index f86c9f09261b7b10a97c4ca1a24eff9ffd56c71a..a2f305d68ce5b832ab08dc623277c20b121ae7e0 100644 (file)
@@ -1660,6 +1660,10 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
     }
   }
 
+  if (sf->disable_golden_ref && (x->content_state_sb != kVeryHighSad ||
+                                 cpi->rc.avg_frame_low_motion < 60))
+    usable_ref_frame = LAST_FRAME;
+
   if (!((cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) &&
         !svc_force_zero_mode[GOLDEN_FRAME - 1] && !force_skip_low_temp_var))
     use_golden_nonzeromv = 0;
index 01365d8fd4c8323d7244c7f8056222f43868e7ad..8f1ec2155f16fc754e2002dfc63647c88a7bdf41 100644 (file)
@@ -375,6 +375,8 @@ static void set_rt_speed_feature_framesize_independent(
   sf->nonrd_keyframe = 0;
   sf->svc_use_lowres_part = 0;
   sf->re_encode_overshoot_rt = 0;
+  sf->disable_16x16part_nonkey = 0;
+  sf->disable_golden_ref = 0;
 
   if (speed >= 1) {
     sf->allow_txfm_domain_distortion = 1;
@@ -671,8 +673,15 @@ static void set_rt_speed_feature_framesize_independent(
   if (speed >= 9) {
     sf->mv.enable_adaptive_subpel_force_stop = 1;
     sf->mv.adapt_subpel_force_stop.mv_thresh = 2;
+    if (cpi->rc.avg_frame_low_motion < 40)
+      sf->mv.adapt_subpel_force_stop.mv_thresh = 1;
     sf->mv.adapt_subpel_force_stop.force_stop_below = 1;
     sf->mv.adapt_subpel_force_stop.force_stop_above = 2;
+    // Disable partition blocks below 16x16, except for low-resolutions.
+    if (cm->frame_type != KEY_FRAME && cm->width >= 320 && cm->height >= 240)
+      sf->disable_16x16part_nonkey = 1;
+    // Allow for disabling GOLDEN reference, for CBR mode.
+    if (cpi->oxcf.rc_mode == VPX_CBR) sf->disable_golden_ref = 1;
   }
 
   if (sf->use_altref_onepass) {
index 8595e54ab66d8fe670396ef10b31a3f78dacd3fe..251cfdbcdf13bd943939f0e24f7923b51ad4081d 100644 (file)
@@ -531,6 +531,12 @@ typedef struct SPEED_FEATURES {
   // Enable re-encoding on scene change with potential high overshoot,
   // for real-time encoding flow.
   int re_encode_overshoot_rt;
+
+  // Disable partitioning of 16x16 blocks.
+  int disable_16x16part_nonkey;
+
+  // Allow for disabling golden reference.
+  int disable_golden_ref;
 } SPEED_FEATURES;
 
 struct VP9_COMP;