HikoGUI
Select Version: ⚠️ This documents the main development branch of HikoGUI. It might differ from release versions.
A low latency retained GUI
|
#include <hikogui/random/dither.hpp>
Public Member Functions | |
dither (dither const &)=default | |
dither (dither &&)=default | |
dither & | operator= (dither const &)=default |
dither & | operator= (dither &&)=default |
dither (int num_bits) noexcept | |
Create a dither object. | |
f32x4 | next () noexcept |
Get 8 floating point number to add to a samples. | |
f32x4 | next (f32x4 samples) noexcept |
Add dither to the given samples. | |
float | next (float sample) noexcept |
Add dither to the given samples. | |
An object that create dither values to add to samples before rounding.
Dither is created by adding two 8 bit RPDF into a 9 bit TPDF. Then this 9 bit TPDF is converted to floating point, which can be added to the original floating point sample.
We start of with 128 bit from an xorshift128p random number generated that is split into 8 bit chunks, made into TPDF and converted to 8 floating point values.
|
inlinenoexcept |
Create a dither object.
num_bits | Number of significant fraction bits, excluding the sign bit. For 24 bit signed PCM samples this value is 23. |
|
inlinenoexcept |
Get 8 floating point number to add to a samples.
The dither is a TPDF with the maximum being 2 quantization steps.
|
inlinenoexcept |
Add dither to the given samples.
samples | The samples to add dithering to. |
|
inlinenoexcept |
Add dither to the given samples.
sample | The sample to add dithering to. |