Commit 1b1dc936 authored by Jingning Han's avatar Jingning Han
Browse files

Reset the txfm context to match block size when skip flag is on

Reset the transform block size context to the actual block size
if the skip flag is turned on.

Change-Id: I821afac2dcd4c3a17389e9954b7b2575f87d07d7
parent 49eea11c
......@@ -775,9 +775,15 @@ static INLINE void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, uint8_t txs, int len) {
}
static INLINE void set_txfm_ctxs(TX_SIZE tx_size, int n8_w, int n8_h,
const MACROBLOCKD *xd) {
const int skip, const MACROBLOCKD *xd) {
uint8_t bw = tx_size_wide[tx_size];
uint8_t bh = tx_size_high[tx_size];
if (skip) {
bw = n8_w * 8;
bh = n8_h * 8;
}
set_txfm_ctx(xd->above_txfm_context, bw, n8_w);
set_txfm_ctx(xd->left_txfm_context, bh, n8_h);
}
......
......@@ -1886,7 +1886,7 @@ static void read_inter_frame_mode_info(AV1Decoder *const pbi,
mbmi->inter_tx_size[idy >> 1][idx >> 1] = mbmi->tx_size;
}
mbmi->min_tx_size = get_min_tx_size(mbmi->tx_size);
set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, mbmi->skip, xd);
}
#else
if (inter_block)
......
......@@ -1305,11 +1305,11 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
}
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
} else {
set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, skip, xd);
write_selected_tx_size(cm, xd, w);
}
} else {
set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, skip, xd);
#else
write_selected_tx_size(cm, xd, w);
#endif
......
......@@ -5492,7 +5492,7 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
else
tx_size = (bsize >= BLOCK_8X8) ? tx_size : TX_4X4;
mbmi->tx_size = tx_size;
set_txfm_ctxs(tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctxs(tx_size, xd->n8_w, xd->n8_h, (mbmi->skip || seg_skip), xd);
}
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment