summaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 2c5cde40..404dea66 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -785,11 +785,13 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
{
ALfloat samp1, samp2;
//First order interpolator (front left)
- samp1 = (ALfloat)((ALshort)(((Data[k*Channels ]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels ]*(fraction)))>>FRACTIONBITS));
+ samp1 = (Data[k*Channels]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels]*fraction) >> FRACTIONBITS;
DryBuffer[j][FRONT_LEFT] += samp1*DrySend[FRONT_LEFT];
WetBuffer[j][FRONT_LEFT] += samp1*WetSend[FRONT_LEFT];
//First order interpolator (front right)
- samp2 = (ALfloat)((ALshort)(((Data[k*Channels+1]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+1]*(fraction)))>>FRACTIONBITS));
+ samp2 = (Data[k*Channels+1]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+1]*fraction) >> FRACTIONBITS;
DryBuffer[j][FRONT_RIGHT] += samp2*DrySend[FRONT_RIGHT];
WetBuffer[j][FRONT_RIGHT] += samp2*WetSend[FRONT_RIGHT];
if(Channels >= 4)
@@ -800,36 +802,42 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
if(Channels != 7)
{
//First order interpolator (center)
- value = (ALfloat)((ALshort)(((Data[k*Channels+i]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+i]*(fraction)))>>FRACTIONBITS));
+ value = (Data[k*Channels+i]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+i]*fraction) >> FRACTIONBITS;
DryBuffer[j][CENTER] += value*DrySend[CENTER];
WetBuffer[j][CENTER] += value*WetSend[CENTER];
i++;
}
//First order interpolator (lfe)
- value = (ALfloat)((ALshort)(((Data[k*Channels+i]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+i]*(fraction)))>>FRACTIONBITS));
+ value = (Data[k*Channels+i]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+i]*fraction) >> FRACTIONBITS;
DryBuffer[j][LFE] += value*DrySend[LFE];
WetBuffer[j][LFE] += value*WetSend[LFE];
i++;
}
//First order interpolator (back left)
- value = (ALfloat)((ALshort)(((Data[k*Channels+i]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+i]*(fraction)))>>FRACTIONBITS));
+ value = (Data[k*Channels+i]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+i]*fraction) >> FRACTIONBITS;
DryBuffer[j][BACK_LEFT] += value*DrySend[BACK_LEFT];
WetBuffer[j][BACK_LEFT] += value*WetSend[BACK_LEFT];
i++;
//First order interpolator (back right)
- value = (ALfloat)((ALshort)(((Data[k*Channels+i]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+i]*(fraction)))>>FRACTIONBITS));
+ value = (Data[k*Channels+i]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+i]*fraction) >> FRACTIONBITS;
DryBuffer[j][BACK_RIGHT] += value*DrySend[BACK_RIGHT];
WetBuffer[j][BACK_RIGHT] += value*WetSend[BACK_RIGHT];
i++;
if(Channels >= 7)
{
//First order interpolator (side left)
- value = (ALfloat)((ALshort)(((Data[k*Channels+i]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+i]*(fraction)))>>FRACTIONBITS));
+ value = (Data[k*Channels+i]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+i]*fraction) >> FRACTIONBITS;
DryBuffer[j][SIDE_LEFT] += value*DrySend[SIDE_LEFT];
WetBuffer[j][SIDE_LEFT] += value*WetSend[SIDE_LEFT];
i++;
//First order interpolator (side right)
- value = (ALfloat)((ALshort)(((Data[k*Channels+i]*((1L<<FRACTIONBITS)-fraction))+(Data[(k+1)*Channels+i]*(fraction)))>>FRACTIONBITS));
+ value = (Data[k*Channels+i]*((1<<FRACTIONBITS)-fraction) +
+ Data[(k+1)*Channels+i]*fraction) >> FRACTIONBITS;
DryBuffer[j][SIDE_RIGHT] += value*DrySend[SIDE_RIGHT];
WetBuffer[j][SIDE_RIGHT] += value*WetSend[SIDE_RIGHT];
i++;