HikoGUI
A low latency retained GUI
|
#include <hikogui/audio/audio_sample_format.hpp>
Public Member Functions | |
constexpr | audio_sample_format (audio_sample_format const &) noexcept=default |
constexpr | audio_sample_format (audio_sample_format &&) noexcept=default |
constexpr audio_sample_format & | operator= (audio_sample_format const &) noexcept=default |
constexpr audio_sample_format & | operator= (audio_sample_format &&) noexcept=default |
constexpr | audio_sample_format (uint8_t num_bytes, uint8_t num_guard_bits, uint8_t num_bits, bool is_float, std::endian endian) noexcept |
Constructor of an audio sample format. | |
constexpr | operator bool () const noexcept |
float | pack_multiplier () const noexcept |
How much to multiply float samples to create integer samples. | |
float | unpack_multiplier () const noexcept |
How much to multiply integer samples to create float samples. | |
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. | |
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. | |
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. | |
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. | |
i8x16 | load_shuffle_indices (std::size_t stride) const noexcept |
Return a shuffle indices for loading samples into 32 bit integers. | |
i8x16 | store_shuffle_indices (std::size_t stride) const noexcept |
Return a shuffle indices for storing 32 bit samples into packed samples. | |
i8x16 | concat_shuffle_indices (std::size_t stride) const noexcept |
Return a shuffle indices to shift previous loaded samples for concatenation. | |
constexpr bool | holds_invariant () const noexcept |
Is the audio sample format valid. | |
Static Public Member Functions | |
static constexpr audio_sample_format | float32_le () noexcept |
static constexpr audio_sample_format | float32_be () noexcept |
static constexpr audio_sample_format | float32 () noexcept |
static constexpr audio_sample_format | int16_le () noexcept |
static constexpr audio_sample_format | int16_be () noexcept |
static constexpr audio_sample_format | int16 () noexcept |
static constexpr audio_sample_format | int20_le () noexcept |
static constexpr audio_sample_format | int20_be () noexcept |
static constexpr audio_sample_format | int20 () noexcept |
static constexpr audio_sample_format | int24_le () noexcept |
static constexpr audio_sample_format | int24_be () noexcept |
static constexpr audio_sample_format | int24 () noexcept |
static constexpr audio_sample_format | int32_le () noexcept |
static constexpr audio_sample_format | int32_be () noexcept |
static constexpr audio_sample_format | int32 () noexcept |
static constexpr audio_sample_format | fix8_23_le () noexcept |
static constexpr audio_sample_format | fix8_23_be () noexcept |
static constexpr audio_sample_format | fix8_23 () noexcept |
Data Fields | |
uint8_t | num_bytes |
The number of bytes of the container. | |
uint8_t | num_guard_bits |
The number of bits used for the integer part of a fixed point number. | |
uint8_t | num_bits |
The number of significant bits of the sample format. | |
bool | is_float |
The numeric type is floating point. | |
std::endian | endian |
The endian order of the bytes in the container. | |
Audio sample format.
Audio samples described by this type can be in three different formats.
num_integer_bits
is set to zero. This is the format used in most audio file formats.Sample values are aligned to the most significant bits of the container described by num_bytes
. The bottom bits are set to zero.
|
inlineconstexprnoexcept |
Constructor of an audio sample format.
num_bytes | The number of bytes used for each sample in the stream of data. |
num_guard_bits | The number of bits used beyond -1.0 and 1.0. |
num_bits | The number of bits used to represent a normalized sample between 0.0 and 1.0 (without the sign bit). |
is_float | True if the sample is float, otherwise integer or fixed point. |
endian | The ordering of bytes in each sample |
|
inlinenoexcept |
The number of bytes to advance to the next chunk to be loaded or stored.
|
inlinenoexcept |
Return a shuffle indices to shift previous loaded samples for concatenation.
|
inlineconstexprnoexcept |
Is the audio sample format valid.
|
inlinenoexcept |
Return a shuffle indices for loading samples into 32 bit integers.
|
inlinenoexcept |
The number of chunks to load or store to handle 4 samples.
|
inlinenoexcept |
Calculate the number of 4 sample-quads can be handled as chunked loads and stores.
|
inlinenoexcept |
The number of packed samples that are handled in a single 128 bit load or store.
Always one of: 1, 2 or 4.
|
inlinenoexcept |
How much to multiply float samples to create integer samples.
|
inlinenoexcept |
Return a shuffle indices for storing 32 bit samples into packed samples.
|
inlinenoexcept |
How much to multiply integer samples to create float samples.
std::endian hi::v1::audio_sample_format::endian |
The endian order of the bytes in the container.
bool hi::v1::audio_sample_format::is_float |
The numeric type is floating point.
Otherwise it is a signed integer or fixed point number.
uint8_t hi::v1::audio_sample_format::num_bits |
The number of significant bits of the sample format.
This value is excluding the sign. (1 << num_bits) - 1
is the maximum sample value.
Examples:
uint8_t hi::v1::audio_sample_format::num_bytes |
The number of bytes of the container.
Must be either 1, 2, 3 or 4
uint8_t hi::v1::audio_sample_format::num_guard_bits |
The number of bits used for the integer part of a fixed point number.
This value is zero for signed integer and float samples.