Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: third_party/libwebp/utils/huffman.h

Issue 116213006: Update libwebp to 0.4.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: After Blink Roll Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libwebp/utils/filters.c ('k') | third_party/libwebp/utils/huffman.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libwebp/utils/huffman.h
diff --git a/third_party/libwebp/utils/huffman.h b/third_party/libwebp/utils/huffman.h
index 83a517ee60dd1421cbeebf488e6684dcad7e8242..e8afd27f24468a931d8d94058d8c71e5f42f7108 100644
--- a/third_party/libwebp/utils/huffman.h
+++ b/third_party/libwebp/utils/huffman.h
@@ -17,7 +17,7 @@
#include <assert.h>
#include "../webp/types.h"
-#if defined(__cplusplus) || defined(c_plusplus)
+#ifdef __cplusplus
extern "C" {
#endif
@@ -28,17 +28,24 @@ typedef struct {
} HuffmanTreeNode;
// Huffman Tree.
+#define HUFF_LUT_BITS 7
+#define HUFF_LUT (1U << HUFF_LUT_BITS)
typedef struct HuffmanTree HuffmanTree;
struct HuffmanTree {
+ // Fast lookup for short bit lengths.
+ uint8_t lut_bits_[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
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.
@@ -73,7 +80,7 @@ int HuffmanCodeLengthsToCodes(const int* const code_lengths,
int code_lengths_size, int* const huff_codes);
-#if defined(__cplusplus) || defined(c_plusplus)
+#ifdef __cplusplus
} // extern "C"
#endif
« no previous file with comments | « third_party/libwebp/utils/filters.c ('k') | third_party/libwebp/utils/huffman.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698