]> granicus.if.org Git - libvpx/commitdiff
vp9: Enable ml based partition for speed>=8 low res.
authorJerome Jiang <jianj@google.com>
Tue, 19 Feb 2019 17:08:50 +0000 (09:08 -0800)
committerJerome Jiang <jianj@google.com>
Wed, 20 Feb 2019 00:10:35 +0000 (16:10 -0800)
~10% speed up with no quality change for speed 8.
7% quality gain for speed 9 with no speed change.

Change-Id: I7eaaa4b82f7b082c9b15aa1d7624765ecc5082e7

vp9/encoder/vp9_speed_features.c

index 7c567a14c4449ceb2ddfd88a3b01b697519788d8..9fc1c75ac8d06f652f66b74c848991cade8cbe12 100644 (file)
@@ -564,14 +564,6 @@ static void set_rt_speed_feature_framesize_independent(
         (frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1);
     sf->max_delta_qindex = is_keyframe ? 20 : 15;
     sf->partition_search_type = REFERENCE_PARTITION;
-    if (sf->nonrd_use_ml_partition) {
-      if (!frame_is_intra_only(cm) && cm->width >= 360 && cm->height >= 360)
-        sf->partition_search_type = ML_BASED_PARTITION;
-#if CONFIG_VP9_HIGHBITDEPTH
-      if (cpi->Source->flags & YV12_FLAG_HIGHBITDEPTH)
-        sf->partition_search_type = REFERENCE_PARTITION;
-#endif  // CONFIG_VP9_HIGHBITDEPTH
-    }
     if (cpi->oxcf.rc_mode == VPX_VBR && cpi->oxcf.lag_in_frames > 0 &&
         cpi->rc.is_src_frame_alt_ref) {
       sf->partition_search_type = VAR_BASED_PARTITION;
@@ -632,10 +624,7 @@ static void set_rt_speed_feature_framesize_independent(
       sf->use_altref_onepass = 1;
       sf->use_compound_nonrd_pickmode = 1;
     }
-
-    if (!sf->nonrd_use_ml_partition)
-      sf->partition_search_type = VAR_BASED_PARTITION;
-
+    sf->partition_search_type = VAR_BASED_PARTITION;
     sf->mv.search_method = NSTEP;
     sf->mv.reduce_first_step_size = 1;
     sf->skip_encode_sb = 0;
@@ -722,7 +711,10 @@ static void set_rt_speed_feature_framesize_independent(
     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;
-
+    // Enable ML based partition for low res.
+    if (!frame_is_intra_only(cm) && cm->width * cm->height <= 352 * 288) {
+      sf->nonrd_use_ml_partition = 1;
+    }
     if (content == VP9E_CONTENT_SCREEN) sf->mv.subpel_force_stop = FULL_PEL;
     if (content == VP9E_CONTENT_SCREEN) sf->lpf_pick = LPF_PICK_MINIMAL_LPF;
     // Only keep INTRA_DC mode for speed 8.
@@ -769,6 +761,9 @@ static void set_rt_speed_feature_framesize_independent(
     if (cpi->rc.avg_frame_low_motion < 65) sf->default_interp_filter = BILINEAR;
   }
 
+  if (sf->nonrd_use_ml_partition)
+    sf->partition_search_type = ML_BASED_PARTITION;
+
   if (sf->use_altref_onepass) {
     if (cpi->rc.is_src_frame_alt_ref && cm->frame_type != KEY_FRAME) {
       sf->partition_search_type = FIXED_PARTITION;