From: Jim Bankoski Date: Mon, 22 Dec 2014 23:05:25 +0000 (-0800) Subject: Merge "make vp9_coef_encodings const" X-Git-Tag: v1.4.0~307 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e04fa6dea716d4dafdb8a1d1dedc15455cddf3b;p=libvpx Merge "make vp9_coef_encodings const" --- 4e04fa6dea716d4dafdb8a1d1dedc15455cddf3b diff --cc vp9/encoder/vp9_tokenize.c index 06bcfc317,a0cfb34b3..54b2594e7 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@@ -175,20 -152,37 +175,19 @@@ const vp9_extra_bit vp9_extra_bits_high }; #endif - struct vp9_token vp9_coef_encodings[ENTROPY_TOKENS]; - - void vp9_coef_tree_initialize() { - vp9_tokens_from_tree(vp9_coef_encodings, vp9_coef_tree); - } + const struct vp9_token vp9_coef_encodings[ENTROPY_TOKENS] = { + {2, 2}, {6, 3}, {28, 5}, {58, 6}, {59, 6}, {60, 6}, {61, 6}, {124, 7}, + {125, 7}, {126, 7}, {127, 7}, {0, 1} + }; -static void tokenize_init_one(TOKENVALUE *t, const vp9_extra_bit *const e, +static void tokenize_init_one(const vp9_extra_bit *const e, int16_t *value_cost, int max_value) { int i = -max_value; - int sign = 1; + TOKENVALUE t; do { - if (!i) - sign = 0; - - { - const int a = sign ? -i : i; - int eb = sign; - - if (a > 4) { - int j = 4; - - while (++j < 11 && e[j].base_val <= a) {} - - t[i].token = --j; - eb |= (a - e[j].base_val) << 1; - } else { - t[i].token = a; - } - t[i].extra = eb; - } + vp9_get_token_extra(i, &t.token, &t.extra); // initialize the cost for extra bits for all possible coefficient value. { int cost = 0;