Commit cef09627 authored by Thomas Davies's avatar Thomas Davies
Browse files

EC_ADAPT: use tile context for TX size.

Change-Id: Idd7926f0539a0bd039828e5882392fbfb024e531
parent 472f63f4
......@@ -714,6 +714,12 @@ static void read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#else
const TX_SIZE tx_size = mbmi->tx_size;
#endif
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
if (!FIXED_TX_TYPE) {
#if CONFIG_EXT_TX
const TX_SIZE square_tx_size = txsize_sqr_map[tx_size];
......@@ -732,7 +738,7 @@ static void read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
if (eset > 0) {
mbmi->tx_type = aom_read_tree(
r, av1_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][square_tx_size], ACCT_STR);
ec_ctx->inter_ext_tx_prob[eset][square_tx_size], ACCT_STR);
if (counts)
++counts->inter_ext_tx[eset][square_tx_size][mbmi->tx_type];
}
......@@ -740,7 +746,7 @@ static void read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
if (eset > 0) {
mbmi->tx_type = aom_read_tree(
r, av1_ext_tx_intra_tree[eset],
cm->fc->intra_ext_tx_prob[eset][square_tx_size][mbmi->mode],
ec_ctx->intra_ext_tx_prob[eset][square_tx_size][mbmi->mode],
ACCT_STR);
if (counts)
++counts->intra_ext_tx[eset][square_tx_size][mbmi->mode]
......@@ -765,21 +771,21 @@ static void read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
if (inter_block) {
#if CONFIG_EC_MULTISYMBOL
mbmi->tx_type = av1_ext_tx_inv[aom_read_symbol(
r, cm->fc->inter_ext_tx_cdf[tx_size], TX_TYPES, ACCT_STR)];
r, ec_ctx->inter_ext_tx_cdf[tx_size], TX_TYPES, ACCT_STR)];
#else
mbmi->tx_type = aom_read_tree(
r, av1_ext_tx_tree, cm->fc->inter_ext_tx_prob[tx_size], ACCT_STR);
r, av1_ext_tx_tree, ec_ctx->inter_ext_tx_prob[tx_size], ACCT_STR);
#endif
if (counts) ++counts->inter_ext_tx[tx_size][mbmi->tx_type];
} else {
const TX_TYPE tx_type_nom = intra_mode_to_tx_type_context[mbmi->mode];
#if CONFIG_EC_MULTISYMBOL
mbmi->tx_type = av1_ext_tx_inv[aom_read_symbol(
r, cm->fc->intra_ext_tx_cdf[tx_size][tx_type_nom], TX_TYPES,
r, ec_ctx->intra_ext_tx_cdf[tx_size][tx_type_nom], TX_TYPES,
ACCT_STR)];
#else
mbmi->tx_type = aom_read_tree(
r, av1_ext_tx_tree, cm->fc->intra_ext_tx_prob[tx_size][tx_type_nom],
r, av1_ext_tx_tree, ec_ctx->intra_ext_tx_prob[tx_size][tx_type_nom],
ACCT_STR);
#endif
if (counts) ++counts->intra_ext_tx[tx_size][tx_type_nom][mbmi->tx_type];
......
......@@ -1170,6 +1170,12 @@ static void write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
#else
const TX_SIZE tx_size = mbmi->tx_size;
#endif // CONFIG_VAR_TX
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
if (!FIXED_TX_TYPE) {
#if CONFIG_EXT_TX
const TX_SIZE square_tx_size = txsize_sqr_map[tx_size];
......@@ -1187,7 +1193,7 @@ static void write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
assert(ext_tx_used_inter[eset][mbmi->tx_type]);
if (eset > 0) {
av1_write_token(w, av1_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][square_tx_size],
ec_ctx->inter_ext_tx_prob[eset][square_tx_size],
&ext_tx_inter_encodings[eset][mbmi->tx_type]);
}
} else if (ALLOW_INTRA_EXT_TX) {
......@@ -1195,7 +1201,7 @@ static void write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
if (eset > 0) {
av1_write_token(
w, av1_ext_tx_intra_tree[eset],
cm->fc->intra_ext_tx_prob[eset][square_tx_size][mbmi->mode],
ec_ctx->intra_ext_tx_prob[eset][square_tx_size][mbmi->mode],
&ext_tx_intra_encodings[eset][mbmi->tx_type]);
}
}
......@@ -1212,22 +1218,22 @@ static void write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
if (is_inter) {
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_ext_tx_ind[mbmi->tx_type],
cm->fc->inter_ext_tx_cdf[tx_size], TX_TYPES);
ec_ctx->inter_ext_tx_cdf[tx_size], TX_TYPES);
#else
av1_write_token(w, av1_ext_tx_tree, cm->fc->inter_ext_tx_prob[tx_size],
av1_write_token(w, av1_ext_tx_tree, ec_ctx->inter_ext_tx_prob[tx_size],
&ext_tx_encodings[mbmi->tx_type]);
#endif
} else {
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(
w, av1_ext_tx_ind[mbmi->tx_type],
cm->fc->intra_ext_tx_cdf[tx_size]
ec_ctx->intra_ext_tx_cdf[tx_size]
[intra_mode_to_tx_type_context[mbmi->mode]],
TX_TYPES);
#else
av1_write_token(
w, av1_ext_tx_tree,
cm->fc
ec_ctx
->intra_ext_tx_prob[tx_size]
[intra_mode_to_tx_type_context[mbmi->mode]],
&ext_tx_encodings[mbmi->tx_type]);
......
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