193 Commits

Author SHA1 Message Date
Chris Robinson
f2ff2bb2f6 Use the difference in HF scale for upsampling ambisonics 2022-09-03 21:06:39 -07:00
Chris Robinson
d2a2a696a1 Update the second-order upsampler HF scale 2022-09-02 09:44:01 -07:00
Chris Robinson
e5c49d019f Revert "Don't apply the HF scaling for "upsampling" ambisonics"
This reverts commit bf3f63fb4c5faa45784d7433d68b7013e29ee2c1.
2022-09-02 09:41:19 -07:00
Chris Robinson
02cf2bde7b Use an icosahedron for 3D second-order 2022-09-01 15:04:58 -07:00
Chris Robinson
bf3f63fb4c Don't apply the HF scaling for "upsampling" ambisonics
Not sure if this is best, but it fixes the issue of upsampling lower orders to
higher orders multiple times (mixing lower order to higher order, cutting back
to lower order by dropping the extra channels, then upsampling again, applying
the HF scale multiple times and messing up the high frequencies/energy vector),
as well as having too-strong high frequencies of upsampled content in general.

As it is, with the new upsampling method, the lower order signal contributes to
some higher order channels, which helps offset the high frequency scaling
difference (except first- to second-order, which adds nothing).
2022-08-31 09:06:53 -07:00
Chris Robinson
c9fbb359df Use predefined variables to handle 1/sqrt(3) 2022-08-30 07:33:50 -07:00
Chris Robinson
84134d7399 Allow the remix tables to be variable length 2022-08-28 06:11:40 -07:00
Chris Robinson
b8d73a226a Add a 2D fourth-order upsampler
This will be necessary for 2D fourth-order sources with 3D fourth-order output.
2022-08-27 03:43:33 -07:00
Chris Robinson
0ae6955f1c Fix variable name 2022-08-26 02:01:28 -07:00
Chris Robinson
e48c294a69 Create and use 2D upsampling matrices 2022-08-25 23:22:45 -07:00
Chris Robinson
df33746571 Create a proper third-order upsampler matrix
This is just an identity matrix for now, since with third-order mixing, it
results in a matrix being multiplied with it's inverse.
2022-08-19 14:08:29 -07:00
Chris Robinson
ed9408e537 Inline and precompute some CalcDirectionCoeffs calls 2022-08-18 20:37:19 -07:00
Chris Robinson
4f75f9258c Avoid duplicate code 2022-08-18 18:44:37 -07:00
Rosen Penev
2f3acdff4a
rtkit: match includes with code (#752)
These headers are used for __gettid. Match the if with the code.

Fixes compilation under MinGW.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-18 18:44:09 -07:00
Chris Robinson
90f02176dd Inline a function and remove an unnecessary parameter 2022-08-16 13:00:03 -07:00
Chris Robinson
82c5b741e5 Use proper array sizes for more gains 2022-08-15 12:56:36 -07:00
Chris Robinson
e805c62152 Use the proper type for a global definition
Some compilers don't seem to like auto deduction for defining a declared
variable.
2022-08-15 09:39:45 -07:00
Chris Robinson
6d5580805e Use a decode-encode method for ambisonic upsampling
This should allow for clearer and less diffuse responses. While a cube is in
the blindspots for second-order, resulting in an identify transform for first-
to-second-order, they do start contributing to third-order channels, which
should make for sharper virtual points. The fixed HF scales should also play
nicer with larger order upmixes.
2022-08-15 09:01:03 -07:00
Chris Robinson
fbfa8a2686 Use the right array size for the mixing parameters 2022-08-14 10:07:32 -07:00
Chris Robinson
4f346caea3 Update some arrays in preparation for fourth order support 2022-08-14 00:56:38 -07:00
Chris Robinson
dd3f03c148 Move a member variable to the struct it's needed 2022-08-09 22:19:11 -07:00
Chris Robinson
7e5dd41968 Add an option for higher quality UHJ filters 2022-08-08 03:44:25 -07:00
Chris Robinson
250f162496 Parameterize the UHJ filter length 2022-08-07 13:09:12 -07:00
Chris Robinson
9d296a9c75 Avoid putting a 1KB array on the stack 2022-08-02 23:29:21 -07:00
Chris Robinson
a1faa5d311 Change an inline function to a class method 2022-08-02 18:26:49 -07:00
Chris Robinson
810821a221 Simplify calculating nearest HRIR index 2022-08-02 18:26:49 -07:00
Chris Robinson
b26ca6b65e Add missing include for FreeBSD 2022-07-29 03:06:07 -07:00
Chris Robinson
339465c91f Use an intrusive_ptr to hold on to the EffectState 2022-07-29 01:49:30 -07:00
Chris Robinson
1b28a24f6e Don't assume rlim_t is unsigned 2022-07-22 17:29:50 -07:00
Chris Robinson
10eca3e7c3 Silence an inline failure warning with GCC 2022-07-19 15:48:40 -07:00
Chris Robinson
4cbb271819 Avoid duplicate initializations for multiple filters
Just initialize the first and copy it to the others.
2022-07-17 18:12:21 -07:00
Chris Robinson
af5d4fb77d Don't store and manage wet buffers separately 2022-07-15 06:58:15 -07:00
Chris Robinson
0f4679981b Allocate EffectSlots in clusters 2022-07-15 06:14:25 -07:00
Chris Robinson
0b9fc03545 Dynamically allocate EffectSlot objects 2022-07-15 04:28:13 -07:00
Chris Robinson
43b0afdab4 Properly update the Super Stereo width
Previously it would just keep using the set target, instead of tracking and
interpolating changes.
2022-07-07 02:01:20 -07:00
Chris Robinson
221d33f3ea Use 48khz by default for playback 2022-07-05 09:27:44 -07:00
Chris Robinson
fcc73d3324 Avoid including intrin.h with cpuid.h
On certain versions of MinGW, that leads to a redefinition errors.
2022-06-17 14:36:34 -07:00
Chris Robinson
86d1eb90ed Use a proper literal type 2022-06-07 01:00:21 -07:00
Chris Robinson
556c5d14d7 Avoid a virtual function call to set the decoder width 2022-05-17 02:32:10 -07:00
Chris Robinson
64cb0dc264 Use a member variable to specify the decoder padding 2022-05-17 02:28:57 -07:00
Chris Robinson
3e9597a768 Avoid magic numbers 2022-05-16 22:49:03 -07:00
Chris Robinson
83238973ed Use virtual functions for the decoder 2022-05-14 21:23:03 -07:00
ilya-fedin
e0d26ba25a
Search the installation data directory (#693)
That allows the logic to work on non-FHS distros like NixOS
2022-05-13 13:55:17 -07:00
Chris Robinson
c870e550fa Don't enable RTKit/D-Bus support on Windows 2022-05-09 12:38:12 -07:00
Chris Robinson
7e6ed2fa95 Use an array of pointers for the UHJ encoder input 2022-05-06 04:14:34 -07:00
Chris Robinson
593966c8db Handle 3D7.1 as a separate channel configuration
It's treated as 5.1 + 2 aux channels. This allows AL_DIRECT_CHANNELS_SOFT to
behave better, not forwarding rear left/right channel inputs to lower front and
upper rear, and allows reporting a more appropriate output mode to the app
instead of 7.1.
2022-04-26 23:32:15 -07:00
Chris Robinson
354c18a242 Remove a couple unused fields 2022-04-22 16:37:08 -07:00
Chris Robinson
6a9fe1e2c1 Rename lerp to avoid conflicts with C++20's std::lerp 2022-04-06 17:41:24 -07:00
Chris Robinson
1e8e63067c Remove an unnecessary subtraction 2022-04-01 09:47:32 -07:00
Chris Robinson
6f9311b1ba Don't manually reverse samples 2022-03-31 13:07:58 -07:00