Update OpenAL-soft to 1.23.1-bc7cb17.

This commit is contained in:
Miku AuahDark
2024-03-20 11:06:03 +08:00
parent 4a512be715
commit 73a6fc9196
294 changed files with 44342 additions and 40077 deletions
+31 -22
View File
@@ -4,24 +4,26 @@
#include <array>
#include <cstddef>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "almalloc.h"
#include "aloptional.h"
#include "alspan.h"
#include "atomic.h"
#include "ambidefs.h"
#include "bufferline.h"
#include "mixer/hrtfdefs.h"
#include "flexarray.h"
#include "intrusive_ptr.h"
#include "vector.h"
#include "mixer/hrtfdefs.h"
struct HrtfStore {
RefCount mRef;
struct alignas(16) HrtfStore {
std::atomic<uint> mRef;
uint sampleRate;
uint irSize;
uint mSampleRate : 24;
uint mIrSize : 8;
struct Field {
float distance;
@@ -30,21 +32,30 @@ struct HrtfStore {
/* NOTE: Fields are stored *backwards*. field[0] is the farthest field, and
* field[fdCount-1] is the nearest.
*/
uint fdCount;
const Field *field;
al::span<const Field> mFields;
struct Elevation {
ushort azCount;
ushort irOffset;
};
Elevation *elev;
const HrirArray *coeffs;
const ubyte2 *delays;
Elevation *mElev;
const HrirArray *mCoeffs;
const ubyte2 *mDelays;
void getCoeffs(float elevation, float azimuth, float distance, float spread, HrirArray &coeffs,
const al::span<uint,2> delays) const;
void add_ref();
void release();
void dec_ref();
DEF_PLACE_NEWDEL()
void *operator new(size_t) = delete;
void *operator new[](size_t) = delete;
void operator delete[](void*) noexcept = delete;
void operator delete(gsl::owner<void*> block, void*) noexcept
{ ::operator delete[](block, std::align_val_t{alignof(HrtfStore)}); }
void operator delete(gsl::owner<void*> block) noexcept
{ ::operator delete[](block, std::align_val_t{alignof(HrtfStore)}); }
};
using HrtfStorePtr = al::intrusive_ptr<HrtfStore>;
@@ -58,7 +69,7 @@ struct AngularPoint {
struct DirectHrtfState {
std::array<float,BufferLineSize> mTemp;
std::array<float,BufferLineSize> mTemp{};
/* HRTF filter state for dry buffer content */
uint mIrSize{0};
@@ -71,8 +82,9 @@ struct DirectHrtfState {
* high-frequency gains for the decoder. The calculated impulse responses
* are ordered and scaled according to the matrix input.
*/
void build(const HrtfStore *Hrtf, const uint irSize,
const al::span<const AngularPoint> AmbiPoints, const float (*AmbiMatrix)[MaxAmbiChannels],
void build(const HrtfStore *Hrtf, const uint irSize, const bool perHrirMin,
const al::span<const AngularPoint> AmbiPoints,
const al::span<const std::array<float,MaxAmbiChannels>> AmbiMatrix,
const float XOverFreq, const al::span<const float,MaxAmbiOrder+1> AmbiOrderHFGain);
static std::unique_ptr<DirectHrtfState> Create(size_t num_chans);
@@ -81,10 +93,7 @@ struct DirectHrtfState {
};
al::vector<std::string> EnumerateHrtf(al::optional<std::string> pathopt);
HrtfStorePtr GetLoadedHrtf(const std::string &name, const uint devrate);
void GetHrtfCoeffs(const HrtfStore *Hrtf, float elevation, float azimuth, float distance,
float spread, HrirArray &coeffs, const al::span<uint,2> delays);
std::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt);
HrtfStorePtr GetLoadedHrtf(const std::string_view name, const uint devrate);
#endif /* CORE_HRTF_H */