Add a new experiment of REF_ADAPT
Noticed that some ALTREF_FRAMEs could have used compound modes for its
prediction but have been labeled as SINGLE_REFERENCE mode in the frame
header. This experiment is to remove the COMPOUND_REFERENCE mode from
the frame-level reference mode choices and only leave SINGLE_REFERENCE
and REFERENCE_MODE_SELECT the two choices in the frame header.
When turning on both ext-refs and ref-adapt, compared against ext-refs
itself, a small gain is achieved. In PSNR, the bitrate saving gains are
as follows:
lowres: Avg -0.120%; BDRate -0.128%
midres: Avg -0.155%; BDRate -0.128%
Change-Id: I2cfff8a6b7eaa65ef863dbdbc4dd086d3b586f8c
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index a9e001e..651be21 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -236,9 +236,13 @@
static REFERENCE_MODE read_frame_reference_mode(
const AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
if (is_compound_reference_allowed(cm)) {
+#if CONFIG_REF_ADAPT
+ return aom_rb_read_bit(rb) ? REFERENCE_MODE_SELECT : SINGLE_REFERENCE;
+#else
return aom_rb_read_bit(rb)
? REFERENCE_MODE_SELECT
: (aom_rb_read_bit(rb) ? COMPOUND_REFERENCE : SINGLE_REFERENCE);
+#endif // CONFIG_REF_ADAPT
} else {
return SINGLE_REFERENCE;
}