rtc:Skip evaluation of filter intra modes
In inter frames, evaluation of filter intra modes is skipped if
rd evaluation of luma dc mode results in invalid rd stats. This
change is enabled for realtime usage.
Instruction Count BD-Rate Loss(%)
cpu-used Reduction(%) avg.psnr ovr.psnr ssim
5 5.382 0.0517 0.0464 0.0136
6 3.537 0.0531 0.0468 0.0493
STATS_CHANGED for --rt speed 5 and 6
Change-Id: I4bea3c73f2f7d3ab6a1fcfad1e8c359d24dfc9cb
diff --git a/av1/encoder/intra_mode_search.c b/av1/encoder/intra_mode_search.c
index 8c9f287..b6fe6ca 100644
--- a/av1/encoder/intra_mode_search.c
+++ b/av1/encoder/intra_mode_search.c
@@ -1000,6 +1000,10 @@
intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost);
best_rd_so_far = RDCOST(x->rdmult, tmp_rate, rd_stats_y->dist);
try_filter_intra = (best_rd_so_far / 2) <= best_rd;
+ } else if (sf->intra_sf.skip_filter_intra_in_inter_frames >= 1) {
+ // As rd cost of luma intra dc mode is more than best_rd (i.e.,
+ // rd_stats_y->rate = INT_MAX), skip the evaluation of filter intra modes.
+ try_filter_intra = 0;
}
if (try_filter_intra) {
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index dc9bd57..3330ad4 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -1380,6 +1380,7 @@
}
sf->intra_sf.skip_intra_in_interframe = 5;
sf->intra_sf.disable_smooth_intra = 1;
+ sf->intra_sf.skip_filter_intra_in_inter_frames = 1;
sf->tx_sf.tx_type_search.prune_2d_txfm_mode = TX_TYPE_PRUNE_3;
sf->tx_sf.use_inter_txb_hash = 0;
@@ -1710,6 +1711,7 @@
intra_sf->cfl_search_range = 3;
intra_sf->top_intra_model_count_allowed = TOP_INTRA_MODEL_COUNT;
intra_sf->early_term_chroma_palette_size_search = 0;
+ intra_sf->skip_filter_intra_in_inter_frames = 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 65b14ab..b977d5e 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -1018,6 +1018,10 @@
// 0.85%, 1.05%, 1.45%, 1.66% and 1.95% for speed 0 to 6 on a typical image
// dataset with no quality drop.
int early_term_chroma_palette_size_search;
+
+ // Skips the evaluation of filter intra modes in inter frames if rd evaluation
+ // of luma intra dc mode results in invalid rd stats.
+ int skip_filter_intra_in_inter_frames;
} INTRA_MODE_SPEED_FEATURES;
typedef struct TX_SPEED_FEATURES {