From 3b4425c2ca9b5f7e736f2bbdab492648364fb550 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Wed, 23 May 2018 11:52:37 -0700 Subject: [PATCH] VP9: Allow for bilinear subpel interp at speed 9 for high motion. Fixed some settings in nonrd pick mode to allow for frame-level bilinear to be set. On Galaxy S8+ it has 4% speed up on high motion clips. Almost the same for low motion. 0.17% quality loss on RTC. Change-Id: I044a7de020183754ba08bb6c96c5a78ba5c7fea2 --- vp9/encoder/vp9_pickmode.c | 18 ++++++++++++------ vp9/encoder/vp9_speed_features.c | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 60d5c89b1..45c96fdc5 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1340,6 +1340,7 @@ static void recheck_zeromv_after_denoising( mi->ref_frame[1] = NONE; mi->mv[0].as_int = 0; mi->interp_filter = EIGHTTAP; + if (cpi->sf.default_interp_filter == BILINEAR) mi->interp_filter = BILINEAR; xd->plane[0].pre[0] = yv12_mb[LAST_FRAME][0]; vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); model_rd_for_sb_y(cpi, bsize, x, xd, &rate, &dist, &var_y, &sse_y); @@ -1512,6 +1513,10 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, int svc_mv_row = 0; int no_scaling = 0; unsigned int thresh_svc_skip_golden = 500; + if (cpi->sf.default_interp_filter == BILINEAR) { + best_pred_filter = BILINEAR; + filter_gf_svc = BILINEAR; + } if (cpi->use_svc && svc->spatial_layer_id > 0) { int layer = LAYER_IDS_TO_IDX(svc->spatial_layer_id - 1, svc->temporal_layer_id, @@ -1562,12 +1567,13 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, // filter_ref, we use a less strict condition on assigning filter_ref. // This is to reduce the probabily of entering the flow of not assigning // filter_ref and then skip filter search. - if (xd->above_mi && is_inter_block(xd->above_mi)) - filter_ref = xd->above_mi->interp_filter; - else if (xd->left_mi && is_inter_block(xd->left_mi)) - filter_ref = xd->left_mi->interp_filter; - else - filter_ref = cm->interp_filter; + filter_ref = cm->interp_filter; + if (cpi->sf.default_interp_filter != BILINEAR) { + if (xd->above_mi && is_inter_block(xd->above_mi)) + filter_ref = xd->above_mi->interp_filter; + else if (xd->left_mi && is_inter_block(xd->left_mi)) + filter_ref = xd->left_mi->interp_filter; + } // initialize mode decisions vp9_rd_cost_reset(&best_rdc); diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index d2842697d..f7e97cebc 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -682,6 +682,7 @@ 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; + if (cpi->rc.avg_frame_low_motion < 65) sf->default_interp_filter = BILINEAR; } if (sf->use_altref_onepass) { -- 2.40.0