38 Commits

Author SHA1 Message Date
Chris Robinson
7bb37deb51 Replace the mixer fraction macros with constexpr variables 2020-10-21 17:16:27 -07:00
Chris Robinson
3e62600ecc Replace some more macros with constexpr variables 2020-10-21 16:39:21 -07:00
Chris Robinson
cdc15a4783 Use constexpr variables in place of some macros 2020-10-19 07:55:25 -07:00
Chris Robinson
3898b77dd6 Avoid iterators for the main mixer 2020-05-01 21:14:41 -07:00
Chris Robinson
6bc3ae178e Use a more efficient type for holding the IrSize 2020-04-30 17:03:56 -07:00
Chris Robinson
dc41f276d8 Get rid of the specialized MixRow_ methods 2020-04-16 01:47:33 -07:00
Chris Robinson
1130597562 Use structs for the mixer and resampler tags 2020-04-03 03:52:23 -07:00
Chris Robinson
d9225083b4 Avoid using ALfloat in the mixer functions 2020-04-03 03:11:32 -07:00
Chris Robinson
8adbde90f5 Jump to the target gain if the fade amount is small 2020-04-03 02:48:35 -07:00
Chris Robinson
367d4af07c Avoid unnecessary duplication in the resamplers 2020-04-03 02:39:23 -07:00
Chris Robinson
8853519d89 Generate the bsinc tables using constexpr methods
All the methods used should be compliant with C++14 constexpr rules. However,
the number of scales and phases cause GenerateBSincCoeffs to reach the allowed
step limit, preventing full compile-time generation. It's not a terribly big
deal, it'll generate them very quickly when loading, but it does prevent using
shared read-only memory pages.
2020-04-02 00:49:19 -07:00
Chris Robinson
54b49594e6 Simplify post-mix HRTF gain storage 2020-01-05 17:12:48 -08:00
Chris Robinson
053de62398 Don't force the HRIR length to a rounded value
The coefficient and accumulation buffers are guaranteed large enough for the
full size, and the SIMD handlers will behave the same either way.
2019-12-11 02:24:44 -08:00
Chris Robinson
d2608e4bde Avoid holding HRTF accumulation samples per-source
It notably simplifies things to mix HRTF sources into an accumulation buffer
together, which the Dry buffer's Ambisonic-to-HRTF decode is then added to,
before being mixed to the Real output.
2019-11-03 00:30:33 -07:00
Chris Robinson
1bb93f4fc2 Avoid direct function template and alias types
It's somewhat ambiguous what they mean. Sometimes acting as a pointer, other
times having weird behavior. Pointer-to-function types are explicitly defined
as such, whereas uses of these tend to be as references (never null and not
changeable).
2019-10-03 04:22:39 -07:00
Chris Robinson
b350ae3766 Remove the Offset parameter from ApplyCoeffs 2019-10-02 22:38:19 -07:00
Chris Robinson
50198ee30c Clean up some ALfloat -> float 2019-10-02 17:07:23 -07:00
Chris Robinson
c833af9ecd Repack the bsinc resamplers coefficients
This puts the base coefficients and the phase deltas next to each other. This
improves caching, as the base and phase deltas are always used together while
the scales are only used for the non-fast versions.
2019-09-29 23:39:04 -07:00
Chris Robinson
9b64e5e0db Implement a "fast" bsinc path
This takes advantage of the fact than when increment <= 1 (when not down-
sampling), the scale factor is always 0. As a result, the scale and scale-phase
deltas never contribute to the filtered output. Removing those multiply+add
operations cuts half of the work done by the inner loop.

Sounds that do need to down-sample (when played with a high pitch, or is 48khz
on 44.1khz output, for example), still go through the normal bsinc process.
2019-09-26 19:24:29 -07:00
Chris Robinson
aca9f4e095 Make the bsinc l and m coefficients unsigned 2019-09-17 18:38:46 -07:00
Chris Robinson
bf2c865d39 Clean up some more shadowing warnings 2019-09-16 07:16:31 -07:00
Chris Robinson
4b8f78a8d6 Fix a few more GCC warnings 2019-09-14 19:42:54 -07:00
Chris Robinson
2c348cecb6 Fix some more implicit conversions noted by GCC 2019-09-14 18:35:23 -07:00
Chris Robinson
f09734b707 Pass IrSize to the HRTF mixers as unsigned 2019-09-13 11:19:11 -07:00
Chris Robinson
c1690178ec Make the resampler increment unsigned 2019-09-13 03:25:13 -07:00
Chris Robinson
e873165019 Only ASSUME values where a variable is used 2019-09-04 19:31:30 -07:00
Chris Robinson
3973334a64 Store the voice fraction offset as unsigned 2019-08-31 15:49:34 -07:00
Chris Robinson
80710c146a Use size_t for the mixers' fade counter and outpos 2019-08-20 12:00:24 -07:00
Chris Robinson
3fa83547e9 Use size_t for HrtfMixer functions' buffer size 2019-08-20 11:39:39 -07:00
Chris Robinson
0961f4eb00 Pass a span to the Resample function 2019-08-20 08:46:12 -07:00
Chris Robinson
102ef6cb33 Pass a span for the Mix function's input 2019-08-20 04:16:44 -07:00
Chris Robinson
4883091f5d Rename the Mix function input for clarity 2019-08-20 01:24:02 -07:00
Chris Robinson
8fd90334a1 Pass the MixRow buffer size as a span 2019-08-20 00:27:28 -07:00
Chris Robinson
2d0568c048 Allow using a variable channel stride for MixRowSamples 2019-08-19 08:02:08 -07:00
Chris Robinson
4f4ef3a410 Don't require MixRow's output to be a FloatBufferLine 2019-08-18 15:15:56 -07:00
Chris Robinson
151ff51e7d Don't templatize HrirArray 2019-07-31 10:46:33 -07:00
Chris Robinson
4c9e18c5a0 Rename al/* sources to avoid camel-case 2019-07-29 17:54:07 -07:00
Chris Robinson
cb3e96e756 Rename Alc to alc 2019-07-28 18:56:04 -07:00