aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-20 05:26:51 -0700
committerChris Robinson <[email protected]>2019-08-20 05:26:51 -0700
commit7a8f81259c515291126f29a0e65aff791efe16b0 (patch)
tree124b56dc301dec0116dd6394d0f46389123da7b2
parent102ef6cb3356ef81e2a392d3aa8bd6324eb3ff30 (diff)
Use size_t for the NFC and biquad filters' sample count
-rw-r--r--alc/effects/reverb.cpp2
-rw-r--r--alc/filters/biquad.cpp2
-rw-r--r--alc/filters/biquad.h3
-rw-r--r--alc/filters/nfc.cpp8
-rw-r--r--alc/filters/nfc.h11
-rw-r--r--alc/mixvoice.cpp8
6 files changed, 19 insertions, 15 deletions
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index 1e5cb861..7f6da778 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -293,7 +293,7 @@ struct T60Filter {
const ALfloat hfDecayTime, const ALfloat lf0norm, const ALfloat hf0norm);
/* Applies the two T60 damping filter sections. */
- void process(ALfloat *samples, const ALsizei todo)
+ void process(ALfloat *samples, const size_t todo)
{
HFFilter.process(samples, samples, todo);
LFFilter.process(samples, samples, todo);
diff --git a/alc/filters/biquad.cpp b/alc/filters/biquad.cpp
index 871c4af4..a4d81604 100644
--- a/alc/filters/biquad.cpp
+++ b/alc/filters/biquad.cpp
@@ -89,7 +89,7 @@ void BiquadFilterR<Real>::setParams(BiquadType type, Real gain, Real f0norm, Rea
}
template<typename Real>
-void BiquadFilterR<Real>::process(Real *dst, const Real *src, int numsamples)
+void BiquadFilterR<Real>::process(Real *dst, const Real *src, const size_t numsamples)
{
ASSUME(numsamples > 0);
diff --git a/alc/filters/biquad.h b/alc/filters/biquad.h
index f8d7f0ba..9de86f2f 100644
--- a/alc/filters/biquad.h
+++ b/alc/filters/biquad.h
@@ -2,6 +2,7 @@
#define FILTERS_BIQUAD_H
#include <cmath>
+#include <cstddef>
#include <utility>
#include "math_defs.h"
@@ -72,7 +73,7 @@ public:
}
- void process(Real *dst, const Real *src, int numsamples);
+ void process(Real *dst, const Real *src, const size_t numsamples);
/* Rather hacky. It's just here to support "manual" processing. */
std::pair<Real,Real> getComponents() const noexcept
diff --git a/alc/filters/nfc.cpp b/alc/filters/nfc.cpp
index 4e36bc66..e4436b27 100644
--- a/alc/filters/nfc.cpp
+++ b/alc/filters/nfc.cpp
@@ -278,7 +278,7 @@ void NfcFilter::adjust(const float w0) noexcept
}
-void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const int count)
+void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const size_t count)
{
ASSUME(count > 0);
@@ -297,7 +297,7 @@ void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const i
first.z[0] = z1;
}
-void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const int count)
+void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const size_t count)
{
ASSUME(count > 0);
@@ -321,7 +321,7 @@ void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const i
second.z[1] = z2;
}
-void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const int count)
+void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const size_t count)
{
ASSUME(count > 0);
@@ -353,7 +353,7 @@ void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const i
third.z[2] = z3;
}
-void NfcFilter::process4(float *RESTRICT dst, const float *RESTRICT src, const int count)
+void NfcFilter::process4(float *RESTRICT dst, const float *RESTRICT src, const size_t count)
{
ASSUME(count > 0);
diff --git a/alc/filters/nfc.h b/alc/filters/nfc.h
index b656850a..d2bf3339 100644
--- a/alc/filters/nfc.h
+++ b/alc/filters/nfc.h
@@ -1,6 +1,9 @@
#ifndef FILTER_NFC_H
#define FILTER_NFC_H
+#include <cstddef>
+
+
struct NfcFilter1 {
float base_gain, gain;
float b1, a1;
@@ -43,16 +46,16 @@ public:
void adjust(const float w0) noexcept;
/* Near-field control filter for first-order ambisonic channels (1-3). */
- void process1(float *RESTRICT dst, const float *RESTRICT src, const int count);
+ void process1(float *RESTRICT dst, const float *RESTRICT src, const size_t count);
/* Near-field control filter for second-order ambisonic channels (4-8). */
- void process2(float *RESTRICT dst, const float *RESTRICT src, const int count);
+ void process2(float *RESTRICT dst, const float *RESTRICT src, const size_t count);
/* Near-field control filter for third-order ambisonic channels (9-15). */
- void process3(float *RESTRICT dst, const float *RESTRICT src, const int count);
+ void process3(float *RESTRICT dst, const float *RESTRICT src, const size_t count);
/* Near-field control filter for fourth-order ambisonic channels (16-24). */
- void process4(float *RESTRICT dst, const float *RESTRICT src, const int count);
+ void process4(float *RESTRICT dst, const float *RESTRICT src, const size_t count);
};
#endif /* FILTER_NFC_H */
diff --git a/alc/mixvoice.cpp b/alc/mixvoice.cpp
index a44b6a10..189e504b 100644
--- a/alc/mixvoice.cpp
+++ b/alc/mixvoice.cpp
@@ -337,7 +337,7 @@ void SendSourceStoppedEvent(ALCcontext *context, ALuint id)
const ALfloat *DoFilters(BiquadFilter *lpfilter, BiquadFilter *hpfilter, ALfloat *dst,
- const ALfloat *src, ALsizei numsamples, int type)
+ const ALfloat *src, const size_t numsamples, int type)
{
switch(type)
{
@@ -769,11 +769,11 @@ void MixVoice(ALvoice *voice, ALvoice::State vstate, const ALuint SourceID, ALCc
const al::span<float> nfcsamples{Device->NfcSampleData,
static_cast<size_t>(DstBufferSize)};
size_t chanoffset{outcount};
- using FilterProc = void (NfcFilter::*)(float*,const float*,int);
- auto apply_nfc = [voice,&parms,samples,TargetGains,DstBufferSize,Counter,OutPos,&chanoffset,nfcsamples](const FilterProc process, const size_t outcount) -> void
+ using FilterProc = void (NfcFilter::*)(float*,const float*,const size_t);
+ auto apply_nfc = [voice,&parms,samples,TargetGains,Counter,OutPos,&chanoffset,nfcsamples](const FilterProc process, const size_t outcount) -> void
{
if(outcount < 1) return;
- (parms.NFCtrlFilter.*process)(nfcsamples.data(), samples, DstBufferSize);
+ (parms.NFCtrlFilter.*process)(nfcsamples.data(), samples, nfcsamples.size());
MixSamples(nfcsamples, voice->mDirect.Buffer.subspan(chanoffset, outcount),
parms.Gains.Current+chanoffset, TargetGains+chanoffset, Counter,
OutPos);