7#include "../required.hpp"
8#include "../assert.hpp"
10#include "../rapid/numeric_array.hpp"
Audio sample format.
Definition audio_sample_format.hpp:29
std::endian endian
The endian order of the bytes in the container.
Definition audio_sample_format.hpp:59
int num_chunks_per_quad() const noexcept
The number of chunks to load or store to handle 4 samples.
bool is_float
The numeric type is floating point.
Definition audio_sample_format.hpp:55
i8x16 store_shuffle_indices() const noexcept
Return a shuffle indices for storing 32 bit samples into packed samples.
int num_bits
The number of significant bits of the sample format.
Definition audio_sample_format.hpp:50
int stride
The number of bytes to step to the next sample of the same channel.
Definition audio_sample_format.hpp:63
float unpack_multiplier() const noexcept
How much to multiply integer samples to create float samples.
i8x16 load_shuffle_indices() const noexcept
Return a shuffle indices for loading samples into 32 bit integers.
float pack_multiplier() const noexcept
How much to multiply float samples to create integer samples.
i8x16 concat_shuffle_indices() const noexcept
Return a shuffle indices to shift previous loaded samples for concatenation.
int num_bytes
The number of bytes of the container.
Definition audio_sample_format.hpp:33
size_t num_fast_quads(size_t num_samples) const noexcept
Calculate the number of 4 sample-quads can be handled as chunked loads and stores.
bool is_valid() const noexcept
Is the audio sample format valid.
int chunk_stride() const noexcept
The number of bytes to advance to the next chunk to be loaded or stored.
int num_guard_bits
The number of bits used for the integer part of a fixed point number.
Definition audio_sample_format.hpp:38
int num_samples_per_chunk() const noexcept
The number of packed samples that are handled in a single 128 bit load or store.