Skip to main content

quantize_reversible_reference

Function quantize_reversible_reference 

Source
pub fn quantize_reversible_reference(
    coefficients: &[f32],
    step_exponent: u16,
    step_mantissa: u16,
    range_bits: u8,
    reversible: bool,
) -> Vec<i32>
Expand description

Adapter scalar reversible sub-band quantization reference for CUDA stage parity.

Quantizes coefficients using the reversible (lossless) integer path of the native CPU quantizer. step_exponent and step_mantissa encode the JPEG 2000 QuantStepSize for the sub-band; range_bits is the nominal bit depth for the sub-band. When reversible is true the step-size parameters are ignored and each coefficient is rounded to the nearest integer.