Jump-lookup for Huffman coding

speeds up those codes that are not part of the main lookup.
This gives a 10 % speedup for a photographic image.

Change-Id: Ief54b0ad77db790a01314402ad351b40ac9a7be4
This commit is contained in:
Jyrki Alakuijala
2013-06-27 08:58:56 +02:00
committed by skal
parent c34307abda
commit 699d80ea6b
3 changed files with 16 additions and 2 deletions

View File

@ -34,7 +34,8 @@ typedef struct HuffmanTree HuffmanTree;
struct HuffmanTree {
// Fast lookup for short bit lengths.
uint8_t lut_bits_[HUFF_LUT];
int lut_symbol_[HUFF_LUT];
int16_t lut_symbol_[HUFF_LUT];
int16_t lut_jump_[HUFF_LUT];
// Complete tree for lookups.
HuffmanTreeNode* root_; // all the nodes, starting at root.
int max_nodes_; // max number of nodes