3676 Commits

Author SHA1 Message Date
Chris Robinson
5d092a1c58 Use the appropriate enums for standard atomics 2018-11-01 08:43:31 -07:00
Chris Robinson
d28c0eb556 Avoid uniform initialization with references
Also doesn't work with GCC 4.x
2018-11-01 08:41:23 -07:00
Chris Robinson
48f877e859 Remove unused header 2018-11-01 08:19:51 -07:00
Chris Robinson
ccf356a03d Include a missing header for atomic 2018-11-01 08:17:23 -07:00
Chris Robinson
95966c4d92 Fix another use of auto uniform initialization 2018-11-01 08:15:47 -07:00
Chris Robinson
759c3a996c Avoid all uniform initialization with auto
Because of early C++11 (GCC 4.x) deficiencies, it's not interpreted correctly.
Either declare the type name explicitly with uniform initization, or use auto
with = initialization. It'll be fine when updating to GCC 5 or Clang 3.6.
2018-11-01 08:04:21 -07:00
Chris Robinson
353bb1ed17 Avoid uniform initialization on auto for integer types
To work around a deficiency with early C++11 compilers (GCC 4.x).
2018-10-31 22:10:26 -07:00
Chris Robinson
d41fbd5c2d Convert the PulseAudio backend to C++ 2018-10-31 20:09:14 -07:00
Chris Robinson
0e7986eaa8 Move some extern inline declarations to C 2018-10-31 13:21:05 -07:00
Chris Robinson
662e1c5cc2 Fix some uses of RESTRICT 2018-10-29 11:50:41 -07:00
Chris Robinson
903d878460 Replace restrict with RESTRICT 2018-10-29 11:32:50 -07:00
Chris Robinson
e876b50113 Remove unnecessary uses of IN_IDE_PARSER 2018-10-29 10:10:37 -07:00
Chris Robinson
7d5a288e83 Add a couple casts for compiling with C++
Also avoid using __builtin_types_compatible_p, which seems broken with C++?
2018-10-29 10:10:37 -07:00
Chris Robinson
1d7b0f54be Add another missing extern "C" 2018-10-29 10:10:37 -07:00
Chris Robinson
8a8ab68f1c Add a more C++-friendly VECTOR_RESIZE 2018-10-29 10:10:37 -07:00
Chris Robinson
fd1361c198 Add a RESTRICT macro to help with C++ compatibility 2018-10-29 10:10:37 -07:00
Chris Robinson
7f8ef092aa Fix a couple internal headers to compile with C++ 2018-10-29 10:10:37 -07:00
Filip Gawin
08226bc6b0 Simplify some statements 2018-10-29 13:38:58 +01:00
Chris Robinson
7a79f09a31 Add a comment about waiting to kill the event thread 2018-10-07 17:18:50 -07:00
Chris Robinson
db65113c5f Use a 24-bit dither depth limit 2018-10-03 13:51:21 -07:00
Chris Robinson
f3f94e478b Don't limit output for ALC_DONT_CARE_SOFT and float samples 2018-10-03 13:48:04 -07:00
Chris Robinson
c39eeb9638 Don't try to get the JNIEnv on Android
It's currently not used. More stuff is needed anyway which may need a different
approach.
2018-10-02 12:40:26 -07:00
Chris Robinson
493c8bbc83 Add back an inadvertently removed static 2018-10-02 12:25:26 -07:00
Chris Robinson
052fdd67cd Use < instead of != for some loop checks 2018-10-01 15:59:05 -07:00
Chris Robinson
ed8f44d102 Don't scale the reverb fade counter so much 2018-09-30 16:34:00 -07:00
Chris Robinson
1d1acc0c34 Ensure BUFFERSIZE is a power of 2 2018-09-30 12:12:27 -07:00
Chris Robinson
1860b2ec8a Make the Compressor struct opaque 2018-09-30 12:08:01 -07:00
Chris Robinson
7ad4f753a4 Fix some length ranges 2018-09-29 19:39:49 -07:00
Chris Robinson
d5a78f0843 Improve a couple loops
Avoid masking the index with each iteration, and instead do up to when the mask
would apply. This allows for better optimizations, in particular fewer
instructions and better chances for vectorization.
2018-09-29 18:48:28 -07:00
Chris Robinson
32494e72a5 Don't use a ringbuffer design for the limiter's side chain
Rather than continuously wrapping when used, each update uses it from the front
and copies the tail to the front at the end. This allows for more effficient
accesses in loops.
2018-09-29 11:54:45 -07:00
Chris Robinson
0396c0ecd2 Add some assumes for the limiter 2018-09-29 09:47:05 -07:00
Chris Robinson
51a447852f Simplify a lower-bound clamp 2018-09-28 18:34:21 -07:00
Chris Robinson
1684b2cc5f Constify a couple more variables 2018-09-28 16:42:22 -07:00
Chris Robinson
79314c4461 Include the limiter's lookAhead delay in the device latency 2018-09-25 23:05:27 -07:00
Chris Robinson
2d6309d6fc Don't hardcode the limiter threshold
It's now calculated from the output sample type and dither depth.
2018-09-25 10:33:20 -07:00
Chris Robinson
c69338bc0d Update the output limiter/compressor
This provides better characteristics for an amplitude limiter. In particular,
it utilizes the peak amplitude instead of the RMS, and the used parameters
basically guarantee no output samples exceed the given threshold... almost, due
to floating-point errors as the threshold is converted from dB to log-e for the
envelope, then is negated and converted to linear amplitude to apply to the
signal. It's quite possible for some rounding errors to creep in and not
perfectly saturate the result.
2018-09-25 10:04:14 -07:00
Chris Robinson
39c3314d00 Only compare the reverb params that induce a need for fading
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.
2018-09-23 22:59:16 -07:00
Chris Robinson
db6905bf57 Clear reverb gain coefficients when doing a device update 2018-09-23 02:22:23 -07:00
Chris Robinson
800326d37a Rename ALreverbState to ReverbState 2018-09-23 01:11:58 -07:00
Chris Robinson
77a53594ba Improve the gain stepping difference check
Given the more stable stepping now in use, check that the total difference is
enough for perceptible transition, instead of the step itself.
2018-09-22 08:26:52 -07:00
Chris Robinson
36a6b9d42a Adjust comment spacing 2018-09-21 06:06:29 -07:00
Chris Robinson
b6d0ff02c2 Use an internal event to more timely release old effect states 2018-09-21 04:14:15 -07:00
Chris Robinson
f21e2df4cf Remove an unnecessary mutex 2018-09-20 22:53:16 -07:00
Chris Robinson
84a90b7cc3 Stop the event thread when releasing the context
To ensure no user callback gets called after alcDestroyContext.
2018-09-20 22:44:58 -07:00
Chris Robinson
ebbbeb0d66 Put user events in a union structure 2018-09-20 21:59:38 -07:00
Chris Robinson
cb8545346d Always start the event thread with the context 2018-09-20 19:58:01 -07:00
Chris Robinson
5c6b8eda4f Remove another duplicate function 2018-09-19 22:18:46 -07:00
Chris Robinson
ea95a8adef Combine nearly-duplicate structures 2018-09-19 21:31:46 -07:00
Chris Robinson
6eb980d1b2 Remove a couple duplicate functions 2018-09-19 21:09:19 -07:00
Chris Robinson
48b7745a49 Add macros for commonly used square roots 2018-09-19 19:53:25 -07:00