2016-03-15 05:08:05 -07:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-12-08 04:10:45 -08:00
|
|
|
#include <cmath>
|
2018-11-03 18:00:05 -07:00
|
|
|
#include <array>
|
|
|
|
#include <vector>
|
2018-12-08 01:32:43 -08:00
|
|
|
#include <numeric>
|
2018-12-08 04:10:45 -08:00
|
|
|
#include <algorithm>
|
2018-12-08 01:32:43 -08:00
|
|
|
#include <functional>
|
2018-11-03 18:00:05 -07:00
|
|
|
|
2016-03-15 05:08:05 -07:00
|
|
|
#include "bformatdec.h"
|
|
|
|
#include "ambdec.h"
|
2018-04-21 23:23:46 -07:00
|
|
|
#include "filters/splitter.h"
|
2016-03-15 05:08:05 -07:00
|
|
|
#include "alu.h"
|
|
|
|
|
2016-03-23 12:53:36 -07:00
|
|
|
#include "threads.h"
|
2016-03-29 00:44:58 -07:00
|
|
|
#include "almalloc.h"
|
2016-03-23 12:53:36 -07:00
|
|
|
|
2016-03-15 05:08:05 -07:00
|
|
|
|
2018-11-03 18:00:05 -07:00
|
|
|
namespace {
|
|
|
|
|
2019-01-05 22:24:38 -08:00
|
|
|
using namespace std::placeholders;
|
|
|
|
|
2018-02-12 20:58:39 -08:00
|
|
|
#define HF_BAND 0
|
|
|
|
#define LF_BAND 1
|
2018-12-08 02:50:34 -08:00
|
|
|
static_assert(BFormatDec::sNumBands == 2, "Unexpected BFormatDec::sNumBands");
|
2016-07-17 00:29:02 -07:00
|
|
|
|
2019-01-05 21:55:14 -08:00
|
|
|
constexpr ALfloat Ambi3DDecoderHFScale[MAX_AMBI_ORDER+1] = {
|
2019-01-06 17:45:44 -08:00
|
|
|
1.00000000e+00f, 1.00000000e+00f
|
2016-07-30 09:29:21 -07:00
|
|
|
};
|
2019-01-05 21:55:14 -08:00
|
|
|
constexpr ALfloat Ambi3DDecoderHFScale2O[MAX_AMBI_ORDER+1] = {
|
2019-01-06 17:45:44 -08:00
|
|
|
7.45355990e-01f, 1.00000000e+00f
|
2018-02-12 21:24:58 -08:00
|
|
|
};
|
2019-01-05 21:55:14 -08:00
|
|
|
constexpr ALfloat Ambi3DDecoderHFScale3O[MAX_AMBI_ORDER+1] = {
|
2019-01-06 17:45:44 -08:00
|
|
|
5.89792205e-01f, 8.79693856e-01f
|
2018-12-23 10:37:07 -08:00
|
|
|
};
|
2016-03-23 12:53:36 -07:00
|
|
|
|
2019-01-05 21:55:14 -08:00
|
|
|
inline auto GetDecoderHFScales(ALsizei order) noexcept -> const ALfloat(&)[MAX_AMBI_ORDER+1]
|
2018-12-23 10:37:07 -08:00
|
|
|
{
|
|
|
|
if(order >= 3) return Ambi3DDecoderHFScale3O;
|
|
|
|
if(order == 2) return Ambi3DDecoderHFScale2O;
|
|
|
|
return Ambi3DDecoderHFScale;
|
|
|
|
}
|
2016-03-23 12:53:36 -07:00
|
|
|
|
2018-12-23 10:37:07 -08:00
|
|
|
inline auto GetAmbiScales(AmbDecScale scaletype) noexcept -> const std::array<float,MAX_AMBI_COEFFS>&
|
2018-12-10 22:32:10 -08:00
|
|
|
{
|
2018-12-20 02:46:59 -08:00
|
|
|
if(scaletype == AmbDecScale::FuMa) return AmbiScale::FromFuMa;
|
|
|
|
if(scaletype == AmbDecScale::SN3D) return AmbiScale::FromSN3D;
|
|
|
|
return AmbiScale::FromN3D;
|
2018-12-10 22:32:10 -08:00
|
|
|
}
|
|
|
|
|
2018-11-03 18:00:05 -07:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
2019-01-05 19:21:25 -08:00
|
|
|
void BFormatDec::reset(const AmbDecConf *conf, bool allow_2band, ALsizei inchans, ALuint srate, const ALsizei (&chanmap)[MAX_OUTPUT_CHANNELS])
|
2016-03-15 05:08:05 -07:00
|
|
|
{
|
2018-12-08 02:50:34 -08:00
|
|
|
mSamples.clear();
|
|
|
|
mSamplesHF = nullptr;
|
|
|
|
mSamplesLF = nullptr;
|
2016-03-15 05:08:05 -07:00
|
|
|
|
2019-01-05 19:21:25 -08:00
|
|
|
mMatrix = MatrixU{};
|
|
|
|
mDualBand = allow_2band && (conf->FreqBands == 2);
|
|
|
|
if(!mDualBand)
|
2019-01-06 05:15:11 -08:00
|
|
|
mSamples.resize(2);
|
2019-01-05 19:21:25 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
mSamples.resize(inchans * 2);
|
|
|
|
mSamplesHF = mSamples.data();
|
|
|
|
mSamplesLF = mSamplesHF + inchans;
|
|
|
|
}
|
|
|
|
mNumChannels = inchans;
|
2016-03-15 05:08:05 -07:00
|
|
|
|
2018-12-15 02:42:04 -08:00
|
|
|
mEnabled = std::accumulate(std::begin(chanmap), std::begin(chanmap)+conf->Speakers.size(), 0u,
|
2018-12-08 01:32:43 -08:00
|
|
|
[](ALuint mask, const ALsizei &chan) noexcept -> ALuint
|
|
|
|
{ return mask | (1 << chan); }
|
|
|
|
);
|
2016-03-28 14:50:18 -07:00
|
|
|
|
2019-01-08 19:42:44 +01:00
|
|
|
const ALfloat xover_norm{conf->XOverFreq / static_cast<float>(srate)};
|
2017-01-24 19:03:51 -08:00
|
|
|
|
2018-12-23 10:37:07 -08:00
|
|
|
const ALsizei out_order{
|
|
|
|
(conf->ChanMask > AMBI_3ORDER_MASK) ? 4 :
|
|
|
|
(conf->ChanMask > AMBI_2ORDER_MASK) ? 3 :
|
2019-01-04 22:17:30 -08:00
|
|
|
(conf->ChanMask > AMBI_1ORDER_MASK) ? 2 : 1};
|
2018-12-08 01:32:43 -08:00
|
|
|
{
|
2019-01-05 21:55:14 -08:00
|
|
|
const ALfloat (&hfscales)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(out_order);
|
2019-01-06 05:15:11 -08:00
|
|
|
|
|
|
|
mUpsampler[0].Splitter.init(xover_norm);
|
|
|
|
mUpsampler[0].Gains[HF_BAND] = Ambi3DDecoderHFScale[0] / hfscales[0];
|
|
|
|
mUpsampler[0].Gains[LF_BAND] = 1.0f;
|
|
|
|
mUpsampler[1].Splitter.init(xover_norm);
|
|
|
|
mUpsampler[1].Gains[HF_BAND] = Ambi3DDecoderHFScale[1] / hfscales[1];
|
|
|
|
mUpsampler[1].Gains[LF_BAND] = 1.0f;
|
|
|
|
std::fill(std::begin(mUpsampler)+2, std::end(mUpsampler), mUpsampler[1]);
|
2016-03-23 12:53:36 -07:00
|
|
|
}
|
|
|
|
|
2019-01-04 22:17:30 -08:00
|
|
|
const bool periphonic{(conf->ChanMask&AMBI_PERIPHONIC_MASK) != 0};
|
2018-12-20 03:26:46 -08:00
|
|
|
const std::array<float,MAX_AMBI_COEFFS> &coeff_scale = GetAmbiScales(conf->CoeffScale);
|
2018-12-13 22:48:02 -08:00
|
|
|
const ALsizei coeff_count{periphonic ? MAX_AMBI_COEFFS : MAX_AMBI2D_COEFFS};
|
2018-12-10 21:30:22 -08:00
|
|
|
|
2018-12-13 22:48:02 -08:00
|
|
|
if(!mDualBand)
|
2016-03-15 05:08:05 -07:00
|
|
|
{
|
2018-12-15 02:42:04 -08:00
|
|
|
for(size_t i{0u};i < conf->Speakers.size();i++)
|
2016-07-17 00:29:02 -07:00
|
|
|
{
|
2018-12-13 22:48:02 -08:00
|
|
|
ALfloat (&mtx)[MAX_AMBI_COEFFS] = mMatrix.Single[chanmap[i]];
|
|
|
|
for(ALsizei j{0},k{0};j < coeff_count;j++)
|
2016-07-17 00:29:02 -07:00
|
|
|
{
|
2018-12-20 04:19:35 -08:00
|
|
|
const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]};
|
2018-12-13 22:48:02 -08:00
|
|
|
if(!(conf->ChanMask&(1<<l))) continue;
|
|
|
|
mtx[j] = conf->HFMatrix[i][k] / coeff_scale[l] *
|
|
|
|
((l>=9) ? conf->HFOrderGain[3] :
|
|
|
|
(l>=4) ? conf->HFOrderGain[2] :
|
|
|
|
(l>=1) ? conf->HFOrderGain[1] : conf->HFOrderGain[0]);
|
|
|
|
++k;
|
2016-07-17 00:29:02 -07:00
|
|
|
}
|
|
|
|
}
|
2016-03-15 05:08:05 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-04 22:17:30 -08:00
|
|
|
mXOver[0].init(xover_norm);
|
2018-12-08 04:10:45 -08:00
|
|
|
std::fill(std::begin(mXOver)+1, std::end(mXOver), mXOver[0]);
|
2016-03-15 05:08:05 -07:00
|
|
|
|
2018-12-10 21:30:22 -08:00
|
|
|
const float ratio{std::pow(10.0f, conf->XOverRatio / 40.0f)};
|
2018-12-15 02:42:04 -08:00
|
|
|
for(size_t i{0u};i < conf->Speakers.size();i++)
|
2016-03-15 05:08:05 -07:00
|
|
|
{
|
2018-12-13 22:48:02 -08:00
|
|
|
ALfloat (&mtx)[sNumBands][MAX_AMBI_COEFFS] = mMatrix.Dual[chanmap[i]];
|
|
|
|
for(ALsizei j{0},k{0};j < coeff_count;j++)
|
2016-03-25 19:57:25 -07:00
|
|
|
{
|
2018-12-20 04:19:35 -08:00
|
|
|
const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]};
|
2018-12-13 22:48:02 -08:00
|
|
|
if(!(conf->ChanMask&(1<<l))) continue;
|
|
|
|
mtx[HF_BAND][j] = conf->HFMatrix[i][k] / coeff_scale[l] *
|
|
|
|
((l>=9) ? conf->HFOrderGain[3] :
|
|
|
|
(l>=4) ? conf->HFOrderGain[2] :
|
|
|
|
(l>=1) ? conf->HFOrderGain[1] : conf->HFOrderGain[0]) * ratio;
|
|
|
|
mtx[LF_BAND][j] = conf->LFMatrix[i][k] / coeff_scale[l] *
|
|
|
|
((l>=9) ? conf->LFOrderGain[3] :
|
|
|
|
(l>=4) ? conf->LFOrderGain[2] :
|
|
|
|
(l>=1) ? conf->LFOrderGain[1] : conf->LFOrderGain[0]) / ratio;
|
|
|
|
++k;
|
2016-03-15 05:08:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-05 22:31:13 -08:00
|
|
|
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])
|
2019-01-05 19:21:25 -08:00
|
|
|
{
|
|
|
|
mSamples.clear();
|
|
|
|
mSamplesHF = nullptr;
|
|
|
|
mSamplesLF = nullptr;
|
|
|
|
|
|
|
|
mMatrix = MatrixU{};
|
|
|
|
mDualBand = false;
|
2019-01-06 05:15:11 -08:00
|
|
|
mSamples.resize(2);
|
2019-01-05 19:21:25 -08:00
|
|
|
mNumChannels = inchans;
|
|
|
|
|
|
|
|
mEnabled = std::accumulate(std::begin(chanmap), std::begin(chanmap)+chancount, 0u,
|
|
|
|
[](ALuint mask, const ALsizei &chan) noexcept -> ALuint
|
|
|
|
{ return mask | (1 << chan); }
|
|
|
|
);
|
|
|
|
|
|
|
|
const ALsizei out_order{
|
|
|
|
(inchans > 7) ? 4 :
|
|
|
|
(inchans > 5) ? 3 :
|
|
|
|
(inchans > 3) ? 2 : 1};
|
|
|
|
{
|
2019-01-05 21:55:14 -08:00
|
|
|
const ALfloat (&hfscales)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(out_order);
|
2019-01-06 05:15:11 -08:00
|
|
|
|
|
|
|
mUpsampler[0].Splitter.init(xover_norm);
|
|
|
|
mUpsampler[0].Gains[HF_BAND] = Ambi3DDecoderHFScale[0] / hfscales[0];
|
|
|
|
mUpsampler[0].Gains[LF_BAND] = 1.0f;
|
|
|
|
mUpsampler[1].Splitter.init(xover_norm);
|
|
|
|
mUpsampler[1].Gains[HF_BAND] = Ambi3DDecoderHFScale[1] / hfscales[1];
|
|
|
|
mUpsampler[1].Gains[LF_BAND] = 1.0f;
|
|
|
|
std::fill(std::begin(mUpsampler)+2, std::end(mUpsampler), mUpsampler[1]);
|
2019-01-06 06:50:58 -08:00
|
|
|
|
|
|
|
mUpAllpass[0].init(xover_norm);
|
|
|
|
std::fill(std::begin(mUpAllpass)+1, std::end(mUpAllpass), mUpAllpass[0]);
|
2019-01-05 19:21:25 -08:00
|
|
|
}
|
|
|
|
|
2019-01-05 21:55:14 -08:00
|
|
|
for(ALsizei i{0};i < chancount;i++)
|
2019-01-05 19:21:25 -08:00
|
|
|
{
|
|
|
|
const ALfloat (&coeffs)[MAX_AMBI_COEFFS] = chancoeffs[chanmap[i]];
|
|
|
|
ALfloat (&mtx)[MAX_AMBI_COEFFS] = mMatrix.Single[chanmap[i]];
|
|
|
|
|
|
|
|
std::copy_n(std::begin(coeffs), inchans, std::begin(mtx));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-24 20:44:55 -08:00
|
|
|
void BFormatDec::process(ALfloat (*OutBuffer)[BUFFERSIZE], const ALsizei OutChannels, const ALfloat (*InSamples)[BUFFERSIZE], const ALsizei SamplesToDo)
|
2016-03-15 05:08:05 -07:00
|
|
|
{
|
2018-12-08 01:32:43 -08:00
|
|
|
ASSUME(OutChannels > 0);
|
2018-12-24 20:44:55 -08:00
|
|
|
ASSUME(mNumChannels > 0);
|
2016-03-15 05:08:05 -07:00
|
|
|
|
2018-12-08 02:50:34 -08:00
|
|
|
if(mDualBand)
|
2016-03-15 05:08:05 -07:00
|
|
|
{
|
2018-12-10 21:30:22 -08:00
|
|
|
for(ALsizei i{0};i < mNumChannels;i++)
|
2018-12-08 02:50:34 -08:00
|
|
|
mXOver[i].process(mSamplesHF[i].data(), mSamplesLF[i].data(), InSamples[i],
|
|
|
|
SamplesToDo);
|
2016-03-15 05:08:05 -07:00
|
|
|
|
2018-12-10 21:30:22 -08:00
|
|
|
for(ALsizei chan{0};chan < OutChannels;chan++)
|
2016-03-15 05:08:05 -07:00
|
|
|
{
|
2018-12-08 02:50:34 -08:00
|
|
|
if(UNLIKELY(!(mEnabled&(1<<chan))))
|
2016-03-28 14:50:18 -07:00
|
|
|
continue;
|
|
|
|
|
2018-12-24 20:44:55 -08:00
|
|
|
MixRowSamples(OutBuffer[chan], mMatrix.Dual[chan][HF_BAND],
|
2018-12-08 02:50:34 -08:00
|
|
|
&reinterpret_cast<ALfloat(&)[BUFFERSIZE]>(mSamplesHF[0]),
|
2019-01-04 22:17:30 -08:00
|
|
|
mNumChannels, 0, SamplesToDo);
|
2018-12-24 20:44:55 -08:00
|
|
|
MixRowSamples(OutBuffer[chan], mMatrix.Dual[chan][LF_BAND],
|
2018-12-08 02:50:34 -08:00
|
|
|
&reinterpret_cast<ALfloat(&)[BUFFERSIZE]>(mSamplesLF[0]),
|
2019-01-04 22:17:30 -08:00
|
|
|
mNumChannels, 0, SamplesToDo);
|
2016-03-15 05:08:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-10 21:30:22 -08:00
|
|
|
for(ALsizei chan{0};chan < OutChannels;chan++)
|
2016-03-26 17:33:49 -07:00
|
|
|
{
|
2018-12-08 02:50:34 -08:00
|
|
|
if(UNLIKELY(!(mEnabled&(1<<chan))))
|
2016-03-28 14:50:18 -07:00
|
|
|
continue;
|
|
|
|
|
2018-12-24 20:44:55 -08:00
|
|
|
MixRowSamples(OutBuffer[chan], mMatrix.Single[chan], InSamples,
|
2018-12-08 02:50:34 -08:00
|
|
|
mNumChannels, 0, SamplesToDo);
|
2016-03-26 17:33:49 -07:00
|
|
|
}
|
2016-03-15 05:08:05 -07:00
|
|
|
}
|
|
|
|
}
|
2016-03-23 12:53:36 -07:00
|
|
|
|
2019-01-06 06:50:58 -08:00
|
|
|
void BFormatDec::upSample(ALfloat (*OutBuffer)[BUFFERSIZE], const ALsizei OutChannels, const ALfloat (*InSamples)[BUFFERSIZE], const ALsizei InChannels, const ALsizei SamplesToDo)
|
2016-03-23 12:53:36 -07:00
|
|
|
{
|
2018-12-08 01:32:43 -08:00
|
|
|
ASSUME(InChannels > 0);
|
2019-01-06 06:50:58 -08:00
|
|
|
ASSUME(OutChannels > InChannels);
|
2016-04-09 08:04:56 -07:00
|
|
|
|
2018-12-17 07:12:37 -08:00
|
|
|
/* This up-sampler leverages the differences observed in dual-band higher-
|
|
|
|
* order decoder matrices compared to first-order. For the same output
|
|
|
|
* channel configuration, the low-frequency matrix has identical
|
2017-01-24 19:03:51 -08:00
|
|
|
* coefficients in the shared input channels, while the high-frequency
|
|
|
|
* matrix has extra scalars applied to the W channel and X/Y/Z channels.
|
2019-01-06 05:15:11 -08:00
|
|
|
* Mixing the first-order content into the higher-order stream, with the
|
|
|
|
* appropriate counter-scales applied to the HF response, results in the
|
|
|
|
* subsequent higher-order decode generating the same response as a first-
|
|
|
|
* order decode.
|
2016-03-23 12:53:36 -07:00
|
|
|
*/
|
2018-12-08 01:32:43 -08:00
|
|
|
for(ALsizei i{0};i < InChannels;i++)
|
2016-03-23 12:53:36 -07:00
|
|
|
{
|
2019-01-06 06:50:58 -08:00
|
|
|
/* NOTE: Because we can't treat the first-order signal as completely
|
|
|
|
* decorrelated from the existing output (it may contain the reverb,
|
|
|
|
* echo, etc, portion) phase interference is a possibility if not kept
|
|
|
|
* coherent. As such, we need to apply an all-pass on the existing
|
|
|
|
* output so that it stays aligned with the upsampled signal.
|
|
|
|
*/
|
|
|
|
mUpAllpass[i].process(OutBuffer[i], SamplesToDo);
|
|
|
|
|
2019-01-06 05:15:11 -08:00
|
|
|
mUpsampler[i].Splitter.process(mSamples[HF_BAND].data(), mSamples[LF_BAND].data(),
|
|
|
|
InSamples[i], SamplesToDo);
|
|
|
|
MixRowSamples(OutBuffer[i], mUpsampler[i].Gains,
|
|
|
|
&reinterpret_cast<ALfloat(&)[BUFFERSIZE]>(mSamples[0]), sNumBands, 0, SamplesToDo);
|
2016-03-23 12:53:36 -07:00
|
|
|
}
|
2019-01-06 06:50:58 -08:00
|
|
|
for(ALsizei i{InChannels};i < OutChannels;i++)
|
|
|
|
mUpAllpass[i].process(OutBuffer[i], SamplesToDo);
|
2016-03-23 12:53:36 -07:00
|
|
|
}
|
2016-07-30 09:29:21 -07:00
|
|
|
|
|
|
|
|
2019-01-06 17:45:44 -08:00
|
|
|
std::array<ALfloat,MAX_AMBI_ORDER+1> AmbiUpsampler::GetHFOrderScales(const ALsizei in_order, const ALsizei out_order) noexcept
|
|
|
|
{
|
|
|
|
std::array<ALfloat,MAX_AMBI_ORDER+1> ret{};
|
|
|
|
|
|
|
|
assert(out_order >= in_order);
|
|
|
|
ASSUME(out_order >= in_order);
|
|
|
|
|
|
|
|
const ALfloat (&target)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(out_order);
|
|
|
|
const ALfloat (&input)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(in_order);
|
|
|
|
|
|
|
|
for(ALsizei i{0};i < in_order+1;++i)
|
|
|
|
ret[i] = input[i] / target[i];
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2019-01-05 21:55:14 -08:00
|
|
|
void AmbiUpsampler::reset(const ALsizei out_order, const ALfloat xover_norm)
|
2016-07-30 09:29:21 -07:00
|
|
|
{
|
2019-01-05 21:55:14 -08:00
|
|
|
const ALfloat (&hfscales)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(out_order);
|
2019-01-06 05:15:11 -08:00
|
|
|
|
|
|
|
mInput[0].Splitter.init(xover_norm);
|
|
|
|
mInput[0].Gains[HF_BAND] = Ambi3DDecoderHFScale[0] / hfscales[0];
|
|
|
|
mInput[0].Gains[LF_BAND] = 1.0f;
|
|
|
|
mInput[1].Splitter.init(xover_norm);
|
|
|
|
mInput[1].Gains[HF_BAND] = Ambi3DDecoderHFScale[1] / hfscales[1];
|
|
|
|
mInput[1].Gains[LF_BAND] = 1.0f;
|
|
|
|
std::fill(std::begin(mInput)+2, std::end(mInput), mInput[1]);
|
2019-01-06 06:50:58 -08:00
|
|
|
|
|
|
|
mAllpass[0].init(xover_norm);
|
|
|
|
std::fill(std::begin(mAllpass)+1, std::end(mAllpass), mAllpass[0]);
|
2016-07-30 09:29:21 -07:00
|
|
|
}
|
|
|
|
|
2019-01-06 06:50:58 -08:00
|
|
|
void AmbiUpsampler::process(ALfloat (*OutBuffer)[BUFFERSIZE], const ALsizei OutChannels, const ALfloat (*InSamples)[BUFFERSIZE], const ALsizei InChannels, const ALsizei SamplesToDo)
|
2016-07-30 09:29:21 -07:00
|
|
|
{
|
2019-01-05 21:55:14 -08:00
|
|
|
ASSUME(InChannels > 0);
|
2019-01-06 06:50:58 -08:00
|
|
|
ASSUME(OutChannels > InChannels);
|
2019-01-04 22:43:48 -08:00
|
|
|
|
2019-01-05 21:55:14 -08:00
|
|
|
for(ALsizei i{0};i < InChannels;i++)
|
2016-07-30 09:29:21 -07:00
|
|
|
{
|
2019-01-06 06:50:58 -08:00
|
|
|
mAllpass[i].process(OutBuffer[i], SamplesToDo);
|
2019-01-06 05:15:11 -08:00
|
|
|
mInput[i].Splitter.process(mSamples[HF_BAND], mSamples[LF_BAND], InSamples[i],
|
|
|
|
SamplesToDo);
|
|
|
|
MixRowSamples(OutBuffer[i], mInput[i].Gains, mSamples, sNumBands, 0, SamplesToDo);
|
2016-07-30 09:29:21 -07:00
|
|
|
}
|
2019-01-06 06:50:58 -08:00
|
|
|
for(ALsizei i{InChannels};i < OutChannels;i++)
|
|
|
|
mAllpass[i].process(OutBuffer[i], SamplesToDo);
|
2016-07-30 09:29:21 -07:00
|
|
|
}
|