235 Commits

Author SHA1 Message Date
Chris Robinson
4cc1c64646 Replace the sinc4 resampler with cubic
Turns out the C version of the cubic resampler is just slightly faster than
even the SSE3 version of the FIR4 resampler. This is likely due to not using a
64KB random-access lookup table along with unaligned loads, both offseting the
gains from SSE.
2018-01-07 05:32:07 -08:00
Chris Robinson
57e516720e Avoid a potential calloc of 0 2017-12-17 14:30:51 -08:00
Chris Robinson
0349bcc500 Update mhr format for 24-bit, multi-field, stereo measurements
Currently only single field HRTFs are supported, but the format now allows up
to 16.
2017-10-22 15:36:42 -07:00
Chris Robinson
67f183f206 Avoid using wmain on Windows 2017-08-30 16:33:44 -07:00
Chris Robinson
6c367cad6e Ensure some macros have the correct size 2017-08-28 05:56:57 -07:00
Chris Robinson
fde02abc35 Rename resampler labels 2017-08-27 10:47:04 -07:00
Chris Robinson
fdce192aab Add bsinc24 to alsoft-config 2017-08-27 10:38:33 -07:00
Chris Robinson
a4d357de06 Add a higher quality bsinc resampler using 24 sample points
This improves the transition width, allowing more of the higher frequencies
remain audible. It would be preferrable to have an upper limit of 32 points
instead of 48, to reduce the overall table size and the CPU cost for down-
sampling.
2017-08-27 10:16:36 -07:00
Chris Robinson
773d4664ff Properly open the output file for writing 2017-08-27 06:40:39 -07:00
Chris Robinson
72e3398baf Avoid including AL headers in makehrtf 2017-08-27 06:23:31 -07:00
Chris Robinson
f1bbf2e48a Use a common header for Unicode-awareness on Windows 2017-08-27 06:01:31 -07:00
Chris Robinson
bfcde9ae8a Allow specifying the output filename with bsincgen 2017-08-26 04:43:16 -07:00
Chris Robinson
561e95528f Rename the bsinc resampler to bsinc12 2017-08-25 05:52:19 -07:00
Chris Robinson
3d76e1c514 Parameterize the filter order and rejection in bsincgen 2017-08-23 03:32:47 -07:00
Chris Robinson
61097d467c Parameterize the bsinc table name 2017-08-22 00:52:17 -07:00
Chris Robinson
ef7ce82828 Properly postfix the filter order number 2017-08-21 04:54:49 -07:00
Chris Robinson
877ecda14d Properly check if a pointer is different when cleaning it up 2017-08-20 21:23:25 -07:00
Chris Robinson
079e4b1edb Fix -l switch 2017-08-20 18:39:26 -07:00
Chris Robinson
65bcbe0dc8 Clarify argument errors in makehrtf 2017-08-20 18:38:22 -07:00
Chris Robinson
bbabc9705e Ensure the arglist is properly terminated 2017-08-20 18:16:52 -07:00
Chris Robinson
520938da57 Print the input and output filenames in makehrtf 2017-08-20 18:00:52 -07:00
Chris Robinson
97d09b4cee Remove the -m command from makehrtf
It only ever outputs mhr files, so there's no need to have a command for it. If
another output format is ever made, it can be a normal option flag.
2017-08-20 16:54:08 -07:00
Chris Robinson
55643d6370 Use getopt to handle options in makehrtf 2017-08-20 04:30:53 -07:00
Chris Robinson
051828344e Improve unicode handling for makehrtf
Command line parameters and filenames are now unicode-aware (the .def files
should be UTF-8 encoded, if they contain any non-ASCII-7 characters). Unicode
characters might not display correctly in the console, but it should process
them correctly.
2017-08-20 01:50:27 -07:00
Chris Robinson
e8e1a05f38 Add a function to multiply a complex with a scalar 2017-08-18 20:58:58 -07:00
Chris Robinson
f75020da5a Show progress when processing HRTFs 2017-08-18 19:00:42 -07:00
Chris Robinson
75bf45376c Use a proper complex number types in makehrtf 2017-08-18 04:32:55 -07:00
Chris Robinson
d2e485cc6d Simplify bsincgen's Kaiser function 2017-08-18 03:09:36 -07:00
Chris Robinson
fdd5070c3b "Unfix" the filter length calculation
Partially reverts 3f3a3ac4f1d069542ca2399a8b5e63d9d1a4df3b. The l*2 + 1 is
correct when you want an odd number of sample points, which avoids an
unnecessary phase offset in the fitler. However, the rounding is still needed
to calculating the left offset (l), or else the transition width can increase
with an odd-numbered order.
2017-08-18 02:48:32 -07:00
Chris Robinson
5048956ff0 Keep bsinc filter quality more consistent between scales
This generates the filters using the proper size and scale. The 'a' divisor
should represent the +/- sample range (and thus be a whole number), with the
number of sample points being double that. Increasing the filter size to a
multiple of 4 (for SIMD) can be done by padding in 0s afterward.
2017-08-17 23:21:41 -07:00
Chris Robinson
080c076643 Workaround Android not having log2 2017-08-17 15:51:42 -07:00
Chris Robinson
3f3a3ac4f1 Properly calculate the filter size 2017-08-17 05:53:16 -07:00
Chris Robinson
9fd3e5f529 Correct the bsinc filter order
Despite the claim that it was an 11th order filter, the transition width was
generated by specifying 12th order. A 12th order filter would need 14 sample
points rather than the 12 it had.
2017-08-17 05:51:18 -07:00
Chris Robinson
e0408d8edf Make the sinc4 table static 2017-08-16 18:19:04 -07:00
Chris Robinson
520dd5c779 Make the bsinc table layout more efficient
The old layout separated filters, scale deltas, phase deltas, and scale phase
deltas into separate segments that each contained a numbers of scale and phase
entries, Since processing a sample needed a filter and one of each delta entry
relating to a particular scale and phase, the memory needed would be spread
across the whole table. And since subsequent samples would use a different
phase, it would jump around the table a whole lot as well.

The new layout packs the data in a way more consistent with its use. The
filters, scale deltas, phase deltas, and scale phase deltas are interleaved,
such that for a particular scale and phase, the filter and delta entries used
are contiguous. And the phase entries for a particular scale are kept together,
so the ~500 to ~1000 samples processed per source update stay within the same
3KB to 6KB area of the 70+KB table, which is much more cache friendly.
2017-08-16 02:05:10 -07:00
Chris Robinson
4dd53ab942 Keep bsinc info together in a struct 2017-08-15 04:15:50 -07:00
Chris Robinson
ad3c4b81e2 Add experimental support for 24-bit, dual-ear HRTFs
Currently makehrtf only handles 24-bit output, not dual-ear, and only when
given the --experimental switch. Files produced this way will not be guaranteed
future compatibility. When the mhr format is also updated with multi-distance
measurements, the experimental switch can go away.
2017-08-08 20:30:26 -07:00
Chris Robinson
6eadccc99d Replace makehrtf's dither
This uses a custom RNG instead of relying on the system-dependent rand(). It
also removes the high-pass/noise-shaping, to flatten the noise floor.
2017-08-01 23:43:25 -07:00
Chris Robinson
75841642bf Update makehrtf to use a larger FFT by default
Also fixes DC offset removal and increases the max IR size.
2017-07-25 16:17:46 -07:00
Chris Robinson
1c04cbad04 Resample HRIRs prior to minimum phase reconstruction 2017-06-01 04:06:08 -07:00
Chris Robinson
dd6c5270b6 Add a dithering option to alsoft-config 2017-05-23 01:12:49 -07:00
Chris Robinson
e1bc4c0730 Include the Built-In HRTF names in alsoft-config when enabled 2017-05-05 07:49:56 -07:00
Chris Robinson
64f0630fef Move native-tools to the root directory 2017-05-05 05:03:50 -07:00
Chris Robinson
47f843632f Make the generated data array static const 2017-05-05 04:59:07 -07:00
alexey.lysiuk
17dfaca43d Implement cross-platform embedding of HRTF data 2017-05-05 14:30:06 +03:00
Chris Robinson
14b23c2502 Print available resamplers in openal-info 2017-05-03 04:53:22 -07:00
Chris Robinson
8f56c9522e Document the output-limiter config option
Expose it in alsoft-config as well.
2017-04-26 19:27:50 -07:00
Chris Robinson
319d097198 Pre-compute the sinc4 resampler coefficient table 2017-04-08 13:43:19 -07:00
Chris Robinson
1d559ec703 Properly update the resampler label in the UI 2017-03-24 15:34:36 -07:00
Chris Robinson
1e7c0b4646 Fix the height of some GUI widgets 2017-03-12 16:25:13 -07:00