75 Commits

Author SHA1 Message Date
Chris Robinson
9ce182228d Avoid some pre-C++14 workarounds 2020-03-22 08:51:06 -07:00
Chris Robinson
3e1a2c0f77 Use an intrusive_ptr for the device's HrtfStore 2020-03-01 17:16:09 -08:00
Chris Robinson
1d91e282c8 Update the MHR format
This update removes the 16/24-bit sample type enum, now always being 24-bit
(other than a very small size saving, there's no practical benefit to storing
16-bit samples). This also reverses the field storage, so no on-load fixup is
needed, and stores the IR delays with 2 bits of sub-sample precision, allowing
for slightly better timing (after resampling, blending, etc).
2020-02-11 00:37:21 -08:00
Chris Robinson
3ee0906c81 Use std::array and span for the HRTF delays 2020-02-08 15:00:58 -08:00
Chris Robinson
e960276a47 Try harder to find the closest HRIR for the B-Format decoder 2020-01-26 01:23:39 -08:00
Chris Robinson
a1a107f576 Return immediately on error when loading HRTFs 2020-01-13 18:13:05 -08:00
Chris Robinson
a56a6116c0 Make a separate function for duplicate code 2020-01-13 15:55:31 -08:00
Chris Robinson
174e48fe8f Use the Field and Elevation structs directly when loading 2020-01-13 14:23:11 -08:00
Chris Robinson
bc946b004e Don't assume the total length of certain arrays 2020-01-13 10:59:15 -08:00
Chris Robinson
7551242143 Use a span for a fixed-size array reference 2020-01-13 08:55:10 -08:00
Chris Robinson
a866aece46 Add missing include 2020-01-12 19:28:12 -08:00
Chris Robinson
2f1a2ce242 Scale the resampled HRTF delays if they exceed the max 2020-01-12 14:49:11 -08:00
Chris Robinson
00d80497d8 Warn when resampled HRIR delays get clamped 2020-01-12 11:24:30 -08:00
Chris Robinson
c182a3376a Blend the whole IR for the interpolated HRIR
The SIMD mixers may use a few more elements beyond the irSize, so not limiting
the blend to that size can slightly improve the quality for resampled HRIRs.
2020-01-12 11:08:05 -08:00
Chris Robinson
b31886ad73 Fix blending for the right IR delay 2020-01-08 17:00:48 -08:00
Chris Robinson
1a2438b09c Don't blend the B-Format decoder HRIRs
Though fine in theory, an issue arises with extra phase interference since the
frequency phases aren't aligned for each response. It would be better to do the
blending before minimum phase reconstruction, where it can blend just the
frequency magnitudes, essentially allowing makemhr to increase the resolution
of the dataset.
2020-01-07 00:40:38 -08:00
Chris Robinson
cdd24c7d01 Combine identical arrays 2020-01-04 00:59:49 -08:00
Chris Robinson
8b3a1ed9e4 Use an array type for the HRIR delay pair 2019-12-30 21:04:10 -08:00
Chris Robinson
cfc8a82951 Load the HRIRs directly into HrirArrays 2019-12-30 20:49:19 -08:00
Chris Robinson
d9e3f0edf6 Avoid declaring a variable early 2019-12-30 19:17:33 -08:00
Chris Robinson
28d2294b07 Workaround for MSVC 2015 2019-12-29 21:49:29 -08:00
Chris Robinson
3b3d3d3a03 Use a span for the band-splitter input 2019-12-25 21:48:58 -08:00
Chris Robinson
053de62398 Don't force the HRIR length to a rounded value
The coefficient and accumulation buffers are guaranteed large enough for the
full size, and the SIMD handlers will behave the same either way.
2019-12-11 02:24:44 -08:00
Chris Robinson
7d0c01050a Fix MHR limits 2019-12-11 01:20:00 -08:00
Chris Robinson
d6bc56d7c1 Use proper array types instead of C-style arrays 2019-12-09 20:55:54 -08:00
Chris Robinson
a1de05fed7 Avoid global macros for format-secific types 2019-12-09 20:45:11 -08:00
Chris Robinson
e43c2bba61 Don't re-sort the enumerated HRTF list 2019-12-08 22:09:21 -08:00
Chris Robinson
a280373dc1 Improve blended IR delay precision for the B-Format decoder 2019-12-08 16:46:11 -08:00
Chris Robinson
c9a6527121 Use doubles for blending the B-Format decoder HRIRs 2019-12-06 22:31:30 -08:00
Chris Robinson
fcf03705e6 Clear the resampler after use 2019-11-29 18:19:01 -08:00
Chris Robinson
a8d06c0731 Store HRTF delays with some fractional precision
Since the delays get bilinearly filtered before use, maintaining a bit of extra
precision can help accuracy even if it ultimately gets rounded to the nearest
integer before use. This should help with resampled HRTFs, which need to scale
the delays that are already rounded, and can also be leveraged by an updated
MHR format.
2019-11-29 14:01:39 -08:00
Chris Robinson
2453f4ec14 Avoid a shadow declaration warning 2019-11-29 08:41:20 -08:00
Chris Robinson
7ff165b095 Use unsigned for array indices 2019-11-29 08:33:46 -08:00
Chris Robinson
34edd3a914 Fix sorting of loaded HRTFs 2019-11-29 06:19:06 -08:00
Chris Robinson
e80256e394 Remove an unnecessary alias 2019-11-28 16:17:00 -08:00
Chris Robinson
b310e09f59 Rename the default HRTF 2019-11-28 15:48:07 -08:00
Chris Robinson
6069eef94d Also scale the HRTF delays for different rates 2019-11-28 14:53:13 -08:00
Chris Robinson
846a997956 Add an option to limit the HRTF's IR size 2019-11-28 14:51:45 -08:00
Chris Robinson
4eb9a0b835 Don't keep a resampled default HRTF 2019-11-28 12:57:42 -08:00
Chris Robinson
f6105cbff0 Resample HRIRs when loading 2019-11-28 12:33:26 -08:00
Chris Robinson
576adf06b1 Store HRIR coefficients using HrirArray 2019-11-28 09:46:16 -08:00
Chris Robinson
925e6e979c Rework HRTF enuemration so the loaded HRTFs are separate 2019-11-28 08:24:29 -08:00
Chris Robinson
1e93fba6d0 Rename HrtfEntry to HrtfStore 2019-11-28 06:10:36 -08:00
Chris Robinson
eb8922596a Apply the full HRIR length for the B-Format decoder 2019-11-21 23:55:10 -08:00
Chris Robinson
2fd8c619b3 Rename a couple struct fields 2019-11-21 02:58:35 -08:00
Chris Robinson
7bc4a27900 Allocate storage for full HRTF coefficient lengths 2019-11-21 02:43:34 -08:00
Chris Robinson
6ad252efda Use wrappers to distinguish elevation and azimuth values 2019-11-16 14:07:31 -08:00
Chris Robinson
0ad512dd51 Clear the whole response HRIR before blending 2019-11-10 21:56:19 -08:00
Chris Robinson
2741a94e58 Use rotate to reorder the default list entry 2019-10-28 23:47:30 -07:00
Chris Robinson
101afb1ee4 Convert HRTF field distances to meters when creating storage 2019-10-27 15:50:59 -07:00