Chris Robinson
5ac19673db
Fix a couple type truncation warnings with MSVC
2019-05-12 19:41:34 -07:00
Chris Robinson
cef7eebed6
Disable NFC by default
2019-04-29 19:47:14 -07:00
Chris Robinson
b42694ea31
Allow NFC filters without HQ decoding
...
It still requires a proper custom decoder configuration for speakers, so that
proper distances can be specified. Ambisonic output still relies on the
nfc-ref-delay option, and HRTF uses the dataset's distance.
2019-04-29 19:47:14 -07:00
Chris Robinson
ace7481b8e
Only enable NFC with HRTF when hq-mode is enabled
2019-04-28 21:49:10 -07:00
Chris Robinson
629cfa04a3
Fix some integer truncation warnings in MSVC
2019-04-12 19:19:24 -07:00
Chris Robinson
4b95d310ae
Remove the SZFMT macro
...
C++11 mandates the %zu/d formatter
2019-04-11 16:01:11 -07:00
Chris Robinson
d04f9326c9
Change RealMixParams::ChannelName to better reflect its use
2019-04-02 16:06:45 -07:00
Chris Robinson
da8494dd8a
Use the existing function to get the ambisonic channel count
2019-03-31 22:50:30 -07:00
Chris Robinson
0e0e85af72
Don't bother with a separate reset method for BFormatDec
2019-03-31 22:27:56 -07:00
Chris Robinson
c88b09170c
Use phase correction for the front stablizer
2019-03-31 18:54:43 -07:00
Chris Robinson
4c32e55ac2
Don't mention which rendering methods aren't used
2019-03-25 23:17:34 -07:00
Chris Robinson
3a6e741e90
Use MixParams for the wet buffers
2019-03-22 19:25:55 -07:00
Chris Robinson
339a37b034
Include std::placeholders once in an anonymouse namespace
2019-03-16 15:15:59 -07:00
Chris Robinson
e4b76d2627
Reverse the HRTF field array
...
Most often a sound's distance will be beyond the farthest field measurement, so
It's more efficient to have the farthest field first and avoid looping through
the whole field array for them.
2019-02-27 23:13:40 -08:00
Chris Robinson
d2664e2192
Remove a duplicate index array
2019-02-24 18:00:49 -08:00
Chris Robinson
317206e8f3
Remove the FOAOut mixing buffer and associated post-processes
2019-02-22 22:35:37 -08:00
Chris Robinson
8ac2d34706
Allow processing some effects in higher order ambisonics
...
Reverb notably is still only first-order (any higher order channels are
dropped, and it writes to FOAOut). But others, like the equalizer, work on all
available channels.
2019-02-21 04:23:01 -08:00
Chris Robinson
a964890537
Add helpers to get the channel count from an ambisonic order
2019-02-21 04:05:49 -08:00
Chris Robinson
615446d6d5
Ensure the device's mAmbiOrder is always set appropriately
...
The Dry target is always ambisonic, so set its order correctly.
2019-02-21 01:23:11 -08:00
Chris Robinson
c43381d811
Allocate the effect slot wet buffer dynamically
2019-02-20 21:01:08 -08:00
Chris Robinson
194fcb6bb7
Rename MAX_AMBI_COEFFS and MAX_AMBI2D_COEFFS
2019-02-19 15:39:33 -08:00
Chris Robinson
d713f5f828
Clean up some AmbiUpsampler initialization
2019-02-19 01:59:30 -08:00
Chris Robinson
2d93a9cdb1
Collect HRTF field info into a struct
2019-01-28 20:43:34 -08:00
Chris Robinson
98be1d1bf5
Make IncRef and DecRef member functions
2019-01-24 10:05:37 -08:00
Filip Gawin
4169c6f37d
Use c++ headers
2019-01-09 19:42:40 +01:00
Chris Robinson
673983dc5d
Make Create methods for structs with flexible array members ...
...
... that are used with unique_ptr.
2019-01-08 23:44:08 -08:00
Chris Robinson
bc1eeb5df0
Avoid calling unique_ptr::reset with a raw pointer
2019-01-08 23:15:58 -08:00
Filip Gawin
0d3a0635d9
Avoid using old style casts
...
To think about:
examples/alffplay.cpp:600
OpenAL32/Include/alMain.h:295
2019-01-08 19:42:44 +01:00
Chris Robinson
fababe76c4
Don't use the dual-band upsampler for basic ambisonic decoding
2019-01-06 17:45:44 -08:00
Chris Robinson
da3a916042
Replace macros with constexpr inline functions
2019-01-06 04:16:51 -08:00
Chris Robinson
3b91010e21
Pass the normalized crossover frequency to the reset method
2019-01-05 22:31:13 -08:00
Chris Robinson
3f35fcc4b5
Simplify MixParams and AmbiUpsampler
...
Since the dry buffer is always an ambisonic target now
2019-01-05 21:59:04 -08:00
Chris Robinson
cff20c2fe8
Use BFormatDec for custom and built-in ambisonic decoding
2019-01-05 19:21:25 -08:00
Chris Robinson
2f1566e0b4
Add and use a make_unique function
2019-01-01 14:33:01 -08:00
Chris Robinson
fbae41020d
Remove extraneous typedef, struct, and enum keywords
2018-12-24 19:29:01 -08:00
Chris Robinson
3fe38fed7c
Mix effect slot output to the effect target if it's set
2018-12-23 08:51:28 -08:00
Chris Robinson
87724db6e3
Rename a couple HRTF structs
2018-12-22 09:20:50 -08:00
Chris Robinson
3553ce1f67
Don't convert the HRTF decoder virtual speaker positions to radians
2018-12-21 08:55:22 -08:00
Chris Robinson
b785d80526
Use a dodecahedron for the ambisonic HRTF decode
...
Also uses full second-order for "basic" HRTF rendering. Note that the supplied
matrix is full third-order, but only the first- and second-order coefficients
are used. The base matrices are the identical, only differing by the high-
frequency scalars.
2018-12-21 06:32:18 -08:00
Chris Robinson
7744e4ff72
Pass RealMixParams by reference instead of pointer
2018-12-20 13:26:39 -08:00
Chris Robinson
49ac268334
Add index maps from 2D and 3D
2018-12-20 04:19:35 -08:00
Chris Robinson
8d3f7651c9
Use std::array in place of some C-style arrays
2018-12-20 03:26:46 -08:00
Chris Robinson
d18140391a
Rename some conversion arrays
2018-12-20 02:46:59 -08:00
Chris Robinson
0214a11024
Use inline methods for the device format sizes
2018-12-19 05:57:36 -08:00
Chris Robinson
5243516149
Use the AmbiUpsampler with higher order basic and custom panning
...
Also allocate the BFormatDec and AmbiUpsampler where they're (re)set.
2018-12-17 07:29:55 -08:00
Chris Robinson
3b0fd20bee
Always use the transcode method with the AmbiUpsampler
2018-12-16 21:03:24 -08:00
Chris Robinson
741861eaa6
Put the ACN index map in a header
...
Also put it and the Ambisonic scales in a more appropriate header.
2018-12-15 23:28:49 -08:00
Chris Robinson
a6a5634adb
Reorder some math terms to help optimizations
...
Because floating-point math is not associative ((a*b)*c does not necessarily
give the same result as a*(b*c)), the ordering of terms can inhibit reuse of
temporary values. For example, both
coeffs[9] = 2.091650066f * y * (3.0f*x*x - y*y);
and
coeffs[15] = 2.091650066f * x * (x*x - 3.0f*y*y);
contain x*x and y*y terms that could be calculated once, stored in temporary
registers, and reused to multiply with 3. But since 3.0f*(x*x) would produce
different results, the compiler is not allowed to make that optimization. If,
however, the multiply with 3 is moved to the right side:
coeffs[9] = 2.091650066f * y * (x*x*3.0f - y*y);
and
coeffs[15] = 2.091650066f * x * (x*x - y*y*3.0f);
in both cases x*x and y*y are calculated first in their respective groups,
guaranteeing the same results for both instances prior to the multiply with 3
and allowing the compiler to reuse those intermediate values.
2018-12-15 20:28:52 -08:00
Chris Robinson
dea077cbae
Add encoding calculations for fourth-order ambisonics
2018-12-15 19:23:42 -08:00
Chris Robinson
0dd13a9dfe
Make the AmbDec speaker and matrix arrays dynamic
2018-12-15 02:56:19 -08:00