Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/brotli/c/common/dictionary.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 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 /* Collection of static dictionary words. */ | |
| 8 | |
| 9 #ifndef BROTLI_COMMON_DICTIONARY_H_ | |
| 10 #define BROTLI_COMMON_DICTIONARY_H_ | |
| 11 | |
| 12 #include <brotli/port.h> | |
| 13 #include <brotli/types.h> | |
| 14 | |
| 15 #if defined(__cplusplus) || defined(c_plusplus) | |
| 16 extern "C" { | |
| 17 #endif | |
| 18 | |
| 19 typedef struct BrotliDictionary { | |
| 20 /** | |
| 21 * Number of bits to encode index of dictionary word in a bucket. | |
| 22 * | |
| 23 * Specification: Appendix A. Static Dictionary Data | |
| 24 * | |
| 25 * Words in a dictionary are bucketed by length. | |
| 26 * @c 0 means that there are no words of a given length. | |
| 27 * Dictionary consists of words with length of [4..24] bytes. | |
| 28 * Values at [0..3] and [25..31] indices should not be addressed. | |
| 29 */ | |
| 30 uint8_t size_bits_by_length[32]; | |
| 31 | |
| 32 /* assert(offset[i + 1] == offset[i] + (bits[i] ? (i << bits[i]) : 0)) */ | |
| 33 uint32_t offsets_by_length[32]; | |
| 34 | |
| 35 /* assert(data_size == offsets_by_length[31]) */ | |
| 36 size_t data_size; | |
| 37 | |
| 38 /* Data array is not bound, and should obey to size_bits_by_length values. | |
| 39 Specified size matches default (RFC 7932) dictionary. Its size is | |
| 40 defined by data_size */ | |
| 41 const uint8_t* data; | |
| 42 } BrotliDictionary; | |
| 43 | |
| 44 BROTLI_COMMON_API const BrotliDictionary* BrotliGetDictionary(void); | |
| 45 | |
| 46 /** | |
| 47 * Sets dictionary data. | |
| 48 * | |
| 49 * When dictionary data is already set / present, this method is no-op. | |
| 50 * | |
| 51 * Dictionary data MUST be provided before BrotliGetDictionary is invoked. | |
| 52 * This method is used ONLY in multi-client environment (e.g. C + Java), | |
| 53 * to reduce storage by sharing single dictionary between implementations. | |
| 54 */ | |
| 55 BROTLI_COMMON_API void BrotliSetDictionaryData(const uint8_t* data); | |
| 56 | |
| 57 #define BROTLI_MIN_DICTIONARY_WORD_LENGTH 4 | |
| 58 #define BROTLI_MAX_DICTIONARY_WORD_LENGTH 24 | |
| 59 | |
| 60 #if defined(__cplusplus) || defined(c_plusplus) | |
| 61 } /* extern "C" */ | |
| 62 #endif | |
| 63 | |
| 64 #endif /* BROTLI_COMMON_DICTIONARY_H_ */ |
