Speedup for decoding lossless WebP photographs:

use bit_pos instead num_bit to update the bit-reader
37.69 MB/s -> 39.79 MB/s, 5.6 %

Change-Id: Ica476cc3e2fc2db084d6961bea8586b050bb221d
This commit is contained in:
skal
2013-06-18 17:26:52 +02:00
parent 24ee098a00
commit 313d853fa9
4 changed files with 13 additions and 12 deletions

View File

@ -35,10 +35,10 @@ struct HuffmanTree {
int num_nodes_; // number of currently occupied nodes
};
// Returns true if the given node is a leaf of the Huffman tree.
static WEBP_INLINE int HuffmanTreeNodeIsLeaf(
// Returns true if the given node is not a leaf of the Huffman tree.
static WEBP_INLINE int HuffmanTreeNodeIsNotLeaf(
const HuffmanTreeNode* const node) {
return (node->children_ == 0);
return node->children_;
}
// Go down one level. Most critical function. 'right_child' must be 0 or 1.