Disable filter intra mode in all intra speed 6
The compression performance loss is 0.35% for 1080p test set. The
encoding speed is up by 11%.
BUG=aomedia:2959
STATS_CHANGED
Change-Id: I8bace7084b08edee27e2a2073a4b9335c277cebc
diff --git a/av1/encoder/intra_mode_search.c b/av1/encoder/intra_mode_search.c
index b9f311e..da47610 100644
--- a/av1/encoder/intra_mode_search.c
+++ b/av1/encoder/intra_mode_search.c
@@ -1076,10 +1076,22 @@
int this_rate, this_rate_tokenonly, s;
int64_t this_distortion, this_rd;
mbmi->mode = intra_rd_search_mode_order[mode_idx];
+ // The smooth prediction mode appears to be more frequently picked
+ // than horizontal / vertical smooth prediction modes. Hence treat
+ // them differently in speed features.
if ((!cpi->oxcf.intra_mode_cfg.enable_smooth_intra ||
cpi->sf.intra_sf.disable_smooth_intra) &&
- (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED ||
- mbmi->mode == SMOOTH_V_PRED))
+ (mbmi->mode == SMOOTH_H_PRED || mbmi->mode == SMOOTH_V_PRED))
+ continue;
+ if (!cpi->oxcf.intra_mode_cfg.enable_smooth_intra &&
+ mbmi->mode == SMOOTH_PRED)
+ continue;
+
+ // The functionality of filter intra modes and smooth prediction
+ // overlap. Retain the smooth prediction if filter intra modes are
+ // disabled.
+ if (cpi->sf.intra_sf.disable_smooth_intra &&
+ !cpi->sf.intra_sf.disable_filter_intra && mbmi->mode == SMOOTH_PRED)
continue;
if (!cpi->oxcf.intra_mode_cfg.enable_paeth_intra &&
mbmi->mode == PAETH_PRED)
@@ -1154,7 +1166,8 @@
}
// Searches filter_intra
- if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize)) {
+ if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize) &&
+ !cpi->sf.intra_sf.disable_filter_intra) {
if (rd_pick_filter_intra_sby(cpi, x, rate, rate_tokenonly, distortion,
skippable, bsize, bmode_costs[DC_PRED],
&best_rd, &best_model_rd, ctx)) {
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 00370b7..0c418ae 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -662,6 +662,7 @@
}
if (speed >= 6) {
+ sf->intra_sf.disable_filter_intra = 1;
sf->intra_sf.chroma_intra_pruning_with_hog = 4;
sf->intra_sf.intra_pruning_with_hog = 4;
@@ -1515,6 +1516,7 @@
intra_sf->intra_uv_mode_mask[i] = UV_INTRA_ALL;
}
intra_sf->disable_smooth_intra = 0;
+ intra_sf->disable_filter_intra = 0;
}
static AOM_INLINE void init_tx_sf(TX_SPEED_FEATURES *tx_sf) {
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 504421c..ba7c472 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -796,6 +796,9 @@
// Enable/disable smooth intra modes.
int disable_smooth_intra;
+ // Enable/disable filter intra modes.
+ int disable_filter_intra;
+
// prune palette search
// 0: No pruning
// 1: Perform coarse search to prune the palette colors. For winner colors,