From dfa33f224bc429159a4bc1652215acd000390765 Mon Sep 17 00:00:00 2001 From: "Nathan E. Egge" Date: Wed, 16 Nov 2016 09:44:26 -0500 Subject: [PATCH] Use inter_ext_tx_cdf with CONFIG_EC_MULTISYMBOL. Change-Id: I76259d6ec925a0c7024e7c70a517debe2d3bf1ab --- av1/common/entropymode.c | 16 ++++++++++------ av1/common/entropymode.h | 6 ++++-- av1/decoder/decodemv.c | 2 +- av1/decoder/decoder.c | 10 ++++++---- av1/encoder/bitstream.c | 6 ++++-- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c index 95d34485c..c0f42616e 100644 --- a/av1/common/entropymode.c +++ b/av1/common/entropymode.c @@ -1782,8 +1782,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { #if !CONFIG_EXT_TX av1_tree_to_cdf_2D(av1_ext_tx_tree, fc->intra_ext_tx_prob, fc->intra_ext_tx_cdf, EXT_TX_SIZES, TX_TYPES); - av1_tree_to_cdf_1D(av1_ext_tx_tree, fc->inter_ext_tx_prob, - fc->inter_ext_tx_cdf, EXT_TX_SIZES); #endif av1_tree_to_cdf_2D(av1_intra_mode_tree, av1_kf_y_mode_prob, av1_kf_y_mode_cdf, INTRA_MODES, INTRA_MODES); @@ -1791,6 +1789,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { #if CONFIG_EC_MULTISYMBOL av1_tree_to_cdf_1D(av1_partition_tree, fc->partition_prob, fc->partition_cdf, PARTITION_CONTEXTS); +#if !CONFIG_EXT_TX + av1_tree_to_cdf_1D(av1_ext_tx_tree, fc->inter_ext_tx_prob, + fc->inter_ext_tx_cdf, EXT_TX_SIZES); +#endif av1_tree_to_cdf(av1_segment_tree, fc->seg.tree_probs, fc->seg.tree_cdf); #endif #if CONFIG_DELTA_Q @@ -1815,6 +1817,12 @@ void av1_set_mode_cdfs(struct AV1Common *cm) { for (i = 0; i < PARTITION_CONTEXTS; ++i) av1_tree_to_cdf(av1_partition_tree, fc->partition_prob[i], fc->partition_cdf[i]); + +#if !CONFIG_EXT_TX + for (i = TX_4X4; i < EXT_TX_SIZES; ++i) + av1_tree_to_cdf(av1_ext_tx_tree, fc->inter_ext_tx_prob[i], + fc->inter_ext_tx_cdf[i]); +#endif #if CONFIG_DAALA_EC for (i = 0; i < INTRA_MODES; ++i) av1_tree_to_cdf(av1_intra_mode_tree, fc->uv_mode_prob[i], @@ -1841,10 +1849,6 @@ void av1_set_mode_cdfs(struct AV1Common *cm) { for (j = 0; j < TX_TYPES; ++j) av1_tree_to_cdf(av1_ext_tx_tree, fc->intra_ext_tx_prob[i][j], fc->intra_ext_tx_cdf[i][j]); - - for (i = TX_4X4; i < EXT_TX_SIZES; ++i) - av1_tree_to_cdf(av1_ext_tx_tree, fc->inter_ext_tx_prob[i], - fc->inter_ext_tx_cdf[i]); #endif #endif } diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h index c1b6d1be5..9ef1aa4fb 100644 --- a/av1/common/entropymode.h +++ b/av1/common/entropymode.h @@ -173,11 +173,13 @@ typedef struct frame_contexts { aom_cdf_prob inter_mode_cdf[INTER_MODE_CONTEXTS][INTER_MODES]; #if !CONFIG_EXT_TX aom_cdf_prob intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][TX_TYPES]; - aom_cdf_prob inter_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES]; #endif #endif #if CONFIG_EC_MULTISYMBOL aom_cdf_prob partition_cdf[PARTITION_CONTEXTS][PARTITION_TYPES]; +#if !CONFIG_EXT_TX + aom_cdf_prob inter_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES]; +#endif #endif #if CONFIG_DELTA_Q aom_prob delta_q_prob[DELTA_Q_CONTEXTS]; @@ -370,7 +372,7 @@ void av1_setup_past_independence(struct AV1Common *cm); void av1_adapt_intra_frame_probs(struct AV1Common *cm); void av1_adapt_inter_frame_probs(struct AV1Common *cm); -#if CONFIG_DAALA_EC && !CONFIG_EXT_TX +#if CONFIG_EC_MULTISYMBOL && !CONFIG_EXT_TX extern int av1_ext_tx_ind[TX_TYPES]; extern int av1_ext_tx_inv[TX_TYPES]; #endif diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c index 11b5bc890..be84cc301 100644 --- a/av1/decoder/decodemv.c +++ b/av1/decoder/decodemv.c @@ -742,7 +742,7 @@ static void read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd, !segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { FRAME_COUNTS *counts = xd->counts; if (inter_block) { -#if CONFIG_DAALA_EC +#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)]; #else diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c index e75ecc6b2..f497f164c 100644 --- a/av1/decoder/decoder.c +++ b/av1/decoder/decoder.c @@ -53,14 +53,16 @@ static void initialize_dec(void) { #if CONFIG_DAALA_EC av1_indices_from_tree(av1_switchable_interp_ind, av1_switchable_interp_inv, SWITCHABLE_FILTERS, av1_switchable_interp_tree); -#if !CONFIG_EXT_TX - av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, TX_TYPES, - av1_ext_tx_tree); -#endif av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv, INTRA_MODES, av1_intra_mode_tree); av1_indices_from_tree(av1_inter_mode_ind, av1_inter_mode_inv, INTER_MODES, av1_inter_mode_tree); +#endif +#if CONFIG_EC_MULTISYMBOL +#if !CONFIG_EXT_TX + av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, TX_TYPES, + av1_ext_tx_tree); +#endif #endif } } diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 0cb3bf147..a42435a3d 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c @@ -180,7 +180,7 @@ void av1_encode_token_init(void) { av1_switchable_restore_tree); #endif // CONFIG_LOOP_RESTORATION -#if CONFIG_DAALA_EC +#if CONFIG_EC_MULTISYMBOL /* This hack is necessary when CONFIG_EXT_INTERP is enabled because the five SWITCHABLE_FILTERS are not consecutive, e.g., 0, 1, 2, 3, 4, when doing an in-order traversal of the av1_switchable_interp_tree structure. */ @@ -193,6 +193,8 @@ void av1_encode_token_init(void) { av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, TX_TYPES, av1_ext_tx_tree); #endif +#endif +#if CONFIG_DAALA_EC av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv, INTRA_MODES, av1_intra_mode_tree); av1_indices_from_tree(av1_inter_mode_ind, av1_inter_mode_inv, INTER_MODES, @@ -1215,7 +1217,7 @@ static void write_tx_type(const AV1_COMMON *const cm, #endif // CONFIG_SUPERTX !segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { if (is_inter) { -#if CONFIG_DAALA_EC +#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); #else -- GitLab