aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Update some atomic memory orderingChris Robinson2016-11-211-2/+2
|
* Remove an unnecessary intermediate variableChris Robinson2016-11-021-7/+5
|
* Add some more 'restrict' keywordsChris Robinson2016-10-061-1/+1
|
* Pass current and target gains directly for mixingChris Robinson2016-10-051-86/+16
|
* Make some pointer-to-array parameters constChris Robinson2016-10-041-0/+13
|
* Make the SelectMixer function sharableChris Robinson2016-09-061-9/+9
|
* Combine related members into a structChris Robinson2016-08-241-1/+1
|
* Don't store the looping state in the voiceChris Robinson2016-07-311-1/+1
| | | | | Certain operations on the buffer queue depend on the loop state to behave properly, so it should not be deferred until the async voice update occurs.
* Fix use of a loop varChris Robinson2016-07-251-9/+11
|
* Move the input channel array out of the DirectParams and SendParamsChris Robinson2016-07-131-20/+18
|
* Store the voice output buffers separate from the paramsChris Robinson2016-07-111-14/+14
|
* Avoid function calls to get the HRTF sample rate and IR sizeChris Robinson2016-07-071-1/+1
|
* Make the source position calues atomicChris Robinson2016-05-191-7/+7
|
* Provide asynchronous property updates for sourcesChris Robinson2016-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This necessitates a change in how source updates are handled. Rather than just being able to update sources when a dependent object state is changed (e.g. a listener gain change), now all source updates must be proactively provided. Consequently, apps that do not utilize any deferring (AL_SOFT_defer_updates or alcSuspendContext/alcProcessContext) may utilize more CPU since it'll be filling out more update containers for the mixer thread to use. The upside is that there's less blocking between the app's calling thread and the mixer thread, particularly for vectors and other multi-value properties (filters and sends). Deferring behavior when used is also improved, since updates that shouldn't be applied yet are simply not provided. And when they are provided, the mixer doesn't have to ignore them, meaning the actual deferring of a context doesn't have to synchrnously force an update -- the process call will send any pending updates, which the mixer will apply even if another deferral occurs before the mixer runs, because it'll still be there waiting on the next mixer invocation. There is one slight bug introduced by this commit. When a listener change is made, or changes to multiple sources while updates are being deferred, it is possible for the mixer to run while the sources are prepping their updates, causing some of the source updates to be seen before the other. This will be fixed in short order.
* Use the real output's left and right channels with HRTFChris Robinson2016-03-111-1/+7
|
* Only calculate steps for the used coefficientsChris Robinson2016-02-141-1/+1
|
* Calculate HRTF stepping params right before mixingChris Robinson2016-02-141-4/+36
| | | | | This means we track the current params and the target params, rather than the target params and the stepping. This closer matches the non-HRTF mixers.
* Calculate channel gain stepping just before mixingChris Robinson2016-02-141-8/+91
|
* Mix to multichannel for effectsChris Robinson2016-01-281-1/+1
| | | | | | This mixes to a 4-channel first-order ambisonics buffer. With ACN ordering and N3D scaling, this makes it easy to remain compatible with effects that only care about mono input since channel 0 is an unattenuated mono signal.
* Move the bsincTable to a separate fileChris Robinson2015-11-101-988/+0
|
* Update the bsinc tableChris Robinson2015-11-101-966/+967
| | | | Precision is increased to cover the full 32-bit float range.
* Cast a double->float return to silence MSVCChris Robinson2015-11-061-1/+1
|
* Implement a band-limited sinc resamplerChris Robinson2015-11-051-1/+997
| | | | | | | | This is essentially a 12-point sinc resampler, unless it's resampling to a rate higher than the output, at which point it will vary between 12 and 24 points and do anti-aliasing to avoid/reduce frequencies going over nyquist. Code provided by Christopher Fitzgerald.
* Change the Kaiser rippling limit to -60dBChris Robinson2015-11-041-2/+2
| | | | | This improves the transition cutoff, shortening its width and reducing the amount of error.
* Replace the Lanczos window with Kaiser for the sinc resamplerChris Robinson2015-11-041-17/+87
|
* Update filter histories even when they're not usedChris Robinson2015-10-241-0/+4
| | | | | | If the filter properties are continually updated, and the HF or LF gain goes from <1, to 1, and later back to <1, the history shouldn't hold stale values from before it was at 1.