aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/reverb.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace restrict with RESTRICTChris Robinson2018-10-291-18/+18
|
* Don't scale the reverb fade counter so muchChris Robinson2018-09-301-5/+6
|
* Only compare the reverb params that induce a need for fadingChris Robinson2018-09-231-23/+41
| | | | | | | The offsets and coefficients are controlled by a relatively small set of input parameters, just with different base constants or different calculations. This lead to numerous redundant checks since if one value didn't change, others that use the same inputs wouldn't have either.
* Clear reverb gain coefficients when doing a device updateChris Robinson2018-09-231-0/+49
|
* Rename ALreverbState to ReverbStateChris Robinson2018-09-231-23/+23
|
* Remove another duplicate functionChris Robinson2018-09-191-4/+4
|
* Add macros for commonly used square rootsChris Robinson2018-09-191-7/+6
|
* The last reverb loop update doesn't need an aligned count.Chris Robinson2018-09-111-4/+7
|
* Ensure the max reverb update size is a multiple of 4Chris Robinson2018-09-111-2/+4
| | | | | | It's not an issue for the final mix, but if one loop has an unaligned count, the next loop will have unaligned input and output buffer targets which can crash the SSE mixers.
* Separate the delay line feeding from readingChris Robinson2018-09-101-2/+4
| | | | | Since it feeds a different line than it reads, the feeding could overwrite what's subsequently read.
* Avoid a couple line count assumptionsChris Robinson2018-09-101-2/+2
|
* Combine identical loops into a separate functionChris Robinson2018-09-101-46/+21
|
* Handle the early reflection delay separate from late refeedChris Robinson2018-09-101-57/+40
|
* Include the mid-band decay with the density gainChris Robinson2018-08-311-7/+7
|
* Calcualte and use the maximum reverb update sizeChris Robinson2018-08-311-6/+14
| | | | | Instead of requiring it to be at least as big as MAX_UPDATE_SAMPLES, which may not be true in some situations.
* Apply the decay gain when reading from the late lineChris Robinson2018-08-311-10/+17
|
* Don't modify the late reverb density with the echo parametersChris Robinson2018-08-301-13/+7
|
* Use second-order biquad filters for the reverb's T60 decayChris Robinson2018-08-121-309/+18
|
* Store the reverb state offset locally while processingChris Robinson2018-08-111-16/+14
|
* Correctly apply reverb coefficient fading over the entire fade lengthChris Robinson2018-08-091-23/+25
|
* Crossfade the early reflections delay coefficientsChris Robinson2018-08-081-30/+50
|
* Apply late reverb density gain on late reverb inputChris Robinson2018-08-081-15/+30
| | | | | | | | | | | This also uses gain stepping for changes in density or decay, so that the late reverb tap fades smoothly between delay offsets and density gain levels simultaneously. Now with these changes, it's preferrable to apply density gain adjustments on late reverb input instead of output so that samples currently in the feedback loop won't see a sudden increase or decrease in amplitude. A similar change can probably be made for the early reflection delays to further smooth out delay changes.
* Specify both scale values to FadedDelayLineOutChris Robinson2018-08-081-9/+17
|
* Properly set early reflection all-pass coefficientChris Robinson2018-08-061-3/+7
|
* Make the all-pass coefficient part of the all-pass structureChris Robinson2018-08-061-22/+17
|
* Apply the vector all-pass separate on uninterleaved samplesChris Robinson2018-08-051-159/+310
| | | | | | | | | | With the vector all-pass applied in a self-contained function, the individual steps of the early and late reverb stages can be better optimized with tighter loops. That allows for more data to be held local, resulting in less thrashing from reloading the same values multiple times. There is room for further improvement, depending on the length of the early delay lines and all-pass delay lines allowing for bulk reads.
* Apply the reverb's T60 filter in groups of samplesChris Robinson2018-08-051-54/+78
| | | | | | | The late reverb line lengths are long enough to ensure a single process loop won't rely on reading samples it wrote in the same call. So we can safely read in all samples we need from the feedback buffer up front, then more efficiently filter them.
* Mix reverb samples right after generating themChris Robinson2018-08-041-31/+36
| | | | | | | Instead of generating both the early and late reverb samples first, then mixing them both to output, this now generates and mixes the early reflections then generates and mixes the late reverb. There's no reason to hold both at the same time so this reduces the amount of temporary storage needed.
* Scale the reverb decay weights to cover up to 20khzChris Robinson2018-08-031-11/+16
| | | | | | | Otherwise, using the device's maximum frequency will cause the weighting factors to shift for different sample rates, irrespective of the content being processed. 20khz is the maximum allowed reference frequency, and also acts as the upper limit of human hearing.
* Apply late reverb density gain adjustment on outputChris Robinson2018-08-011-22/+17
| | | | | | | | Because density/late line length changes start affecting late reverb output right away, with samples that are still going through feedback decay and not just new input samples, it makes more sense to correct for it on output instead of input. This has the additional benefit of working with the output mixer's gain fading, avoiding discontinuities from significant density gain changes.
* Fix late reverb density gain blend weightsChris Robinson2018-08-011-4/+4
| | | | | | | | | | | | Now it only accounts for the representable frequency range (0.5 normalized, or 0...pi radians instead of tau). Previously, the bulk of the weighting factors was given to the HF decay (nearly 90%, given a 44.1khz sample rate and the default 5khz reference), with low- and mid-frequency decays splitting the remaining 10%. Now it's closer to 75%, matching the range of representable frequencies above the reference. This could probably be improved further due to human hearing being less sensitive to higher frequencies, but that is much more complicated.
* Add a specific function for truncating float-to-int conversionsChris Robinson2018-05-031-10/+10
|
* Rename BiquadState to BiquadFilterChris Robinson2018-04-041-12/+12
|
* Apply biquad and T60 filters using transposed direct form IIChris Robinson2018-04-031-14/+9
|
* Fix a couple comments about coordinate handednessChris Robinson2018-03-241-3/+3
|
* Rename ALfilterState/Type to BiquadState/TypeChris Robinson2018-03-231-12/+12
|
* Move the filter implementation to a separate directoryChris Robinson2018-03-221-2/+1
|
* Move mixer sources into a sub-directoryChris Robinson2018-03-221-1/+0
|
* Fix the reverb panning behavior to better fit the specChris Robinson2018-03-191-83/+38
| | | | | | Previously it would attenuate the response from direction opposite to the vector, whereas the property descriptions say it should simply move all reflections toward the given direction.
* Use a macro template to define similar functionsChris Robinson2018-03-151-78/+48
|
* Remove an extraneous +Chris Robinson2018-03-141-1/+1
|
* Move a loop into a functionChris Robinson2018-03-131-5/+7
|
* Avoid AL prefix on internal effect state factory typesChris Robinson2018-02-281-8/+8
| | | | Also avoid using the generic V/V0 macros for them
* Combine the vector reverse and partial scatter where they're togetherChris Robinson2018-02-181-21/+20
|
* Remove unused reverb modulation codeChris Robinson2018-02-101-107/+2
| | | | | | Still unsure how to handle reverb modulation without some kind of reference output, so remove the related functions to not waste CPU time. It'll remain in the Git history should it ever need to be resurrected.
* Attempt to improve the reverb panning vectorsChris Robinson2018-02-081-20/+42
| | | | | This should now retain the original orientation of the soundfield and merely focus on the panning vector direction, as intended.
* Alter tha curve of the density-related delay scaleChris Robinson2018-02-081-22/+33
| | | | | | | | | | | | | | | | | | | The delay scale is roughly linear with respect to room size, however the density is not linear with room size. The density is calculated by taking the room size cubed, then normalized by some factor. Unnormalizing the density and taking the cube root restores the original room size to use as a delay scale. The patch also alters the delay and all-pass line lengths to be based on a 1 meter room size, so the the room size recovered from the density acts as a direct multiple for the desired target length. Note that the room scale range is unchanged (5m to 50m), so the minimum and maximum delays are the same. It should also be noted that 50m may not be the correct room size for a density value of 1. A density value of 1 corresponds to an environment size of roughly 2.52m when converted from EAX (DENSITY_SCALE should be 16 rather than 125000), but sizes that low result in undesirable resonance in the feedback, indicating other changes are necessary for that to work.
* Revert "Don't fade the all-pass delay changes"Chris Robinson2018-02-041-28/+48
| | | | This reverts commit 799dfb732b4f49198d72649e86955ea82f45f229.
* Construct error messages using parameterized valuesChris Robinson2018-01-251-44/+48
|
* Provide messages for the remaining AL errorsChris Robinson2018-01-241-62/+50
|