encoder_dict.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef BROTLI_ENC_ENCODER_DICT_H_
  6. #define BROTLI_ENC_ENCODER_DICT_H_
  7. #include "../common/dictionary.h"
  8. #include "../common/platform.h"
  9. #include <brotli/types.h>
  10. #include "./static_dict_lut.h"
  11. #if defined(__cplusplus) || defined(c_plusplus)
  12. extern "C" {
  13. #endif
  14. /* Dictionary data (words and transforms) for 1 possible context */
  15. typedef struct BrotliEncoderDictionary {
  16. const BrotliDictionary* words;
  17. uint32_t num_transforms;
  18. /* cut off for fast encoder */
  19. uint32_t cutoffTransformsCount;
  20. uint64_t cutoffTransforms;
  21. /* from dictionary_hash.h, for fast encoder */
  22. const uint16_t* hash_table_words;
  23. const uint8_t* hash_table_lengths;
  24. /* from static_dict_lut.h, for slow encoder */
  25. const uint16_t* buckets;
  26. const DictWord* dict_words;
  27. } BrotliEncoderDictionary;
  28. BROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict);
  29. #if defined(__cplusplus) || defined(c_plusplus)
  30. } /* extern "C" */
  31. #endif
  32. #endif /* BROTLI_ENC_ENCODER_DICT_H_ */