Pass the normalized crossover frequency to the reset method

This commit is contained in:
Chris Robinson 2019-01-05 22:31:13 -08:00
parent aa29bf5933
commit 3b91010e21
3 changed files with 4 additions and 5 deletions

View File

@ -146,7 +146,7 @@ void BFormatDec::reset(const AmbDecConf *conf, bool allow_2band, ALsizei inchans
}
}
void BFormatDec::reset(ALsizei inchans, ALuint srate, ALsizei chancount, const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS])
void BFormatDec::reset(const ALsizei inchans, const ALfloat xover_norm, const ALsizei chancount, const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS])
{
mSamples.clear();
mSamplesHF = nullptr;
@ -162,8 +162,6 @@ void BFormatDec::reset(ALsizei inchans, ALuint srate, ALsizei chancount, const C
{ return mask | (1 << chan); }
);
const ALfloat xover_norm{400.0f / (float)srate};
const ALsizei out_order{
(inchans > 7) ? 4 :
(inchans > 5) ? 3 :

View File

@ -42,7 +42,7 @@ private:
public:
void reset(const AmbDecConf *conf, bool allow_2band, ALsizei inchans, ALuint srate, const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]);
void reset(ALsizei inchans, ALuint srate, ALsizei chancount, const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]);
void reset(const ALsizei inchans, const ALfloat xover_norm, const ALsizei chancount, const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS]);
/* Decodes the ambisonic input to the given output channels. */
void process(ALfloat (*OutBuffer)[BUFFERSIZE], const ALsizei OutChannels, const ALfloat (*InSamples)[BUFFERSIZE], const ALsizei SamplesToDo);

View File

@ -450,7 +450,8 @@ void InitPanning(ALCdevice *device)
""
);
device->AmbiDecoder.reset(new BFormatDec{});
device->AmbiDecoder->reset(coeffcount, device->Frequency, count, chancoeffs, idxmap);
device->AmbiDecoder->reset(coeffcount, 400.0f / static_cast<ALfloat>(device->Frequency),
count, chancoeffs, idxmap);
if(coeffcount <= 4)
{