Expand description
Huffman decoding for HPACK (RFC 7541 ยง5.2).
The decoder has a fast path which decodes 12 bits a time. The decoder
looks the next 12 bits up in FAST_TABLE, which maps directly to either
one or two symbols to decode. Since ASCII letters and digits have 5-7 bit
codes, one lookup usually decodes two symbols at once.
Two situations fall off this fast path:
- Codes longer than 12 bits: control characters and bytes >= 0x80
- The end of the input, when fewer than 12 bits remain.
These are decoded by walking the generated DECODE_TABLE one input byte at a time.
Constantsยง
- BRANCH ๐
- FAST_
BITS ๐ - FAST_
DECODE_ ๐TABLE - TABLE_
INDEX_ ๐MASK - TABLE_
WIDTH ๐
Functionsยง
- build_
fast_ ๐table - decode
- decode_
code_ ๐slow