aboutsummaryrefslogtreecommitdiff
path: root/c/common/constants.h
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas.ru@gmail.com>2020-08-26 12:32:27 +0200
committerGitHub <noreply@github.com>2020-08-26 12:32:27 +0200
commit223d80cfbec8fd346e32906c732c8ede21f0cea6 (patch)
treede47f73fd7323e327cd9c9f20100da8ed4e13f54 /c/common/constants.h
parent0c5603e07bed1d5fbb45e38f9bdf0e4560fde3f0 (diff)
downloadbrotli-223d80cfbec8fd346e32906c732c8ede21f0cea6.tar.gz
Update (#826)
* IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB * simplify max Huffman table size calculation * eliminate symbol duplicates (static arrays in .h files) * minor combing in research/ code
Diffstat (limited to 'c/common/constants.h')
-rw-r--r--c/common/constants.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/c/common/constants.h b/c/common/constants.h
index f6e44dc..e848195 100644
--- a/c/common/constants.h
+++ b/c/common/constants.h
@@ -13,6 +13,7 @@
#define BROTLI_COMMON_CONSTANTS_H_
#include "./platform.h"
+#include <brotli/port.h>
#include <brotli/types.h>
/* Specification: 7.3. Encoding of the context map */
@@ -84,6 +85,10 @@
(see kLargeWindowDistanceCodeLimits). */
#define BROTLI_MAX_ALLOWED_DISTANCE 0x7FFFFFFC
+
+/* Specification: 4. Encoding of Literal Insertion Lengths and Copy Lengths */
+#define BROTLI_NUM_INS_COPY_CODES 24
+
/* 7.1. Context modes and context ID lookup for literals */
/* "context IDs for literals are in the range of 0..63" */
#define BROTLI_LITERAL_CONTEXT_BITS 6
@@ -181,4 +186,15 @@ BROTLI_UNUSED_FUNCTION BrotliDistanceCodeLimit BrotliCalculateDistanceCodeLimit(
}
}
+/* Represents the range of values belonging to a prefix code:
+ [offset, offset + 2^nbits) */
+typedef struct {
+ uint16_t offset;
+ uint8_t nbits;
+} BrotliPrefixCodeRange;
+
+/* "Soft-private", it is exported, but not "advertised" as API. */
+BROTLI_COMMON_API extern const BrotliPrefixCodeRange
+ _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS];
+
#endif /* BROTLI_COMMON_CONSTANTS_H_ */