From a6c70992b01b168d561c448fa235a86c9697b6ef Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 15 Apr 2016 22:05:47 -0700 Subject: More directly map coefficients for ambisonic mixing buffers Instead of looping over all the coefficients for each channel with multiplies, when we know only one will have a non-0 factor for ambisonic mixing buffers, just index the one with a non-0 factor. --- OpenAL32/Include/alMain.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenAL32/Include/alMain.h') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 52296a15..12c4c610 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -509,8 +509,12 @@ struct ALCdevice_struct struct { /* Channel names for the dry buffer mix. */ enum Channel ChannelName[MAX_OUTPUT_CHANNELS]; - /* Ambisonic coefficients for mixing to the dry buffer. */ - ChannelConfig AmbiCoeffs[MAX_OUTPUT_CHANNELS]; + union { + /* Ambisonic coefficients for mixing to the dry buffer. */ + ChannelConfig Coeffs[MAX_OUTPUT_CHANNELS]; + /* Coefficient channel mapping for mixing to the dry buffer. */ + BFChannelConfig Map[MAX_OUTPUT_CHANNELS]; + } Ambi; /* Number of coefficients in each ChannelConfig to mix together (4 for * first-order, 9 for second-order, etc). */ @@ -523,8 +527,12 @@ struct ALCdevice_struct /* First-order ambisonics output, to be upsampled to the dry buffer if different. */ struct { - /* Ambisonic coefficients for mixing. */ - ChannelConfig AmbiCoeffs[MAX_OUTPUT_CHANNELS]; + union { + ChannelConfig Coeffs[MAX_OUTPUT_CHANNELS]; + BFChannelConfig Map[MAX_OUTPUT_CHANNELS]; + } Ambi; + /* Will only be 4 or 0. */ + ALuint CoeffCount; ALfloat (*Buffer)[BUFFERSIZE]; ALuint NumChannels; -- cgit v1.2.3