OLD | NEW |
1 /* Copyright 2015 Google Inc. All Rights Reserved. | 1 /* Copyright 2015 Google Inc. All Rights Reserved. |
2 | 2 |
3 Distributed under MIT license. | 3 Distributed under MIT license. |
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT | 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
5 */ | 5 */ |
6 | 6 |
7 // Static entropy codes used for faster meta-block encoding. | 7 /* Static entropy codes used for faster meta-block encoding. */ |
8 | 8 |
9 #ifndef BROTLI_ENC_ENTROPY_ENCODE_STATIC_H_ | 9 #ifndef BROTLI_ENC_ENTROPY_ENCODE_STATIC_H_ |
10 #define BROTLI_ENC_ENTROPY_ENCODE_STATIC_H_ | 10 #define BROTLI_ENC_ENTROPY_ENCODE_STATIC_H_ |
11 | 11 |
12 #include "./prefix.h" | 12 #include "../common/constants.h" |
13 #include "./types.h" | 13 #include <brotli/port.h> |
| 14 #include <brotli/types.h> |
14 #include "./write_bits.h" | 15 #include "./write_bits.h" |
15 | 16 |
16 namespace brotli { | 17 #if defined(__cplusplus) || defined(c_plusplus) |
| 18 extern "C" { |
| 19 #endif |
17 | 20 |
18 static const uint8_t kCodeLengthDepth[18] = { | 21 static const uint8_t kCodeLengthDepth[18] = { |
19 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 0, 4, 4, | 22 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 0, 4, 4, |
20 }; | 23 }; |
21 | 24 |
22 static const uint8_t kStaticCommandCodeDepth[kNumCommandPrefixes] = { | 25 static const uint8_t kStaticCommandCodeDepth[BROTLI_NUM_COMMAND_SYMBOLS] = { |
23 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 26 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
24 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 27 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
25 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 28 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
26 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 29 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
27 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 30 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
28 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 31 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
29 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 32 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
30 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 33 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
31 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 34 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
32 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, | 35 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, | 73 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
71 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, | 74 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
72 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, | 75 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
73 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, | 76 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
74 }; | 77 }; |
75 | 78 |
76 static const uint32_t kCodeLengthBits[18] = { | 79 static const uint32_t kCodeLengthBits[18] = { |
77 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 15, 31, 0, 11, 7, | 80 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 15, 31, 0, 11, 7, |
78 }; | 81 }; |
79 | 82 |
80 inline void StoreStaticCodeLengthCode(size_t* storage_ix, uint8_t* storage) { | 83 static BROTLI_INLINE void StoreStaticCodeLengthCode( |
81 WriteBits(40, MAKE_UINT64_T(0xff, 0x55555554), storage_ix, storage); | 84 size_t* storage_ix, uint8_t* storage) { |
| 85 BrotliWriteBits( |
| 86 40, BROTLI_MAKE_UINT64_T(0x0000ffU, 0x55555554U), storage_ix, storage); |
82 } | 87 } |
83 | 88 |
84 static const uint64_t kZeroRepsBits[704] = { | 89 static const uint64_t kZeroRepsBits[BROTLI_NUM_COMMAND_SYMBOLS] = { |
85 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000017, 0x00000027, | 90 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000017, 0x00000027, |
86 0x00000037, 0x00000047, 0x00000057, 0x00000067, 0x00000077, 0x00000770, | 91 0x00000037, 0x00000047, 0x00000057, 0x00000067, 0x00000077, 0x00000770, |
87 0x00000b87, 0x00001387, 0x00001b87, 0x00002387, 0x00002b87, 0x00003387, | 92 0x00000b87, 0x00001387, 0x00001b87, 0x00002387, 0x00002b87, 0x00003387, |
88 0x00003b87, 0x00000397, 0x00000b97, 0x00001397, 0x00001b97, 0x00002397, | 93 0x00003b87, 0x00000397, 0x00000b97, 0x00001397, 0x00001b97, 0x00002397, |
89 0x00002b97, 0x00003397, 0x00003b97, 0x000003a7, 0x00000ba7, 0x000013a7, | 94 0x00002b97, 0x00003397, 0x00003b97, 0x000003a7, 0x00000ba7, 0x000013a7, |
90 0x00001ba7, 0x000023a7, 0x00002ba7, 0x000033a7, 0x00003ba7, 0x000003b7, | 95 0x00001ba7, 0x000023a7, 0x00002ba7, 0x000033a7, 0x00003ba7, 0x000003b7, |
91 0x00000bb7, 0x000013b7, 0x00001bb7, 0x000023b7, 0x00002bb7, 0x000033b7, | 96 0x00000bb7, 0x000013b7, 0x00001bb7, 0x000023b7, 0x00002bb7, 0x000033b7, |
92 0x00003bb7, 0x000003c7, 0x00000bc7, 0x000013c7, 0x00001bc7, 0x000023c7, | 97 0x00003bb7, 0x000003c7, 0x00000bc7, 0x000013c7, 0x00001bc7, 0x000023c7, |
93 0x00002bc7, 0x000033c7, 0x00003bc7, 0x000003d7, 0x00000bd7, 0x000013d7, | 98 0x00002bc7, 0x000033c7, 0x00003bc7, 0x000003d7, 0x00000bd7, 0x000013d7, |
94 0x00001bd7, 0x000023d7, 0x00002bd7, 0x000033d7, 0x00003bd7, 0x000003e7, | 99 0x00001bd7, 0x000023d7, 0x00002bd7, 0x000033d7, 0x00003bd7, 0x000003e7, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 0x02e5cb87, 0x04e5cb87, 0x06e5cb87, 0x08e5cb87, 0x0ae5cb87, 0x0ce5cb87, | 200 0x02e5cb87, 0x04e5cb87, 0x06e5cb87, 0x08e5cb87, 0x0ae5cb87, 0x0ce5cb87, |
196 0x0ee5cb87, 0x00e9cb87, 0x02e9cb87, 0x04e9cb87, 0x06e9cb87, 0x08e9cb87, | 201 0x0ee5cb87, 0x00e9cb87, 0x02e9cb87, 0x04e9cb87, 0x06e9cb87, 0x08e9cb87, |
197 0x0ae9cb87, 0x0ce9cb87, 0x0ee9cb87, 0x00edcb87, 0x02edcb87, 0x04edcb87, | 202 0x0ae9cb87, 0x0ce9cb87, 0x0ee9cb87, 0x00edcb87, 0x02edcb87, 0x04edcb87, |
198 0x06edcb87, 0x08edcb87, 0x0aedcb87, 0x0cedcb87, 0x0eedcb87, 0x00f1cb87, | 203 0x06edcb87, 0x08edcb87, 0x0aedcb87, 0x0cedcb87, 0x0eedcb87, 0x00f1cb87, |
199 0x02f1cb87, 0x04f1cb87, 0x06f1cb87, 0x08f1cb87, 0x0af1cb87, 0x0cf1cb87, | 204 0x02f1cb87, 0x04f1cb87, 0x06f1cb87, 0x08f1cb87, 0x0af1cb87, 0x0cf1cb87, |
200 0x0ef1cb87, 0x00f5cb87, 0x02f5cb87, 0x04f5cb87, 0x06f5cb87, 0x08f5cb87, | 205 0x0ef1cb87, 0x00f5cb87, 0x02f5cb87, 0x04f5cb87, 0x06f5cb87, 0x08f5cb87, |
201 0x0af5cb87, 0x0cf5cb87, 0x0ef5cb87, 0x00f9cb87, 0x02f9cb87, 0x04f9cb87, | 206 0x0af5cb87, 0x0cf5cb87, 0x0ef5cb87, 0x00f9cb87, 0x02f9cb87, 0x04f9cb87, |
202 0x06f9cb87, 0x08f9cb87, | 207 0x06f9cb87, 0x08f9cb87, |
203 }; | 208 }; |
204 | 209 |
205 static const uint32_t kZeroRepsDepth[704] = { | 210 static const uint32_t kZeroRepsDepth[BROTLI_NUM_COMMAND_SYMBOLS] = { |
206 0, 4, 8, 7, 7, 7, 7, 7, 7, 7, 7, 11, 14, 14, 14, 14, | 211 0, 4, 8, 7, 7, 7, 7, 7, 7, 7, 7, 11, 14, 14, 14, 14, |
207 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | 212 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
208 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | 213 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
209 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | 214 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
210 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 21, 21, | 215 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 21, 21, |
211 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | 216 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
212 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | 217 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
213 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | 218 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
214 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | 219 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
215 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, | 220 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
(...skipping 26 matching lines...) Expand all Loading... |
242 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 28, 28, 28, 28, 28, | 247 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 28, 28, 28, 28, 28, |
243 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 248 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
244 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 249 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
245 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 250 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
246 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 251 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
247 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 252 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
248 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 253 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
249 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 254 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, |
250 }; | 255 }; |
251 | 256 |
252 static const uint64_t kNonZeroRepsBits[704] = { | 257 static const uint64_t kNonZeroRepsBits[BROTLI_NUM_COMMAND_SYMBOLS] = { |
253 0x0000000b, 0x0000001b, 0x0000002b, 0x0000003b, 0x000002cb, 0x000006cb, | 258 0x0000000b, 0x0000001b, 0x0000002b, 0x0000003b, 0x000002cb, 0x000006cb, |
254 0x00000acb, 0x00000ecb, 0x000002db, 0x000006db, 0x00000adb, 0x00000edb, | 259 0x00000acb, 0x00000ecb, 0x000002db, 0x000006db, 0x00000adb, 0x00000edb, |
255 0x000002eb, 0x000006eb, 0x00000aeb, 0x00000eeb, 0x000002fb, 0x000006fb, | 260 0x000002eb, 0x000006eb, 0x00000aeb, 0x00000eeb, 0x000002fb, 0x000006fb, |
256 0x00000afb, 0x00000efb, 0x0000b2cb, 0x0001b2cb, 0x0002b2cb, 0x0003b2cb, | 261 0x00000afb, 0x00000efb, 0x0000b2cb, 0x0001b2cb, 0x0002b2cb, 0x0003b2cb, |
257 0x0000b6cb, 0x0001b6cb, 0x0002b6cb, 0x0003b6cb, 0x0000bacb, 0x0001bacb, | 262 0x0000b6cb, 0x0001b6cb, 0x0002b6cb, 0x0003b6cb, 0x0000bacb, 0x0001bacb, |
258 0x0002bacb, 0x0003bacb, 0x0000becb, 0x0001becb, 0x0002becb, 0x0003becb, | 263 0x0002bacb, 0x0003bacb, 0x0000becb, 0x0001becb, 0x0002becb, 0x0003becb, |
259 0x0000b2db, 0x0001b2db, 0x0002b2db, 0x0003b2db, 0x0000b6db, 0x0001b6db, | 264 0x0000b2db, 0x0001b2db, 0x0002b2db, 0x0003b2db, 0x0000b6db, 0x0001b6db, |
260 0x0002b6db, 0x0003b6db, 0x0000badb, 0x0001badb, 0x0002badb, 0x0003badb, | 265 0x0002b6db, 0x0003b6db, 0x0000badb, 0x0001badb, 0x0002badb, 0x0003badb, |
261 0x0000bedb, 0x0001bedb, 0x0002bedb, 0x0003bedb, 0x0000b2eb, 0x0001b2eb, | 266 0x0000bedb, 0x0001bedb, 0x0002bedb, 0x0003bedb, 0x0000b2eb, 0x0001b2eb, |
262 0x0002b2eb, 0x0003b2eb, 0x0000b6eb, 0x0001b6eb, 0x0002b6eb, 0x0003b6eb, | 267 0x0002b2eb, 0x0003b2eb, 0x0000b6eb, 0x0001b6eb, 0x0002b6eb, 0x0003b6eb, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 0x0b2cb6db, 0x1b2cb6db, 0x2b2cb6db, 0x3b2cb6db, 0x0b6cb6db, 0x1b6cb6db, | 368 0x0b2cb6db, 0x1b2cb6db, 0x2b2cb6db, 0x3b2cb6db, 0x0b6cb6db, 0x1b6cb6db, |
364 0x2b6cb6db, 0x3b6cb6db, 0x0bacb6db, 0x1bacb6db, 0x2bacb6db, 0x3bacb6db, | 369 0x2b6cb6db, 0x3b6cb6db, 0x0bacb6db, 0x1bacb6db, 0x2bacb6db, 0x3bacb6db, |
365 0x0becb6db, 0x1becb6db, 0x2becb6db, 0x3becb6db, 0x0b2db6db, 0x1b2db6db, | 370 0x0becb6db, 0x1becb6db, 0x2becb6db, 0x3becb6db, 0x0b2db6db, 0x1b2db6db, |
366 0x2b2db6db, 0x3b2db6db, 0x0b6db6db, 0x1b6db6db, 0x2b6db6db, 0x3b6db6db, | 371 0x2b2db6db, 0x3b2db6db, 0x0b6db6db, 0x1b6db6db, 0x2b6db6db, 0x3b6db6db, |
367 0x0badb6db, 0x1badb6db, 0x2badb6db, 0x3badb6db, 0x0bedb6db, 0x1bedb6db, | 372 0x0badb6db, 0x1badb6db, 0x2badb6db, 0x3badb6db, 0x0bedb6db, 0x1bedb6db, |
368 0x2bedb6db, 0x3bedb6db, 0x0b2eb6db, 0x1b2eb6db, 0x2b2eb6db, 0x3b2eb6db, | 373 0x2bedb6db, 0x3bedb6db, 0x0b2eb6db, 0x1b2eb6db, 0x2b2eb6db, 0x3b2eb6db, |
369 0x0b6eb6db, 0x1b6eb6db, 0x2b6eb6db, 0x3b6eb6db, 0x0baeb6db, 0x1baeb6db, | 374 0x0b6eb6db, 0x1b6eb6db, 0x2b6eb6db, 0x3b6eb6db, 0x0baeb6db, 0x1baeb6db, |
370 0x2baeb6db, 0x3baeb6db, | 375 0x2baeb6db, 0x3baeb6db, |
371 }; | 376 }; |
372 | 377 |
373 static const uint32_t kNonZeroRepsDepth[704] = { | 378 static const uint32_t kNonZeroRepsDepth[BROTLI_NUM_COMMAND_SYMBOLS] = { |
374 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, | 379 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, |
375 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, | 380 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, |
376 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, | 381 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, |
377 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, | 382 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, |
378 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, | 383 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, |
379 18, 18, 18, 18, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 384 18, 18, 18, 18, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
380 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 385 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
381 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 386 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
382 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 387 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
383 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 388 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
(...skipping 26 matching lines...) Expand all Loading... |
410 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 415 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
411 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 416 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
412 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 417 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
413 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 418 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
414 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 419 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
415 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 420 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
416 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 421 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
417 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | 422 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
418 }; | 423 }; |
419 | 424 |
420 static const uint16_t kStaticLiteralCodeBits[256] = { | 425 static const uint16_t kStaticCommandCodeBits[BROTLI_NUM_COMMAND_SYMBOLS] = { |
421 0, 128, 64, 192, 32, 160, 96, 224, | |
422 16, 144, 80, 208, 48, 176, 112, 240, | |
423 8, 136, 72, 200, 40, 168, 104, 232, | |
424 24, 152, 88, 216, 56, 184, 120, 248, | |
425 4, 132, 68, 196, 36, 164, 100, 228, | |
426 20, 148, 84, 212, 52, 180, 116, 244, | |
427 12, 140, 76, 204, 44, 172, 108, 236, | |
428 28, 156, 92, 220, 60, 188, 124, 252, | |
429 2, 130, 66, 194, 34, 162, 98, 226, | |
430 18, 146, 82, 210, 50, 178, 114, 242, | |
431 10, 138, 74, 202, 42, 170, 106, 234, | |
432 26, 154, 90, 218, 58, 186, 122, 250, | |
433 6, 134, 70, 198, 38, 166, 102, 230, | |
434 22, 150, 86, 214, 54, 182, 118, 246, | |
435 14, 142, 78, 206, 46, 174, 110, 238, | |
436 30, 158, 94, 222, 62, 190, 126, 254, | |
437 1, 129, 65, 193, 33, 161, 97, 225, | |
438 17, 145, 81, 209, 49, 177, 113, 241, | |
439 9, 137, 73, 201, 41, 169, 105, 233, | |
440 25, 153, 89, 217, 57, 185, 121, 249, | |
441 5, 133, 69, 197, 37, 165, 101, 229, | |
442 21, 149, 85, 213, 53, 181, 117, 245, | |
443 13, 141, 77, 205, 45, 173, 109, 237, | |
444 29, 157, 93, 221, 61, 189, 125, 253, | |
445 3, 131, 67, 195, 35, 163, 99, 227, | |
446 19, 147, 83, 211, 51, 179, 115, 243, | |
447 11, 139, 75, 203, 43, 171, 107, 235, | |
448 27, 155, 91, 219, 59, 187, 123, 251, | |
449 7, 135, 71, 199, 39, 167, 103, 231, | |
450 23, 151, 87, 215, 55, 183, 119, 247, | |
451 15, 143, 79, 207, 47, 175, 111, 239, | |
452 31, 159, 95, 223, 63, 191, 127, 255, | |
453 }; | |
454 | |
455 inline void StoreStaticLiteralHuffmanTree(size_t* storage_ix, | |
456 uint8_t* storage) { | |
457 WriteBits(32, 0x00010003U, storage_ix, storage); | |
458 } | |
459 | |
460 static const uint16_t kStaticCommandCodeBits[kNumCommandPrefixes] = { | |
461 0, 256, 128, 384, 64, 320, 192, 448, | 426 0, 256, 128, 384, 64, 320, 192, 448, |
462 32, 288, 160, 416, 96, 352, 224, 480, | 427 32, 288, 160, 416, 96, 352, 224, 480, |
463 16, 272, 144, 400, 80, 336, 208, 464, | 428 16, 272, 144, 400, 80, 336, 208, 464, |
464 48, 304, 176, 432, 112, 368, 240, 496, | 429 48, 304, 176, 432, 112, 368, 240, 496, |
465 8, 264, 136, 392, 72, 328, 200, 456, | 430 8, 264, 136, 392, 72, 328, 200, 456, |
466 40, 296, 168, 424, 104, 360, 232, 488, | 431 40, 296, 168, 424, 104, 360, 232, 488, |
467 24, 280, 152, 408, 88, 344, 216, 472, | 432 24, 280, 152, 408, 88, 344, 216, 472, |
468 56, 312, 184, 440, 120, 376, 248, 504, | 433 56, 312, 184, 440, 120, 376, 248, 504, |
469 4, 260, 132, 388, 68, 324, 196, 452, | 434 4, 260, 132, 388, 68, 324, 196, 452, |
470 36, 292, 164, 420, 100, 356, 228, 484, | 435 36, 292, 164, 420, 100, 356, 228, 484, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 31, 1055, 543, 1567, 287, 1311, 799, 1823, | 506 31, 1055, 543, 1567, 287, 1311, 799, 1823, |
542 159, 1183, 671, 1695, 415, 1439, 927, 1951, | 507 159, 1183, 671, 1695, 415, 1439, 927, 1951, |
543 95, 1119, 607, 1631, 351, 1375, 863, 1887, | 508 95, 1119, 607, 1631, 351, 1375, 863, 1887, |
544 223, 1247, 735, 1759, 479, 1503, 991, 2015, | 509 223, 1247, 735, 1759, 479, 1503, 991, 2015, |
545 63, 1087, 575, 1599, 319, 1343, 831, 1855, | 510 63, 1087, 575, 1599, 319, 1343, 831, 1855, |
546 191, 1215, 703, 1727, 447, 1471, 959, 1983, | 511 191, 1215, 703, 1727, 447, 1471, 959, 1983, |
547 127, 1151, 639, 1663, 383, 1407, 895, 1919, | 512 127, 1151, 639, 1663, 383, 1407, 895, 1919, |
548 255, 1279, 767, 1791, 511, 1535, 1023, 2047, | 513 255, 1279, 767, 1791, 511, 1535, 1023, 2047, |
549 }; | 514 }; |
550 | 515 |
551 inline void StoreStaticCommandHuffmanTree(size_t* storage_ix, | 516 static BROTLI_INLINE void StoreStaticCommandHuffmanTree( |
552 uint8_t* storage) { | 517 size_t* storage_ix, uint8_t* storage) { |
553 WriteBits(28, 0x0000000006307003U, storage_ix, storage); | 518 BrotliWriteBits( |
554 WriteBits(31, 0x0000000009262441U, storage_ix, storage); | 519 56, BROTLI_MAKE_UINT64_T(0x926244U, 0x16307003U), storage_ix, storage); |
| 520 BrotliWriteBits(3, 0x00000000U, storage_ix, storage); |
555 } | 521 } |
556 | 522 |
557 static const uint16_t kStaticDistanceCodeBits[64] = { | 523 static const uint16_t kStaticDistanceCodeBits[64] = { |
558 0, 32, 16, 48, 8, 40, 24, 56, 4, 36, 20, 52, 12, 44, 28, 60, | 524 0, 32, 16, 48, 8, 40, 24, 56, 4, 36, 20, 52, 12, 44, 28, 60, |
559 2, 34, 18, 50, 10, 42, 26, 58, 6, 38, 22, 54, 14, 46, 30, 62, | 525 2, 34, 18, 50, 10, 42, 26, 58, 6, 38, 22, 54, 14, 46, 30, 62, |
560 1, 33, 17, 49, 9, 41, 25, 57, 5, 37, 21, 53, 13, 45, 29, 61, | 526 1, 33, 17, 49, 9, 41, 25, 57, 5, 37, 21, 53, 13, 45, 29, 61, |
561 3, 35, 19, 51, 11, 43, 27, 59, 7, 39, 23, 55, 15, 47, 31, 63, | 527 3, 35, 19, 51, 11, 43, 27, 59, 7, 39, 23, 55, 15, 47, 31, 63, |
562 }; | 528 }; |
563 | 529 |
564 inline void StoreStaticDistanceHuffmanTree(size_t* storage_ix, | 530 static BROTLI_INLINE void StoreStaticDistanceHuffmanTree( |
565 uint8_t* storage) { | 531 size_t* storage_ix, uint8_t* storage) { |
566 WriteBits(18, 0x000000000001dc03U, storage_ix, storage); | 532 BrotliWriteBits(28, 0x0369dc03U, storage_ix, storage); |
567 WriteBits(10, 0x00000000000000daU, storage_ix, storage); | |
568 } | 533 } |
569 | 534 |
570 } // namespace brotli | 535 #if defined(__cplusplus) || defined(c_plusplus) |
| 536 } /* extern "C" */ |
| 537 #endif |
571 | 538 |
572 #endif // BROTLI_ENC_ENTROPY_ENCODE_STATIC_H_ | 539 #endif /* BROTLI_ENC_ENTROPY_ENCODE_STATIC_H_ */ |
OLD | NEW |