56 Commits

Author SHA1 Message Date
Chris Robinson
1ce310c6d1 Make some more channel counts unsigned 2019-06-05 19:26:54 -07:00
Chris Robinson
410a5ca621 Make RealMixParams channel count unsigned 2019-06-05 18:54:17 -07:00
Chris Robinson
c80ee5b701 Use std::array for most mixing buffer arrays 2019-05-28 16:22:36 -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
3683e31662 Constify some parameters and remove an explicit loop 2019-02-23 00:01:38 -08:00
Chris Robinson
317206e8f3 Remove the FOAOut mixing buffer and associated post-processes 2019-02-22 22:35:37 -08:00
Chris Robinson
194fcb6bb7 Rename MAX_AMBI_COEFFS and MAX_AMBI2D_COEFFS 2019-02-19 15:39:33 -08:00
Chris Robinson
0763dfa954 Apply the all-pass separately from the upsampling mix 2019-01-08 18:34:45 -08:00
Chris Robinson
edba7da8ab Avoid macros for indexing HF and LF fequency bands 2019-01-08 17:21:22 -08: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
f5b6d761ff Apply an all-pass on the existing output when upsampling ambisonics 2019-01-06 06:50:58 -08:00
Chris Robinson
13056b45b0 Revert back to using a band-splitter to increase the HF response
Unfortunately the shelf filter causes issues due to the shelf gain magnitude
creating a varying phase offset. The splitter also creates phase offsets, but
it's consistent regardless of gain.
2019-01-06 05:15:11 -08:00
Chris Robinson
3b91010e21 Pass the normalized crossover frequency to the reset method 2019-01-05 22:31:13 -08:00
Chris Robinson
aa29bf5933 Remove unnecessary structs and buffers 2019-01-05 22:24:38 -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
641bbf075d Enable simplified upsampling for AmbiUpsampler 2019-01-05 00:23:06 -08:00
Chris Robinson
6d7e8cf8b0 Simplify the BFormatDec upsampler
Since the only difference applied is a scalar on the high-frequency response, a
B-Format-to-B-Format transcode can be accomplished with a high-shelf filter. A
similar thing can be done with AmbiUpsampler, but only when outputing to
periphonic B-Format.
2019-01-04 22:17:30 -08:00
Chris Robinson
3b7f668b28 Avoid an intermediate mixing buffer 2018-12-24 20:44:55 -08:00
Chris Robinson
11d815cfd3 Repack some AmbiUpsampler fields for better access patterns 2018-12-23 15:55:12 -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
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
e87eb07db4 A bit more cleanup 2018-12-10 21:30:22 -08:00
Chris Robinson
c9f5617f06 Avoid several uses of memset 2018-12-08 14:22:20 -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
b3b4220182 Use unique_ptr for BFormatDec and AmbiUpsampler 2018-11-22 05:37:35 -08:00
Chris Robinson
67f9efdad4 Convert the BFormat decoder to C++ 2018-11-03 15:32:09 -07:00
Chris Robinson
903d878460 Replace restrict with RESTRICT 2018-10-29 11:32:50 -07:00
Chris Robinson
9575eebac4 Move the bnad-splitter filters to a separate source 2018-04-21 23:23:46 -07:00
Chris Robinson
7dafac0c34 Avoid duplicating some scale tables 2018-02-18 23:56:51 -08:00
Chris Robinson
59768674f1 Use an alternate ambisonic HRTF decode layout
Similar to the previous, but includes the top and bottom HRTF responses. The
higher-order decode (for the "basic" HRTF output) also now uses 2H1P mixed-
order instead of 2H1V, which seems more stable.
2018-02-13 03:03:26 -08:00
Chris Robinson
4d417f3dd4 Make bformatdec_free and ambiup_free clear the freed pointer 2018-02-12 20:48:28 -08:00
Chris Robinson
c346baff5b Clarify some macro names using ambisonic mixed-mode notation 2018-02-09 18:43:34 -08:00
Chris Robinson
78cb70a5f9 Replace some freq_mult variable names with f0norm
The latter is a bit more descriptive as f0 is often used to denote the
reference frequency of a filter, so f0norm indicates the normalized reference
frequency (ref_freq / sample_rate).
2018-01-13 09:14:46 -08:00
Chris Robinson
8a735d0ba9 Add a front-stablizer config option for surround sound modes
This improves a stereo (front-left + front-right) sound "image" by generating a
front-center channel signal. Done correctly, it helps reduce the comb effects
and phase errors associated with using only two speakers to simulate center
sounds.

Note that it shouldn't be used if the front-center channel is already included
in the positional audio mix (the dialog effect is okay). In general, it may
actually be better to exclude the front-center channel from the positional
audio mix and use this to generate front-center output.
2017-07-31 23:49:48 -07:00
Chris Robinson
fea74124c8 Add an all-pass filter that replicates the band splitter's phase shift 2017-07-19 02:48:01 -07:00
Chris Robinson
6f2a30dea2 Remove an unneeded function 2017-02-28 19:48:44 -08:00
Chris Robinson
652ef2b7fd Remove an unused function 2017-02-23 20:40:16 -08:00
Chris Robinson
f5e8a8c75e Remove an unused flag enum 2017-02-20 09:25:09 -08:00
Chris Robinson
3761336e6c Apply distance compensation when writing to the output 2017-02-19 22:47:59 -08:00
Chris Robinson
9da152a9c8 Don't use periphonic FOA when the HOA decoder is not periphonic 2017-02-19 17:45:27 -08:00
Chris Robinson
071b83ba52 Replace more ALuint with ALsizei 2017-01-29 16:42:02 -08:00
Chris Robinson
1ebfce4cac Improve the ambisonic upscaling methods
This now takes advantage of the differences seen in generated decoder matrices
for first-order compared to second- and third-order, such that with the
appropriate frequency-dependent scaling applied to first-order content, the
result is identical with a higher-order decoder matrix compared to a first-
order matrix for the same layout.
2017-01-24 19:03:51 -08:00
Chris Robinson
e9009968fb More ALsizei, with the B-Format decoder 2017-01-16 09:37:55 -08:00
Chris Robinson
959812ee13 Use ALsizei in a few more places 2017-01-16 08:59:08 -08:00
Chris Robinson
9349ee9002 Make some pointer-to-array parameters const 2016-10-04 16:25:43 -07:00