diff options
-rw-r--r-- | Alc/alc.cpp | 2 | ||||
-rw-r--r-- | Alc/alu.cpp | 16 | ||||
-rw-r--r-- | Alc/bformatdec.cpp | 12 | ||||
-rw-r--r-- | Alc/bformatdec.h | 6 | ||||
-rw-r--r-- | Alc/effects/autowah.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/base.h | 2 | ||||
-rw-r--r-- | Alc/effects/compressor.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/equalizer.cpp | 4 | ||||
-rw-r--r-- | Alc/effects/modulator.cpp | 4 | ||||
-rw-r--r-- | Alc/hrtf.cpp | 12 | ||||
-rw-r--r-- | Alc/hrtf.h | 4 | ||||
-rw-r--r-- | Alc/panning.cpp | 18 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 |
13 files changed, 42 insertions, 44 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 010ea5f9..a71cb662 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -1927,7 +1927,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->Frequency, device->UpdateSize, device->BufferSize); aluInitRenderer(device, hrtf_id, hrtf_appreq, hrtf_userreq); - TRACE("Channel config, Main: %d, Real: %d\n", device->Dry.NumChannels, + TRACE("Channel config, Main: %u, Real: %u\n", device->Dry.NumChannels, device->RealOut.NumChannels); /* Allocate extra channels for any post-filter output. */ diff --git a/Alc/alu.cpp b/Alc/alu.cpp index fbafd021..eed4ddc3 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -134,8 +134,7 @@ void ProcessHrtf(ALCdevice *device, const ALsizei SamplesToDo) DirectHrtfState *state{device->mHrtfState.get()}; MixDirectHrtf(device->RealOut.Buffer[lidx], device->RealOut.Buffer[ridx], - {device->Dry.Buffer,device->Dry.Buffer+device->Dry.NumChannels}, device->HrtfAccumData, - state, SamplesToDo); + {device->Dry.Buffer, device->Dry.NumChannels}, device->HrtfAccumData, state, SamplesToDo); } void ProcessAmbiDec(ALCdevice *device, const ALsizei SamplesToDo) @@ -982,8 +981,7 @@ void CalcNonAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, cons } else { - voice->mSend[i].Buffer = {SendSlots[i]->Wet.Buffer, - static_cast<size_t>(SendSlots[i]->Wet.NumChannels)}; + voice->mSend[i].Buffer = {SendSlots[i]->Wet.Buffer, SendSlots[i]->Wet.NumChannels}; } } @@ -1028,7 +1026,7 @@ void CalcAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, const A const ALlistener &Listener = ALContext->Listener; /* Set mixing buffers and get send parameters. */ - voice->mDirect.Buffer = {Device->Dry.Buffer, static_cast<size_t>(Device->Dry.NumChannels)}; + voice->mDirect.Buffer = {Device->Dry.Buffer, Device->Dry.NumChannels}; ALeffectslot *SendSlots[MAX_SENDS]; ALfloat RoomRolloff[MAX_SENDS]; ALfloat DecayDistance[MAX_SENDS]; @@ -1085,10 +1083,7 @@ void CalcAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, const A if(!SendSlots[i]) voice->mSend[i].Buffer = {}; else - { - voice->mSend[i].Buffer = {SendSlots[i]->Wet.Buffer, - static_cast<size_t>(SendSlots[i]->Wet.NumChannels)}; - } + voice->mSend[i].Buffer = {SendSlots[i]->Wet.Buffer, SendSlots[i]->Wet.NumChannels}; } /* Transform source to listener space (convert to head relative) */ @@ -1459,9 +1454,8 @@ void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo) [SamplesToDo](const ALeffectslot *slot) -> void { EffectState *state{slot->Params.mEffectState}; - const auto outchans = static_cast<size_t>(state->mOutChannels); state->process(SamplesToDo, slot->Wet.Buffer, slot->Wet.NumChannels, - {state->mOutBuffer, outchans}); + {state->mOutBuffer, state->mOutChannels}); } ); } diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp index 6d2dbfbe..9c0c72ec 100644 --- a/Alc/bformatdec.cpp +++ b/Alc/bformatdec.cpp @@ -49,7 +49,7 @@ inline auto GetAmbiScales(AmbDecScale scaletype) noexcept -> const std::array<fl } // namespace -BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALsizei inchans, +BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALuint inchans, const ALuint srate, const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]) { mDualBand = allow_2band && (conf->FreqBands == 2); @@ -119,7 +119,7 @@ BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALs } } -BFormatDec::BFormatDec(const ALsizei inchans, const ALsizei chancount, +BFormatDec::BFormatDec(const ALuint inchans, const ALsizei chancount, const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]) { @@ -154,12 +154,12 @@ void BFormatDec::process(FloatBufferLine *OutBuffer, const ALuint OutChannels, if(mDualBand) { - for(ALsizei i{0};i < mNumChannels;i++) + for(ALuint i{0};i < mNumChannels;i++) mXOver[i].process(mSamplesHF[i].data(), mSamplesLF[i].data(), InSamples[i].data(), SamplesToDo); - const al::span<const FloatBufferLine> hfsamples{mSamplesHF, mSamplesHF+mNumChannels}; - const al::span<const FloatBufferLine> lfsamples{mSamplesLF, mSamplesLF+mNumChannels}; + const al::span<const FloatBufferLine> hfsamples{mSamplesHF, mNumChannels}; + const al::span<const FloatBufferLine> lfsamples{mSamplesLF, mNumChannels}; for(ALuint chan{0};chan < OutChannels;chan++) { if(UNLIKELY(!(mEnabled&(1<<chan)))) @@ -171,7 +171,7 @@ void BFormatDec::process(FloatBufferLine *OutBuffer, const ALuint OutChannels, } else { - const al::span<const FloatBufferLine> insamples{InSamples, InSamples+mNumChannels}; + const al::span<const FloatBufferLine> insamples{InSamples, mNumChannels}; for(ALuint chan{0};chan < OutChannels;chan++) { if(UNLIKELY(!(mEnabled&(1<<chan)))) diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h index 4693fd4b..47723815 100644 --- a/Alc/bformatdec.h +++ b/Alc/bformatdec.h @@ -32,13 +32,13 @@ class BFormatDec { std::array<ALfloat,BUFFERSIZE> *mSamplesHF{nullptr}; std::array<ALfloat,BUFFERSIZE> *mSamplesLF{nullptr}; - ALsizei mNumChannels{0}; + ALuint mNumChannels{0u}; bool mDualBand{false}; public: - BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALsizei inchans, + BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALuint inchans, const ALuint srate, const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]); - BFormatDec(const ALsizei inchans, const ALsizei chancount, + BFormatDec(const ALuint inchans, const ALsizei chancount, const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]); diff --git a/Alc/effects/autowah.cpp b/Alc/effects/autowah.cpp index 90531229..ab885460 100644 --- a/Alc/effects/autowah.cpp +++ b/Alc/effects/autowah.cpp @@ -121,7 +121,7 @@ void ALautowahState::update(const ALCcontext *context, const ALeffectslot *slot, mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; - for(ALsizei i{0};i < slot->Wet.NumChannels;++i) + for(ALuint i{0u};i < slot->Wet.NumChannels;++i) { auto coeffs = GetAmbiIdentityRow(i); ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); diff --git a/Alc/effects/base.h b/Alc/effects/base.h index d2b33b9b..1a59078f 100644 --- a/Alc/effects/base.h +++ b/Alc/effects/base.h @@ -145,7 +145,7 @@ struct EffectState { RefCount mRef{1u}; FloatBufferLine *mOutBuffer{nullptr}; - ALsizei mOutChannels{0}; + ALuint mOutChannels{0u}; virtual ~EffectState() = default; diff --git a/Alc/effects/compressor.cpp b/Alc/effects/compressor.cpp index 5c0d0121..049f521b 100644 --- a/Alc/effects/compressor.cpp +++ b/Alc/effects/compressor.cpp @@ -80,7 +80,7 @@ void CompressorState::update(const ALCcontext* UNUSED(context), const ALeffectsl mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; - for(ALsizei i{0};i < slot->Wet.NumChannels;++i) + for(ALuint i{0u};i < slot->Wet.NumChannels;++i) { auto coeffs = GetAmbiIdentityRow(i); ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mGain[i]); diff --git a/Alc/effects/equalizer.cpp b/Alc/effects/equalizer.cpp index d37f15ea..179dbc1b 100644 --- a/Alc/effects/equalizer.cpp +++ b/Alc/effects/equalizer.cpp @@ -141,7 +141,7 @@ void EqualizerState::update(const ALCcontext *context, const ALeffectslot *slot, BiquadFilter::rcpQFromSlope(gain, 0.75f)); /* Copy the filter coefficients for the other input channels. */ - for(ALsizei i{1};i < slot->Wet.NumChannels;++i) + for(ALuint i{1u};i < slot->Wet.NumChannels;++i) { mChans[i].filter[0].copyParamsFrom(mChans[0].filter[0]); mChans[i].filter[1].copyParamsFrom(mChans[0].filter[1]); @@ -151,7 +151,7 @@ void EqualizerState::update(const ALCcontext *context, const ALeffectslot *slot, mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; - for(ALsizei i{0};i < slot->Wet.NumChannels;++i) + for(ALuint i{0u};i < slot->Wet.NumChannels;++i) { auto coeffs = GetAmbiIdentityRow(i); ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp index 60728d2e..1630654f 100644 --- a/Alc/effects/modulator.cpp +++ b/Alc/effects/modulator.cpp @@ -129,12 +129,12 @@ void ModulatorState::update(const ALCcontext *context, const ALeffectslot *slot, /* Bandwidth value is constant in octaves. */ mChans[0].Filter.setParams(BiquadType::HighPass, 1.0f, f0norm, BiquadFilter::rcpQFromBandwidth(f0norm, 0.75f)); - for(ALsizei i{1};i < slot->Wet.NumChannels;++i) + for(ALuint i{1u};i < slot->Wet.NumChannels;++i) mChans[i].Filter.copyParamsFrom(mChans[0].Filter); mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; - for(ALsizei i{0};i < slot->Wet.NumChannels;++i) + for(ALuint i{0u};i < slot->Wet.NumChannels;++i) { auto coeffs = GetAmbiIdentityRow(i); ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains); diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp index 438997ad..668e5b24 100644 --- a/Alc/hrtf.cpp +++ b/Alc/hrtf.cpp @@ -291,7 +291,9 @@ std::unique_ptr<DirectHrtfState> DirectHrtfState::Create(size_t num_chans) return std::unique_ptr<DirectHrtfState>{new (ptr) DirectHrtfState{num_chans}}; } -void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_CHANNELS], const size_t AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain) +void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALuint NumChannels, + const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_CHANNELS], + const size_t AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain) { static constexpr int OrderFromChan[MAX_AMBI_CHANNELS]{ 0, 1,1,1, 2,2,2,2,2, 3,3,3,3,3,3,3, @@ -350,7 +352,7 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz if(!DualBand) { /* For single-band decoding, apply the HF scale to the response. */ - for(ALsizei i{0};i < NumChannels;++i) + for(ALuint i{0u};i < NumChannels;++i) { const ALdouble mult{ALdouble{AmbiOrderHFGain[OrderFromChan[i]]} * AmbiMatrix[c][i]}; @@ -392,7 +394,7 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz static_cast<int>(tmpfilt[2].size())); /* Apply left ear response with delay and HF scale. */ - for(ALsizei i{0};i < NumChannels;++i) + for(ALuint i{0u};i < NumChannels;++i) { const ALdouble mult{AmbiMatrix[c][i]}; const ALdouble hfgain{AmbiOrderHFGain[OrderFromChan[i]]}; @@ -413,7 +415,7 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz splitter.process(tmpfilt[0].data(), tmpfilt[1].data(), tmpfilt[2].data(), static_cast<int>(tmpfilt[2].size())); - for(ALsizei i{0};i < NumChannels;++i) + for(ALuint i{0u};i < NumChannels;++i) { const ALdouble mult{AmbiMatrix[c][i]}; const ALdouble hfgain{AmbiOrderHFGain[OrderFromChan[i]]}; @@ -425,7 +427,7 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz tmpfilt.clear(); idx.clear(); - for(ALsizei i{0};i < NumChannels;++i) + for(ALuint i{0u};i < NumChannels;++i) { auto copy_arr = [](const std::array<double,2> &in) noexcept -> std::array<float,2> { return std::array<float,2>{{static_cast<float>(in[0]), static_cast<float>(in[1])}}; }; @@ -115,6 +115,8 @@ void GetHrtfCoeffs(const HrtfEntry *Hrtf, ALfloat elevation, ALfloat azimuth, AL * ordered and scaled according to the matrix input. Note the specified virtual * positions should be in degrees, not radians! */ -void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_CHANNELS], const size_t AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain); +void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALuint NumChannels, + const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_CHANNELS], + const size_t AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain); #endif /* ALC_HRTF_H */ diff --git a/Alc/panning.cpp b/Alc/panning.cpp index 87f8bf72..d43f3f0f 100644 --- a/Alc/panning.cpp +++ b/Alc/panning.cpp @@ -328,7 +328,7 @@ auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<int,MAX_A void InitPanning(ALCdevice *device) { al::span<const ChannelMap> chanmap; - ALsizei coeffcount{}; + ALuint coeffcount{}; switch(device->FmtChans) { @@ -383,7 +383,7 @@ void InitPanning(ALCdevice *device) [&n3dscale](const ALsizei &acn) noexcept -> BFChannelConfig { return BFChannelConfig{1.0f/n3dscale[acn], acn}; } ); - device->Dry.NumChannels = static_cast<ALsizei>(count); + device->Dry.NumChannels = static_cast<ALuint>(count); ALfloat nfc_delay{0.0f}; if(ConfigValueFloat(devname, "decoder", "nfc-ref-delay", &nfc_delay) && nfc_delay > 0.0f) @@ -417,7 +417,7 @@ void InitPanning(ALCdevice *device) * channel count. Built-in speaker decoders are always 2D, so just * reverse that calculation. */ - device->mAmbiOrder = (coeffcount-1) / 2; + device->mAmbiOrder = static_cast<ALsizei>((coeffcount-1) / 2); std::transform(AmbiIndex::From2D.begin(), AmbiIndex::From2D.begin()+coeffcount, std::begin(device->Dry.AmbiMap), @@ -450,10 +450,10 @@ void InitCustomPanning(ALCdevice *device, bool hqdec, const AmbDecConf *conf, co (conf->ChanMask > AMBI_1ORDER_MASK) ? 2 : 1}; device->mAmbiOrder = order; - ALsizei count; + ALuint count; if((conf->ChanMask&AMBI_PERIPHONIC_MASK)) { - count = static_cast<ALsizei>(AmbiChannelsFromOrder(order)); + count = static_cast<ALuint>(AmbiChannelsFromOrder(order)); std::transform(AmbiIndex::From3D.begin(), AmbiIndex::From3D.begin()+count, std::begin(device->Dry.AmbiMap), [](const ALsizei &index) noexcept { return BFChannelConfig{1.0f, index}; } @@ -461,7 +461,7 @@ void InitCustomPanning(ALCdevice *device, bool hqdec, const AmbDecConf *conf, co } else { - count = static_cast<ALsizei>(Ambi2DChannelsFromOrder(order)); + count = static_cast<ALuint>(Ambi2DChannelsFromOrder(order)); std::transform(AmbiIndex::From2D.begin(), AmbiIndex::From2D.begin()+count, std::begin(device->Dry.AmbiMap), [](const ALsizei &index) noexcept { return BFChannelConfig{1.0f, index}; } @@ -607,7 +607,7 @@ void InitHrtfPanning(ALCdevice *device) std::begin(device->Dry.AmbiMap), [](const ALsizei &index) noexcept { return BFChannelConfig{1.0f, index}; } ); - device->Dry.NumChannels = static_cast<ALsizei>(count); + device->Dry.NumChannels = static_cast<ALuint>(count); device->RealOut.NumChannels = device->channelsFromFmt(); @@ -733,7 +733,7 @@ void CalcAmbiCoeffs(const ALfloat y, const ALfloat z, const ALfloat x, const ALf void ComputePanGains(const MixParams *mix, const ALfloat *RESTRICT coeffs, ALfloat ingain, ALfloat (&gains)[MAX_OUTPUT_CHANNELS]) { auto ambimap = mix->AmbiMap.cbegin(); - const ALsizei numchans{mix->NumChannels}; + const ALuint numchans{mix->NumChannels}; ASSUME(numchans > 0); auto iter = std::transform(ambimap, ambimap+numchans, std::begin(gains), @@ -998,5 +998,5 @@ void aluInitEffectPanning(ALeffectslot *slot, ALCdevice *device) ); std::fill(iter, slot->Wet.AmbiMap.end(), BFChannelConfig{}); slot->Wet.Buffer = slot->MixBuffer.data(); - slot->Wet.NumChannels = static_cast<ALsizei>(count); + slot->Wet.NumChannels = static_cast<ALuint>(count); } diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 35ac617a..0534751f 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -318,7 +318,7 @@ struct MixParams { std::array<BFChannelConfig,MAX_OUTPUT_CHANNELS> AmbiMap; FloatBufferLine *Buffer{nullptr}; - ALsizei NumChannels{0}; + ALuint NumChannels{0u}; }; struct RealMixParams { |