| OLD | NEW |
| 1 /* Copyright 2013 Google Inc. All Rights Reserved. | 1 /* Copyright 2013 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 // Collection of static dictionary words. | 7 /* Functions to estimate the bit cost of Huffman trees. */ |
| 8 | 8 |
| 9 #ifndef BROTLI_ENC_DICTIONARY_H_ | 9 #include "./bit_cost.h" |
| 10 #define BROTLI_ENC_DICTIONARY_H_ | |
| 11 | 10 |
| 12 #include "./types.h" | 11 #include "../common/constants.h" |
| 13 | 12 #include <brotli/types.h> |
| 14 // No namespace, use same identifier as for the C decoder. | 13 #include "./fast_log.h" |
| 14 #include "./histogram.h" |
| 15 #include "./port.h" |
| 15 | 16 |
| 16 #if defined(__cplusplus) || defined(c_plusplus) | 17 #if defined(__cplusplus) || defined(c_plusplus) |
| 17 extern "C" { | 18 extern "C" { |
| 18 #endif | 19 #endif |
| 19 | 20 |
| 20 extern const uint8_t kBrotliDictionary[122784]; | 21 #define FN(X) X ## Literal |
| 22 #include "./bit_cost_inc.h" /* NOLINT(build/include) */ |
| 23 #undef FN |
| 21 | 24 |
| 22 static const uint32_t kBrotliDictionaryOffsetsByLength[] = { | 25 #define FN(X) X ## Command |
| 23 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, | 26 #include "./bit_cost_inc.h" /* NOLINT(build/include) */ |
| 24 53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536, | 27 #undef FN |
| 25 115968, 118528, 119872, 121280, 122016, | |
| 26 }; | |
| 27 | 28 |
| 28 static const uint8_t kBrotliDictionarySizeBitsByLength[] = { | 29 #define FN(X) X ## Distance |
| 29 0, 0, 0, 0, 10, 10, 11, 11, 10, 10, | 30 #include "./bit_cost_inc.h" /* NOLINT(build/include) */ |
| 30 10, 10, 10, 9, 9, 8, 7, 7, 8, 7, | 31 #undef FN |
| 31 7, 6, 6, 5, 5, | |
| 32 }; | |
| 33 | |
| 34 static const int kBrotliMinDictionaryWordLength = 4; | |
| 35 static const int kBrotliMaxDictionaryWordLength = 24; | |
| 36 | 32 |
| 37 #if defined(__cplusplus) || defined(c_plusplus) | 33 #if defined(__cplusplus) || defined(c_plusplus) |
| 38 } /* extern "C" */ | 34 } /* extern "C" */ |
| 39 #endif | 35 #endif |
| 40 | |
| 41 #endif // BROTLI_ENC_DICTIONARY_H_ | |
| OLD | NEW |