Commit 580943a7 authored by Rupert Swarbrick's avatar Rupert Swarbrick

supertx: Read and write transforms with CDF in decode_partition

Patch b1bedf5f converted the three writes in bitstream.c that
specify an extended transform from using av1_write_token (encoded with
probability trees) to aom_write_symbol (encoded with CDFs).

That patch fixed up the two reads in decodemv.c but didn't fix up the
corresponding read in decodeframe.c. This patch does so.

The patch also fixes up a write of a (non-extended) transform when not
CONFIG_EXT_TX and the corresponding read.

Change-Id: Ibf5dcfcf3e7122f08dd0ef8616fb0ecddb95d99a
parent e3b81bcf
......@@ -2589,22 +2589,28 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd,
if (skip) {
av1_reset_skip_context(xd, mi_row, mi_col, bsize);
} else {
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1, cm->reduced_tx_set_used) >
1) {
const int eset =
get_ext_tx_set(supertx_size, bsize, 1, cm->reduced_tx_set_used);
if (eset > 0) {
txfm = aom_read_tree(r, av1_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][supertx_size],
ACCT_STR);
const int packed_sym =
aom_read_symbol(r, ec_ctx->inter_ext_tx_cdf[eset][supertx_size],
ext_tx_cnt_inter[eset], ACCT_STR);
txfm = av1_ext_tx_inter_inv[eset][packed_sym];
if (xd->counts) ++xd->counts->inter_ext_tx[eset][supertx_size][txfm];
}
}
#else
if (supertx_size < TX_32X32) {
txfm = aom_read_tree(r, av1_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size], ACCT_STR);
txfm = aom_read_symbol(r, ec_ctx->inter_ext_tx_cdf[supertx_size],
TX_TYPES, ACCT_STR);
if (xd->counts) ++xd->counts->inter_ext_tx[supertx_size][txfm];
}
#endif // CONFIG_EXT_TX
......
......@@ -3149,17 +3149,19 @@ static void write_modes_sb(AV1_COMP *const cpi, const TileInfo *const tile,
assert(mbmi->segment_id_supertx < MAX_SEGMENTS);
skip = write_skip(cm, xd, mbmi->segment_id_supertx, xd->mi[0], w);
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1, cm->reduced_tx_set_used) > 1 &&
!skip) {
const int eset =
get_ext_tx_set(supertx_size, bsize, 1, cm->reduced_tx_set_used);
if (eset > 0) {
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
aom_write_symbol(w, av1_ext_tx_inter_ind[eset][mbmi->tx_type],
ec_ctx->inter_ext_tx_cdf[eset][supertx_size],
ext_tx_cnt_inter[eset]);
......@@ -3167,9 +3169,8 @@ static void write_modes_sb(AV1_COMP *const cpi, const TileInfo *const tile,
}
#else
if (supertx_size < TX_32X32 && !skip) {
av1_write_token(w, av1_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size],
&ext_tx_encodings[mbmi->tx_type]);
aom_write_symbol(w, mbmi->tx_type, ec_ctx->inter_ext_tx_cdf[supertx_size],
TX_TYPES);
}
#endif // CONFIG_EXT_TX
......
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