Add speed_features to disable PARTITION_SPLIT on speed 1~2
Currently only enabled on midres. Lowres requires a different threshold
as it splits with a higher frequency than midres.
Performance on speed 1:
TESTSET| AVG_PSNR| OVR_PSNR| SSIM| VMAF | AVG_SPDUP| OVR_SPDUP|
MIDRES| +0.044%| +0.049%| +0.054%| +0.146%| +4.368%| +3.267%|
STATS_CHANGED
Change-Id: I1f4c0684de2d22595912f9aeafddcf1bc0547588
diff --git a/av1/encoder/partition_model_weights.h b/av1/encoder/partition_model_weights.h
index 0a30622..4adbfc0 100644
--- a/av1/encoder/partition_model_weights.h
+++ b/av1/encoder/partition_model_weights.h
@@ -2713,6 +2713,17 @@
static const float av1_simple_motion_search_split_thresh_8 =
2.555636f; // p = 0.927951
+static const float av1_simple_motion_search_no_split_thresh_128 =
+ -3.38168078f; // p = 0.032872917
+static const float av1_simple_motion_search_no_split_thresh_64 =
+ -4.08610739f; // p = 0.14393017
+static const float av1_simple_motion_search_no_split_thresh_32 =
+ -1.7830237f; // p = 0.15270848
+static const float av1_simple_motion_search_no_split_thresh_16 =
+ -10.0f; // p = 0
+static const float av1_simple_motion_search_no_split_thresh_8 =
+ -10.0f; // p = 0
+
static const float av1_simple_motion_search_split_mean_128[17] = {
14.119120f, 14.087010f, 12.016185f, 11.966075f, 12.042454f, 11.994805f,
12.152105f, 12.100394f, 12.178377f, 12.128937f, 4.779944f, 0.714786f,
diff --git a/av1/encoder/partition_strategy.c b/av1/encoder/partition_strategy.c
index 736ddf0..4ea5b16 100644
--- a/av1/encoder/partition_strategy.c
+++ b/av1/encoder/partition_strategy.c
@@ -148,32 +148,37 @@
const NN_CONFIG *nn_config = NULL;
const float *ml_mean = NULL, *ml_std = NULL;
- float split_only_thresh = 1.0f;
+ float split_only_thresh = 10.0f, no_split_thresh = -10.0f;
if (bsize == BLOCK_128X128) {
ml_mean = av1_simple_motion_search_split_mean_128;
ml_std = av1_simple_motion_search_split_std_128;
nn_config = &av1_simple_motion_search_split_nn_config_128;
split_only_thresh = av1_simple_motion_search_split_thresh_128;
+ no_split_thresh = av1_simple_motion_search_no_split_thresh_128;
} else if (bsize == BLOCK_64X64) {
ml_mean = av1_simple_motion_search_split_mean_64;
ml_std = av1_simple_motion_search_split_std_64;
nn_config = &av1_simple_motion_search_split_nn_config_64;
split_only_thresh = av1_simple_motion_search_split_thresh_64;
+ no_split_thresh = av1_simple_motion_search_no_split_thresh_64;
} else if (bsize == BLOCK_32X32) {
ml_mean = av1_simple_motion_search_split_mean_32;
ml_std = av1_simple_motion_search_split_std_32;
nn_config = &av1_simple_motion_search_split_nn_config_32;
split_only_thresh = av1_simple_motion_search_split_thresh_32;
+ no_split_thresh = av1_simple_motion_search_no_split_thresh_32;
} else if (bsize == BLOCK_16X16) {
ml_mean = av1_simple_motion_search_split_mean_16;
ml_std = av1_simple_motion_search_split_std_16;
nn_config = &av1_simple_motion_search_split_nn_config_16;
split_only_thresh = av1_simple_motion_search_split_thresh_16;
+ no_split_thresh = av1_simple_motion_search_no_split_thresh_16;
} else if (bsize == BLOCK_8X8) {
ml_mean = av1_simple_motion_search_split_mean_8;
ml_std = av1_simple_motion_search_split_std_8;
nn_config = &av1_simple_motion_search_split_nn_config_8;
split_only_thresh = av1_simple_motion_search_split_thresh_8;
+ no_split_thresh = av1_simple_motion_search_no_split_thresh_8;
} else {
assert(0 && "Unexpected block size in simple_motion_based_split");
return;
@@ -198,6 +203,10 @@
*partition_vert_allowed = 0;
*do_rectangular_split = 0;
}
+
+ if (cpi->sf.simple_motion_search_split_only >= 2 && score < no_split_thresh) {
+ *do_square_split = 0;
+ }
}
// Given a list of ref frames in refs, performs simple_motion_search on each of
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 571687a..51a52bc 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -126,6 +126,8 @@
sf->use_square_partition_only_threshold = BLOCK_128X128;
} else if (is_480p_or_larger) {
sf->use_square_partition_only_threshold = BLOCK_64X64;
+
+ sf->simple_motion_search_split_only = 2;
} else {
sf->use_square_partition_only_threshold = BLOCK_32X32;
}
@@ -179,6 +181,13 @@
}
sf->use_first_partition_pass_interintra_stats =
sf->two_pass_partition_search;
+
+ // TODO(Venkat): Clean-up frame type dependency for
+ // simple_motion_search_split_only in partition search function and set the
+ // speed feature accordingly
+ // TODO(Venkat): Evaluate this speed feature for speed 1 & 2
+ sf->simple_motion_search_split_only =
+ cm->allow_screen_content_tools ? 1 : 2;
}
if (speed >= 4) {
@@ -336,12 +345,6 @@
frame_is_intra_only(&cpi->common) ? 0 : (boosted ? 1 : 2);
sf->perform_coeff_opt = is_boosted_arf2_bwd_type ? 2 : 3;
sf->prune_comp_type_by_model_rd = boosted ? 0 : 1;
- // TODO(Venkat): Clean-up frame type dependency for
- // simple_motion_search_split_only in partition search function and set the
- // speed feature accordingly
- // TODO(Venkat): Evaluate this speed feature for speed 1 & 2
- sf->simple_motion_search_split_only =
- cm->allow_screen_content_tools ? 1 : 2;
sf->disable_smooth_intra =
!frame_is_intra_only(&cpi->common) || (cpi->rc.frames_to_key != 1);
}