Skip to main content

quantize_to_code

Function quantize_to_code 

Source
pub fn quantize_to_code(
    x: f32,
    bits: u32,
    eps: f32,
    source: &mut impl DitherSource,
) -> i32
Expand description

Quantize to a raw integer code (signed, in [-(2^(bits-1)), 2^(bits-1)-1]).

Useful when you need the integer representation rather than a re-scaled float.