diff options
author | Chris Robinson <[email protected]> | 2020-12-25 08:31:02 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-25 08:31:02 -0800 |
commit | 78f73a42770f436218fc40b85ff804b301201df1 (patch) | |
tree | 341dd48ba1897614676a6190a231534e36a7073e /core/ambdec.h | |
parent | eaf209d2f17e0c5675c1e17fe67d44ac0ef382a0 (diff) |
Avoid dynamic vectors in AmbDecConf
Also add a bit more sanity checking
Diffstat (limited to 'core/ambdec.h')
-rw-r--r-- | core/ambdec.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/ambdec.h b/core/ambdec.h index 9f0db6b5..6b7394da 100644 --- a/core/ambdec.h +++ b/core/ambdec.h @@ -2,10 +2,10 @@ #define CORE_AMBDEC_H #include <array> +#include <memory> #include <string> #include "core/ambidefs.h" -#include "vector.h" /* Helpers to read .ambdec configuration files. */ @@ -32,15 +32,18 @@ struct AmbDecConf { float Elevation{0.0f}; std::string Connection; }; - al::vector<SpeakerConf> Speakers; + size_t NumSpeakers{0}; + std::unique_ptr<SpeakerConf[]> Speakers; using CoeffArray = std::array<float,MaxAmbiChannels>; + std::unique_ptr<CoeffArray[]> Matrix; + /* Unused when FreqBands == 1 */ float LFOrderGain[MaxAmbiOrder+1]{}; - al::vector<CoeffArray> LFMatrix; + CoeffArray *LFMatrix; float HFOrderGain[MaxAmbiOrder+1]{}; - al::vector<CoeffArray> HFMatrix; + CoeffArray *HFMatrix; int load(const char *fname) noexcept; }; |