7#include "../utility/utility.hpp"
8#include "../SIMD/module.hpp"
9#include "../macros.hpp"
12hi_export_module(hikogui.audio.audio_sample_format);
14namespace hi {
inline namespace v1 {
93 return {4, 8, 23,
true, std::endian::little};
98 return {4, 8, 23,
true, std::endian::big};
103 return {4, 8, 23,
true, std::endian::native};
108 return {2, 0, 15,
false, std::endian::little};
113 return {2, 0, 15,
false, std::endian::big};
118 return {2, 0, 15,
false, std::endian::native};
123 return {3, 0, 19,
false, std::endian::little};
128 return {3, 0, 19,
false, std::endian::big};
133 return {3, 0, 19,
false, std::endian::native};
138 return {3, 0, 23,
false, std::endian::little};
143 return {3, 0, 23,
false, std::endian::big};
148 return {3, 0, 23,
false, std::endian::native};
153 return {4, 0, 31,
false, std::endian::little};
158 return {4, 0, 31,
false, std::endian::big};
163 return {4, 0, 31,
false, std::endian::native};
168 return {4, 8, 23,
false, std::endian::little};
173 return {4, 8, 23,
false, std::endian::big};
178 return {4, 8, 23,
false, std::endian::native};
201 return static_cast<float>(max_value);
218 hi_assert(r == 1
or r == 2
or r == 4);
256 auto r = i8x16::broadcast(-1);
287 auto r = i8x16::broadcast(-1);
328 (
endian == std::endian::little ||
endian == std::endian::big);
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Audio sample format.
Definition audio_sample_format.hpp:30
uint8_t num_bytes
The number of bytes of the container.
Definition audio_sample_format.hpp:34
constexpr bool holds_invariant() const noexcept
Is the audio sample format valid.
Definition audio_sample_format.hpp:325
i8x16 load_shuffle_indices(std::size_t stride) const noexcept
Return a shuffle indices for loading samples into 32 bit integers.
Definition audio_sample_format.hpp:251
std::size_t num_chunks_per_quad(std::size_t stride) const noexcept
The number of chunks to load or store to handle 4 samples.
Definition audio_sample_format.hpp:231
bool is_float
The numeric type is floating point.
Definition audio_sample_format.hpp:56
std::size_t chunk_stride(std::size_t stride) const noexcept
The number of bytes to advance to the next chunk to be loaded or stored.
Definition audio_sample_format.hpp:224
std::size_t num_samples_per_chunk(std::size_t stride) const noexcept
The number of packed samples that are handled in a single 128 bit load or store.
Definition audio_sample_format.hpp:215
i8x16 store_shuffle_indices(std::size_t stride) const noexcept
Return a shuffle indices for storing 32 bit samples into packed samples.
Definition audio_sample_format.hpp:282
uint8_t num_bits
The number of significant bits of the sample format.
Definition audio_sample_format.hpp:51
std::endian endian
The endian order of the bytes in the container.
Definition audio_sample_format.hpp:60
uint8_t num_guard_bits
The number of bits used for the integer part of a fixed point number.
Definition audio_sample_format.hpp:39
i8x16 concat_shuffle_indices(std::size_t stride) const noexcept
Return a shuffle indices to shift previous loaded samples for concatenation.
Definition audio_sample_format.hpp:313
float pack_multiplier() const noexcept
How much to multiply float samples to create integer samples.
Definition audio_sample_format.hpp:188
float unpack_multiplier() const noexcept
How much to multiply integer samples to create float samples.
Definition audio_sample_format.hpp:207
std::size_t num_fast_quads(std::size_t stride, std::size_t num_samples) const noexcept
Calculate the number of 4 sample-quads can be handled as chunked loads and stores.
Definition audio_sample_format.hpp:238