diff options
Diffstat (limited to 'vp8/common/entropy.c')
-rw-r--r-- | vp8/common/entropy.c | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/vp8/common/entropy.c b/vp8/common/entropy.c index 0eee60ec8..ca37aab22 100644 --- a/vp8/common/entropy.c +++ b/vp8/common/entropy.c @@ -59,6 +59,24 @@ DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) = 9, 12, 13, 10, 7, 11, 14, 15, }; +#if CONFIG_T8X8 +DECLARE_ALIGNED(64, cuchar, vp8_coef_bands_8x8[64]) = { 0, 1, 2, 3, 5, 4, 4, 5, + 5, 3, 6, 3, 5, 4, 6, 6, + 6, 5, 5, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7 +}; +DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]) = +{ + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, +}; +#endif DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) = { @@ -69,6 +87,9 @@ DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) = }; DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]); +#if CONFIG_T8X8 +DECLARE_ALIGNED(64, short, vp8_default_zig_zag_mask_8x8[64]);//int64_t +#endif const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6}; @@ -99,9 +120,15 @@ static const Prob Pcat2[] = { 165, 145}; static const Prob Pcat3[] = { 173, 148, 140}; static const Prob Pcat4[] = { 176, 155, 140, 135}; static const Prob Pcat5[] = { 180, 157, 141, 134, 130}; +#if CONFIG_EXTEND_QRANGE +static const Prob Pcat6[] = +{ 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129}; +#else static const Prob Pcat6[] = { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129}; +#endif + static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22]; void vp8_init_scan_order_mask() @@ -112,7 +139,12 @@ void vp8_init_scan_order_mask() { vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; } - +#if CONFIG_T8X8 + for (i = 0; i < 64; i++) + { + vp8_default_zig_zag_mask_8x8[vp8_default_zig_zag1d_8x8[i]] = 1 << i; + } +#endif } static void init_bit_tree(vp8_tree_index *p, int n) @@ -135,7 +167,11 @@ static void init_bit_trees() init_bit_tree(cat3, 3); init_bit_tree(cat4, 4); init_bit_tree(cat5, 5); +#if CONFIG_EXTEND_QRANGE + init_bit_tree(cat6, 13); +#else init_bit_tree(cat6, 11); +#endif } vp8_extra_bit_struct vp8_extra_bits[12] = @@ -150,7 +186,11 @@ vp8_extra_bit_struct vp8_extra_bits[12] = { cat3, Pcat3, 3, 11}, { cat4, Pcat4, 4, 19}, { cat5, Pcat5, 5, 35}, +#if CONFIG_EXTEND_QRANGE + { cat6, Pcat6, 13, 67}, +#else { cat6, Pcat6, 11, 67}, +#endif { 0, 0, 0, 0} }; #include "defaultcoefcounts.h" @@ -183,6 +223,31 @@ void vp8_default_coef_probs(VP8_COMMON *pc) while (++i < COEF_BANDS); } while (++h < BLOCK_TYPES); +#if CONFIG_T8X8 + h = 0; + do + { + int i = 0; + + do + { + int k = 0; + + do + { + unsigned int branch_ct [ENTROPY_NODES] [2]; + vp8_tree_probs_from_distribution( + MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, + pc->fc.coef_probs_8x8 [h][i][k], branch_ct, vp8_default_coef_counts_8x8 [h][i][k], + 256, 1); + + } + while (++k < PREV_COEF_CONTEXTS); + } + while (++i < COEF_BANDS); + } + while (++h < BLOCK_TYPES); +#endif } |