[NORMATIVE] Move frame_offset setup upwards
This CL is to set up the frame_offset (which is OrderHint in the spec)
earlier, inside the read_uncompressed_header(), as is needed by the
later handling of frame_refs_short_signaling.
BUG=aomedia:1484
Change-Id: Ie5d85c1caa36354ec3f98129eb247eb700389081
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 11512a4..0f4334a 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3083,6 +3083,17 @@
cm->frame_refs_short_signaling = 0;
#endif // CONFIG_FRAME_REFS_SIGNALING
+ 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]);
+ 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);
+ aom_wb_write_literal(wb, arf_offset, FRAME_OFFSET_BITS);
+ }
+
if (cm->frame_type == KEY_FRAME) {
write_frame_size(cm, frame_size_override_flag, wb);
assert(av1_superres_unscaled(cm) ||
@@ -3234,17 +3245,6 @@
}
}
- 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]);
- 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);
- aom_wb_write_literal(wb, arf_offset, FRAME_OFFSET_BITS);
- }
-
if (cm->seq_params.frame_id_numbers_present_flag) {
cm->refresh_mask =
cm->frame_type == KEY_FRAME ? 0xFF : get_refresh_mask(cpi);