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 #include "./encoder_dict.h" 8*f4ee7fbaSAndroid Build Coastguard Worker 9*f4ee7fbaSAndroid Build Coastguard Worker #include "../common/dictionary.h" 10*f4ee7fbaSAndroid Build Coastguard Worker #include "../common/transform.h" 11*f4ee7fbaSAndroid Build Coastguard Worker #include "./dictionary_hash.h" 12*f4ee7fbaSAndroid Build Coastguard Worker #include "./hash.h" 13*f4ee7fbaSAndroid Build Coastguard Worker 14*f4ee7fbaSAndroid Build Coastguard Worker #if defined(__cplusplus) || defined(c_plusplus) 15*f4ee7fbaSAndroid Build Coastguard Worker extern "C" { 16*f4ee7fbaSAndroid Build Coastguard Worker #endif 17*f4ee7fbaSAndroid Build Coastguard Worker BrotliInitEncoderDictionary(BrotliEncoderDictionary * dict)18*f4ee7fbaSAndroid Build Coastguard Workervoid BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict) { 19*f4ee7fbaSAndroid Build Coastguard Worker dict->words = BrotliGetDictionary(); 20*f4ee7fbaSAndroid Build Coastguard Worker dict->num_transforms = (uint32_t)BrotliGetTransforms()->num_transforms; 21*f4ee7fbaSAndroid Build Coastguard Worker 22*f4ee7fbaSAndroid Build Coastguard Worker dict->hash_table_words = kStaticDictionaryHashWords; 23*f4ee7fbaSAndroid Build Coastguard Worker dict->hash_table_lengths = kStaticDictionaryHashLengths; 24*f4ee7fbaSAndroid Build Coastguard Worker dict->buckets = kStaticDictionaryBuckets; 25*f4ee7fbaSAndroid Build Coastguard Worker dict->dict_words = kStaticDictionaryWords; 26*f4ee7fbaSAndroid Build Coastguard Worker 27*f4ee7fbaSAndroid Build Coastguard Worker dict->cutoffTransformsCount = kCutoffTransformsCount; 28*f4ee7fbaSAndroid Build Coastguard Worker dict->cutoffTransforms = kCutoffTransforms; 29*f4ee7fbaSAndroid Build Coastguard Worker } 30*f4ee7fbaSAndroid Build Coastguard Worker 31*f4ee7fbaSAndroid Build Coastguard Worker #if defined(__cplusplus) || defined(c_plusplus) 32*f4ee7fbaSAndroid Build Coastguard Worker } /* extern "C" */ 33*f4ee7fbaSAndroid Build Coastguard Worker #endif 34