Fix encode/decode mismatches for supertx + delta-q
This fixes the following mismatch bugs:
* At the bitstream level, the decoder would not read the delta_qindex
information for supertx blocks, but the encoder always sent it,
leading to the encoder and decoder becoming misaligned.
The delta_qindex information is still required for supertx blocks,
so change the decoder to read it.
* In addition, the quantizer was not properly adjusted for supertx
blocks at the decoder. We copy the quantizer setup code from
non-supertx blocks.
Since this does not change the encoder, it should not have any
quality impact.
Change-Id: I9a0f79c3aa66f2a5a353821e2a6f3b526636e7b4
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 15cdb58..4f16940 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1987,17 +1987,22 @@
mbmi->mv[1].as_int = 0;
mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r);
#if CONFIG_SUPERTX
- if (!supertx_enabled) {
+ if (!supertx_enabled)
#endif // CONFIG_SUPERTX
mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
+
#if CONFIG_DELTA_Q
- if (cm->delta_q_present_flag) {
- xd->current_qindex =
- xd->prev_qindex +
- read_delta_qindex(cm, xd, r, mbmi, mi_col, mi_row) * cm->delta_q_res;
- xd->prev_qindex = xd->current_qindex;
- }
+ if (cm->delta_q_present_flag) {
+ xd->current_qindex =
+ xd->prev_qindex +
+ read_delta_qindex(cm, xd, r, mbmi, mi_col, mi_row) * cm->delta_q_res;
+ xd->prev_qindex = xd->current_qindex;
+ }
#endif
+
+#if CONFIG_SUPERTX
+ if (!supertx_enabled) {
+#endif // CONFIG_SUPERTX
inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r);
#if CONFIG_VAR_TX