1 /* Copyright 2017 Google Inc. All Rights Reserved. 2 3 Distributed under MIT license. 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 */ 6 7 #ifndef BROTLI_ENC_ENCODER_DICT_H_ 8 #define BROTLI_ENC_ENCODER_DICT_H_ 9 10 #include "../common/dictionary.h" 11 #include "../common/platform.h" 12 #include <brotli/types.h> 13 #include "./static_dict_lut.h" 14 15 #if defined(__cplusplus) || defined(c_plusplus) 16 extern "C" { 17 #endif 18 19 /* Dictionary data (words and transforms) for 1 possible context */ 20 typedef struct BrotliEncoderDictionary { 21 const BrotliDictionary* words; 22 uint32_t num_transforms; 23 24 /* cut off for fast encoder */ 25 uint32_t cutoffTransformsCount; 26 uint64_t cutoffTransforms; 27 28 /* from dictionary_hash.h, for fast encoder */ 29 const uint16_t* hash_table_words; 30 const uint8_t* hash_table_lengths; 31 32 /* from static_dict_lut.h, for slow encoder */ 33 const uint16_t* buckets; 34 const DictWord* dict_words; 35 } BrotliEncoderDictionary; 36 37 BROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict); 38 39 #if defined(__cplusplus) || defined(c_plusplus) 40 } /* extern "C" */ 41 #endif 42 43 #endif /* BROTLI_ENC_ENCODER_DICT_H_ */ 44