Add frame index to the decoded frames
Add frame index to the deocded frames. Store such information to
the reference frame buffer pool. This design allows each frame
to know its index in natural order, as well as its reference
frames positions.
Change-Id: I5bb36928dc5750a4fdcc582dca0d244d6482f400
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 54ad2df..cbb78da 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -4443,6 +4443,21 @@
}
}
+#if CONFIG_MFMV
+ if (cm->show_frame == 0) {
+ int arf_offset = AOMMIN(
+ (MAX_GF_INTERVAL - 1),
+ cpi->twopass.gf_group.arf_src_offset[cpi->twopass.gf_group.index]);
+#if CONFIG_EXT_REFS
+ int brf_offset =
+ cpi->twopass.gf_group.brf_src_offset[cpi->twopass.gf_group.index];
+
+ arf_offset = AOMMIN((MAX_GF_INTERVAL - 1), arf_offset + brf_offset);
+#endif
+ aom_wb_write_literal(wb, arf_offset, 4);
+ }
+#endif
+
#if CONFIG_REFERENCE_BUFFER
cm->refresh_mask = cm->frame_type == KEY_FRAME ? 0xFF : get_refresh_mask(cpi);
#endif