11cb0ef41Sopenharmony_ci/* Copyright 2017 Google Inc. All Rights Reserved. 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ci Distributed under MIT license. 41cb0ef41Sopenharmony_ci See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 51cb0ef41Sopenharmony_ci*/ 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci#ifndef BROTLI_ENC_ENCODER_DICT_H_ 81cb0ef41Sopenharmony_ci#define BROTLI_ENC_ENCODER_DICT_H_ 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ci#include "../common/dictionary.h" 111cb0ef41Sopenharmony_ci#include "../common/platform.h" 121cb0ef41Sopenharmony_ci#include <brotli/types.h> 131cb0ef41Sopenharmony_ci#include "./static_dict_lut.h" 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci#if defined(__cplusplus) || defined(c_plusplus) 161cb0ef41Sopenharmony_ciextern "C" { 171cb0ef41Sopenharmony_ci#endif 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ci/* Dictionary data (words and transforms) for 1 possible context */ 201cb0ef41Sopenharmony_citypedef struct BrotliEncoderDictionary { 211cb0ef41Sopenharmony_ci const BrotliDictionary* words; 221cb0ef41Sopenharmony_ci uint32_t num_transforms; 231cb0ef41Sopenharmony_ci 241cb0ef41Sopenharmony_ci /* cut off for fast encoder */ 251cb0ef41Sopenharmony_ci uint32_t cutoffTransformsCount; 261cb0ef41Sopenharmony_ci uint64_t cutoffTransforms; 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci /* from dictionary_hash.h, for fast encoder */ 291cb0ef41Sopenharmony_ci const uint16_t* hash_table_words; 301cb0ef41Sopenharmony_ci const uint8_t* hash_table_lengths; 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci /* from static_dict_lut.h, for slow encoder */ 331cb0ef41Sopenharmony_ci const uint16_t* buckets; 341cb0ef41Sopenharmony_ci const DictWord* dict_words; 351cb0ef41Sopenharmony_ci} BrotliEncoderDictionary; 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ciBROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict); 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci#if defined(__cplusplus) || defined(c_plusplus) 401cb0ef41Sopenharmony_ci} /* extern "C" */ 411cb0ef41Sopenharmony_ci#endif 421cb0ef41Sopenharmony_ci 431cb0ef41Sopenharmony_ci#endif /* BROTLI_ENC_ENCODER_DICT_H_ */ 44