encoder_dict.c 949 B

123456789101112131415161718192021222324252627282930313233
  1. /* Copyright 2017 Google Inc. All Rights Reserved.
  2. Distributed under MIT license.
  3. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
  4. */
  5. #include "./encoder_dict.h"
  6. #include "../common/dictionary.h"
  7. #include "../common/transform.h"
  8. #include "./dictionary_hash.h"
  9. #include "./hash.h"
  10. #if defined(__cplusplus) || defined(c_plusplus)
  11. extern "C" {
  12. #endif
  13. void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict) {
  14. dict->words = BrotliGetDictionary();
  15. dict->num_transforms = (uint32_t)BrotliGetTransforms()->num_transforms;
  16. dict->hash_table_words = kStaticDictionaryHashWords;
  17. dict->hash_table_lengths = kStaticDictionaryHashLengths;
  18. dict->buckets = kStaticDictionaryBuckets;
  19. dict->dict_words = kStaticDictionaryWords;
  20. dict->cutoffTransformsCount = kCutoffTransformsCount;
  21. dict->cutoffTransforms = kCutoffTransforms;
  22. }
  23. #if defined(__cplusplus) || defined(c_plusplus)
  24. } /* extern "C" */
  25. #endif