HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
audio_sample_packer.hpp
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "audio_sample_format.hpp"
8#include "../utility/module.hpp"
9#include "../SIMD/module.hpp"
10#include "../random/dither.hpp"
11#include <cstddef>
12#include <bit>
13
14namespace hi::inline v1 {
15
17public:
27
34 void operator()(float const *hi_restrict src, std::byte *hi_restrict dst, std::size_t num_samples) const noexcept;
35
36private:
37 i8x16 _store_shuffle_indices;
38 i8x16 _concat_shuffle_indices;
39 f32x4 _multiplier;
40 mutable dither _dither;
41 audio_sample_format _format;
42 std::size_t _num_chunks_per_quad;
43 std::size_t _stride;
44 std::size_t _chunk_stride;
45 int _direction;
46 int _start_byte;
47 int _align_shift;
48};
49
50} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:13
Audio sample format.
Definition audio_sample_format.hpp:27
Definition audio_sample_packer.hpp:16
void operator()(float const *hi_restrict src, std::byte *hi_restrict dst, std::size_t num_samples) const noexcept
Unpack samples.
audio_sample_packer(audio_sample_format format, std::size_t stride) noexcept
Audio sample packer One instance of this class can be used to pack multiple buffers either from one a...
An object that create dither values to add to samples before rounding.
Definition dither.hpp:23