aboutsummaryrefslogtreecommitdiffstats
path: root/core/hrtf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/hrtf.cpp')
-rw-r--r--core/hrtf.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/core/hrtf.cpp b/core/hrtf.cpp
index 607e3d3d..7d11ee19 100644
--- a/core/hrtf.cpp
+++ b/core/hrtf.cpp
@@ -20,6 +20,7 @@
#include <optional>
#include <type_traits>
#include <utility>
+#include <vector>
#include "albit.h"
#include "alfstream.h"
@@ -34,7 +35,6 @@
#include "mixer/hrtfdefs.h"
#include "opthelpers.h"
#include "polyphase_resampler.h"
-#include "vector.h"
namespace {
@@ -98,10 +98,10 @@ constexpr char magicMarker03[8]{'M','i','n','P','H','R','0','3'};
constexpr auto PassthruCoeff = static_cast<float>(1.0/al::numbers::sqrt2);
std::mutex LoadedHrtfLock;
-al::vector<LoadedHrtf> LoadedHrtfs;
+std::vector<LoadedHrtf> LoadedHrtfs;
std::mutex EnumeratedHrtfLock;
-al::vector<HrtfEntry> EnumeratedHrtfs;
+std::vector<HrtfEntry> EnumeratedHrtfs;
class databuf final : public std::streambuf {
@@ -295,7 +295,7 @@ void DirectHrtfState::build(const HrtfStore *Hrtf, const uint irSize, const bool
}
uint min_delay{HrtfHistoryLength*HrirDelayFracOne}, max_delay{0};
- al::vector<ImpulseResponse> impres; impres.reserve(AmbiPoints.size());
+ std::vector<ImpulseResponse> impres; impres.reserve(AmbiPoints.size());
auto calc_res = [Hrtf,&max_delay,&min_delay](const AngularPoint &pt) -> ImpulseResponse
{
auto &field = Hrtf->mFields[0];
@@ -331,7 +331,7 @@ void DirectHrtfState::build(const HrtfStore *Hrtf, const uint irSize, const bool
TRACE("Min delay: %.2f, max delay: %.2f, FIR length: %u\n",
min_delay/double{HrirDelayFracOne}, max_delay/double{HrirDelayFracOne}, irSize);
- auto tmpres = al::vector<std::array<double2,HrirLength>>(mChannels.size());
+ auto tmpres = std::vector<std::array<double2,HrirLength>>(mChannels.size());
max_delay = 0;
for(size_t c{0u};c < AmbiPoints.size();++c)
{
@@ -529,7 +529,7 @@ std::unique_ptr<HrtfStore> LoadHrtf00(std::istream &data, const char *filename)
return nullptr;
}
- auto elevs = al::vector<HrtfStore::Elevation>(evCount);
+ auto elevs = std::vector<HrtfStore::Elevation>(evCount);
for(auto &elev : elevs)
elev.irOffset = readle<uint16_t>(data);
if(!data || data.eof())
@@ -571,8 +571,8 @@ std::unique_ptr<HrtfStore> LoadHrtf00(std::istream &data, const char *filename)
return nullptr;
}
- auto coeffs = al::vector<HrirArray>(irCount, HrirArray{});
- auto delays = al::vector<ubyte2>(irCount);
+ auto coeffs = std::vector<HrirArray>(irCount, HrirArray{});
+ auto delays = std::vector<ubyte2>(irCount);
for(auto &hrir : coeffs)
{
for(auto &val : al::span<float2>{hrir.data(), irSize})
@@ -626,7 +626,7 @@ std::unique_ptr<HrtfStore> LoadHrtf01(std::istream &data, const char *filename)
return nullptr;
}
- auto elevs = al::vector<HrtfStore::Elevation>(evCount);
+ auto elevs = std::vector<HrtfStore::Elevation>(evCount);
for(auto &elev : elevs)
elev.azCount = readle<uint8_t>(data);
if(!data || data.eof())
@@ -649,8 +649,8 @@ std::unique_ptr<HrtfStore> LoadHrtf01(std::istream &data, const char *filename)
elevs[i].irOffset = static_cast<ushort>(elevs[i-1].irOffset + elevs[i-1].azCount);
const ushort irCount{static_cast<ushort>(elevs.back().irOffset + elevs.back().azCount)};
- auto coeffs = al::vector<HrirArray>(irCount, HrirArray{});
- auto delays = al::vector<ubyte2>(irCount);
+ auto coeffs = std::vector<HrirArray>(irCount, HrirArray{});
+ auto delays = std::vector<ubyte2>(irCount);
for(auto &hrir : coeffs)
{
for(auto &val : al::span<float2>{hrir.data(), irSize})
@@ -722,8 +722,8 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename)
return nullptr;
}
- auto fields = al::vector<HrtfStore::Field>(fdCount);
- auto elevs = al::vector<HrtfStore::Elevation>{};
+ auto fields = std::vector<HrtfStore::Field>(fdCount);
+ auto elevs = std::vector<HrtfStore::Elevation>{};
for(size_t f{0};f < fdCount;f++)
{
const ushort distance{readle<uint16_t>(data)};
@@ -787,8 +787,8 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename)
});
const auto irTotal = static_cast<ushort>(elevs.back().azCount + elevs.back().irOffset);
- auto coeffs = al::vector<HrirArray>(irTotal, HrirArray{});
- auto delays = al::vector<ubyte2>(irTotal);
+ auto coeffs = std::vector<HrirArray>(irTotal, HrirArray{});
+ auto delays = std::vector<ubyte2>(irTotal);
if(channelType == ChanType_LeftOnly)
{
if(sampleType == SampleType_S16)
@@ -881,10 +881,10 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename)
if(fdCount > 1)
{
- auto fields_ = al::vector<HrtfStore::Field>(fields.size());
- auto elevs_ = al::vector<HrtfStore::Elevation>(elevs.size());
- auto coeffs_ = al::vector<HrirArray>(coeffs.size());
- auto delays_ = al::vector<ubyte2>(delays.size());
+ auto fields_ = std::vector<HrtfStore::Field>(fields.size());
+ auto elevs_ = std::vector<HrtfStore::Elevation>(elevs.size());
+ auto coeffs_ = std::vector<HrirArray>(coeffs.size());
+ auto delays_ = std::vector<ubyte2>(delays.size());
/* Simple reverse for the per-field elements. */
std::reverse_copy(fields.cbegin(), fields.cend(), fields_.begin());
@@ -983,8 +983,8 @@ std::unique_ptr<HrtfStore> LoadHrtf03(std::istream &data, const char *filename)
return nullptr;
}
- auto fields = al::vector<HrtfStore::Field>(fdCount);
- auto elevs = al::vector<HrtfStore::Elevation>{};
+ auto fields = std::vector<HrtfStore::Field>(fdCount);
+ auto elevs = std::vector<HrtfStore::Elevation>{};
for(size_t f{0};f < fdCount;f++)
{
const ushort distance{readle<uint16_t>(data)};
@@ -1048,8 +1048,8 @@ std::unique_ptr<HrtfStore> LoadHrtf03(std::istream &data, const char *filename)
});
const auto irTotal = static_cast<ushort>(elevs.back().azCount + elevs.back().irOffset);
- auto coeffs = al::vector<HrirArray>(irTotal, HrirArray{});
- auto delays = al::vector<ubyte2>(irTotal);
+ auto coeffs = std::vector<HrirArray>(irTotal, HrirArray{});
+ auto delays = std::vector<ubyte2>(irTotal);
if(channelType == ChanType_LeftOnly)
{
for(auto &hrir : coeffs)
@@ -1221,7 +1221,7 @@ al::span<const char> GetResource(int name)
} // namespace
-al::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt)
+std::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt)
{
std::lock_guard<std::mutex> _{EnumeratedHrtfLock};
EnumeratedHrtfs.clear();
@@ -1270,7 +1270,7 @@ al::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt)
AddBuiltInEntry("Built-In HRTF", IDR_DEFAULT_HRTF_MHR);
}
- al::vector<std::string> list;
+ std::vector<std::string> list;
list.reserve(EnumeratedHrtfs.size());
for(auto &entry : EnumeratedHrtfs)
list.emplace_back(entry.mDispName);
@@ -1394,7 +1394,7 @@ HrtfStorePtr GetLoadedHrtf(const std::string &name, const uint devrate)
/* Scale the delays for the new sample rate. */
float max_delay{0.0f};
- auto new_delays = al::vector<float2>(irCount);
+ auto new_delays = std::vector<float2>(irCount);
const float rate_scale{static_cast<float>(devrate)/static_cast<float>(hrtf->mSampleRate)};
for(size_t i{0};i < irCount;++i)
{