Skip to main content

Crate _msrtc_rans

Crate _msrtc_rans 

Source
Expand description

§msrtc-rans-python

Python extension module _msrtc_rans providing the msrtc.rans Python API.

This crate uses PyO3 to create a CPython extension module that is import-path-compatible with the existing msrtc.rans package.

Stream classes wrap the persistent Rust stream types from msrtc_rans::stream, matching Microsoft’s RansEncoderStream / RansDecoderStream semantics:

  • RansEncoderStream keeps a single persistent raw rANS encoder state across push() calls and flushes it once (Flush(abort=false)), exactly like Microsoft’s RansEncoderStreamImpl.
  • RansDecoderStream owns the encoded message and keeps a persistent decode cursor (unit position + rANS state) across decode() calls, matching Microsoft’s RansDecoderStreamImpl.