diff options
Diffstat (limited to 'third_party/aom/av1/common/entropy.h')
-rw-r--r-- | third_party/aom/av1/common/entropy.h | 74 |
1 files changed, 52 insertions, 22 deletions
diff --git a/third_party/aom/av1/common/entropy.h b/third_party/aom/av1/common/entropy.h index b02d41bff..49d5f6c57 100644 --- a/third_party/aom/av1/common/entropy.h +++ b/third_party/aom/av1/common/entropy.h @@ -32,10 +32,6 @@ extern "C" { #define QCTX_BINS (1 << QCTX_BIN_BITS) #endif // CONFIG_Q_ADAPT_PROBS -#if CONFIG_SUBFRAME_PROB_UPDATE -#define COEF_PROBS_BUFS 16 -#endif // CONFIG_SUBFRAME_PROB_UPDATE - // Coefficient token alphabet #define ZERO_TOKEN 0 // 0 Extra Bits 0+0 #define ONE_TOKEN 1 // 1 Extra Bits 0+1 @@ -49,18 +45,16 @@ extern "C" { #define CATEGORY5_TOKEN 9 // 35-66 Extra Bits 5+1 #define CATEGORY6_TOKEN 10 // 67+ Extra Bits 14+1 #define EOB_TOKEN 11 // EOB Extra Bits 0+0 -#if CONFIG_NEW_TOKENSET -#define NO_EOB 0 // Not an end-of-block -#define EARLY_EOB 1 // End of block before the last position -#define LAST_EOB 2 // End of block in the last position (implicit) -#define BLOCK_Z_TOKEN 255 // block zero +#define NO_EOB 0 // Not an end-of-block +#define EARLY_EOB 1 // End of block before the last position +#define LAST_EOB 2 // End of block in the last position (implicit) +#define BLOCK_Z_TOKEN 255 // block zero #define HEAD_TOKENS 5 #define TAIL_TOKENS 9 #define ONE_TOKEN_EOB 1 #define ONE_TOKEN_NEOB 2 #define TWO_TOKEN_PLUS_EOB 3 #define TWO_TOKEN_PLUS_NEOB 4 -#endif #define ENTROPY_TOKENS 12 #define ENTROPY_NODES 11 @@ -131,7 +125,7 @@ static INLINE int av1_get_cat6_extrabits_size(TX_SIZE tx_size, // TODO(debargha): Does TX_64X64 require an additional extrabit? if (tx_size > TX_32X32) tx_size = TX_32X32; #endif -#if CONFIG_CB4X4 +#if CONFIG_CHROMA_2X2 int tx_offset = (tx_size < TX_4X4) ? 0 : (int)(tx_size - TX_4X4); #else int tx_offset = (int)(tx_size - TX_4X4); @@ -175,9 +169,7 @@ static INLINE int av1_get_cat6_extrabits_size(TX_SIZE tx_size, distinct bands). */ #define COEFF_CONTEXTS 6 -#if CONFIG_EC_MULTISYMBOL #define BLOCKZ_CONTEXTS 3 -#endif #define COEFF_CONTEXTS0 3 // for band 0 #define BAND_COEFF_CONTEXTS(band) \ ((band) == 0 ? COEFF_CONTEXTS0 : COEFF_CONTEXTS) @@ -199,9 +191,6 @@ void av1_adapt_coef_probs(struct AV1Common *cm); #if CONFIG_EC_ADAPT void av1_adapt_coef_cdfs(struct AV1Common *cm, struct frame_contexts *pre_fc); #endif -#if CONFIG_SUBFRAME_PROB_UPDATE -void av1_partial_adapt_probs(struct AV1Common *cm, int mi_row, int mi_col); -#endif // CONFIG_SUBFRAME_PROB_UPDATE // This is the index in the scan order beyond which all coefficients for // 8x8 transform and above are in the top band. @@ -250,7 +239,6 @@ typedef unsigned int av1_coeff_count_model[REF_TYPES][COEF_BANDS] void av1_model_to_full_probs(const aom_prob *model, aom_prob *full); -#if CONFIG_EC_MULTISYMBOL typedef aom_cdf_prob coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] [CDF_SIZE(ENTROPY_TOKENS)]; typedef aom_prob av1_blockz_probs_model[REF_TYPES][BLOCKZ_CONTEXTS]; @@ -260,11 +248,9 @@ extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS] extern const aom_cdf_prob av1_pareto8_tail_probs[COEFF_PROB_MODELS] [ENTROPY_TOKENS - 3]; struct frame_contexts; -#if CONFIG_NEW_TOKENSET + void av1_coef_head_cdfs(struct frame_contexts *fc); -#endif void av1_coef_pareto_cdfs(struct frame_contexts *fc); -#endif // CONFIG_EC_MULTISYMBOL typedef char ENTROPY_CONTEXT; @@ -277,7 +263,7 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, const ENTROPY_CONTEXT *l) { ENTROPY_CONTEXT above_ec = 0, left_ec = 0; -#if CONFIG_CB4X4 +#if CONFIG_CHROMA_2X2 switch (tx_size) { case TX_2X2: above_ec = a[0] != 0; @@ -323,10 +309,36 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8)); left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8)); break; +#if CONFIG_TX64X64 + case TX_64X64: + above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8) | + *(const uint64_t *)(a + 16) | *(const uint64_t *)(a + 24)); + left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8) | + *(const uint64_t *)(l + 16) | *(const uint64_t *)(l + 24)); + break; +#endif // CONFIG_TX64X64 +#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT + case TX_4X16: + above_ec = !!*(const uint16_t *)a; + left_ec = !!*(const uint64_t *)l; + break; + case TX_16X4: + above_ec = !!*(const uint64_t *)a; + left_ec = !!*(const uint16_t *)l; + break; + case TX_8X32: + above_ec = !!*(const uint32_t *)a; + left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8)); + break; + case TX_32X8: + above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8)); + left_ec = !!*(const uint32_t *)l; + break; +#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT default: assert(0 && "Invalid transform size."); break; } return combine_entropy_contexts(above_ec, left_ec); -#endif +#endif // CONFIG_CHROMA_2X2 switch (tx_size) { case TX_4X4: @@ -375,6 +387,24 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8)); break; #endif // CONFIG_TX64X64 +#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT + case TX_4X16: + above_ec = a[0] != 0; + left_ec = !!*(const uint32_t *)l; + break; + case TX_16X4: + above_ec = !!*(const uint32_t *)a; + left_ec = l[0] != 0; + break; + case TX_8X32: + above_ec = !!*(const uint16_t *)a; + left_ec = !!*(const uint64_t *)l; + break; + case TX_32X8: + above_ec = !!*(const uint64_t *)a; + left_ec = !!*(const uint16_t *)l; + break; +#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT default: assert(0 && "Invalid transform size."); break; } return combine_entropy_contexts(above_ec, left_ec); |