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