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 πŸŽ€πŸ’œ