constants.h(3)
β¨ constants.h β the constants.h(3) page, bestie edition β¨
okay so this is constants.h(3) from the Library Functions Manual, and it's literally the little box of shared numbers that both the decoder AND the encoder side of Brotli reach into. common ground. friendship bracelet energy. π«Ά
π NAME π
constants.h β common constants used in decoder and encoder API. that's it, that's the whole vibe. shared numbers, both sides, no drama.
πΈ SYNOPSIS πΈ
π Macros
#define BROTLI_LARGE_MAX_DISTANCE_BITS 62Uβ the theoretical max number of distance bits specified for large window brotli, for 64-bit encoders and decoders.#define BROTLI_LARGE_MAX_WBITS 30β the max supported large brotli window bits that the encoder and decoder will actually handle.#define BROTLI_MAX_NPOSTFIX 3β the maximal number of 'postfix' bits.
π¦ Detailed Description π¦
common constants used in decoder and encoder API. they're shared, they're load-bearing, they're doing the most for both sides at once. π
π Macro Definition Documentation π
β #define BROTLI_LARGE_MAX_DISTANCE_BITS 62U
the theoretical maximum number of distance bits specified for large window brotli, for 64-bit encoders and decoders.
and yes, the number is 62 even though in practice 32-bit encoders and decoders only support up to 30 max distance bits. why tho?? because it affects the large window brotli file format. specifically, it affects the encoding of simple huffman tree for distances β see Specification RFC 7932 chapter 3.4. so it's not a typo, it's the format. the format said 62 and we respect the format. π₯
β #define BROTLI_LARGE_MAX_WBITS 30
the maximum supported large brotli window bits by the encoder and decoder.
here's the tea: large window brotli allows up to 62 bits, however the current encoder and decoder, designed for 32-bit integers, only support up to 30 bits maximum. so 62 is the dream, 30 is the reality. the 32-bit integers are the limit and they are NOT budging. π
β #define BROTLI_MAX_NPOSTFIX 3
maximal number of 'postfix' bits. the number of 'postfix' bits is stored as 2 bits in the meta-block header. tiny field, big responsibility. β¨
π§ Author π§
generated automatically by Doxygen for Brotli from the source code. no human typed this out by hand, it was born fully formed from the source code like a little documentation butterfly. π
and that's a wrap, bestie π this page came from Brotli, dated August 2021, and the header was literally constants.h(3) β go forth and encode/decode responsibly ππ
π¦ where this page comes from
- alpine 3.22: brotli-doc 1.1.1-r0 Β· MIT
- alpine 3.23: brotli-doc 1.2.1-r0 Β· MIT
- alpine 3.24: brotli-doc 1.2.1-r0 Β· MIT
- arch rolling: brotli 1.2.0-1
- arch rolling: brotli 1.2.1-1 Β· MIT
- nixos 26.05: brotli 1.2.1
- nixpkgs unstable: brotli 1.2.0
- opensuse-leap 16.0: libbrotli-devel 1.1.0-160000.2.2 Β· MIT
- opensuse-leap 16.0: libbrotli-devel 1.1.0-160000.2.2 Β· MIT
- opensuse-leap 16.0: libbrotli-devel 1.1.0-160000.2.2 Β· MIT
- opensuse-leap 16.0: libbrotli-devel 1.1.0-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms