Skip to content

Commit 3699412

Browse files
committed
Update brotli & zstd
1 parent cea089e commit 3699412

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+17251
-27746
lines changed

Extra/brotli/common/constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@
5050
/* Number of slack bytes for window size. Don't confuse
5151
with BROTLI_NUM_DISTANCE_SHORT_CODES. */
5252
#define BROTLI_WINDOW_GAP 16
53+
#define BROTLI_MAX_BACKWARD_LIMIT(W) (((size_t)1 << (W)) - BROTLI_WINDOW_GAP)
5354

5455
#endif /* BROTLI_COMMON_CONSTANTS_H_ */

Extra/brotli/common/dictionary.c

Lines changed: 5867 additions & 9455 deletions
Large diffs are not rendered by default.

Extra/brotli/common/dictionary.h

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,29 @@
1616
extern "C" {
1717
#endif
1818

19-
BROTLI_COMMON_API extern const uint8_t kBrotliDictionary[122784];
20-
BROTLI_COMMON_API extern const uint32_t kBrotliDictionaryOffsetsByLength[25];
21-
BROTLI_COMMON_API extern const uint8_t kBrotliDictionarySizeBitsByLength[25];
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+
/* Data array is not bound, and should obey to size_bits_by_length values.
36+
Specified size matches default (RFC 7932) dictionary. */
37+
/* assert(sizeof(data) == offsets_by_length[31]) */
38+
uint8_t data[122784];
39+
} BrotliDictionary;
40+
41+
BROTLI_COMMON_API extern const BrotliDictionary* BrotliGetDictionary(void);
2242

2343
#define BROTLI_MIN_DICTIONARY_WORD_LENGTH 4
2444
#define BROTLI_MAX_DICTIONARY_WORD_LENGTH 24

Extra/brotli/common/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
If library is dynamically linked, use BrotliDecoderVersion and
1414
BrotliEncoderVersion methods. */
1515

16-
/* Semantic version, claculated as (MAJOR << 24) | (MINOR << 12) | PATCH */
16+
/* Semantic version, calculated as (MAJOR << 24) | (MINOR << 12) | PATCH */
1717
#define BROTLI_VERSION 0x1000000
1818

1919
#endif /* BROTLI_COMMON_VERSION_H_ */

0 commit comments

Comments
 (0)