aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alu.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-02-14 03:23:06 -0800
committerChris Robinson <[email protected]>2016-02-14 03:23:06 -0800
commitecdc93f3ca3b12ab0b226864cf8cd579140f1484 (patch)
tree9c5d34a6f9caaf163512908af0eb5da11dd90c60 /OpenAL32/Include/alu.h
parent25732d0895cc4d320472fc50cd74302d91b24a0c (diff)
Calculate HRTF stepping params right before mixing
This means we track the current params and the target params, rather than the target params and the stepping. This closer matches the non-HRTF mixers.
Diffstat (limited to 'OpenAL32/Include/alu.h')
-rw-r--r--OpenAL32/Include/alu.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 50ef1f5e..af2ea857 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -138,16 +138,19 @@ typedef struct MixGains {
ALfloat Target;
} MixGains;
+typedef struct MixHrtfParams {
+ const HrtfParams *Target;
+ HrtfParams *Current;
+ struct {
+ alignas(16) ALfloat Coeffs[HRIR_LENGTH][2];
+ ALint Delay[2];
+ } Steps;
+} MixHrtfParams;
typedef struct DirectParams {
ALfloat (*OutBuffer)[BUFFERSIZE];
ALuint OutChannels;
- /* Last direction (relative to listener) and gain of a moving source. */
- aluVector LastDir;
- ALfloat LastGain;
- ALuint HrtfCounter;
-
struct {
enum ActiveFilters ActiveType;
ALfilterState LowPass;
@@ -155,7 +158,8 @@ typedef struct DirectParams {
} Filters[MAX_INPUT_CHANNELS];
struct {
- HrtfParams Params;
+ HrtfParams Current;
+ HrtfParams Target;
HrtfState State;
} Hrtf[MAX_INPUT_CHANNELS];
@@ -191,7 +195,7 @@ typedef void (*MixerFunc)(const ALfloat *data, ALuint OutChans,
ALuint Counter, ALuint OutPos, ALuint BufferSize);
typedef void (*HrtfMixerFunc)(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
ALuint Counter, ALuint Offset, ALuint OutPos,
- const ALuint IrSize, const HrtfParams *hrtfparams,
+ const ALuint IrSize, const MixHrtfParams *hrtfparams,
HrtfState *hrtfstate, ALuint BufferSize);