aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-27 13:23:37 -0700
committerChris Robinson <[email protected]>2016-03-27 13:23:37 -0700
commit33cd3834ac9b01fb4c2ef9c5497fc9926e8b8d28 (patch)
treec8f7290ce72b95cc0aa9a5da7c95f9c4abab5acc /Alc
parent91d53560d6f7e22be00ef6243f5dc1ea3211ceed (diff)
Align the ChannelMix buffer and use it for up-sampling
Diffstat (limited to 'Alc')
-rw-r--r--Alc/bformatdec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c
index d873984a..ce489dc1 100644
--- a/Alc/bformatdec.c
+++ b/Alc/bformatdec.c
@@ -177,18 +177,18 @@ typedef struct BFormatDec {
ALfloat (*SamplesHF)[BUFFERSIZE];
ALfloat (*SamplesLF)[BUFFERSIZE];
- struct {
- const ALfloat (*restrict MatrixHF)[MAX_AMBI_COEFFS];
- const ALfloat (*restrict Encoder)[MAX_AMBI_COEFFS];
- ALuint NumChannels;
- } UpSampler;
+ alignas(16) ALfloat ChannelMix[BUFFERSIZE];
struct {
alignas(16) ALfloat Buffer[MAX_DELAY_LENGTH];
ALuint Length; /* Valid range is [0...MAX_DELAY_LENGTH). */
} Delay[MAX_OUTPUT_CHANNELS];
- ALfloat ChannelMix[BUFFERSIZE];
+ struct {
+ const ALfloat (*restrict MatrixHF)[MAX_AMBI_COEFFS];
+ const ALfloat (*restrict Encoder)[MAX_AMBI_COEFFS];
+ ALuint NumChannels;
+ } UpSampler;
ALuint NumChannels;
ALboolean DualBand;
@@ -502,8 +502,8 @@ void bformatdec_upSample(struct BFormatDec *dec, ALfloat (*restrict OutBuffer)[B
*/
for(k = 0;k < dec->UpSampler.NumChannels;k++)
{
- memset(dec->Samples[0], 0, SamplesToDo*sizeof(ALfloat));
- apply_row(dec->Samples[0], dec->UpSampler.MatrixHF[k], InSamples,
+ memset(dec->ChannelMix, 0, SamplesToDo*sizeof(ALfloat));
+ apply_row(dec->ChannelMix, dec->UpSampler.MatrixHF[k], InSamples,
InChannels, SamplesToDo);
for(j = 0;j < dec->NumChannels;j++)
@@ -512,7 +512,7 @@ void bformatdec_upSample(struct BFormatDec *dec, ALfloat (*restrict OutBuffer)[B
if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD))
continue;
for(i = 0;i < SamplesToDo;i++)
- OutBuffer[j][i] += dec->Samples[0][i] * gain;
+ OutBuffer[j][i] += dec->ChannelMix[i] * gain;
}
}
}