5746 Commits

Author SHA1 Message Date
Chris Robinson
59013b5cb5 Avoid hard-coded scale factors in BFormatDec's upsampler 2018-12-17 07:12:37 -08:00
Chris Robinson
a359cb85e6 Mix each frequency band individually for ambisonic upsampling 2018-12-16 22:37:29 -08:00
Chris Robinson
3b0fd20bee Always use the transcode method with the AmbiUpsampler 2018-12-16 21:03:24 -08:00
Chris Robinson
064f4f500a Avoid extraneous alignment requirements 2018-12-16 01:27:52 -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
e0f635b20d Move some ambisonic-related macros to a separate header 2018-12-15 03:30:47 -08:00
Chris Robinson
0dd13a9dfe Make the AmbDec speaker and matrix arrays dynamic 2018-12-15 02:56:19 -08:00
Chris Robinson
640c06c292 Avoid some explicit loop counts 2018-12-15 01:48:54 -08:00
Chris Robinson
4d36730baa Clean up panning.cpp a bit 2018-12-15 00:38:38 -08:00
Chris Robinson
2d13e0af29 Add macros for the ambisonic order masks 2018-12-14 23:26:44 -08:00
Chris Robinson
0882728dec Cleanup bformatdec.cpp a bit 2018-12-13 22:48:02 -08:00
Chris Robinson
d18ae81e9c Add POPCNT32 and CTZ32 macros 2018-12-13 22:05:47 -08:00
Chris Robinson
0d73b13f59 Add more casts for MSVC 2018-12-12 21:58:41 -08:00
Chris Robinson
b779ebb512 Fix some MSVC conversion warnings 2018-12-12 21:18:31 -08:00
Chris Robinson
b37bc9f8b7 Fix an MSVC warning 2018-12-12 19:24:06 -08:00
Chris Robinson
43f6a7c626 Remove an unused source 2018-12-12 04:34:09 -08:00
Chris Robinson
5a283c66ee Use proper classes for Vector and Matrix types 2018-12-12 04:22:11 -08:00
Chris Robinson
19c5c41c70 Cleanup alu.cpp some 2018-12-12 01:09:04 -08:00
Chris Robinson
0d36ba0fbb Use helpers to get the Ambisonic scales and layout maps 2018-12-10 22:35:32 -08:00
Chris Robinson
e87eb07db4 A bit more cleanup 2018-12-10 21:30:22 -08:00
Chris Robinson
ed18fd76c5 Clean up a few more loops 2018-12-10 14:49:57 -08:00
Chris Robinson
d91ada2e02 Add missing header 2018-12-10 02:13:57 -08:00
Chris Robinson
9bb7ed0129 Put static methods into an anonymous namespace 2018-12-10 02:08:54 -08:00
Chris Robinson
0d56c59f14 Avoid some more explicit loops 2018-12-10 00:01:13 -08:00
Chris Robinson
0a805727db Use std::accumulate to find the max channel count 2018-12-09 18:16:00 -08:00
Chris Robinson
b1beb7dfdc Avoid some more explicit loops 2018-12-09 17:24:00 -08:00
Chris Robinson
efb8e076c7 Pass a reference to an array for a function parameter 2018-12-09 15:21:24 -08:00
Chris Robinson
6c8f45b5f6 Rename a couple global variables
Avoid clashing with an enum name
2018-12-09 15:07:44 -08:00
Chris Robinson
d7d9870839 Add default construction to HrtfEntry 2018-12-09 13:36:13 -08:00
Chris Robinson
621f0dfe73 Use a vector for LoadedHrtfs 2018-12-09 03:04:18 -08:00
Chris Robinson
e5db9b2378 Avoid static global initialization functions 2018-12-08 21:58:44 -08:00
Chris Robinson
a4009c47e7 Add a cmake option to specify prebuilt native tools
This should only be used with automated build systems that guarantee the native
tools' binaries are up-to-date. Otherwise it's best to leave it alone so it can
automatically rebuild them as needed.
2018-12-08 17:22:10 -08:00
Chris Robinson
30a3a19574 Rename a member variable and inline a function 2018-12-08 16:30:19 -08:00
Chris Robinson
c9f5617f06 Avoid several uses of memset 2018-12-08 14:22:20 -08:00
Chris Robinson
fc8da0c16b Add missing include 2018-12-08 13:06:31 -08:00
Chris Robinson
5a9a2cb1ed Increase GAIN_MIX_MAX 2018-12-08 04:10:59 -08:00
Chris Robinson
9e9b771e8a A bit more cleanup 2018-12-08 04:10:45 -08:00
Chris Robinson
5ea3c8fb60 Use member functions for BFormatDec and AmbiUpsampler 2018-12-08 02:50:34 -08:00
Chris Robinson
7695afe0cb Clean up some more loops 2018-12-08 02:15:00 -08:00
Chris Robinson
a603cc906f Inline a simple method 2018-12-08 00:08:39 -08:00
Chris Robinson
ab5a11d5f3 Avoid using the deprecated mem_fun_ref method 2018-12-07 21:46:22 -08:00
Chris Robinson
6e4c856257 Add fourth-order methods to the NFC filter
Unused, but it finishes out the currently possible implementations.
2018-12-07 18:38:56 -08:00
Chris Robinson
0f24139b57 Use a constructor instead of a macro to initialize AsyncEvent 2018-12-06 22:24:20 -08:00
Chris Robinson
42d26472eb Remove some more explicit loops 2018-12-05 17:11:33 -08:00
Chris Robinson
e60d0886d0 Use class methods for BandSplitter and SplitterAllpass filters 2018-12-05 15:38:05 -08:00
Chris Robinson
10b39d57d5 Use class methods for the NFC filters 2018-12-05 15:20:52 -08:00
Chris Robinson
164a86a381 Use class methods for the biquad filter 2018-12-04 22:31:08 -08:00
Chris Robinson
36a8b615c8 Avoid using AL types with the filters 2018-12-04 20:55:10 -08:00