diff options
author | Chris Robinson <[email protected]> | 2017-03-10 04:35:32 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-03-10 04:35:32 -0800 |
commit | 583d431947be540a33843d68feb5f1456671c298 (patch) | |
tree | 0f85220f58dd446d9732cb3a70bf7917585619c8 /OpenAL32/Include/alu.h | |
parent | d9b1995e95ac3d838566500f1e5496ae71d832e0 (diff) |
Implement NFC filters for Ambisonic rendering
NFC filters currently only work when rendering to ambisonic buffers, which
includes HQ rendering and ambisonic output. There are two new config options:
'decoder/nfc' (default on) enables or disables use of NFC filters globally, and
'decoder/nfc-ref-delay' (default 0) specifies the reference delay parameter for
NFC-HOA rendering with ambisonic output (a value of 0 disables NFC).
Currently, NFC filters rely on having an appropriate value set for
AL_METERS_PER_UNIT to get the correct scaling. HQ rendering uses the averaged
speaker distances as a control/reference, and currently doesn't correct for
individual speaker distances (if the speakers are all equidistant, this is
fine, otherwise per-speaker correction should be done as well).
Diffstat (limited to 'OpenAL32/Include/alu.h')
-rw-r--r-- | OpenAL32/Include/alu.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 03f0090d..6c374ebc 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -17,6 +17,7 @@ #include "hrtf.h" #include "align.h" +#include "nfcfilter.h" #include "math_defs.h" @@ -129,6 +130,8 @@ typedef struct DirectParams { ALfilterState LowPass; ALfilterState HighPass; + NfcFilter NFCtrlFilter[MAX_AMBI_ORDER]; + struct { HrtfParams Current; HrtfParams Target; @@ -152,6 +155,9 @@ typedef struct SendParams { } Gains; } SendParams; +#define VOICE_IS_HRTF (1<<0) +#define VOICE_HAS_NFC (1<<1) + typedef struct ALvoice { struct ALsourceProps *Props; @@ -182,7 +188,7 @@ typedef struct ALvoice { /* If not 'moving', gain/coefficients are set directly without fading. */ ALboolean Moving; - ALboolean IsHrtf; + ALuint Flags; ALuint Offset; /* Number of output samples mixed since starting. */ @@ -195,6 +201,7 @@ typedef struct ALvoice { ALfloat (*Buffer)[BUFFERSIZE]; ALsizei Channels; + ALsizei ChannelsPerOrder[MAX_AMBI_ORDER+1]; } Direct; struct { |