7#include "xorshift128p.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
40 hi_axiom(num_bits > 0);
41 auto maximum_value =
static_cast<float>((1_uz << num_bits) - 1);
44 maximum_value *= 127.0f;
47 maximum_value *= 2.0f;
49 _multiplier = f32x4::broadcast(1.0f / maximum_value);
77 [[nodiscard]] f32x4
next(f32x4 samples)
noexcept
79 return samples + next();
87 [[nodiscard]]
float next(
float sample)
noexcept
89 return get<0>(f32x4::broadcast(sample) + next());
93 f32x4 _multiplier = {};
95 xorshift128p _state = {};
96 unsigned char _counter = 0;
DOXYGEN BUG.
Definition algorithm.hpp:16
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
An object that create dither values to add to samples before rounding.
Definition dither.hpp:26
dither(int num_bits) noexcept
Create a dither object.
Definition dither.hpp:38
f32x4 next() noexcept
Get 8 floating point number to add to a samples.
Definition dither.hpp:55
f32x4 next(f32x4 samples) noexcept
Add dither to the given samples.
Definition dither.hpp:77
float next(float sample) noexcept
Add dither to the given samples.
Definition dither.hpp:87