Commit 15580c52 authored by Thomas Davies's avatar Thomas Davies Committed by Alex Converse

Fix bug with tx_size_coding for EC_ADAPT.

With EC_ADAPT, contexts should be tile-dependent.

Change-Id: I2b714a930ea4661115b1e419d0cb5eefc0ae5362
parent 1a0d5ea0
......@@ -420,13 +420,20 @@ static TX_SIZE read_selected_tx_size(AV1_COMMON *cm, MACROBLOCKD *xd,
int tx_size_cat, aom_reader *r) {
FRAME_COUNTS *counts = xd->counts;
const int ctx = get_tx_size_context(xd);
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
const int depth =
#if CONFIG_EC_MULTISYMBOL
aom_read_symbol(r, cm->fc->tx_size_cdf[tx_size_cat][ctx], tx_size_cat + 2,
aom_read_symbol(r, ec_ctx->tx_size_cdf[tx_size_cat][ctx], tx_size_cat + 2,
ACCT_STR);
#else
aom_read_tree(r, av1_tx_size_tree[tx_size_cat],
cm->fc->tx_size_probs[tx_size_cat][ctx], ACCT_STR);
ec_ctx->tx_size_probs[tx_size_cat][ctx], ACCT_STR);
#endif
const TX_SIZE tx_size = depth_to_tx_size(depth);
#if CONFIG_RECT_TX
......
......@@ -446,6 +446,12 @@ static void write_selected_tx_size(const AV1_COMMON *cm, const MACROBLOCKD *xd,
aom_writer *w) {
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
// For sub8x8 blocks the tx_size symbol does not need to be sent
#if CONFIG_CB4X4 && (CONFIG_VAR_TX || CONFIG_RECT_TX)
#if CONFIG_RECT_TX
......@@ -470,11 +476,11 @@ static void write_selected_tx_size(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, depth, cm->fc->tx_size_cdf[tx_size_cat][tx_size_ctx],
aom_write_symbol(w, depth, ec_ctx->tx_size_cdf[tx_size_cat][tx_size_ctx],
tx_size_cat + 2);
#else
av1_write_token(w, av1_tx_size_tree[tx_size_cat],
cm->fc->tx_size_probs[tx_size_cat][tx_size_ctx],
ec_ctx->tx_size_probs[tx_size_cat][tx_size_ctx],
&tx_size_encodings[tx_size_cat][depth]);
#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