Clean-up code related to sf disable_filtered_key_tpl
The speed feature disable_filtered_key_tpl was introduced
when computation of tpl stats for key-frame and ARF frame
of first GF group was happening separately:
https://aomedia-review.googlesource.com/c/aom/+/113364
Later, the tpl stats computation of above 2 cases was
merged in the CL below:
https://aomedia-review.googlesource.com/c/aom/+/148007
Hence, the tpl stats computation was being completely
avoided for key-frame/first GF group due to the speed
feature disable_filtered_key_tpl in parent version for
speed=6.
In this CL, the relevant speed feature code is cleaned-up
to ensure the computation of tpl stats for first GF group.
For 'good' encoding,
Instruction Count BD-Rate Loss(%)
cpu Resolution Reduction(%) avg.psnr ovr.psnr ssim
6 LOWRES2 -1.007 -0.0891 -0.1327 -1.2631
6 MIDRES2 -1.640 -0.2633 -0.3907 -2.2604
6 HDRES2 -1.762 -0.8351 -0.8809 -2.2599
STATS_CHANGED for 'good', speed=6
Change-Id: I882df33d3d0134ec948f67ff66fa27349d97645c
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 44a9356..afce0da 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -860,10 +860,7 @@
if (gf_group->size > MAX_LENGTH_TPL_FRAME_STATS) {
allow_tpl = 0;
}
- if (frame_params->frame_type == KEY_FRAME) {
- // TODO(angiebird): handle disable_filtered_key_tpl properly
- allow_tpl = allow_tpl && !cpi->sf.tpl_sf.disable_filtered_key_tpl;
- } else {
+ if (frame_params->frame_type != KEY_FRAME) {
// In rare case, it's possible to have non ARF/GF update_type here.
// We should set allow_tpl to zero in the situation
allow_tpl =
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 9fbfbd7..166bb88 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -1239,7 +1239,6 @@
sf->mv_sf.skip_fullpel_search_using_startmv = boosted ? 0 : 1;
sf->tpl_sf.gop_length_decision_method = 3;
- sf->tpl_sf.disable_filtered_key_tpl = 1;
sf->rd_sf.perform_coeff_opt = is_boosted_arf2_bwd_type ? 6 : 8;
@@ -1818,7 +1817,6 @@
tpl_sf->skip_alike_starting_mv = 0;
tpl_sf->subpel_force_stop = EIGHTH_PEL;
tpl_sf->search_method = NSTEP;
- tpl_sf->disable_filtered_key_tpl = 0;
tpl_sf->prune_ref_frames_in_tpl = 0;
tpl_sf->allow_compound_pred = 1;
tpl_sf->use_y_only_rate_distortion = 0;
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 00c21e5..caa2f30 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -505,9 +505,6 @@
// Prune starting mvs in TPL based on sad scores.
int prune_starting_mv;
- // Not run TPL for filtered Key frame.
- int disable_filtered_key_tpl;
-
// Prune reference frames in TPL.
int prune_ref_frames_in_tpl;
diff --git a/test/horz_superres_test.cc b/test/horz_superres_test.cc
index 323aa93..cba29e9 100644
--- a/test/horz_superres_test.cc
+++ b/test/horz_superres_test.cc
@@ -53,12 +53,12 @@
const TestVideoParam kTestVideoVectors[] = {
{ "park_joy_90p_8_420.y4m", AOM_IMG_FMT_I420, AOM_BITS_8, 0, 5, 0, 25.3,
- 45.0 },
+ 44.7 },
#if CONFIG_AV1_HIGHBITDEPTH
{ "park_joy_90p_10_444.y4m", AOM_IMG_FMT_I44416, AOM_BITS_10, 1, 5, 0, 27.0,
- 47.9 },
+ 46.8 },
#endif
- { "screendata.y4m", AOM_IMG_FMT_I420, AOM_BITS_8, 0, 4, 1, 23.0, 56.0 },
+ { "screendata.y4m", AOM_IMG_FMT_I420, AOM_BITS_8, 0, 4, 1, 23.0, 52.5 },
// Image coding (single frame).
{ "niklas_1280_720_30.y4m", AOM_IMG_FMT_I420, AOM_BITS_8, 0, 1, 0, 32.0,
49.0 },