rtc: Tune adaptive_subpel_search_level for cpu 7/8
Consolidated two levels of sf such that cpu 7/8 use the QP and
source var based conditions for selecting the aggressive subpel
search.
The Borg test results are:
cpu Testset Instr. Count BD-Rate Drop (%)
Reduction(%) avg. psnr ovr.psnr ssim
7 rtc_derf -0.019 -0.0797 -0.0566 -0.1040
7 rtc -0.107 0.0947 0.1224 0.1224
7 rtc-screen 0.002 -0.0068 -0.0066 -0.0058
8 rtc_derf 0.024 0.1218 0.1302 0.1159
8 rtc -0.088 0.0281 0.0792 0.0344
8 rtc-screen 0.006 -0.0089 -0.0132 -0.0145
No changes to cpu 9, 10.
STATS_CHANGED
Change-Id: I3d0dbf9a6a6cdba00d2b401634a95f220e7c0cd9
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index 8578177..d696d18 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -353,19 +353,17 @@
}
bool use_aggressive_subpel_search_method(MACROBLOCK *x,
- int adaptive_subpel_search_level,
+ bool use_adaptive_subpel_search,
const bool fullpel_performed_well) {
- if (!adaptive_subpel_search_level) return false;
+ if (!use_adaptive_subpel_search) return false;
const int qband = x->qindex >> (QINDEX_BITS - 2);
assert(qband < 4);
- const bool is_fullpel_well_or_lowsad =
- fullpel_performed_well || x->content_state_sb.source_sad_nonrd <= kLowSad;
- if (adaptive_subpel_search_level == 2 && qband != 0 &&
- (is_fullpel_well_or_lowsad || x->source_variance < 100))
+ if ((qband > 0) && (fullpel_performed_well ||
+ (x->content_state_sb.source_sad_nonrd <= kLowSad) ||
+ (x->source_variance < 100)))
return true;
- else if (adaptive_subpel_search_level == 1 && is_fullpel_well_or_lowsad)
- return true;
- return false;
+ else
+ return false;
}
/*!\brief Runs Motion Estimation for a specific block and specific ref frame.
@@ -472,7 +470,7 @@
MV subpel_start_mv = get_mv_from_fullmv(&tmp_mv->as_fullmv);
// adaptively downgrade subpel search method based on block properties
if (use_aggressive_subpel_search_method(
- x, sf->rt_sf.adaptive_subpel_search_level, fullpel_performed_well))
+ x, sf->rt_sf.use_adaptive_subpel_search, fullpel_performed_well))
av1_find_best_sub_pixel_tree_pruned_more(xd, cm, &ms_params,
subpel_start_mv, &tmp_mv->as_mv,
&dis, &x->pred_sse[ref], NULL);
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 975f4b5..7a87416 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -1297,7 +1297,7 @@
}
#endif
#endif
- sf->rt_sf.adaptive_subpel_search_level = 0;
+ sf->rt_sf.use_adaptive_subpel_search = false;
}
if (speed >= 10) {
sf->rt_sf.skip_intra_pred = 2;
@@ -1329,14 +1329,14 @@
sf->rt_sf.skip_cdef_sb = 1;
sf->rt_sf.sad_based_adp_altref_lag = 2;
sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
- sf->rt_sf.adaptive_subpel_search_level = 2;
+ sf->rt_sf.use_adaptive_subpel_search = true;
}
if (speed >= 10) {
sf->rt_sf.hybrid_intra_pickmode = 2;
sf->rt_sf.sad_based_adp_altref_lag = 4;
sf->rt_sf.tx_size_level_based_on_qstep = 0;
sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
- sf->rt_sf.adaptive_subpel_search_level = 0;
+ sf->rt_sf.use_adaptive_subpel_search = false;
}
}
if (!is_480p_or_larger) {
@@ -1375,7 +1375,7 @@
if (is_1080p_or_larger) {
if (speed >= 7) {
sf->rt_sf.reduce_mv_pel_precision_highmotion = 0;
- sf->rt_sf.adaptive_subpel_search_level = 0;
+ sf->rt_sf.use_adaptive_subpel_search = 0;
}
} else {
if (speed >= 9) sf->lpf_sf.cdef_pick_method = CDEF_PICK_FROM_Q;
@@ -1730,7 +1730,7 @@
sf->rt_sf.prune_compoundmode_with_singlecompound_var = true;
sf->rt_sf.prune_compoundmode_with_singlemode_var = true;
sf->rt_sf.skip_compound_based_on_var = true;
- sf->rt_sf.adaptive_subpel_search_level = 1;
+ sf->rt_sf.use_adaptive_subpel_search = true;
}
if (speed >= 8) {
@@ -1758,7 +1758,7 @@
sf->rt_sf.frame_level_mode_cost_update = true;
sf->rt_sf.check_only_zero_zeromv_on_large_blocks = true;
sf->rt_sf.reduce_mv_pel_precision_highmotion = 0;
- sf->rt_sf.adaptive_subpel_search_level = 2;
+ sf->rt_sf.use_adaptive_subpel_search = true;
}
if (speed >= 10) {
sf->rt_sf.sse_early_term_inter_search = EARLY_TERM_IDX_4;
@@ -2099,7 +2099,7 @@
rt_sf->prune_compoundmode_with_singlemode_var = false;
rt_sf->skip_compound_based_on_var = false;
rt_sf->set_zeromv_skip_based_on_source_sad = 1;
- rt_sf->adaptive_subpel_search_level = 0;
+ rt_sf->use_adaptive_subpel_search = false;
rt_sf->screen_content_cdef_filter_qindex_thresh = 0;
rt_sf->enable_ref_short_signaling = false;
rt_sf->check_globalmv_on_single_ref = true;
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index ee51a85..ee764cf 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -1644,12 +1644,9 @@
int set_zeromv_skip_based_on_source_sad;
// Downgrades the block-level subpel motion search to
- // av1_find_best_sub_pixel_tree_pruned_more.
- // 0: disable
- // 1: when either fullpel search performed well, or when zeromv has low sad.
- // 2: for higher QP and when fullpel search performed well, zeromv has low sad
- // or low source_var
- int adaptive_subpel_search_level;
+ // av1_find_best_sub_pixel_tree_pruned_more for higher QP and when fullpel
+ // search performed well, zeromv has low sad or low source_var
+ bool use_adaptive_subpel_search;
// A flag used in RTC case to control frame_refs_short_signaling. Note that
// the final decision is made in check_frame_refs_short_signaling(). The flag