From f4b7004967c586fe0dbef5de09f08a2c800ce7b5 Mon Sep 17 00:00:00 2001 From: chiyotsai Date: Thu, 17 Jan 2019 14:15:00 -0800 Subject: [PATCH] Change temporal filter's search_method on speed 1 This commit introduces a new speed feature that determines the SEARCH_METHOD used by temporal filter when doing 16x16 block on full_pixel_motion_search. On speed 0, the most exhaustive method MESH is used. On speed 1 and above, a faster method NSTEP is used. Performance: | AVG_PSNR | AVG_SPDUP | AVG_SPDUP:AVG_PSNR MISRES | 0.007% | 2.818% | 402:1 HDRES | 0.004% | 4.897% | 1224:1 In the case of midres, there is a small quality gain of -0.021% on OVR_PSNR. Performance measurement is done on speed 1 with auto_alt_ref=1. Quality is measured on full midres set over 60 frames. Speed is measured on 5 midres clips over 4 bitrates over 30 frames. STATS_CHANGED Change-Id: Ic1879d2237f8734529e194767a6cf5e43e20b47b --- vp9/encoder/vp9_speed_features.c | 2 ++ vp9/encoder/vp9_speed_features.h | 3 +++ vp9/encoder/vp9_temporal_filter.c | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 5aede927b..50e25c35c 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -237,6 +237,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi, } if (speed >= 1) { + sf->temporal_filter_search_method = NSTEP; sf->ml_var_partition_pruning = !boosted; sf->ml_prune_rect_partition_threhold[1] = 200; sf->ml_prune_rect_partition_threhold[2] = 200; @@ -906,6 +907,7 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) { sf->allow_acl = 1; sf->enable_tpl_model = oxcf->enable_tpl_model; sf->prune_ref_frame_for_rect_partitions = 0; + sf->temporal_filter_search_method = MESH; for (i = 0; i < TX_SIZES; i++) { sf->intra_y_mode_mask[i] = INTRA_ALL; diff --git a/vp9/encoder/vp9_speed_features.h b/vp9/encoder/vp9_speed_features.h index 9b09ec474..98f8de81d 100644 --- a/vp9/encoder/vp9_speed_features.h +++ b/vp9/encoder/vp9_speed_features.h @@ -595,6 +595,9 @@ typedef struct SPEED_FEATURES { // Allow sub-pixel search to use interpolation filters with different taps in // order to achieve accurate motion search result. SUBPEL_SEARCH_TYPE use_accurate_subpel_search; + + // Search method used by temporal filtering in full_pixel_motion_search. + SEARCH_METHODS temporal_filter_search_method; } SPEED_FEATURES; struct VP9_COMP; diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c index 23943bb18..7d2701355 100644 --- a/vp9/encoder/vp9_temporal_filter.c +++ b/vp9/encoder/vp9_temporal_filter.c @@ -501,6 +501,7 @@ static uint32_t temporal_filter_find_matching_mb_c( MACROBLOCKD *const xd = &x->e_mbd; MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; const SEARCH_METHODS search_method = MESH; + const SEARCH_METHODS search_method_16 = cpi->sf.temporal_filter_search_method; int step_param; int sadpb = x->sadperbit16; uint32_t bestsme = UINT_MAX; @@ -563,7 +564,7 @@ static uint32_t temporal_filter_find_matching_mb_c( vp9_set_mv_search_range(&x->mv_limits, &best_ref_mv1); vp9_full_pixel_search(cpi, x, TF_SUB_BLOCK, &best_ref_mv1_full, - step_param, search_method, sadpb, + step_param, search_method_16, sadpb, cond_cost_list(cpi, cost_list), &best_ref_mv1, &blk_mvs[k], 0, 0); /* restore UMV window */ -- 2.40.0