AV1 RT: Use legacy RD Model for Interpolation and Intra searches
On Speed6 Lowres The speed up is 7-10% and BDRate degradation overall of
0.09% (max 0.2%).
Change-Id: I0c1701d5f15738a53ba8854b18a97f46fbfe5859
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 9b24f40..eb9fae7 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -3175,7 +3175,6 @@
const double sse_norm = (double)sse / num_samples;
const double qstepsqr = (double)qstep * qstep;
const double xqr = log2(sse_norm / qstepsqr);
-
double rate_f, dist_by_sse_norm_f;
av1_model_rd_curvfit(plane_bsize, sse_norm, xqr, &rate_f,
&dist_by_sse_norm_f);
@@ -4474,7 +4473,8 @@
}
}
// RD estimation.
- model_rd_sb_fn[MODELRD_TYPE_INTRA](
+ model_rd_sb_fn[cpi->sf.use_simple_rd_model ? MODELRD_LEGACY
+ : MODELRD_TYPE_INTRA](
cpi, bsize, x, xd, 0, 0, &this_rd_stats.rate, &this_rd_stats.dist,
&this_rd_stats.skip, &temp_sse, NULL, NULL, NULL);
if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) {
@@ -8892,7 +8892,8 @@
plane_from, plane_to);
}
- model_rd_sb_fn[MODELRD_TYPE_INTERP_FILTER](
+ model_rd_sb_fn[cpi->sf.use_simple_rd_model ? MODELRD_LEGACY
+ : MODELRD_TYPE_INTERP_FILTER](
cpi, bsize, x, xd, plane_from, plane_to, &tmp_rd_stats.rate,
&tmp_rd_stats.dist, &tmp_rd_stats.skip, &tmp_rd_stats.sse, NULL, NULL,
NULL);
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 51d8393..e4df066 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -692,6 +692,7 @@
sf->adaptive_mode_search = 2;
sf->force_tx_search_off = 1;
sf->num_inter_modes_for_tx_search = 5;
+ sf->use_simple_rd_model = 1;
}
if (speed >= 7) {
sf->lpf_pick = LPF_PICK_FROM_Q;
@@ -866,6 +867,7 @@
sf->motion_mode_for_winner_cand = 0;
sf->num_inter_modes_for_tx_search = INT_MAX;
sf->prune_palette_search_level = 0;
+ sf->use_simple_rd_model = 0;
for (i = 0; i < TX_SIZES; i++) {
sf->intra_y_mode_mask[i] = INTRA_ALL;
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 7a77d35..622090e 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -869,6 +869,9 @@
// Use interpolation filter search in non-RD mode decision.
int use_nonrd_filter_search;
+ // Use simplified RD model for interpolation search and Intra
+ int use_simple_rd_model;
+
// If set forces interpolation filter to EIGHTTAP_REGULAR
int skip_interp_filter_search;