aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-03-10 04:35:32 -0800
committerChris Robinson <[email protected]>2017-03-10 04:35:32 -0800
commit583d431947be540a33843d68feb5f1456671c298 (patch)
tree0f85220f58dd446d9732cb3a70bf7917585619c8 /OpenAL32/Include/alMain.h
parentd9b1995e95ac3d838566500f1e5496ae71d832e0 (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/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index cc30dcef..e4c5b94a 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -726,6 +726,7 @@ struct ALCdevice_struct
alignas(16) ALfloat SourceData[BUFFERSIZE];
alignas(16) ALfloat ResampledData[BUFFERSIZE];
alignas(16) ALfloat FilteredData[BUFFERSIZE];
+ alignas(16) ALfloat NFCtrlData[BUFFERSIZE];
/* The "dry" path corresponds to the main output. */
struct {
@@ -738,6 +739,7 @@ struct ALCdevice_struct
ALfloat (*Buffer)[BUFFERSIZE];
ALsizei NumChannels;
+ ALsizei NumChannelsPerOrder[MAX_AMBI_ORDER+1];
} Dry;
/* First-order ambisonics output, to be upsampled to the dry buffer if different. */
@@ -760,6 +762,11 @@ struct ALCdevice_struct
ALsizei NumChannels;
} RealOut;
+ /* The average speaker distance as determined by the ambdec configuration
+ * (or alternatively, by the NFC-HOA reference delay). Only used for NFC.
+ */
+ ALfloat AvgSpeakerDist;
+
/* Delay buffers used to compensate for speaker distances. */
DistanceComp ChannelDelay[MAX_OUTPUT_CHANNELS];