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