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

@ -165,6 +165,10 @@ static WEBP_INLINE int ReadSymbol(const HuffmanTree* tree,
VP8LSetBitPos(br, bitpos + lut_bits);
return tree->lut_symbol_[lut_ix];
}
node += tree->lut_jump_[lut_ix];
bitpos += HUFF_LUT_BITS;
bits >>= HUFF_LUT_BITS;
// Decode the value from a binary tree.
assert(node != NULL);
while (HuffmanTreeNodeIsNotLeaf(node)) {