From f67b2b8929e2edd242c68a3aeac555f1e79587ab Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Fri, 29 Mar 2019 15:18:14 -0700 Subject: [PATCH] vp9-rtc: Speed feature changes for speed 9. Add threshold multipler for variance partitioning as speed feature, and increase it by 2x for speed >= 9 for resoln >= VGA. Also only allow simple_interpol filter when avg_low_motion is below threshold. Better tradeoff of speed/quality comparing to speed 8. Change-Id: I6bd29ad3cced470b32d04f60771120531112a5d9 --- vp9/encoder/vp9_encodeframe.c | 3 ++- vp9/encoder/vp9_speed_features.c | 4 +++- vp9/encoder/vp9_speed_features.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index db59b6b..933cd3c 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -555,7 +555,8 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q, int content_state) { VP9_COMMON *const cm = &cpi->common; const int is_key_frame = frame_is_intra_only(cm); - const int threshold_multiplier = is_key_frame ? 20 : 1; + const int threshold_multiplier = + is_key_frame ? 20 : cpi->sf.variance_part_thresh_mult; int64_t threshold_base = (int64_t)(threshold_multiplier * cpi->y_dequant[q][1]); diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 55bd106..0a04340 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -451,6 +451,7 @@ static void set_rt_speed_feature_framesize_independent( sf->enhanced_full_pixel_motion_search = 0; sf->use_accurate_subpel_search = USE_2_TAPS; sf->nonrd_use_ml_partition = 0; + sf->variance_part_thresh_mult = 1; if (speed >= 1) { sf->allow_txfm_domain_distortion = 1; @@ -760,7 +761,8 @@ static void set_rt_speed_feature_framesize_independent( 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; - sf->default_interp_filter = BILINEAR; + if (cpi->rc.avg_frame_low_motion < 70) sf->default_interp_filter = BILINEAR; + if (cm->width * cm->height >= 640 * 360) sf->variance_part_thresh_mult = 2; } if (sf->nonrd_use_ml_partition) diff --git a/vp9/encoder/vp9_speed_features.h b/vp9/encoder/vp9_speed_features.h index 22c1c3f..b1d5c8d 100644 --- a/vp9/encoder/vp9_speed_features.h +++ b/vp9/encoder/vp9_speed_features.h @@ -605,6 +605,9 @@ typedef struct SPEED_FEATURES { // Use machine learning based partition search. int nonrd_use_ml_partition; + + // Multiplier for base thresold for variance partitioning. + int variance_part_thresh_mult; } SPEED_FEATURES; struct VP9_COMP; -- 2.7.4