ref: 147b125b1596df9bd0c8141b9d09229ab65d3e0f
parent: 746439ef6c1dd2fedbe0c24ddb76d40cb9d26357
author: John Koleszar <jkoleszar@google.com>
date: Thu Sep 16 06:00:04 EDT 2010
Reduce size of tokenizer tables This patch reduces the size of the global tables maintained by the tokenizer to 16k from 80k-96k. See issue #177. Change-Id: If0275d5f28389af11ac83c5d929d1157cde90fbe
--- a/vp8/encoder/tokenize.c
+++ b/vp8/encoder/tokenize.c
@@ -26,8 +26,8 @@
void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) ;
void vp8_fix_contexts(MACROBLOCKD *x);
-TOKENEXTRA vp8_dct_value_tokens[DCT_MAX_VALUE*2];
-const TOKENEXTRA *vp8_dct_value_tokens_ptr;
+TOKENVALUE vp8_dct_value_tokens[DCT_MAX_VALUE*2];
+const TOKENVALUE *vp8_dct_value_tokens_ptr;
int vp8_dct_value_cost[DCT_MAX_VALUE*2];
const int *vp8_dct_value_cost_ptr;
#if 0
@@ -37,7 +37,7 @@
static void fill_value_tokens()
{
- TOKENEXTRA *const t = vp8_dct_value_tokens + DCT_MAX_VALUE;
+ TOKENVALUE *const t = vp8_dct_value_tokens + DCT_MAX_VALUE;
vp8_extra_bit_struct *const e = vp8_extra_bits;
int i = -DCT_MAX_VALUE;
--- a/vp8/encoder/tokenize.h
+++ b/vp8/encoder/tokenize.h
@@ -19,6 +19,12 @@
typedef struct
{
+ short Token;
+ short Extra;
+} TOKENVALUE;
+
+typedef struct
+{
int Token;
int Extra;
const vp8_prob *context_tree;
@@ -40,6 +46,6 @@
* improve cache locality, since it's needed for costing when the rest of the
* fields are not.
*/
-extern const TOKENEXTRA *vp8_dct_value_tokens_ptr;
+extern const TOKENVALUE *vp8_dct_value_tokens_ptr;
#endif /* tokenize_h */