]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/BrotliCompress/enc/static_dict.h
BaseTools: Update Brotli Compress to the latest one 1.0.6
[mirror_edk2.git] / BaseTools / Source / C / BrotliCompress / enc / static_dict.h
CommitLineData
11b7501a
SB
1/* Copyright 2013 Google Inc. All Rights Reserved.\r
2\r
3 Distributed under MIT license.\r
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT\r
5*/\r
6\r
7/* Class to model the static dictionary. */\r
8\r
9#ifndef BROTLI_ENC_STATIC_DICT_H_\r
10#define BROTLI_ENC_STATIC_DICT_H_\r
11\r
dd4f667e
LG
12#include "../common/dictionary.h"\r
13#include "../common/platform.h"\r
14#include <brotli/types.h>\r
15#include "./encoder_dict.h"\r
11b7501a
SB
16\r
17#if defined(__cplusplus) || defined(c_plusplus)\r
18extern "C" {\r
19#endif\r
20\r
21#define BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN 37\r
dd4f667e 22static const uint32_t kInvalidMatch = 0xFFFFFFF;\r
11b7501a
SB
23\r
24/* Matches data against static dictionary words, and for each length l,\r
25 for which a match is found, updates matches[l] to be the minimum possible\r
26 (distance << 5) + len_code.\r
27 Returns 1 if matches have been found, otherwise 0.\r
28 Prerequisites:\r
29 matches array is at least BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN + 1 long\r
30 all elements are initialized to kInvalidMatch */\r
31BROTLI_INTERNAL BROTLI_BOOL BrotliFindAllStaticDictionaryMatches(\r
dd4f667e 32 const BrotliEncoderDictionary* dictionary,\r
11b7501a
SB
33 const uint8_t* data, size_t min_length, size_t max_length,\r
34 uint32_t* matches);\r
35\r
36#if defined(__cplusplus) || defined(c_plusplus)\r
37} /* extern "C" */\r
38#endif\r
39\r
40#endif /* BROTLI_ENC_STATIC_DICT_H_ */\r