Modify hog threshold in intra mode pruning
Adjusted hog threshold at speed 6 to speed up encoder. Applied
aggressive thresholds in inter frame encoding, and less aggressive
thresholds in intra frame encoding.
Borg test result at speed 6:
avg_psnr: ovr_psnr: ssim: speedup:
midres2: 0.197 0.219 0.299 2.4%
hdres2: 0.162 0.142 0.215 4.0%
STATS_CHANGED
Change-Id: Ibefbf790de640d75ff55671c864c5b9393cc5cc2
diff --git a/av1/encoder/intra_mode_search.c b/av1/encoder/intra_mode_search.c
index ff807fe..3e19cd6 100644
--- a/av1/encoder/intra_mode_search.c
+++ b/av1/encoder/intra_mode_search.c
@@ -883,9 +883,9 @@
cpi->oxcf.intra_mode_cfg.enable_angle_delta) {
if (sf->intra_sf.intra_pruning_with_hog &&
!intra_search_state->dir_mode_skip_mask_ready) {
- // Need to adjust the threshold for different speeds.
- const float intra_pruning_with_hog_thresh = -1.2f;
- prune_intra_mode_with_hog(x, bsize, intra_pruning_with_hog_thresh,
+ const float thresh[2] = { -1.2f, 1.2f };
+ prune_intra_mode_with_hog(x, bsize,
+ thresh[sf->intra_sf.intra_pruning_with_hog - 1],
intra_search_state->directional_mode_skip_mask);
intra_search_state->dir_mode_skip_mask_ready = 1;
}
@@ -1027,9 +1027,12 @@
mbmi->angle_delta[PLANE_TYPE_Y] = 0;
if (cpi->sf.intra_sf.intra_pruning_with_hog) {
- const float intra_pruning_with_hog_thresh = -1.2f;
- prune_intra_mode_with_hog(x, bsize, intra_pruning_with_hog_thresh,
- directional_mode_skip_mask);
+ // Less aggressive thresholds are used here than those used in inter frame
+ // encoding.
+ const float thresh[2] = { -1.2f, 0.4f };
+ prune_intra_mode_with_hog(
+ x, bsize, thresh[cpi->sf.intra_sf.intra_pruning_with_hog - 1],
+ directional_mode_skip_mask);
}
mbmi->filter_intra_mode_info.use_filter_intra = 0;
pmi->palette_size[0] = 0;
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 3fb1535..b377fa6 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -686,6 +686,8 @@
sf->inter_sf.prune_inter_modes_based_on_tpl = boosted ? 0 : 3;
sf->inter_sf.prune_nearmv_using_neighbors = 1;
+ sf->intra_sf.intra_pruning_with_hog = 2;
+
sf->part_sf.prune_rectangular_split_based_on_qidx =
boosted || allow_screen_content_tools ? 0 : 1;
sf->part_sf.prune_sub_8x8_partition_level =