Commit Graph

5989 Commits

Author SHA1 Message Date
Chris Robinson 0e4402b2e1 Avoid some explicit loops 2019-03-05 06:21:09 -08:00
Chris Robinson da9ec374d8 Normalize HRIRs using their maximum RMS 2019-03-04 08:00:04 -08:00
Chris Robinson 90d1e1212b Pass a reference to function for a template parameter 2019-03-03 00:24:33 -08:00
Chris Robinson 2d14de3fb0 Use more specific names for temp buffer storage 2019-03-02 23:41:26 -08:00
Chris Robinson 0aa0f24dd7 Use a proper flag to indicate audio is prepared in alffplay 2019-03-01 22:46:56 -08:00
Chris Robinson e4b76d2627 Reverse the HRTF field array
Most often a sound's distance will be beyond the farthest field measurement, so
It's more efficient to have the farthest field first and avoid looping through
the whole field array for them.
2019-02-27 23:13:40 -08:00
Chris Robinson 86926f0998 Combine the reverb output mixes into a single call 2019-02-25 05:52:37 -08:00
Chris Robinson 8a34bd59b0 Unlock the audio decoder mutex before disabling events in alffplay
The callback may be waiting on the mutex, but disabling the callback needs any
current invocation to finish first.
2019-02-25 02:03:43 -08:00
Chris Robinson 81aa5af3b9 Make sure the reverb fading completes
The processing loop doesn't depend on being aligned anymore, so it won't get
stuck when only less than 4 samples can be done in a non-final update.
2019-02-25 01:08:11 -08:00
Chris Robinson 4d6b66163c Convert the device frequency to float just once 2019-02-24 19:07:21 -08:00
Chris Robinson d6fb4d5f52 Make sure the voice's direct buffer is always set 2019-02-24 19:02:49 -08:00
Chris Robinson d2664e2192 Remove a duplicate index array 2019-02-24 18:00:49 -08:00
Chris Robinson cadff0f6c1 Reduce BUFFERSIZE to match the default period size
Also adds a bit more space to the temp source data buffer, to avoid needing to
loop on matching sample rates.
2019-02-24 16:13:51 -08:00
Chris Robinson a2ba550ebf Rework reverb A/B-Format conversion mixing
This should help improve performance using the optimized mixers, and fewer
passes on the transforms, though at the cost of more memory.
2019-02-24 15:43:56 -08:00
Chris Robinson 4ec0aed286 Change some functions to proper methods 2019-02-23 03:18:12 -08:00
Chris Robinson 42934b09e5 Avoid multiple int-to-float conversions 2019-02-23 01:43:55 -08:00
Chris Robinson 3683e31662 Constify some parameters and remove an explicit loop 2019-02-23 00:01:38 -08:00
Chris Robinson 317206e8f3 Remove the FOAOut mixing buffer and associated post-processes 2019-02-22 22:35:37 -08:00
Chris Robinson 45378fe687 Remove the unused FOAOut EffectTarget 2019-02-22 22:03:04 -08:00
Chris Robinson 5b35e60a98 Apply ambisonic upsampling on reverb output as needed
This isn't the greatest thing since it splits the A-to-B-Format transform from
the panning transform. The A-to-B and HF scale mixes are also not as optimal as
they could be, since they can't use the main mixer functions (wrong buffer line
length).

It does, however, get rid of the final use of the FOAOut buffer, so the
upsampling post-process is no longer needed.
2019-02-22 21:53:45 -08:00
Chris Robinson 6a3c10d850 Ensure reverb fading doesn't end with less than 4 samples 2019-02-22 02:15:22 -08:00
Chris Robinson 6a2cf96448 Avoid some unnecessary local variables 2019-02-22 01:00:57 -08:00
Chris Robinson 01ac6e2e56 Combine reverb transform matrices one column at a time 2019-02-21 19:05:20 -08:00
Chris Robinson 7a9d67934f Mix B-Format sources directly to the dry buffer
Now the only thing that utilizes FOAOut is reverb output.
2019-02-21 17:48:08 -08:00
Chris Robinson 1eea3cb2d1 Remove RESTRICT from the bandsplitter process method
The compiler can see there's no aliasing with the local variables, and the
input/output buffers are handled sequentially one element at a time anyway.
2019-02-21 17:37:02 -08:00
Chris Robinson 169a11dffc Add some preliminary fields for mix-time ambisonic upsampling 2019-02-21 04:57:56 -08:00
Chris Robinson 8ac2d34706 Allow processing some effects in higher order ambisonics
Reverb notably is still only first-order (any higher order channels are
dropped, and it writes to FOAOut). But others, like the equalizer, work on all
available channels.
2019-02-21 04:23:01 -08:00
Chris Robinson a964890537 Add helpers to get the channel count from an ambisonic order 2019-02-21 04:05:49 -08:00
Chris Robinson a35255291f Fix unused parameter warning 2019-02-21 03:54:12 -08:00
Chris Robinson 8d2d7c63da Get rid of the MAX_EFFECT_CHANNELS macro 2019-02-21 03:52:54 -08:00
Chris Robinson 462e320847 Make sure the B2A matrix has enough values for the input count 2019-02-21 03:31:24 -08:00
Chris Robinson d95e144c48 Remove some now-unnecessary ReverbState fields 2019-02-21 03:07:36 -08:00
Chris Robinson 4b4041319d Pass the number of input channels to EffectState::process 2019-02-21 02:57:39 -08:00
Chris Robinson 7e00f646d9 Add a method to get the row of an ambisonic identity transform 2019-02-21 02:13:30 -08:00
Chris Robinson 615446d6d5 Ensure the device's mAmbiOrder is always set appropriately
The Dry target is always ambisonic, so set its order correctly.
2019-02-21 01:23:11 -08:00
Chris Robinson 3966665ca3 Store effect slots in groups of 64
Now that their wet buffers are allocated dynamically, the ALeffectslot object
itself is rather small.
2019-02-20 22:00:26 -08:00
Chris Robinson c43381d811 Allocate the effect slot wet buffer dynamically 2019-02-20 21:01:08 -08:00
Chris Robinson 77ba61ecb3 Partially handle non-periphonic reverb input 2019-02-19 22:55:43 -08:00
Chris Robinson 87902fa3b2 Use the right macro for the number of reverb panning gains 2019-02-19 20:51:10 -08:00
Chris Robinson 194fcb6bb7 Rename MAX_AMBI_COEFFS and MAX_AMBI2D_COEFFS 2019-02-19 15:39:33 -08:00
Chris Robinson a75bc26173 Reduce some indenting 2019-02-19 02:30:01 -08:00
Chris Robinson 2c04095d22 Apply the upsampler's all-pass when mixing the band-split samples 2019-02-19 02:05:35 -08:00
Chris Robinson d713f5f828 Clean up some AmbiUpsampler initialization 2019-02-19 01:59:30 -08:00
Chris Robinson 69ab36cc14 Avoid a temp buffer for the distance compensation delay 2019-02-17 00:43:10 -08:00
Chris Robinson c95d6a5d8c Apply phase correction to the ambisonic decoder HRIRs
This preserves the original phase of the HRIR frequencies for decoding the
ambisonic signal. This should help prevent extra coloration from the band-
splitter used to scale the HF response.
2019-02-16 22:57:38 -08:00
Chris Robinson 69f6f56160 Avoid using internal AL[u]int64 types 2019-02-11 12:16:58 -08:00
Chris Robinson 2fc8461c14 Don't check for __int64 2019-02-11 11:44:35 -08:00
Chris Robinson dac609b29a Move some more functions to alnumeric.h 2019-02-11 11:31:31 -08:00
Chris Robinson 21aaa18c50 Get rid of the FAM_SIZE macro 2019-02-11 11:14:34 -08:00
Chris Robinson 995c9649cb Move some number-related stuff to a separate header 2019-02-11 11:07:06 -08:00