aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
Diffstat (limited to 'alc')
-rw-r--r--alc/alc.cpp29
-rw-r--r--alc/alcmain.h2
-rw-r--r--alc/alu.h3
-rw-r--r--alc/backends/jack.cpp2
-rw-r--r--alc/backends/wasapi.cpp2
-rw-r--r--alc/converter.cpp64
-rw-r--r--alc/converter.h12
-rw-r--r--alc/effects/reverb.cpp6
-rw-r--r--alc/hrtf.cpp16
-rw-r--r--alc/mastering.cpp14
-rw-r--r--alc/panning.cpp3
-rw-r--r--alc/uhjfilter.cpp22
-rw-r--r--alc/uhjfilter.h4
13 files changed, 90 insertions, 89 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index f5119c15..021097a3 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -1247,7 +1247,7 @@ void ProbeCaptureDeviceList()
} // namespace
/* Mixing thread piority level */
-ALint RTPrioLevel{1};
+int RTPrioLevel{1};
FILE *gLogFile{stderr};
#ifdef _DEBUG
@@ -2123,24 +2123,23 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(GetConfigValueBool(device->DeviceName.c_str(), nullptr, "dither", 1))
{
- ALint depth{
- ConfigValueInt(device->DeviceName.c_str(), nullptr, "dither-depth").value_or(0)};
+ int depth{ConfigValueInt(device->DeviceName.c_str(), nullptr, "dither-depth").value_or(0)};
if(depth <= 0)
{
switch(device->FmtType)
{
- case DevFmtByte:
- case DevFmtUByte:
- depth = 8;
- break;
- case DevFmtShort:
- case DevFmtUShort:
- depth = 16;
- break;
- case DevFmtInt:
- case DevFmtUInt:
- case DevFmtFloat:
- break;
+ case DevFmtByte:
+ case DevFmtUByte:
+ depth = 8;
+ break;
+ case DevFmtShort:
+ case DevFmtUShort:
+ depth = 16;
+ break;
+ case DevFmtInt:
+ case DevFmtUInt:
+ case DevFmtFloat:
+ break;
}
}
diff --git a/alc/alcmain.h b/alc/alcmain.h
index 8bc2fc6f..1df28fe1 100644
--- a/alc/alcmain.h
+++ b/alc/alcmain.h
@@ -369,7 +369,7 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice> {
#define RECORD_THREAD_NAME "alsoft-record"
-extern ALint RTPrioLevel;
+extern int RTPrioLevel;
void SetRTPriority(void);
void SetDefaultChannelOrder(ALCdevice *device);
diff --git a/alc/alu.h b/alc/alu.h
index 0b6aa103..7b2ac627 100644
--- a/alc/alu.h
+++ b/alc/alu.h
@@ -75,7 +75,8 @@ void aluInitMixer(void);
* Set up the appropriate panning method and mixing method given the device
* properties.
*/
-void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appreq, HrtfRequestMode hrtf_userreq);
+void aluInitRenderer(ALCdevice *device, int hrtf_id, HrtfRequestMode hrtf_appreq,
+ HrtfRequestMode hrtf_userreq);
void aluInitEffectPanning(ALeffectslot *slot, ALCdevice *device);
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp
index 8d52d6ee..33a535de 100644
--- a/alc/backends/jack.cpp
+++ b/alc/backends/jack.cpp
@@ -254,7 +254,7 @@ int JackPlayback::process(jack_nframes_t numframes) noexcept
if(numframes > total)
{
jack_nframes_t todo{numframes - total};
- auto clear_buf = [todo](ALfloat *outbuf) -> void { std::fill_n(outbuf, todo, 0.0f); };
+ auto clear_buf = [todo](float *outbuf) -> void { std::fill_n(outbuf, todo, 0.0f); };
std::for_each(out, out+numchans, clear_buf);
}
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index 6082b545..462b5038 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -1269,7 +1269,7 @@ FORCE_ALIGN int WasapiCapture::recordProc()
size_t dstframes;
if(mSampleConv)
{
- const ALvoid *srcdata{rdata};
+ const void *srcdata{rdata};
ALuint srcframes{numsamples};
dstframes = mSampleConv->convert(&srcdata, &srcframes, data.first.buf,
diff --git a/alc/converter.cpp b/alc/converter.cpp
index f20a348e..47a3bfce 100644
--- a/alc/converter.cpp
+++ b/alc/converter.cpp
@@ -24,27 +24,27 @@ namespace {
* chokes on that given the inline specializations.
*/
template<DevFmtType T>
-inline ALfloat LoadSample(typename DevFmtTypeTraits<T>::Type val) noexcept;
+inline float LoadSample(typename DevFmtTypeTraits<T>::Type val) noexcept;
-template<> inline ALfloat LoadSample<DevFmtByte>(DevFmtTypeTraits<DevFmtByte>::Type val) noexcept
+template<> inline float LoadSample<DevFmtByte>(DevFmtTypeTraits<DevFmtByte>::Type val) noexcept
{ return val * (1.0f/128.0f); }
-template<> inline ALfloat LoadSample<DevFmtShort>(DevFmtTypeTraits<DevFmtShort>::Type val) noexcept
+template<> inline float LoadSample<DevFmtShort>(DevFmtTypeTraits<DevFmtShort>::Type val) noexcept
{ return val * (1.0f/32768.0f); }
-template<> inline ALfloat LoadSample<DevFmtInt>(DevFmtTypeTraits<DevFmtInt>::Type val) noexcept
+template<> inline float LoadSample<DevFmtInt>(DevFmtTypeTraits<DevFmtInt>::Type val) noexcept
{ return static_cast<float>(val) * (1.0f/2147483648.0f); }
-template<> inline ALfloat LoadSample<DevFmtFloat>(DevFmtTypeTraits<DevFmtFloat>::Type val) noexcept
+template<> inline float LoadSample<DevFmtFloat>(DevFmtTypeTraits<DevFmtFloat>::Type val) noexcept
{ return val; }
-template<> inline ALfloat LoadSample<DevFmtUByte>(DevFmtTypeTraits<DevFmtUByte>::Type val) noexcept
+template<> inline float LoadSample<DevFmtUByte>(DevFmtTypeTraits<DevFmtUByte>::Type val) noexcept
{ return LoadSample<DevFmtByte>(static_cast<ALbyte>(val - 128)); }
-template<> inline ALfloat LoadSample<DevFmtUShort>(DevFmtTypeTraits<DevFmtUShort>::Type val) noexcept
+template<> inline float LoadSample<DevFmtUShort>(DevFmtTypeTraits<DevFmtUShort>::Type val) noexcept
{ return LoadSample<DevFmtShort>(static_cast<ALshort>(val - 32768)); }
-template<> inline ALfloat LoadSample<DevFmtUInt>(DevFmtTypeTraits<DevFmtUInt>::Type val) noexcept
+template<> inline float LoadSample<DevFmtUInt>(DevFmtTypeTraits<DevFmtUInt>::Type val) noexcept
{ return LoadSample<DevFmtInt>(static_cast<ALint>(val - 2147483648u)); }
template<DevFmtType T>
-inline void LoadSampleArray(ALfloat *RESTRICT dst, const void *src, const size_t srcstep,
+inline void LoadSampleArray(float *RESTRICT dst, const void *src, const size_t srcstep,
const size_t samples) noexcept
{
using SampleType = typename DevFmtTypeTraits<T>::Type;
@@ -54,7 +54,7 @@ inline void LoadSampleArray(ALfloat *RESTRICT dst, const void *src, const size_t
dst[i] = LoadSample<T>(ssrc[i*srcstep]);
}
-void LoadSamples(ALfloat *dst, const ALvoid *src, const size_t srcstep, const DevFmtType srctype,
+void LoadSamples(float *dst, const void *src, const size_t srcstep, const DevFmtType srctype,
const size_t samples) noexcept
{
#define HANDLE_FMT(T) \
@@ -74,27 +74,27 @@ void LoadSamples(ALfloat *dst, const ALvoid *src, const size_t srcstep, const De
template<DevFmtType T>
-inline typename DevFmtTypeTraits<T>::Type StoreSample(ALfloat) noexcept;
+inline typename DevFmtTypeTraits<T>::Type StoreSample(float) noexcept;
-template<> inline ALfloat StoreSample<DevFmtFloat>(ALfloat val) noexcept
+template<> inline ALfloat StoreSample<DevFmtFloat>(float val) noexcept
{ return val; }
-template<> inline ALint StoreSample<DevFmtInt>(ALfloat val) noexcept
+template<> inline ALint StoreSample<DevFmtInt>(float val) noexcept
{ return fastf2i(clampf(val*2147483648.0f, -2147483648.0f, 2147483520.0f)); }
-template<> inline ALshort StoreSample<DevFmtShort>(ALfloat val) noexcept
+template<> inline ALshort StoreSample<DevFmtShort>(float val) noexcept
{ return static_cast<ALshort>(fastf2i(clampf(val*32768.0f, -32768.0f, 32767.0f))); }
-template<> inline ALbyte StoreSample<DevFmtByte>(ALfloat val) noexcept
+template<> inline ALbyte StoreSample<DevFmtByte>(float val) noexcept
{ return static_cast<ALbyte>(fastf2i(clampf(val*128.0f, -128.0f, 127.0f))); }
/* Define unsigned output variations. */
-template<> inline ALuint StoreSample<DevFmtUInt>(ALfloat val) noexcept
+template<> inline ALuint StoreSample<DevFmtUInt>(float val) noexcept
{ return static_cast<ALuint>(StoreSample<DevFmtInt>(val)) + 2147483648u; }
-template<> inline ALushort StoreSample<DevFmtUShort>(ALfloat val) noexcept
+template<> inline ALushort StoreSample<DevFmtUShort>(float val) noexcept
{ return static_cast<ALushort>(StoreSample<DevFmtShort>(val) + 32768); }
-template<> inline ALubyte StoreSample<DevFmtUByte>(ALfloat val) noexcept
+template<> inline ALubyte StoreSample<DevFmtUByte>(float val) noexcept
{ return static_cast<ALubyte>(StoreSample<DevFmtByte>(val) + 128); }
template<DevFmtType T>
-inline void StoreSampleArray(void *dst, const ALfloat *RESTRICT src, const size_t dststep,
+inline void StoreSampleArray(void *dst, const float *RESTRICT src, const size_t dststep,
const size_t samples) noexcept
{
using SampleType = typename DevFmtTypeTraits<T>::Type;
@@ -105,7 +105,7 @@ inline void StoreSampleArray(void *dst, const ALfloat *RESTRICT src, const size_
}
-void StoreSamples(ALvoid *dst, const ALfloat *src, const size_t dststep, const DevFmtType dsttype,
+void StoreSamples(void *dst, const float *src, const size_t dststep, const DevFmtType dsttype,
const size_t samples) noexcept
{
#define HANDLE_FMT(T) \
@@ -125,7 +125,7 @@ void StoreSamples(ALvoid *dst, const ALfloat *src, const size_t dststep, const D
template<DevFmtType T>
-void Mono2Stereo(ALfloat *RESTRICT dst, const void *src, const size_t frames) noexcept
+void Mono2Stereo(float *RESTRICT dst, const void *src, const size_t frames) noexcept
{
using SampleType = typename DevFmtTypeTraits<T>::Type;
@@ -135,7 +135,7 @@ void Mono2Stereo(ALfloat *RESTRICT dst, const void *src, const size_t frames) no
}
template<DevFmtType T>
-void Stereo2Mono(ALfloat *RESTRICT dst, const void *src, const size_t frames) noexcept
+void Stereo2Mono(float *RESTRICT dst, const void *src, const size_t frames) noexcept
{
using SampleType = typename DevFmtTypeTraits<T>::Type;
@@ -178,7 +178,7 @@ SampleConverterPtr CreateSampleConverter(DevFmtType srcType, DevFmtType dstType,
ALuint SampleConverter::availableOut(ALuint srcframes) const
{
- ALint prepcount{mSrcPrepCount};
+ int prepcount{mSrcPrepCount};
if(prepcount < 0)
{
/* Negative prepcount means we need to skip that many input samples. */
@@ -211,7 +211,7 @@ ALuint SampleConverter::availableOut(ALuint srcframes) const
return static_cast<ALuint>(clampu64((DataSize64 + mIncrement-1)/mIncrement, 1, BUFFERSIZE));
}
-ALuint SampleConverter::convert(const ALvoid **src, ALuint *srcframes, ALvoid *dst, ALuint dstframes)
+ALuint SampleConverter::convert(const void **src, ALuint *srcframes, void *dst, ALuint dstframes)
{
const ALuint SrcFrameSize{static_cast<ALuint>(mChan.size()) * mSrcTypeSize};
const ALuint DstFrameSize{static_cast<ALuint>(mChan.size()) * mDstTypeSize};
@@ -223,13 +223,13 @@ ALuint SampleConverter::convert(const ALvoid **src, ALuint *srcframes, ALvoid *d
ALuint pos{0};
while(pos < dstframes && NumSrcSamples > 0)
{
- ALint prepcount{mSrcPrepCount};
+ int prepcount{mSrcPrepCount};
if(prepcount < 0)
{
/* Negative prepcount means we need to skip that many input samples. */
if(static_cast<ALuint>(-prepcount) >= NumSrcSamples)
{
- mSrcPrepCount = static_cast<ALint>(NumSrcSamples) + prepcount;
+ mSrcPrepCount = static_cast<int>(NumSrcSamples) + prepcount;
NumSrcSamples = 0;
break;
}
@@ -250,13 +250,13 @@ ALuint SampleConverter::convert(const ALvoid **src, ALuint *srcframes, ALvoid *d
LoadSamples(&mChan[chan].PrevSamples[prepcount], SamplesIn + mSrcTypeSize*chan,
mChan.size(), mSrcType, toread);
- mSrcPrepCount = prepcount + static_cast<ALint>(toread);
+ mSrcPrepCount = prepcount + static_cast<int>(toread);
NumSrcSamples = 0;
break;
}
- ALfloat *RESTRICT SrcData{mSrcSamples};
- ALfloat *RESTRICT DstData{mDstSamples};
+ float *RESTRICT SrcData{mSrcSamples};
+ float *RESTRICT DstData{mDstSamples};
ALuint DataPosFrac{mFracOffset};
auto DataSize64 = static_cast<uint64_t>(prepcount);
DataSize64 += toread;
@@ -297,7 +297,7 @@ ALuint SampleConverter::convert(const ALvoid **src, ALuint *srcframes, ALvoid *d
}
/* Now resample, and store the result in the output buffer. */
- const ALfloat *ResampledData{mResample(&mState, SrcData+(MAX_RESAMPLER_PADDING>>1),
+ const float *ResampledData{mResample(&mState, SrcData+(MAX_RESAMPLER_PADDING>>1),
DataPosFrac, increment, {DstData, DstSize})};
StoreSamples(DstSamples, ResampledData, mChan.size(), mDstType, DstSize);
@@ -307,7 +307,7 @@ ALuint SampleConverter::convert(const ALvoid **src, ALuint *srcframes, ALvoid *d
* fractional offset.
*/
DataPosFrac += increment*DstSize;
- mSrcPrepCount = mini(prepcount + static_cast<ALint>(toread - (DataPosFrac>>FRACTIONBITS)),
+ mSrcPrepCount = mini(prepcount + static_cast<int>(toread - (DataPosFrac>>FRACTIONBITS)),
MAX_RESAMPLER_PADDING);
mFracOffset = DataPosFrac & FRACTIONMASK;
@@ -326,7 +326,7 @@ ALuint SampleConverter::convert(const ALvoid **src, ALuint *srcframes, ALvoid *d
}
-void ChannelConverter::convert(const ALvoid *src, ALfloat *dst, ALuint frames) const
+void ChannelConverter::convert(const void *src, float *dst, ALuint frames) const
{
if(mSrcChans == DevFmtStereo && mDstChans == DevFmtMono)
{
diff --git a/alc/converter.h b/alc/converter.h
index 5842df07..b3ceea9a 100644
--- a/alc/converter.h
+++ b/alc/converter.h
@@ -20,24 +20,24 @@ struct SampleConverter {
ALuint mSrcTypeSize{};
ALuint mDstTypeSize{};
- ALint mSrcPrepCount{};
+ int mSrcPrepCount{};
ALuint mFracOffset{};
ALuint mIncrement{};
InterpState mState{};
ResamplerFunc mResample{};
- alignas(16) ALfloat mSrcSamples[BUFFERSIZE]{};
- alignas(16) ALfloat mDstSamples[BUFFERSIZE]{};
+ alignas(16) float mSrcSamples[BUFFERSIZE]{};
+ alignas(16) float mDstSamples[BUFFERSIZE]{};
struct ChanSamples {
- alignas(16) ALfloat PrevSamples[MAX_RESAMPLER_PADDING];
+ alignas(16) float PrevSamples[MAX_RESAMPLER_PADDING];
};
al::FlexArray<ChanSamples> mChan;
SampleConverter(size_t numchans) : mChan{numchans} { }
- ALuint convert(const ALvoid **src, ALuint *srcframes, ALvoid *dst, ALuint dstframes);
+ ALuint convert(const void **src, ALuint *srcframes, void *dst, ALuint dstframes);
ALuint availableOut(ALuint srcframes) const;
DEF_FAM_NEWDEL(SampleConverter, mChan)
@@ -55,7 +55,7 @@ struct ChannelConverter {
bool is_active() const noexcept { return mSrcChans != mDstChans; }
- void convert(const ALvoid *src, ALfloat *dst, ALuint frames) const;
+ void convert(const void *src, float *dst, ALuint frames) const;
};
#endif /* CONVERTER_H */
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index c97818f2..036d6f23 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -710,11 +710,11 @@ inline float CalcDensityGain(const float a)
}
/* Calculate the scattering matrix coefficients given a diffusion factor. */
-inline ALvoid CalcMatrixCoeffs(const float diffusion, float *x, float *y)
+inline void CalcMatrixCoeffs(const float diffusion, float *x, float *y)
{
/* The matrix is of order 4, so n is sqrt(4 - 1). */
- float n{std::sqrt(3.0f)};
- float t{diffusion * std::atan(n)};
+ const float n{std::sqrt(3.0f)};
+ const float t{diffusion * std::atan(n)};
/* Calculate the first mixing matrix coefficient. */
*x = std::cos(t);
diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp
index 8078bbc3..6a9c187e 100644
--- a/alc/hrtf.cpp
+++ b/alc/hrtf.cpp
@@ -100,7 +100,7 @@ constexpr ALchar magicMarker03[8]{'M','i','n','P','H','R','0','3'};
/* First value for pass-through coefficients (remaining are 0), used for omni-
* directional sounds. */
-constexpr ALfloat PassthruCoeff{0.707106781187f/*sqrt(0.5)*/};
+constexpr float PassthruCoeff{0.707106781187f/*sqrt(0.5)*/};
std::mutex LoadedHrtfLock;
al::vector<LoadedHrtf> LoadedHrtfs;
@@ -559,7 +559,7 @@ ALushort GetLE_ALushort(std::istream &data)
return static_cast<ALushort>(ret);
}
-ALint GetLE_ALint24(std::istream &data)
+int GetLE_ALint24(std::istream &data)
{
int ret = data.get();
ret |= data.get() << 8;
@@ -569,11 +569,11 @@ ALint GetLE_ALint24(std::istream &data)
ALuint GetLE_ALuint(std::istream &data)
{
- int ret = data.get();
- ret |= data.get() << 8;
- ret |= data.get() << 16;
- ret |= data.get() << 24;
- return static_cast<ALuint>(ret);
+ ALuint ret{static_cast<ALuint>(data.get())};
+ ret |= static_cast<ALuint>(data.get()) << 8;
+ ret |= static_cast<ALuint>(data.get()) << 16;
+ ret |= static_cast<ALuint>(data.get()) << 24;
+ return ret;
}
std::unique_ptr<HrtfStore> LoadHrtf00(std::istream &data, const char *filename)
@@ -1381,7 +1381,7 @@ HrtfStorePtr GetLoadedHrtf(const std::string &name, const char *devname, const A
}
std::unique_ptr<std::istream> stream;
- ALint residx{};
+ int residx{};
char ch{};
if(sscanf(fname.c_str(), "!%d%c", &residx, &ch) == 2 && ch == '_')
{
diff --git a/alc/mastering.cpp b/alc/mastering.cpp
index 7e760aa1..4ccf1f04 100644
--- a/alc/mastering.cpp
+++ b/alc/mastering.cpp
@@ -42,7 +42,7 @@ using namespace std::placeholders;
*
* http://www.richardhartersworld.com/cri/2001/slidingmin.html
*/
-ALfloat UpdateSlidingHold(SlidingHold *Hold, const ALuint i, const float in)
+float UpdateSlidingHold(SlidingHold *Hold, const ALuint i, const float in)
{
static constexpr ALuint mask{BUFFERSIZE - 1};
const ALuint length{Hold->mLength};
@@ -170,7 +170,7 @@ void PeakHoldDetector(Compressor *Comp, const ALuint SamplesToDo)
SlidingHold *hold{Comp->mHold};
ALuint i{0};
- auto detect_peak = [&i,hold](const ALfloat x_abs) -> ALfloat
+ auto detect_peak = [&i,hold](const float x_abs) -> float
{
const float x_G{std::log(maxf(0.000001f, x_abs))};
return UpdateSlidingHold(hold, i++, x_G);
@@ -293,8 +293,8 @@ void SignalDelay(Compressor *Comp, const ALuint SamplesToDo, FloatBufferLine *Ou
for(size_t c{0};c < numChans;c++)
{
- ALfloat *inout{al::assume_aligned<16>(OutBuffer[c].data())};
- ALfloat *delaybuf{al::assume_aligned<16>(Comp->mDelay[c].data())};
+ float *inout{al::assume_aligned<16>(OutBuffer[c].data())};
+ float *delaybuf{al::assume_aligned<16>(Comp->mDelay[c].data())};
auto inout_end = inout + SamplesToDo;
if LIKELY(SamplesToDo >= lookAhead)
@@ -428,11 +428,11 @@ void Compressor::process(const ALuint SamplesToDo, FloatBufferLine *OutBuffer)
if(mDelay)
SignalDelay(this, SamplesToDo, OutBuffer);
- const ALfloat (&sideChain)[BUFFERSIZE*2] = mSideChain;
+ const float (&sideChain)[BUFFERSIZE*2] = mSideChain;
auto apply_comp = [SamplesToDo,&sideChain](FloatBufferLine &input) noexcept -> void
{
- ALfloat *buffer{al::assume_aligned<16>(input.data())};
- const ALfloat *gains{al::assume_aligned<16>(&sideChain[0])};
+ float *buffer{al::assume_aligned<16>(input.data())};
+ const float *gains{al::assume_aligned<16>(&sideChain[0])};
std::transform(gains, gains+SamplesToDo, buffer, buffer,
std::bind(std::multiplies<float>{}, _1, _2));
};
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 10aa9138..7dae8879 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -682,7 +682,8 @@ void InitUhjPanning(ALCdevice *device)
} // namespace
-void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appreq, HrtfRequestMode hrtf_userreq)
+void aluInitRenderer(ALCdevice *device, int hrtf_id, HrtfRequestMode hrtf_appreq,
+ HrtfRequestMode hrtf_userreq)
{
/* Hold the HRTF the device last used, in case it's used again. */
HrtfStorePtr old_hrtf{std::move(device->mHrtf)};
diff --git a/alc/uhjfilter.cpp b/alc/uhjfilter.cpp
index 7d01a91f..f74dbc00 100644
--- a/alc/uhjfilter.cpp
+++ b/alc/uhjfilter.cpp
@@ -19,21 +19,21 @@ namespace {
#define MAX_UPDATE_SAMPLES 128
-constexpr ALfloat Filter1CoeffSqr[4] = {
+constexpr float Filter1CoeffSqr[4] = {
0.479400865589f, 0.876218493539f, 0.976597589508f, 0.997499255936f
};
-constexpr ALfloat Filter2CoeffSqr[4] = {
+constexpr float Filter2CoeffSqr[4] = {
0.161758498368f, 0.733028932341f, 0.945349700329f, 0.990599156685f
};
-void allpass_process(AllPassState *state, ALfloat *dst, const ALfloat *src, const ALfloat aa,
+void allpass_process(AllPassState *state, float *dst, const float *src, const float aa,
const size_t todo)
{
- ALfloat z1{state->z[0]};
- ALfloat z2{state->z[1]};
- auto proc_sample = [aa,&z1,&z2](const ALfloat input) noexcept -> ALfloat
+ float z1{state->z[0]};
+ float z2{state->z[1]};
+ auto proc_sample = [aa,&z1,&z2](const float input) noexcept -> float
{
- const ALfloat output{input*aa + z1};
+ const float output{input*aa + z1};
z1 = z2; z2 = output*aa - input;
return output;
};
@@ -68,8 +68,8 @@ void allpass_process(AllPassState *state, ALfloat *dst, const ALfloat *src, cons
void Uhj2Encoder::encode(FloatBufferLine &LeftOut, FloatBufferLine &RightOut,
FloatBufferLine *InSamples, const size_t SamplesToDo)
{
- alignas(16) ALfloat D[MAX_UPDATE_SAMPLES], S[MAX_UPDATE_SAMPLES];
- alignas(16) ALfloat temp[MAX_UPDATE_SAMPLES];
+ alignas(16) float D[MAX_UPDATE_SAMPLES], S[MAX_UPDATE_SAMPLES];
+ alignas(16) float temp[MAX_UPDATE_SAMPLES];
ASSUME(SamplesToDo > 0);
@@ -122,11 +122,11 @@ void Uhj2Encoder::encode(FloatBufferLine &LeftOut, FloatBufferLine &RightOut,
mLastWX = temp[todo-1];
/* Left = (S + D)/2.0 */
- ALfloat *RESTRICT left = al::assume_aligned<16>(LeftOut.data()+base);
+ float *RESTRICT left{al::assume_aligned<16>(LeftOut.data()+base)};
for(size_t i{0};i < todo;i++)
left[i] += (S[i] + D[i]) * 0.5f;
/* Right = (S - D)/2.0 */
- ALfloat *RESTRICT right = al::assume_aligned<16>(RightOut.data()+base);
+ float *RESTRICT right{al::assume_aligned<16>(RightOut.data()+base)};
for(size_t i{0};i < todo;i++)
right[i] += (S[i] - D[i]) * 0.5f;
diff --git a/alc/uhjfilter.h b/alc/uhjfilter.h
index 88d30351..e88048e1 100644
--- a/alc/uhjfilter.h
+++ b/alc/uhjfilter.h
@@ -8,7 +8,7 @@
struct AllPassState {
- ALfloat z[2]{0.0f, 0.0f};
+ float z[2]{0.0f, 0.0f};
};
/* Encoding 2-channel UHJ from B-Format is done as:
@@ -40,7 +40,7 @@ struct Uhj2Encoder {
AllPassState mFilter1_Y[4];
AllPassState mFilter2_WX[4];
AllPassState mFilter1_WX[4];
- ALfloat mLastY{0.0f}, mLastWX{0.0f};
+ float mLastY{0.0f}, mLastWX{0.0f};
/* Encodes a 2-channel UHJ (stereo-compatible) signal from a B-Format input
* signal. The input must use FuMa channel ordering and scaling.