aboutsummaryrefslogtreecommitdiffstats
path: root/alc/bformatdec.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-04-25 18:08:08 -0700
committerChris Robinson <[email protected]>2021-04-25 18:08:08 -0700
commit2479483645bf719233fa5d39bc91682f12d71350 (patch)
treede4d9f11e4d4549adc6e7a43b9c4a1d630f91feb /alc/bformatdec.h
parent8d09d03ed363ab1735b1933588d8242ba85ddf10 (diff)
Move bformatdec to core
Diffstat (limited to 'alc/bformatdec.h')
-rw-r--r--alc/bformatdec.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/alc/bformatdec.h b/alc/bformatdec.h
deleted file mode 100644
index bb39f709..00000000
--- a/alc/bformatdec.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef BFORMATDEC_H
-#define BFORMATDEC_H
-
-#include <array>
-#include <cstddef>
-#include <memory>
-
-#include "almalloc.h"
-#include "alspan.h"
-#include "core/ambidefs.h"
-#include "core/bufferline.h"
-#include "core/devformat.h"
-#include "core/filters/splitter.h"
-
-struct AmbDecConf;
-struct FrontStablizer;
-
-
-using ChannelDec = std::array<float,MaxAmbiChannels>;
-
-class BFormatDec {
- static constexpr size_t sHFBand{0};
- static constexpr size_t sLFBand{1};
- static constexpr size_t sNumBands{2};
-
- struct ChannelDecoder {
- union MatrixU {
- float Dual[sNumBands][MAX_OUTPUT_CHANNELS];
- float Single[MAX_OUTPUT_CHANNELS];
- } mGains{};
-
- /* NOTE: BandSplitter filter is unused with single-band decoding. */
- BandSplitter mXOver;
- };
-
- alignas(16) std::array<FloatBufferLine,2> mSamples;
-
- const std::unique_ptr<FrontStablizer> mStablizer;
- const bool mDualBand{false};
-
- al::FlexArray<ChannelDecoder> mChannelDec;
-
-public:
- BFormatDec(const AmbDecConf *conf, const bool allow_2band, const size_t inchans,
- const uint srate, const uint (&chanmap)[MAX_OUTPUT_CHANNELS],
- std::unique_ptr<FrontStablizer> stablizer);
- BFormatDec(const size_t inchans, const al::span<const ChannelDec> coeffs,
- const al::span<const ChannelDec> coeffslf, std::unique_ptr<FrontStablizer> stablizer);
-
- bool hasStablizer() const noexcept { return mStablizer != nullptr; };
-
- /* Decodes the ambisonic input to the given output channels. */
- void process(const al::span<FloatBufferLine> OutBuffer, const FloatBufferLine *InSamples,
- const size_t SamplesToDo);
-
- /* Decodes the ambisonic input to the given output channels with stablization. */
- void processStablize(const al::span<FloatBufferLine> OutBuffer,
- const FloatBufferLine *InSamples, const size_t lidx, const size_t ridx, const size_t cidx,
- const size_t SamplesToDo);
-
- static std::unique_ptr<BFormatDec> Create(const AmbDecConf *conf, const bool allow_2band,
- const size_t inchans, const uint srate, const uint (&chanmap)[MAX_OUTPUT_CHANNELS],
- std::unique_ptr<FrontStablizer> stablizer);
- static std::unique_ptr<BFormatDec> Create(const size_t inchans,
- const al::span<const ChannelDec> coeffs, const al::span<const ChannelDec> coeffslf,
- std::unique_ptr<FrontStablizer> stablizer);
-
- DEF_FAM_NEWDEL(BFormatDec, mChannelDec)
-};
-
-#endif /* BFORMATDEC_H */