aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't check for space in the ringbuffer before trying to writeChris Robinson2018-03-031-5/+2
| | | | The write method already checks and returns how much it managed to fit in.
* Only send one buffer completed event per updateChris Robinson2018-02-251-5/+3
| | | | | The 'param' callback parameter indicates the number of buffers that were completed.
* Count all buffers in a list item for processed and queuedChris Robinson2018-02-251-1/+1
|
* Combine multiple functions called sequentiallyChris Robinson2018-02-111-2/+2
|
* Don't generate Buffer Completed events for static sourcesChris Robinson2018-02-011-9/+34
|
* Use a semaphore to signal the event handlerChris Robinson2018-02-011-1/+1
| | | | | | | | | | | Semaphores allow for semi-persistent signals, compared to a condition variable which requires a mutex for proper detection. A semaphore can be 'post'ed after writing some data on one thread, and another thread will be able to recognize it quickly even if the post occured in between checking for data and waiting. This more correctly fixes a race condition with events since the mixer shouldn't be using mutexes, and arbitrary wake-ups just to make sure an event wasn't missed was quite inefficient.
* Send buffer completed events when enabledChris Robinson2018-02-011-10/+37
|
* Handle double-precision buffers in the mixerChris Robinson2018-01-211-0/+5
|
* Store 8-bit sample types directly as unsigned byteChris Robinson2018-01-191-4/+4
|
* Store mulaw and alaw samples directly in the bufferChris Robinson2018-01-171-9/+18
| | | | | | | They're now decompressed on the fly in the mixer. This is not a significant performance issue given that it only needs a 512-byte lookup table, and the buffer stores half as much data (it may actually be faster, requiring less overall memory).
* Use a voice flag to indicate it being staticChris Robinson2018-01-161-2/+2
|
* Use a global RowMixerFuncChris Robinson2018-01-161-1/+3
|
* 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
|