Expand description
Bit-level output primitives shared by the native codecs.
BitWriter packs bits MSB-first into a byte buffer and knows the two
variable-length codes the HEVC high-level syntax needs: unsigned/signed
Exp-Golomb (ue(v) / se(v)). rbsp_trailing_bits and
emulation_prevention turn a raw bit payload into the byte-stuffed form a
NAL unit carries.
Pure core/alloc + std::Vec — no OS, threads, or time — so it builds and
runs identically on native and wasm32.
Structs§
- BitWriter
- Packs bits MSB-first into a growable byte buffer.
Functions§
- emulation_
prevention - Insert emulation-prevention bytes, turning a raw byte-aligned RBSP into the EBSP a NAL unit carries (H.265 §7.3.1.1).
- rbsp_
trailing_ bits - Append RBSP trailing bits: a single
1stop bit followed by0s to the next byte boundary (H.265 §7.3.2.11). Every RBSP ends with this.