Speed up ref selection by enforcing max 6 frames
A speedup feature that enforces the maximum number of reference frames
to evaluate for each arbitrary frame to be 6, as opposed to the maximum
syntax-allowed number of reference frames which is 7, through the
following rules:
(1) When all the possible reference frames are availble, we reduce the
number of reference frames (7) by 1 by removing one reference
frame;
(2) Always retain GOLDEN_FARME/ALTEF_FRAME;
(3) Check the earliest 2 remaining reference frames, and there are two
options to remove one reference frame:
(a) Remove the one with the lower quality factor; Otherwise if
both frames have been coded at the same quality level, remove the
earliest reference frame;
(b) Always remove the earliest reference frame.
Currently set option (a).
This patch has demonstrated an encoder speedup of ~8.5%. It is under
speed2 with "selective_ref_frame >= 2". (May be considered to move
to speed1 later once the coding performance impact is evaluated
further.)
Using the following configure setups, the coding performance has been
dropped on Google test sets (50 frames) in BDRate by ~0.2% for lowres
and by ~0.1% for midres:
--enable-experimental --disable-convolve-round --disable-ext-partition
--disable-ext-partition-types --disable-txk-sel --disable-txm
Change-Id: I84317bae00bfd90b2c3d301858a849f441974e6f
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index c61316d..c2a4c3d 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -470,6 +470,9 @@
int mbgraph_n_frames; // number of frames filled in the above
int static_mb_pct; // % forced skip mbs by segmentation
int ref_frame_flags;
+#if CONFIG_FRAME_MARKER
+ RATE_FACTOR_LEVEL frame_rf_level[FRAME_BUFFERS];
+#endif // CONFIG_FRAME_MARKER
SPEED_FEATURES sf;