You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I.e. what good old RiQuantize does. I think it's safe to assume a dither amplitude of 0.5.
This should be built-in. I do not see anyone wanting to see banding when they do a conversion to one of those two types.
Only challenge I see is a nice API for seeding the RNG so results are deterministic on re-runs.
Rust version of RiQuantize:
use num_traits::float::Float;use core::ops::Mul;use oorandom;pubfnquantize<T>(value:T,one:T,min:T,max:T,dither_amplitude:T,rng:&mut oorandom::Rand32) -> TwhereT:Float + Mul<f32,Output = T>{use clamped::Clamp;(one * value + dither_amplitude * rng.rand_float()).round().clamped(min, max)}
The text was updated successfully, but these errors were encountered:
I.e. what good old
RiQuantize
does. I think it's safe to assume a dither amplitude of0.5
.This should be built-in. I do not see anyone wanting to see banding when they do a conversion to one of those two types.
Only challenge I see is a nice API for seeding the RNG so results are deterministic on re-runs.
Rust version of
RiQuantize
:The text was updated successfully, but these errors were encountered: