Make the signaling of allow_screen_content_tools consistent
in keyframe and all-intra frame.
Change-Id: I09d6f83efd3c4fe3f9a464d6a0e22e2e68220a8d
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 0288a20..83b7a22 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2816,13 +2816,6 @@
cm->use_prev_frame_mvs = 0;
#endif
} else {
- if (cm->intra_only) {
- cm->allow_screen_content_tools = aom_rb_read_bit(rb);
-#if CONFIG_INTRABC
- if (cm->allow_screen_content_tools)
- cm->allow_intrabc = aom_rb_read_bit(rb);
-#endif // CONFIG_INTRABC
- }
#if CONFIG_TEMPMV_SIGNALING
if (cm->intra_only || cm->error_resilient_mode) cm->use_prev_frame_mvs = 0;
#endif
@@ -2868,6 +2861,11 @@
#if CONFIG_ANS && ANS_MAX_SYMBOLS
cm->ans_window_size_log2 = aom_rb_read_literal(rb, 4) + 8;
#endif
+ cm->allow_screen_content_tools = aom_rb_read_bit(rb);
+#if CONFIG_INTRABC
+ if (cm->allow_screen_content_tools)
+ cm->allow_intrabc = aom_rb_read_bit(rb);
+#endif // CONFIG_INTRABC
} else if (pbi->need_resync != 1) { /* Skip if need resync */
#if CONFIG_OBU
pbi->refresh_frame_flags = (cm->frame_type == S_FRAME)
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 6d9b00f..ed6626e 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3700,13 +3700,6 @@
}
#endif
} else {
- if (cm->intra_only) {
- aom_wb_write_bit(wb, cm->allow_screen_content_tools);
-#if CONFIG_INTRABC
- if (cm->allow_screen_content_tools)
- aom_wb_write_bit(wb, cm->allow_intrabc);
-#endif // CONFIG_INTRABC
- }
#if !CONFIG_NO_FRAME_CONTEXT_SIGNALING
if (!cm->error_resilient_mode) {
if (cm->intra_only) {
@@ -3733,12 +3726,16 @@
write_frame_size(cm, wb);
#endif
write_sb_size(cm, wb);
-
#if CONFIG_ANS && ANS_MAX_SYMBOLS
assert(cpi->common.ans_window_size_log2 >= 8);
assert(cpi->common.ans_window_size_log2 < 24);
aom_wb_write_literal(wb, cpi->common.ans_window_size_log2 - 8, 4);
#endif // CONFIG_ANS && ANS_MAX_SYMBOLS
+ aom_wb_write_bit(wb, cm->allow_screen_content_tools);
+#if CONFIG_INTRABC
+ if (cm->allow_screen_content_tools)
+ aom_wb_write_bit(wb, cm->allow_intrabc);
+#endif // CONFIG_INTRABC
} else {
aom_wb_write_literal(wb, cpi->refresh_frame_mask, REF_FRAMES);