7#include "xorshift128p.hpp"
8#include "../utility/module.hpp"
10namespace hi::inline
v1 {
25 dither(dither
const &) =
default;
26 dither(dither &&) =
default;
27 dither &operator=(dither
const &) =
default;
28 dither &operator=(dither &&) =
default;
38 auto maximum_value =
static_cast<float>((1_uz << num_bits) - 1);
41 maximum_value *= 127.0f;
44 maximum_value *= 2.0f;
46 _multiplier = f32x4::broadcast(1.0f / maximum_value);
74 [[nodiscard]] f32x4
next(f32x4 samples)
noexcept
76 return samples +
next();
84 [[nodiscard]]
float next(
float sample)
noexcept
86 return get<0>(f32x4::broadcast(sample) +
next());
90 f32x4 _multiplier = {};
92 xorshift128p _state = {};
93 unsigned char _counter = 0;
#define hi_not_implemented(...)
This part of the code has not been implemented yet.
Definition assert.hpp:335
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
DOXYGEN BUG.
Definition algorithm.hpp:13
dither(int num_bits) noexcept
Create a dither object.
Definition dither.hpp:35
f32x4 next() noexcept
Get 8 floating point number to add to a samples.
Definition dither.hpp:52
f32x4 next(f32x4 samples) noexcept
Add dither to the given samples.
Definition dither.hpp:74
float next(float sample) noexcept
Add dither to the given samples.
Definition dither.hpp:84