Allow less agg ml-based partition pruning on screen contents
This commit re-enables simple_motion_search_split and
simple_motion_search_prune_rect for screen contents on speed 3 and
above.
However, for screen contents, the pruning aggressiveness is reduced by
one level.
Performance:
SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR | SSIM | SPD
---------+---------+----------+----------+---------+-------
3 | hdres2 | +0.035% | +0.038% | +0.056% | +1.1%
3 | screen | -0.667% | -0.690% | +0.584% | +7.2%
---------+---------+----------+----------+---------+-------
4 | hdres2 | +0.031% | +0.034% | +0.045% | +1.0%
4 | screen | +0.359% | +0.425% | +1.362% | +6.2%
---------+---------+----------+----------+---------+-------
5 | hdres2 | +0.028% | +0.031% | +0.051% | +1.1%
5 | screen | +0.421% | +0.450% | +1.002% | +6.2%
STATS_CHANGED
Change-Id: I71baa0d425c4b180b386b913a59db943edaae889
diff --git a/av1/encoder/partition_strategy.c b/av1/encoder/partition_strategy.c
index 8b9ac1d..8bce3d4 100644
--- a/av1/encoder/partition_strategy.c
+++ b/av1/encoder/partition_strategy.c
@@ -354,6 +354,10 @@
av1_simple_motion_search_split_nn_config[bsize_idx];
const int agg = cpi->sf.part_sf.simple_motion_search_prune_agg;
+ if (agg < 0) {
+ return;
+ }
+
const float split_only_thresh =
av1_simple_motion_search_split_thresh[agg][res_idx][bsize_idx];
const float no_split_thresh =
@@ -623,6 +627,11 @@
*ml_std = av1_simple_motion_search_prune_rect_std[bsize_idx];
const int agg = cpi->sf.part_sf.simple_motion_search_prune_agg;
+
+ if (agg < 0) {
+ return;
+ }
+
const float prune_thresh =
av1_simple_motion_search_prune_rect_thresh[agg][res_idx][bsize_idx];
@@ -1582,7 +1591,6 @@
// must be done prior to PARTITION_SPLIT to propagate the initial mvs to a
// smaller blocksize.
const int try_split_only =
- !cpi->use_screen_content_tools &&
cpi->sf.part_sf.simple_motion_search_split && *do_square_split &&
bsize >= BLOCK_8X8 &&
mi_row + mi_size_high[bsize] <= mi_params->mi_rows &&
@@ -1600,7 +1608,6 @@
// direction. The results are stored in prune_horz and prune_vert in order to
// bypass future related pruning checks if a pruning decision has been made.
const int try_prune_rect =
- !cpi->use_screen_content_tools &&
cpi->sf.part_sf.simple_motion_search_prune_rect &&
!frame_is_intra_only(cm) && *do_rectangular_split &&
(*do_square_split || *partition_none_allowed ||
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 34943e8..5edaf10 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -773,6 +773,8 @@
sf->part_sf.ml_predict_breakout_level = use_hbd ? 1 : 3;
sf->part_sf.reuse_prev_rd_results_for_part_ab = 1;
sf->part_sf.use_best_rd_for_pruning = 1;
+ sf->part_sf.simple_motion_search_prune_agg =
+ allow_screen_content_tools ? -1 : 0;
// TODO(debargha): Test, tweak and turn on either 1 or 2
sf->inter_sf.inter_mode_rd_model_estimation = 1;
@@ -927,7 +929,8 @@
sf->gm_sf.gm_search_type = GM_DISABLE_SEARCH;
sf->part_sf.less_rectangular_check_level = 2;
- sf->part_sf.simple_motion_search_prune_agg = 1;
+ sf->part_sf.simple_motion_search_prune_agg =
+ allow_screen_content_tools ? 0 : 1;
sf->part_sf.prune_ext_part_using_split_info = 1;
sf->part_sf.simple_motion_search_rect_split = 1;
@@ -998,7 +1001,8 @@
sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
- sf->part_sf.simple_motion_search_prune_agg = 2;
+ sf->part_sf.simple_motion_search_prune_agg =
+ allow_screen_content_tools ? 0 : 2;
sf->part_sf.simple_motion_search_reduce_search_steps = 4;
sf->part_sf.prune_ext_part_using_split_info = 2;
sf->part_sf.ml_predict_breakout_level = 3;
@@ -1053,7 +1057,8 @@
if (speed >= 5) {
sf->fp_sf.reduce_mv_step_param = 4;
- sf->part_sf.simple_motion_search_prune_agg = 3;
+ sf->part_sf.simple_motion_search_prune_agg =
+ allow_screen_content_tools ? 0 : 3;
sf->part_sf.ext_partition_eval_thresh =
allow_screen_content_tools ? BLOCK_8X8 : BLOCK_16X16;
sf->part_sf.prune_sub_8x8_partition_level =