encoder_dict.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. /* cut off for fast encoder */
  18. uint32_t cutoffTransformsCount;
  19. uint64_t cutoffTransforms;
  20. /* from dictionary_hash.h, for fast encoder */
  21. const uint16_t* hash_table;
  22. /* from static_dict_lut.h, for slow encoder */
  23. const uint16_t* buckets;
  24. const DictWord* dict_words;
  25. } BrotliEncoderDictionary;
  26. BROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict);
  27. #if defined(__cplusplus) || defined(c_plusplus)
  28. } /* extern "C" */
  29. #endif
  30. #endif /* BROTLI_ENC_ENCODER_DICT_H_ */