126fa459cSmrg/* Copyright 2017 Google Inc. All Rights Reserved.
226fa459cSmrg
326fa459cSmrg   Distributed under MIT license.
426fa459cSmrg   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
526fa459cSmrg*/
626fa459cSmrg
726fa459cSmrg#ifndef BROTLI_ENC_ENCODER_DICT_H_
826fa459cSmrg#define BROTLI_ENC_ENCODER_DICT_H_
926fa459cSmrg
1026fa459cSmrg#include "../common/dictionary.h"
1126fa459cSmrg#include "../common/platform.h"
1226fa459cSmrg#include <brotli/types.h>
1326fa459cSmrg#include "./static_dict_lut.h"
1426fa459cSmrg
1526fa459cSmrg#if defined(__cplusplus) || defined(c_plusplus)
1626fa459cSmrgextern "C" {
1726fa459cSmrg#endif
1826fa459cSmrg
1926fa459cSmrg/* Dictionary data (words and transforms) for 1 possible context */
2026fa459cSmrgtypedef struct BrotliEncoderDictionary {
2126fa459cSmrg  const BrotliDictionary* words;
2226fa459cSmrg  uint32_t num_transforms;
2326fa459cSmrg
2426fa459cSmrg  /* cut off for fast encoder */
2526fa459cSmrg  uint32_t cutoffTransformsCount;
2626fa459cSmrg  uint64_t cutoffTransforms;
2726fa459cSmrg
2826fa459cSmrg  /* from dictionary_hash.h, for fast encoder */
2926fa459cSmrg  const uint16_t* hash_table_words;
3026fa459cSmrg  const uint8_t* hash_table_lengths;
3126fa459cSmrg
3226fa459cSmrg  /* from static_dict_lut.h, for slow encoder */
3326fa459cSmrg  const uint16_t* buckets;
3426fa459cSmrg  const DictWord* dict_words;
3526fa459cSmrg} BrotliEncoderDictionary;
3626fa459cSmrg
3726fa459cSmrgBROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict);
3826fa459cSmrg
3926fa459cSmrg#if defined(__cplusplus) || defined(c_plusplus)
4026fa459cSmrg}  /* extern "C" */
4126fa459cSmrg#endif
4226fa459cSmrg
4326fa459cSmrg#endif  /* BROTLI_ENC_ENCODER_DICT_H_ */
44