]>
Commit | Line | Data |
---|---|---|
11b7501a SB |
1 | /* Copyright 2016 Google Inc. All Rights Reserved.\r |
2 | \r | |
3 | Distributed under MIT license.\r | |
4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT\r | |
5 | */\r | |
6 | \r | |
7 | #ifndef BROTLI_COMMON_CONSTANTS_H_\r | |
8 | #define BROTLI_COMMON_CONSTANTS_H_\r | |
9 | \r | |
10 | /* Specification: 7.3. Encoding of the context map */\r | |
11 | #define BROTLI_CONTEXT_MAP_MAX_RLE 16\r | |
12 | \r | |
13 | /* Specification: 2. Compressed representation overview */\r | |
14 | #define BROTLI_MAX_NUMBER_OF_BLOCK_TYPES 256\r | |
15 | \r | |
16 | /* Specification: 3.3. Alphabet sizes: insert-and-copy length */\r | |
17 | #define BROTLI_NUM_LITERAL_SYMBOLS 256\r | |
18 | #define BROTLI_NUM_COMMAND_SYMBOLS 704\r | |
19 | #define BROTLI_NUM_BLOCK_LEN_SYMBOLS 26\r | |
20 | #define BROTLI_MAX_CONTEXT_MAP_SYMBOLS (BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + \\r | |
21 | BROTLI_CONTEXT_MAP_MAX_RLE)\r | |
22 | #define BROTLI_MAX_BLOCK_TYPE_SYMBOLS (BROTLI_MAX_NUMBER_OF_BLOCK_TYPES + 2)\r | |
23 | \r | |
24 | /* Specification: 3.5. Complex prefix codes */\r | |
25 | #define BROTLI_REPEAT_PREVIOUS_CODE_LENGTH 16\r | |
26 | #define BROTLI_REPEAT_ZERO_CODE_LENGTH 17\r | |
27 | #define BROTLI_CODE_LENGTH_CODES (BROTLI_REPEAT_ZERO_CODE_LENGTH + 1)\r | |
28 | /* "code length of 8 is repeated" */\r | |
29 | #define BROTLI_INITIAL_REPEATED_CODE_LENGTH 8\r | |
30 | \r | |
31 | /* Specification: 4. Encoding of distances */\r | |
32 | #define BROTLI_NUM_DISTANCE_SHORT_CODES 16\r | |
33 | #define BROTLI_MAX_NPOSTFIX 3\r | |
34 | #define BROTLI_MAX_NDIRECT 120\r | |
35 | /* BROTLI_NUM_DISTANCE_SYMBOLS == 520 */\r | |
36 | #define BROTLI_NUM_DISTANCE_SYMBOLS (BROTLI_NUM_DISTANCE_SHORT_CODES + \\r | |
37 | BROTLI_MAX_NDIRECT + \\r | |
38 | (24 << (BROTLI_MAX_NPOSTFIX + 1)))\r | |
39 | \r | |
40 | /* 7.1. Context modes and context ID lookup for literals */\r | |
41 | /* "context IDs for literals are in the range of 0..63" */\r | |
42 | #define BROTLI_LITERAL_CONTEXT_BITS 6\r | |
43 | \r | |
44 | /* 7.2. Context ID for distances */\r | |
45 | #define BROTLI_DISTANCE_CONTEXT_BITS 2\r | |
46 | \r | |
47 | #endif /* BROTLI_COMMON_CONSTANTS_H_ */\r |