Commit e3f6978d authored by Thomas Davies's avatar Thomas Davies

NEW_MULTISYMBOL: support RECT_TX_EXT.

Change-Id: I0b6f56d2bf0482cfbf45525828d6daa6aea187e5
parent 05685a2f
......@@ -2309,6 +2309,9 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(palette_y_mode_cdf)
AVERAGE_TILE_CDFS(palette_uv_mode_cdf)
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
AVERAGE_TILE_CDFS(quarter_tx_size_cdf)
#endif
#endif
}
......
......@@ -2484,6 +2484,11 @@ static const int palette_color_index_context_lookup[MAX_COLOR_CONTEXT_HASH +
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
static const aom_prob default_quarter_tx_size_prob = 192;
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_quarter_tx_size_cdf[CDF_SIZE(2)] = {
AOM_ICDF(192 * 128), AOM_ICDF(32768), 0
};
#endif
#endif
#if CONFIG_LOOP_RESTORATION
......@@ -5583,6 +5588,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
fc->quarter_tx_size_prob = default_quarter_tx_size_prob;
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->quarter_tx_size_cdf, default_quarter_tx_size_cdf);
#endif // CONFIG_NEW_MULTISYMBOL
#endif
#if CONFIG_VAR_TX
av1_copy(fc->txfm_partition_prob, default_txfm_partition_probs);
......
......@@ -309,6 +309,9 @@ typedef struct frame_contexts {
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
aom_prob quarter_tx_size_prob;
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob quarter_tx_size_cdf[CDF_SIZE(2)];
#endif
#endif
#if CONFIG_VAR_TX
aom_prob txfm_partition_prob[TXFM_PARTITION_CONTEXTS];
......
......@@ -551,10 +551,14 @@ static TX_SIZE read_tx_size(AV1_COMMON *cm, MACROBLOCKD *xd, int is_inter,
int quarter_tx;
if (quarter_txsize_lookup[bsize] != max_txsize_lookup[bsize]) {
#if CONFIG_NEW_MULTISYMBOL
quarter_tx =
aom_read_symbol(r, cm->fc->quarter_tx_size_cdf, 2, ACCT_STR);
#else
quarter_tx = aom_read(r, cm->fc->quarter_tx_size_prob, ACCT_STR);
FRAME_COUNTS *counts = xd->counts;
if (counts) ++counts->quarter_tx_size[quarter_tx];
#endif
} else {
quarter_tx = 1;
}
......@@ -2970,8 +2974,13 @@ static void read_inter_frame_mode_info(AV1Decoder *const pbi,
int quarter_tx;
if (quarter_txsize_lookup[bsize] != max_tx_size) {
#if CONFIG_NEW_MULTISYMBOL
quarter_tx =
aom_read_symbol(r, cm->fc->quarter_tx_size_cdf, 2, ACCT_STR);
#else
quarter_tx = aom_read(r, cm->fc->quarter_tx_size_prob, ACCT_STR);
if (xd->counts) ++xd->counts->quarter_tx_size[quarter_tx];
#endif
} else {
quarter_tx = 1;
}
......
......@@ -381,8 +381,13 @@ static void write_selected_tx_size(const AV1_COMMON *cm, const MACROBLOCKD *xd,
tx_size_cat + 2);
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
if (is_quarter_tx_allowed(xd, mbmi, is_inter) && tx_size != coded_tx_size)
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol(w, tx_size == quarter_txsize_lookup[bsize],
cm->fc->quarter_tx_size_cdf, 2);
#else
aom_write(w, tx_size == quarter_txsize_lookup[bsize],
cm->fc->quarter_tx_size_prob);
#endif
#endif
}
}
......@@ -1791,8 +1796,13 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
quarter_txsize_lookup[bsize] != max_tx_size &&
(mbmi->tx_size == quarter_txsize_lookup[bsize] ||
mbmi->tx_size == max_tx_size)) {
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol(w, mbmi->tx_size != max_tx_size,
cm->fc->quarter_tx_size_cdf, 2);
#else
aom_write(w, mbmi->tx_size != max_tx_size,
cm->fc->quarter_tx_size_prob);
#endif
}
#endif
} else {
......
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