diff options
author | Chris Robinson <[email protected]> | 2008-08-08 00:21:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-08-08 00:21:25 -0700 |
commit | cfe620ccb5496f8e928cdba0c74fd26b5fd87f34 (patch) | |
tree | 843804b4a9e9b11ced3ae0fbad65e02f21b61318 | |
parent | 453b01522511b6caadad909e9fee6975ea3477cd (diff) |
Remove unnecessary casting
-rw-r--r-- | Alc/ALu.c | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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++; |