aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a higher quality bsinc resampler using 24 sample pointsChris Robinson2017-08-271-0/+8
| | | | | | | This improves the transition width, allowing more of the higher frequencies remain audible. It would be preferrable to have an upper limit of 32 points instead of 48, to reduce the overall table size and the CPU cost for down- sampling.
* Rename the bsinc resampler to bsinc12Chris Robinson2017-08-251-2/+2
|
* Store the sinc4 table in the filter stateChris Robinson2017-08-161-14/+14
| | | | Also rename the resampler functions to remove the unnecessary '32' token.
* Check the source type once when mixingChris Robinson2017-08-141-2/+4
|
* Add restrict to a few more parametersChris Robinson2017-08-101-2/+4
|
* Use a macro to apply NFC filtered mixes instead of a loopChris Robinson2017-06-261-18/+16
|
* Reduce the amount of variables that hold the same valueChris Robinson2017-05-211-2/+2
|
* Increase the HRTF transition to 128 samplesChris Robinson2017-05-051-2/+2
|
* Add a mixing function to blend HRIRsChris Robinson2017-05-031-20/+20
| | | | | | This is a bit more efficient than calling the normal HRTF mixing function twice, and helps solve the problem of the values generated from convolution not being consistent with the new HRIR.
* Remove a duplicate checkChris Robinson2017-05-021-1/+1
|
* Rename VOICE_IS_HRTF to VOICE_HAS_HRTFChris Robinson2017-05-021-1/+1
|
* Rename 'moving' flag to 'fading'Chris Robinson2017-05-021-2/+2
|
* Fade HRTF coefficients over 64 samples at mostChris Robinson2017-04-281-40/+69
| | | | | | This greatly improves HRTF performance since the dual-mix only applies to the 64-sample coefficient transition. So rather than doubling the full mix, it only doubles 64 samples out of the full mix.
* Skip mixing the fade out step when starting silentChris Robinson2017-04-251-12/+19
| | | | | Unfortunately it can't skip mixing the fade in when going to silence because the history needs to be up to date.
* Store the resampler as part of the sourceChris Robinson2017-04-211-3/+1
|
* Make the default resampler a variableChris Robinson2017-04-201-8/+9
|
* Try NEON mixers before SSEChris Robinson2017-04-201-9/+8
|
* Make the buffer list next pointer atomicChris Robinson2017-04-191-3/+5
|
* Store the source queue head in the voice to signify loopingChris Robinson2017-04-181-12/+9
| | | | | This removes the need to access a couple more source fields in the mixer, and also makes the looping and queue fields non-atomic.
* Add a sample converterChris Robinson2017-04-101-10/+1
| | | | | | | | | | This is intended to do conversions for interleaved samples, and supports changing from one DevFmtType to another as well as resampling. It does not handle remixing channels. The mixer is more optimized to use the resampling functions directly. However, this should prove useful for recording with certain backends that won't do the conversion themselves.
* Handle the source offset fraction as an ALsizeiChris Robinson2017-04-081-2/+2
|
* Pre-compute the sinc4 resampler coefficient tableChris Robinson2017-04-081-92/+0
|
* Remove another reference to the sinc8 resamplerChris Robinson2017-04-071-1/+1
|
* Convert integer samples to float using a power-of-2 divisorChris Robinson2017-03-311-2/+2
| | | | | | | This should cut down on unnecessary quantization noise (however minor) for 8- and 16-bit samples. Unfortunately a power-of-2 multiple can't be used as easily for converting float samples to integer, due to integer types having a non- power-of-2 maximum amplitude (it'd require more per-sample clamping).
* Fix HRTF interpolated gain calculationChris Robinson2017-03-261-2/+2
|
* Use a loop to apply NFC filtersChris Robinson2017-03-251-30/+15
|
* Make DataPosInt an ALsizeiChris Robinson2017-03-201-15/+16
|
* Use proper bools for boolean statesChris Robinson2017-03-201-12/+11
|
* Check usability of MixHrtf_Neon before MixHrtf_SSEChris Robinson2017-03-141-4/+4
|
* Store the HRIR coeff pointer and delays directly in MixHrtfParamsChris Robinson2017-03-121-4/+10
|
* Rework HRTF coefficient fadingChris Robinson2017-03-111-35/+52
| | | | | | | | | | | | | | | This improves fading between HRIRs as sources pan around. In particular, it improves the issue with individual coefficients having various rounding errors in the stepping values, as well as issues with interpolating delay values. It does this by doing two mixing passes for each source. First using the last coefficients that fade to silence, and then again using the new coefficients that fade from silence. When added together, it creates a linear fade from one to the other. Additionally, the gain is applied separately so the individual coefficients don't step with rounding errors. Although this does increase CPU cost since it's doing two mixes per source, each mix is a bit cheaper now since the stepping is simplified to a single gain value, and the overall quality is improved.
* Make the voice's 'moving' state a bitflagChris Robinson2017-03-111-2/+2
|
* Dynamically allocate the device's HRTF stateChris Robinson2017-03-101-1/+1
|
* Implement NFC filters for Ambisonic renderingChris Robinson2017-03-101-5/+50
| | | | | | | | | | | | | | 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).
* Store the channel count and sample size in the voiceChris Robinson2017-03-071-2/+2
|
* Don't modify the source state in the mixerChris Robinson2017-03-071-1/+0
|
* Move the current buffer queue entry and play position to the voiceChris Robinson2017-02-271-7/+7
| | | | | | | | | | | | | | This has a couple behavioral changes. First and biggest is that querying AL_BUFFERS_PROCESSED from a source will always return all buffers processed when in an AL_STOPPED state. Previously all buffers would be set as processed when first becoming stopped, but newly queued buffers would *not* be indicated as processed. That old behavior was not compliant with the spec, which unequivocally states "On a source in the AL_STOPPED state, all buffers are processed." Secondly, querying AL_BUFFER on an AL_STREAMING source will now always return 0. Previously it would return the current "active" buffer in the queue, but there's no basis for that in the spec.
* Ensure a non-playing or -paused source does not use a mixing voiceChris Robinson2017-02-251-1/+2
|
* Dynamically allocate the ALsource Send[] arrayChris Robinson2017-02-211-1/+1
|
* Remove the sinc8 resampler optionChris Robinson2017-02-191-45/+14
| | | | | Perf shows less than 1 percent CPU difference from the higher quality bsinc resampler, but uses almost twice as much memory (a 128KB lookup table).
* Reorganize ALvoice membersChris Robinson2017-02-151-7/+8
| | | | | This places the Send[] array at the end of the struct, making it easier to handle dynamically.
* Make the source state atomicChris Robinson2017-02-131-1/+1
| | | | | Since it's modified by the mixer when playback is ended, a plain struct member isn't safe.
* Put BsincState in a generic unionChris Robinson2017-02-131-1/+1
|
* Add NEON-enhanced resamplersChris Robinson2017-02-121-0/+16
|
* Replace some ALvoid with voidChris Robinson2017-01-181-1/+1
|
* Use ALsizei in more placesChris Robinson2017-01-181-33/+33
|
* Pass the left and right buffers to the hrtf mixers directlyChris Robinson2017-01-171-4/+6
|
* Use ALsizei and ALint for sizes and offsets with resamplers and filtersChris Robinson2017-01-161-1/+1
|
* Use ALsizei for sizes and offsets with the mixerChris Robinson2017-01-161-3/+3
| | | | | | Unsigned 32-bit offsets actually have some potential overhead on 64-bit targets for pointer/array accesses due to rules on integer wrapping. No idea how much impact it has in practice, but it's nice to be correct about it.
* Use separate macros for atomics that don't take a memory orderChris Robinson2016-12-201-2/+2
|