Remove unused high level speed features
This CL removes some speed feature flags related to temporal filtering
and overlay coding because their values are constant across all
settings.
These include:
- disable_overlay_frames
* overlay encoding is always used as it gives a quality boost with
almost no speed overhead.
- adaptive_overlay_encoding
* adaptive_overlay is always enabled
- second_alt_ref_filtering
* second_alt_ref_filtering is always enabled as it gives a large
quality improvement.
BUG=aomedia:2694
Change-Id: I52759123dfcd7b340c154cecf62e30a64b6081d2
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index eb5c863..9bdf86e 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -1078,9 +1078,7 @@
frame_params.show_existing_frame = 1;
} else {
frame_params.show_existing_frame =
- ((oxcf->algo_cfg.enable_overlay == 0 ||
- cpi->sf.hl_sf.disable_overlay_frames ||
- cpi->show_existing_alt_ref) &&
+ ((oxcf->algo_cfg.enable_overlay == 0 || cpi->show_existing_alt_ref) &&
gf_group->update_type[gf_group->index] == OVERLAY_UPDATE) ||
gf_group->update_type[gf_group->index] == INTNL_OVERLAY_UPDATE;
}
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index fc17776..b125c92 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -946,12 +946,9 @@
// best quality defaults
hl_sf->frame_parameter_update = 1;
hl_sf->recode_loop = ALLOW_RECODE;
- hl_sf->disable_overlay_frames = 0;
- hl_sf->adaptive_overlay_encoding = 1;
// Recode loop tolerance %.
hl_sf->recode_tolerance = 25;
hl_sf->high_precision_mv_usage = CURRENT_Q;
- hl_sf->second_alt_ref_filtering = 1;
}
static AOM_INLINE void init_tpl_sf(TPL_SPEED_FEATURES *tpl_sf) {
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index e362d29..ffb4fb1 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -303,39 +303,28 @@
RECODE_LOOP_TYPE recode_loop;
/*!
- * Controls the tolerence vs target rate used in deciding whether to
+ * Controls the tolerance vs target rate used in deciding whether to
* recode a frame. It has no meaning if recode is disabled.
*/
int recode_tolerance;
- /*!\cond */
+ /*!\cond */
// Determine how motion vector precision is chosen. The possibilities are:
// LAST_MV_DATA: use the mv data from the last coded frame
// CURRENT_Q: use the current q as a threshold
// QTR_ONLY: use quarter pel precision only.
MV_PREC_LOGIC high_precision_mv_usage;
- // Whether to disable overlay frames for filtered Altref frames,
- // overiding oxcf->algo_cfg.enable_overlay flag set as 1.
- int disable_overlay_frames;
-
- // Enable/disable adaptively deciding whether or not to encode ALTREF overlay
- // frame.
- int adaptive_overlay_encoding;
-
// Always set to 0. If on it enables 0 cost background transmission
// (except for the initial transmission of the segmentation). The feature is
// disabled because the addition of very large block sizes make the
// backgrounds very to cheap to encode, and the segmentation we have
// adds overhead.
int static_segmentation;
-
- // Enable/disable second_alt_ref temporal filtering.
- int second_alt_ref_filtering;
/*!\endcond */
} HIGH_LEVEL_SPEED_FEATURES;
-/*!\cond */
+/*!\cond */
typedef struct TPL_SPEED_FEATURES {
// Enable/disable GOP length adaptive decision.
int disable_gop_length_decision;
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
index 94ac9ec..9ce3306 100644
--- a/av1/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -810,7 +810,7 @@
tf_normalize_filtered_frame(mbd, block_size, mb_row, mb_col, num_planes,
accum, count, &cpi->alt_ref_buffer);
- if (!is_key_frame && cpi->sf.hl_sf.adaptive_overlay_encoding) {
+ if (!is_key_frame) {
const int y_height = mb_height >> mbd->plane[0].subsampling_y;
const int y_width = mb_width >> mbd->plane[0].subsampling_x;
const int source_y_stride = frame_to_filter->y_stride;
@@ -1020,9 +1020,8 @@
const FRAME_UPDATE_TYPE update_type = gf_group->update_type[group_idx];
// Filter one more ARF if the lookahead index is leq 7 (w.r.t. 9-th frame).
// This frame is ALWAYS a show existing frame.
- const int is_second_arf = (update_type == INTNL_ARF_UPDATE) &&
- (filter_frame_lookahead_idx >= 7) &&
- cpi->sf.hl_sf.second_alt_ref_filtering;
+ const int is_second_arf =
+ (update_type == INTNL_ARF_UPDATE) && (filter_frame_lookahead_idx >= 7);
// TODO(anyone): Currently, we enforce the filtering strength on internal
// ARFs except the second ARF to be zero. We should investigate in which case
// it is more beneficial to use non-zero strength filtering.
@@ -1056,8 +1055,7 @@
if (filter_frame_lookahead_idx >= 0) {
cpi->common.showable_frame = num_frames_for_filtering == 1 ||
is_second_arf ||
- (cpi->oxcf.algo_cfg.enable_overlay == 0 ||
- cpi->sf.hl_sf.disable_overlay_frames);
+ (cpi->oxcf.algo_cfg.enable_overlay == 0);
}
// Do filtering.
@@ -1077,8 +1075,7 @@
return 1;
}
- if ((show_existing_arf != NULL && cpi->sf.hl_sf.adaptive_overlay_encoding) ||
- is_second_arf) {
+ if (show_existing_arf != NULL || is_second_arf) {
const int frame_height = frames[filter_frame_idx]->y_crop_height;
const int frame_width = frames[filter_frame_idx]->y_crop_width;
const int block_height = block_size_high[TF_BLOCK_SIZE];