From: Hui Su Date: Tue, 2 Oct 2018 21:40:27 +0000 (-0700) Subject: Turn on ml_var_partition_pruning for speed 1 X-Git-Tag: v1.8.0~259^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b25c7515a02d34d7e8a34c2982cd4da9ccdfc33a;p=platform%2Fupstream%2Flibvpx.git Turn on ml_var_partition_pruning for speed 1 Coding loss: lowres 0.08%; midres 0.11%; hdres 0.07% Average encoding speedup is about 6%. Change-Id: I950291cf0f1d610bcdedeb150bcbefea2f5579bc --- diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index ad30951..72dc137 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -3405,30 +3405,29 @@ static void ml_predict_var_rd_paritioning(VP9_COMP *cpi, MACROBLOCK *x, MODE_INFO *mi = xd->mi[0]; const NN_CONFIG *nn_config = NULL; DECLARE_ALIGNED(16, uint8_t, pred_buf[64 * 64]); + const int speed = cpi->oxcf.speed; int i; - float thresh_low = -1.0f; - float thresh_high = 0.0f; + float thresh = 0.0f; switch (bsize) { case BLOCK_64X64: nn_config = &vp9_var_rd_part_nnconfig_64; - thresh_low = -3.0f; - thresh_high = 3.0f; + thresh = speed > 0 ? 3.5f : 3.0f; break; case BLOCK_32X32: nn_config = &vp9_var_rd_part_nnconfig_32; - thresh_low = -3.0; - thresh_high = 3.0f; + thresh = speed > 0 ? 3.5f : 3.0f; break; case BLOCK_16X16: nn_config = &vp9_var_rd_part_nnconfig_16; - thresh_low = -4.0; - thresh_high = 4.0f; + thresh = speed > 0 ? 3.5f : 4.0f; break; case BLOCK_8X8: nn_config = &vp9_var_rd_part_nnconfig_8; - thresh_low = -2.0; - thresh_high = 2.0f; + if (cm->width >= 720 && cm->height >= 720) + thresh = speed > 0 ? 2.5f : 2.0f; + else + thresh = speed > 0 ? 3.5f : 2.0f; break; default: assert(0 && "Unexpected block size."); return; } @@ -3520,8 +3519,8 @@ static void ml_predict_var_rd_paritioning(VP9_COMP *cpi, MACROBLOCK *x, // partition is better than the non-split partition. So if the score is // high enough, we skip the none-split partition search; if the score is // low enough, we skip the split partition search. - if (score > thresh_high) *none = 0; - if (score < thresh_low) *split = 0; + if (score > thresh) *none = 0; + if (score < -thresh) *split = 0; } } #undef FEATURES diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 4490923..8bf9909 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -242,7 +242,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi, if (speed >= 1) { sf->enable_tpl_model = 0; - sf->ml_var_partition_pruning = 0; + sf->ml_var_partition_pruning = !boosted; sf->ml_prune_rect_partition_threhold[1] = 200; sf->ml_prune_rect_partition_threhold[2] = 200; sf->ml_prune_rect_partition_threhold[3] = 200; @@ -291,6 +291,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi, } if (speed >= 2) { + sf->ml_var_partition_pruning = 0; if (oxcf->vbr_corpus_complexity) sf->recode_loop = ALLOW_RECODE_FIRST; else