aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-03 09:41:16 -0800
committerChris Robinson <[email protected]>2012-03-03 09:41:16 -0800
commit91ed077ebadf125913f3572ac216f6c7262b2553 (patch)
tree8b4c871f76f5694aa184d618dc31099b283dcd43
parent49433c2074c57eb996f78e32869b3069799560d6 (diff)
Handle BS2B cross-feed right after click removal
-rw-r--r--Alc/ALu.c52
1 files changed, 12 insertions, 40 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 743093ed..398912da 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -821,42 +821,49 @@ static void Write_##T##_##N(ALCdevice *device, T *RESTRICT buffer, \
}
DECL_TEMPLATE(ALfloat, 1, aluF2F)
+DECL_TEMPLATE(ALfloat, 2, aluF2F)
DECL_TEMPLATE(ALfloat, 4, aluF2F)
DECL_TEMPLATE(ALfloat, 6, aluF2F)
DECL_TEMPLATE(ALfloat, 7, aluF2F)
DECL_TEMPLATE(ALfloat, 8, aluF2F)
DECL_TEMPLATE(ALuint, 1, aluF2UI)
+DECL_TEMPLATE(ALuint, 2, aluF2UI)
DECL_TEMPLATE(ALuint, 4, aluF2UI)
DECL_TEMPLATE(ALuint, 6, aluF2UI)
DECL_TEMPLATE(ALuint, 7, aluF2UI)
DECL_TEMPLATE(ALuint, 8, aluF2UI)
DECL_TEMPLATE(ALint, 1, aluF2I)
+DECL_TEMPLATE(ALint, 2, aluF2I)
DECL_TEMPLATE(ALint, 4, aluF2I)
DECL_TEMPLATE(ALint, 6, aluF2I)
DECL_TEMPLATE(ALint, 7, aluF2I)
DECL_TEMPLATE(ALint, 8, aluF2I)
DECL_TEMPLATE(ALushort, 1, aluF2US)
+DECL_TEMPLATE(ALushort, 2, aluF2US)
DECL_TEMPLATE(ALushort, 4, aluF2US)
DECL_TEMPLATE(ALushort, 6, aluF2US)
DECL_TEMPLATE(ALushort, 7, aluF2US)
DECL_TEMPLATE(ALushort, 8, aluF2US)
DECL_TEMPLATE(ALshort, 1, aluF2S)
+DECL_TEMPLATE(ALshort, 2, aluF2S)
DECL_TEMPLATE(ALshort, 4, aluF2S)
DECL_TEMPLATE(ALshort, 6, aluF2S)
DECL_TEMPLATE(ALshort, 7, aluF2S)
DECL_TEMPLATE(ALshort, 8, aluF2S)
DECL_TEMPLATE(ALubyte, 1, aluF2UB)
+DECL_TEMPLATE(ALubyte, 2, aluF2UB)
DECL_TEMPLATE(ALubyte, 4, aluF2UB)
DECL_TEMPLATE(ALubyte, 6, aluF2UB)
DECL_TEMPLATE(ALubyte, 7, aluF2UB)
DECL_TEMPLATE(ALubyte, 8, aluF2UB)
DECL_TEMPLATE(ALbyte, 1, aluF2B)
+DECL_TEMPLATE(ALbyte, 2, aluF2B)
DECL_TEMPLATE(ALbyte, 4, aluF2B)
DECL_TEMPLATE(ALbyte, 6, aluF2B)
DECL_TEMPLATE(ALbyte, 7, aluF2B)
@@ -864,46 +871,6 @@ DECL_TEMPLATE(ALbyte, 8, aluF2B)
#undef DECL_TEMPLATE
-#define DECL_TEMPLATE(T, N, func) \
-static void Write_##T##_##N(ALCdevice *device, T *RESTRICT buffer, \
- ALuint SamplesToDo) \
-{ \
- ALfloat (*RESTRICT DryBuffer)[MAXCHANNELS] = device->DryBuffer; \
- const enum Channel *ChanMap = device->DevChannels; \
- ALuint i, j; \
- \
- if(device->Bs2b) \
- { \
- for(i = 0;i < SamplesToDo;i++) \
- { \
- float samples[2]; \
- samples[0] = DryBuffer[i][ChanMap[0]]; \
- samples[1] = DryBuffer[i][ChanMap[1]]; \
- bs2b_cross_feed(device->Bs2b, samples); \
- *(buffer++) = func(samples[0]); \
- *(buffer++) = func(samples[1]); \
- } \
- } \
- else \
- { \
- for(i = 0;i < SamplesToDo;i++) \
- { \
- for(j = 0;j < N;j++) \
- *(buffer++) = func(DryBuffer[i][ChanMap[j]]); \
- } \
- } \
-}
-
-DECL_TEMPLATE(ALfloat, 2, aluF2F)
-DECL_TEMPLATE(ALuint, 2, aluF2UI)
-DECL_TEMPLATE(ALint, 2, aluF2I)
-DECL_TEMPLATE(ALushort, 2, aluF2US)
-DECL_TEMPLATE(ALshort, 2, aluF2S)
-DECL_TEMPLATE(ALubyte, 2, aluF2UB)
-DECL_TEMPLATE(ALbyte, 2, aluF2B)
-
-#undef DECL_TEMPLATE
-
#define DECL_TEMPLATE(T) \
static void Write_##T(ALCdevice *device, T *buffer, ALuint SamplesToDo) \
{ \
@@ -1066,6 +1033,11 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
device->ClickRemoval[c] += device->PendingClicks[c];
device->PendingClicks[c] = 0.0f;
}
+ if(device->Bs2b)
+ {
+ for(i = 0;i < SamplesToDo;i++)
+ bs2b_cross_feed(device->Bs2b, &device->DryBuffer[i][0]);
+ }
}
else
{