aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove the SAFE_CONST macroChris Robinson2018-01-141-2/+2
| | | | | Seems compilers are now allowing a pointer-to-type-array to implicitly convert to pointer-to-const-type-array.
* Move the config function declarations to their own headerChris Robinson2018-01-111-0/+1
| | | | And rename alcConfig.c to alconfig.c for consistency.
* Move the CPU capability flags to a separate headerChris Robinson2018-01-111-0/+1
|
* Avoid using macros to access anonymous structuresChris Robinson2018-01-111-2/+2
|
* Make a function pointer staticChris Robinson2018-01-101-1/+1
|
* Use one macro to handle both resample padding sizesChris Robinson2018-01-091-9/+9
|
* Rename the device's temp buffer storage to be more genericChris Robinson2018-01-091-5/+10
|
* Replace the sinc4 resampler with cubicChris Robinson2018-01-071-16/+4
| | | | | | | Turns out the C version of the cubic resampler is just slightly faster than even the SSE3 version of the FIR4 resampler. This is likely due to not using a 64KB random-access lookup table along with unaligned loads, both offseting the gains from SSE.
* Test the correct offset for the loop start rangeChris Robinson2018-01-041-1/+1
|
* Use the correct start point when loopingChris Robinson2018-01-041-2/+2
|
* Reset CompLen when loading loop repeats in the mixerChris Robinson2018-01-021-0/+1
|
* Update resampler padding checksChris Robinson2017-12-291-3/+3
|
* Make MixSamples non-static globalChris Robinson2017-12-171-2/+2
|
* Mix multiple buffers in each buffer list itemChris Robinson2017-12-161-64/+112
| | | | Basically now this just relies on being able to specify composited buffers.
* Pre-clear the source temp buffer and accumulate into itChris Robinson2017-12-161-18/+7
|
* Rename SrcDataSize to be less confusingChris Robinson2017-12-161-25/+23
|
* Allow storing multiple buffers in a ALbufferlistitemChris Robinson2017-12-151-3/+7
| | | | | | | | | | | | | | | This will be to allow buffer layering, multiple buffers of the same format and sample rate that are mixed together prior to resampling, filtering, and panning. This will allow composing sounds from individual components that can be swapped around on different invocations (e.g. layer SoundA and SoundB on one instance and SoundA and SoundC on a different instance for a slightly different sound, then just SoundA for a third instance, and so on). The longest buffer within the list item determines the length of the list item. More work needs to be done to fully support it, namely the ability to specity multiple buffers to layer for static and streaming sources. Also the behavior of loop points for layered static sources should be worked out. Should also consider allowing each layer to have a sample offset.
* 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
|