suica/jxl/coding does not have a README file

    Decoder

    type Decoder

    An entropy decoder.

    Integer types: contexts and clusters are Int; decoded values are UInt (Rust u32), so they can be passed to @bitstream.unpack_signed.

    Decoder::as_no_lz77

    fn Decoder::as_no_lz77(self : Decoder) -> DecoderNoLz77?

    Converts the decoder to one without LZ77.

    Decoder::as_rle

    fn Decoder::as_rle(self : Decoder) -> DecoderRleMode?

    Converts the decoder to one in RLE mode.

    Decoder::as_with_lz77

    fn Decoder::as_with_lz77(self : Decoder) -> DecoderWithLz77?

    Converts the decoder to LZ77-enabled one.

    Decoder::begin

    Explicitly start reading an entropy encoded stream.

    This involves reading an initial state for the ANS stream. It's okay to skip this method, as the state will be initialized on the first read.

    Decoder::clone

    fn Decoder::clone(self : Decoder) -> Decoder

    An independent copy of the decoder (Rust Clone): distributions are shared, the ANS state and the LZ77 window are copied.

    Decoder::cluster_map

    fn Decoder::cluster_map(self : Decoder) -> FixedArray[Int]

    Returns the cluster mapping of distributions (context -> cluster). Do not modify the returned array.

    Decoder::finalize

    fn Decoder::finalize(self : Decoder) -> Unit raise
    JxlError

    Finalizes the stream, and check whether the stream was valid.

    For prefix code stream, this method will always succeed. For ANS streams, this method checks if the final state matches expected state, which is specified in the specification.

    Decoder::parse

    Create a decoder by reading symbol distribution, integer configurations and LZ77 configuration from the bitstream.

    Decoder::read_varint

    fn Decoder::read_varint(self : Decoder, bitstream :
    Bitstream
    , ctx : Int) -> UInt raise
    JxlError

    Read an integer from the bitstream with the given context.

    Decoder::read_varint_with_multiplier

    fn Decoder::read_varint_with_multiplier(self : Decoder, bitstream :
    Bitstream
    , ctx : Int, dist_multiplier : Int) -> UInt raise
    JxlError

    Read an integer from the bitstream with the given context and LZ77 distance multiplier.

    Decoder::read_varint_with_multiplier_clustered

    fn Decoder::read_varint_with_multiplier_clustered(self : Decoder, bitstream :
    Bitstream
    , cluster : Int, dist_multiplier : Int) -> UInt raise
    JxlError

    Read an integer from the bitstream with the given cluster and LZ77 distance multiplier.

    Contexts can be converted to clusters using [the cluster map][Decoder::cluster_map].

    Decoder::single_token

    fn Decoder::single_token(self : Decoder, cluster : Int) -> UInt?

    Returns the token to be decoded if the decoder always emits single token repeatedly.

    DecoderNoLz77

    type DecoderNoLz77

    An entropy decoder without LZ77. It shares the state of the [Decoder] it was created from.

    DecoderNoLz77::cluster_map

    fn DecoderNoLz77::cluster_map(self : DecoderNoLz77) -> FixedArray[Int]

    Returns the cluster mapping of distributions.

    DecoderNoLz77::read_varint_clustered

    fn DecoderNoLz77::read_varint_clustered(self : DecoderNoLz77, bitstream :
    Bitstream
    , cluster : Int) -> UInt raise
    JxlError

    Read an integer from the bitstream with the given cluster.

    DecoderNoLz77::single_token

    fn DecoderNoLz77::single_token(self : DecoderNoLz77, cluster : Int) -> UInt?

    Returns the token to be decoded if the decoder always emits single token repeatedly.

    DecoderRleMode

    type DecoderRleMode

    An entropy decoder in RLE mode. It shares the state of the [Decoder] it was created from.

    DecoderRleMode::cluster_map

    fn DecoderRleMode::cluster_map(self : DecoderRleMode) -> FixedArray[Int]

    Returns the cluster mapping of distributions.

    DecoderRleMode::read_varint_clustered

    fn DecoderRleMode::read_varint_clustered(self : DecoderRleMode, bitstream :
    Bitstream
    , cluster : Int) -> RleToken raise
    JxlError

    Read an integer from the bitstream with the given cluster.

    Contexts can be converted to clusters using [the cluster map][DecoderRleMode::cluster_map].

    DecoderRleMode::read_varint_clustered_packed

    fn DecoderRleMode::read_varint_clustered_packed(self : DecoderRleMode, bitstream :
    Bitstream
    , cluster : Int) -> Int64 raise
    JxlError

    Allocation-free variant of [DecoderRleMode::read_varint_clustered]: returns v (>= 0) for Value(v) and -1 - n (< 0) for Repeat(n).

    DecoderWithLz77

    type DecoderWithLz77

    A LZ77-enabled entropy decoder. It shares the state of the [Decoder] it was created from.

    DecoderWithLz77::cluster_map

    fn DecoderWithLz77::cluster_map(self : DecoderWithLz77) -> FixedArray[Int]

    Returns the cluster mapping of distributions.

    DecoderWithLz77::read_varint_with_multiplier_clustered

    fn DecoderWithLz77::read_varint_with_multiplier_clustered(self : DecoderWithLz77, bitstream :
    Bitstream
    , cluster : Int, dist_multiplier : Int) -> UInt raise
    JxlError

    Read an integer from the bitstream with the given cluster and LZ77 distance multiplier.

    RleToken

    pub(all) enum RleToken {
    Value(UInt)
    Repeat(UInt)
    } derive(Eq,
    Debug
    )

    Decoded token from an entropy decoder in RLE mode.

    read_clusters

    fn read_clusters(bitstream :
    Bitstream
    , num_dist : Int) -> (Int, FixedArray[Int]) raise
    JxlError

    Read a distribution clustering from the bitstream.

    Returns (num_clusters, cluster map).

    read_permutation

    fn read_permutation(bitstream :
    Bitstream
    , decoder : Decoder, size : Int, skip : Int) -> Array[Int] raise
    JxlError

    Read a permutation from the entropy encoded stream.

    Requires skip <= size.