Support ext-skip for both low delay and high delay
For both low delay and high delay scenarios, the reference pair in
skip mode are specified as the closest fwd ref, together with the
closest bwd ref if there is any bwd ref, otherwise with the two
closest fwd refs.
Skip mode by default uses COMPOUND_AVERAGE. When all the reference
frames are on the same side, temporal-distance weighted compound is
considered, and a compound index is signaled to indicate whether
distance-weighted compound or compound-average is usd.
Whether to use distance-weighted compound for skip mode is still
under experimenting, hence a flag is temporarily added:
SKIP_MODE_WITH_JNT_COMP.
Following experimental results are obtained over 30 frames, using the
setup of --disable-ext-partition --disable-ext-partition-types
--disable-txmg --enable-jnt-comp --enable-mfmv --enable-ext-skip:
(1) High Latency:
For Google test sets (lowres/midres), the BDRate coding gain is ~0.2%;
For AWCY, the coding gain is ~0.1%.
(2) Low Latency:
No gain has been observed over Google sets and ~0.1% gain is obtained
only when temporal-distance weighted prediction is used.
Change-Id: I8c433357adebed0126ebfdd5c4d51aa71e64be57
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 8f5eec5..99ee4f6 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1410,7 +1410,19 @@
}
#if CONFIG_EXT_SKIP
- if (mbmi->skip_mode) return;
+ if (mbmi->skip_mode) {
+#if CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
+ const int cur_offset = (int)cm->frame_offset;
+ const int cur_to_fwd = cur_offset - cm->ref_frame_idx_0;
+ const int cur_to_bwd = abs(cm->ref_frame_idx_1 - cur_offset);
+ if (cur_to_fwd != cur_to_bwd && xd->all_one_sided_refs) {
+ const int comp_index_ctx = get_comp_index_context(cm, xd);
+ aom_write_symbol(w, mbmi->compound_idx,
+ ec_ctx->compound_index_cdf[comp_index_ctx], 2);
+ }
+#endif // CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
+ return;
+ }
#endif // CONFIG_EXT_SKIP
if (!is_inter) {
@@ -4305,7 +4317,11 @@
arf_offset = AOMMIN((MAX_GF_INTERVAL - 1), arf_offset + brf_offset);
aom_wb_write_literal(wb, arf_offset, FRAME_OFFSET_BITS);
}
-#endif
+
+#if CONFIG_EXT_SKIP
+ if (cm->is_skip_mode_allowed) aom_wb_write_bit(wb, cm->skip_mode_flag);
+#endif // CONFIG_EXT_SKIP
+#endif // CONFIG_FRAME_MARKER
#if CONFIG_REFERENCE_BUFFER
if (cm->seq_params.frame_id_numbers_present_flag) {