From: Paul Wilkins Date: Thu, 23 May 2013 14:44:45 +0000 (+0100) Subject: Fix bug in 4x4 band definition. X-Git-Tag: v1.3.0~1104^2~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e41fd6e3e23291f6ed189e5c601d33d7320c2950;p=libvpx Fix bug in 4x4 band definition. Also some unused data structures/references removed. Change-Id: I295809e887173543e794250cb60ddaf1475ffd24 --- diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c index d4d64b428..1b7da6cd5 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -35,35 +35,16 @@ DECLARE_ALIGNED(16, const uint8_t, vp9_norm[256]) = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -// Unified coefficient band structure used by all block sizes -DECLARE_ALIGNED(16, const int, vp9_coef_bands8x8[64]) = { - 0, 1, 2, 3, 4, 4, 5, 5, - 1, 2, 3, 4, 4, 5, 5, 5, - 2, 3, 4, 4, 5, 5, 5, 5, - 3, 4, 4, 5, 5, 5, 5, 5, - 4, 4, 5, 5, 5, 5, 5, 5, - 4, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5 -}; - DECLARE_ALIGNED(16, const uint8_t, vp9_coefband_trans_8x8plus[MAXBAND_INDEX + 1]) = { 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }; -DECLARE_ALIGNED(16, const int, vp9_coef_bands4x4[16]) = { - 0, 1, 2, 3, - 1, 2, 3, 4, - 2, 3, 4, 5, - 3, 4, 5, 5 -}; - DECLARE_ALIGNED(16, const uint8_t, vp9_coefband_trans_4x4[MAXBAND_INDEX + 1]) = { - 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 5 + 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, + 5, 5, 5, 5, 5, 5 }; DECLARE_ALIGNED(16, const uint8_t, vp9_pt_energy_class[MAX_ENTROPY_TOKENS]) = { diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index 2d8071c69..5d57f149e 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -134,17 +134,16 @@ static INLINE void vp9_reset_sb_tokens_context(MACROBLOCKD* const xd, } } -extern const int vp9_coef_bands8x8[64]; -extern const int vp9_coef_bands4x4[16]; -extern const uint8_t vp9_coefband_trans_8x8plus[22]; -extern const uint8_t vp9_coefband_trans_4x4[22]; - // This is the index in the scan order beyond which all coefficients for // 8x8 transform and above are in the top band. // For 4x4 blocks the index is less but to keep things common the lookup // table for 4x4 is padded out to this index. #define MAXBAND_INDEX 21 +extern const uint8_t vp9_coefband_trans_8x8plus[MAXBAND_INDEX + 1]; +extern const uint8_t vp9_coefband_trans_4x4[MAXBAND_INDEX + 1]; + + static int get_coef_band(const uint8_t * band_translate, int coef_index) { return (coef_index > MAXBAND_INDEX) ? (COEF_BANDS-1) : band_translate[coef_index]; diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c index a0263e699..02900c08c 100644 --- a/vp9/decoder/vp9_detokenize.c +++ b/vp9/decoder/vp9_detokenize.c @@ -58,8 +58,6 @@ static const vp9_prob cat6_prob[15] = { 254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 }; -DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]); - #define INCREMENT_COUNT(token) \ do { \ coef_counts[type][ref][band][pt] \