suica/jxl/vardct does not have a README file

    BlockInfo

    pub(all) enum BlockInfo {
    Uninit
    Occupied
    Data(dct_select~ : TransformType, hf_mul~ : Int)
    } derive(Eq,
    Debug
    )

    Varblock grid information.

    DctDirection

    pub(all) enum DctDirection {
    Forward
    Inverse
    } derive(Eq,
    Debug
    )

    Direction of a DCT.

    DequantMatrixSet

    pub struct DequantMatrixSet {
    // private fields
    }

    A set of dequantization matrices.

    DequantMatrixSet::get

    fn DequantMatrixSet::get(self : DequantMatrixSet, channel : Int, dct_select : TransformType) -> FixedArray[Float]

    Returns the dequantization matrix for the given channel and transform type.

    The coefficients is in the raster order.

    DequantMatrixSet::get_transposed

    fn DequantMatrixSet::get_transposed(self : DequantMatrixSet, channel : Int, dct_select : TransformType) -> FixedArray[Float]

    Returns the transposed dequantization matrix for the given channel and transform type.

    The coefficients is in the raster order.

    DequantMatrixSet::jpeg_quant_values

    fn DequantMatrixSet::jpeg_quant_values(self : DequantMatrixSet, channel : Int) -> FixedArray[Int]?

    DequantMatrixSetParams

    pub struct DequantMatrixSetParams {
    // private fields
    }

    Parameters for decoding DequantMatrixSet.

    DequantMatrixSetParams::new

    fn DequantMatrixSetParams::new(bit_depth : Int, num_lf_groups : Int, global_ma_config :
    MaConfig
    ?, tracker :
    AllocTracker
    ?) -> DequantMatrixSetParams

    Create a new DequantMatrixSetParams with the given information.

    num_lf_groups is used to compute the stream index for Modular images.

    HfBlockContext

    pub(all) struct HfBlockContext {
    qf_thresholds : Array[Int]
    lf_thresholds : FixedArray[Array[Int]]
    block_ctx_map : FixedArray[Int]
    num_block_clusters : Int
    } derive(
    Debug
    )

    Context information for the entropy decoder of HF coefficients.

    HfBlockContext::default

    HfCoeffParams

    pub(all) struct HfCoeffParams {
    num_hf_presets : Int
    hf_block_ctx : HfBlockContext
    block_info :
    SubGrid
    [BlockInfo]
    jpeg_upsampling : FixedArray[Int]
    lf_quant : FixedArray[
    SubGrid
    [Int]]?
    hf_pass : HfPass
    coeff_shift : Int
    tracker :
    AllocTracker
    ?
    }

    Parameters for decoding HfCoeff.

    HfMetadata

    pub(all) struct HfMetadata {
    x_from_y :
    Grid
    [Int]
    b_from_y :
    Grid
    [Int]
    block_info :
    Grid
    [BlockInfo]
    epf_sigma :
    Grid
    [Float]
    }

    Data for decoding and rendering varblocks within an LF group.

    HfMetadataParams

    pub(all) struct HfMetadataParams {
    num_lf_groups : Int
    lf_group_idx : Int
    lf_width : Int
    lf_height : Int
    jpeg_upsampling : FixedArray[Int]
    bits_per_sample : Int
    global_ma_config :
    MaConfig
    ?
    epf : (Float, FixedArray[Float])?
    quantizer_global_scale : Int
    tracker :
    AllocTracker
    ?
    }

    Parameters for decoding HfMetadata.

    HfPass

    pub struct HfPass {
    // private fields
    }

    HF coefficient decoder configuration.

    Includes distribution for the entropy decoder and the order of HF coefficients. This struct is passed as a parameter when [decoding HF coefficients][write_hf_coeff].

    HfPassParams

    pub struct HfPassParams {
    // private fields
    }

    Parameters for decoding HfPass.

    HfPassParams::new

    fn HfPassParams::new(hf_block_ctx : HfBlockContext, num_hf_presets : Int) -> HfPassParams

    LfChannelCorrelation

    pub(all) struct LfChannelCorrelation {
    all_default : Bool
    colour_factor : Int
    base_correlation_x : Float
    base_correlation_b : Float
    x_factor_lf : Int
    b_factor_lf : Int
    } derive(
    Debug
    )

    Channel correlation data, used by chroma-from-luma procedure.

    LfChannelCorrelation::default

    LfChannelDequantization

    pub(all) struct LfChannelDequantization {
    all_default : Bool
    m_x_lf : Float
    m_y_lf : Float
    m_b_lf : Float
    } derive(
    Debug
    )

    Dequantization information for each channel.

    LfChannelDequantization::default

    LfChannelDequantization::m_b_lf_unscaled

    fn LfChannelDequantization::m_b_lf_unscaled(self : LfChannelDequantization) -> Float

    LfChannelDequantization::m_x_lf_unscaled

    fn LfChannelDequantization::m_x_lf_unscaled(self : LfChannelDequantization) -> Float

    LfChannelDequantization::m_y_lf_unscaled

    fn LfChannelDequantization::m_y_lf_unscaled(self : LfChannelDequantization) -> Float

    LfCoeff

    pub(all) struct LfCoeff {
    extra_precision : Int
    lf_quant :
    Modular

    partial : Bool
    }

    Quantized LF image.

    LfCoeffParams

    pub(all) struct LfCoeffParams {
    lf_group_idx : Int
    lf_width : Int
    lf_height : Int
    jpeg_upsampling : FixedArray[Int]
    bits_per_sample : Int
    global_ma_config :
    MaConfig
    ?
    allow_partial : Bool
    tracker :
    AllocTracker
    ?
    }

    Paramters for decoding LfCoeff.

    Quantizer

    pub(all) struct Quantizer {
    global_scale : Int
    quant_lf : Int
    } derive(
    Debug
    )

    Global quantizer multipliers.

    TransformType

    pub(all) enum TransformType {
    Dct8
    Hornuss
    Dct2
    Dct4
    Dct16
    Dct32
    Dct16x8
    Dct8x16
    Dct32x8
    Dct8x32
    Dct32x16
    Dct16x32
    Dct4x8
    Dct8x4
    Afv0
    Afv1
    Afv2
    Afv3
    Dct64
    Dct64x32
    Dct32x64
    Dct128
    Dct128x64
    Dct64x128
    Dct256
    Dct256x128
    Dct128x256
    } derive(Eq, Hash,
    Debug
    )

    Varblock transform types.

    TransformType::dct_select_size

    fn TransformType::dct_select_size(self : TransformType) -> (Int, Int)

    Returns the size of the transform type, in 8x8 blocks.

    TransformType::need_transpose

    fn TransformType::need_transpose(self : TransformType) -> Bool

    Returns whether DCT coefficients should be transposed.

    TransformType::to_int

    fn TransformType::to_int(self : TransformType) -> Int

    The repr(u8) value of the transform type.

    TransformType::try_from

    TryFrom<u8> for TransformType.

    dct8_natural_order

    let dct8_natural_order : FixedArray[(Int, Int)]

    The natural coefficient order of DCT8, as (x, y) pairs (upstream DCT8_NATURAL_ORDER).

    dct_2d

    fn dct_2d(io :
    SubGrid
    [Float], direction : DctDirection) -> Unit

    In-place 2D DCT of io (dct_2d).

    scale_f

    fn scale_f(c : Int, logb : Int) -> Float

    Precomputed for c = 0..32, b = 256.

    sec_half

    fn sec_half(n : Int) -> FixedArray[Float]

    Table of 1 / (2 cos((2k + 1) / 2n * pi)), k < n / 2.

    transform

    fn transform(coeff :
    SubGrid
    [Float], dct_select : TransformType) -> Unit

    Inverse transform of a varblock, given its coefficients with the LLF coefficients already in place (transform).

    transform_varblock

    fn transform_varblock(lf :
    SubGrid
    [Float], coeff :
    SubGrid
    [Float], shifted_bx : Int, shifted_by : Int, dct_select : TransformType) -> Unit

    Computes the LLF coefficients of a varblock from the LF image and runs the inverse transform (the body of transform_varblocks_inner for one block).

    coeff is the channel's coefficient grid, lf the channel's LF grid (one sample per 8x8 block); shifted_bx/shifted_by are block coordinates in both.

    transform_varblocks

    fn transform_varblocks(lf : FixedArray[
    SubGrid
    [Float]], coeff_out : FixedArray[
    SubGrid
    [Float]], hshifts : FixedArray[Int], vshifts : FixedArray[Int], block_info :
    SubGrid
    [BlockInfo]) -> Unit

    transform_varblocks: LLF computation and inverse transform of every varblock of a group, for each of the three channels.

    hshifts/vshifts are the channel shifts (ChannelShift::hshift/vshift) of the X, Y, B channels.

    varblock_at

    fn varblock_at(block_info :
    SubGrid
    [BlockInfo], bx : Int, by : Int, hshift : Int, vshift : Int) -> (Int, Int, TransformType, Int)?

    One step of for_each_varblocks: returns (shifted_bx, shifted_by, dct_select, hf_mul) if a varblock of the shifted channel starts at block (bx, by).

    write_hf_coeff

    fn write_hf_coeff(bitstream :
    Bitstream
    , params : HfCoeffParams, hf_coeff_output : FixedArray[
    SubGrid
    [Int]]) -> Unit raise
    JxlError

    Decode and write HF coefficients from the bitstream.

    Coefficients are added to hf_coeff_output (X, Y, B), which must cover the pass group.