aboutsummaryrefslogtreecommitdiffstats
path: root/utils/makemhr
Commit message (Collapse)AuthorAgeFilesLines
* Implement our own cache for MYSOFA_EASY objectsChris Robinson2023-12-311-14/+39
| | | | | | | This is to both fix the potential issue of libmysofa calling free() on memory we allocated with calloc (which can be an issue if it linked to a different C runtime), and work around the code checker thinking the MYSOFA_EASY object leaks when mysofa_close and mysofa_cache_store are taking ownership of it.
* Handle pointer ownership a bit betterChris Robinson2023-12-291-14/+17
|
* Clean up some gotos and non-optimal castsChris Robinson2023-12-261-2/+4
|
* Use standard methods for roundingChris Robinson2023-12-251-1/+1
|
* Avoid assignments in if conditionsChris Robinson2023-12-231-2/+2
|
* Fix implicit widening after multiplicationChris Robinson2023-12-233-39/+40
|
* Ensure struct members are initializedChris Robinson2023-12-201-4/+4
|
* Fix clang-tidy warnings from the examples and utilitiesChris Robinson2023-12-134-171/+184
|
* Much more clang-tidy cleanupChris Robinson2023-12-104-230/+216
|
* Clean up some variables for clang-tidyChris Robinson2023-12-041-13/+10
|
* Slightly simplify calculating the minimum phase outputChris Robinson2023-10-261-4/+1
|
* Use deduction guides instead of helper functions for spansChris Robinson2023-05-053-4/+4
|
* Replace al::optional with std::optionalChris Robinson2023-05-042-5/+4
|
* Avoid using auto for lambda parametersChris Robinson2023-02-061-1/+1
|
* Make sure a variable is set before useChris Robinson2023-01-311-3/+3
|
* Increase the default mhr truncation size to 64Chris Robinson2023-01-231-1/+1
| | | | To match the default data set.
* Replace a couple more pointer+count with a spanChris Robinson2023-01-234-148/+124
|
* Use a vector of arrays for a multi-dimensional arrayChris Robinson2023-01-234-12/+16
|
* Use a span instead of pointer+countChris Robinson2023-01-234-17/+19
|
* Remove a redundant struct memberChris Robinson2023-01-234-37/+34
|
* Remove some unused membersChris Robinson2023-01-232-4/+0
|
* Fix closing parenthesisChris Robinson2023-01-151-1/+1
|
* clang-tidy cleanups (#800)Rosen Penev2023-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clang-tidy: use bool literals Found with modernize-use-bool-literals Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: replace std::bind with lambdas Found with modernize-avoid-bind Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: use data() instead of pointer stuff Found with readability-container-data-pointe Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: use empty() Found with readability-container-size-empty Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: remove static in anon namespace Found with readability-static-definition-in-anonymous-namespace Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: remove const return Found with readability-const-return-type Signed-off-by: Rosen Penev <[email protected]> Signed-off-by: Rosen Penev <[email protected]>
* Remove the FFT'd resampler from makemhrChris Robinson2023-01-111-93/+0
| | | | | Both SOFA and non-SOFA inputs use the polyphase resampler as needed when loading the IRs.
* Avoid extraneous temporaries when filling vectorsChris Robinson2022-12-152-0/+5
|
* Avoid manually specifying FFT template parametersChris Robinson2022-12-141-2/+2
|
* Use the existing common FFT functions in makemhrChris Robinson2022-11-272-84/+16
|
* Avoid nesting lambdasChris Robinson2022-10-241-42/+27
|
* Don't pass null to fprintfChris Robinson2022-10-101-2/+2
|
* Handle the delays specified in SOFA filesChris Robinson2022-10-101-44/+55
|
* Resample before frequency analysisChris Robinson2022-05-135-38/+92
| | | | | | | | | | We want to resample before minimum phase reconstruction since that changes the phase relationship of the sampled signal, introducing a slight bit of noise from truncated sampling. It's not clear that the frequency domain resampling method is accurate, so resampling prior to frequency analysis is an alternative to ensure the resulting frequencies are given the proper phase for sampling. This also cleans up some micro allocations in loops.
* Add missing includeChris Robinson2021-02-161-0/+1
|
* Avoid allocating for each HRIR reconstructionChris Robinson2020-08-141-9/+9
|
* Simplify StrSubst in makemhrChris Robinson2020-08-131-36/+27
|
* Improve handling main() with UTF-8 args on WindowsChris Robinson2020-08-121-2/+0
|
* Apply simulated HRIR occlusion in the frequency domainChris Robinson2020-06-211-50/+59
|
* Synthesize missing elevations in the frequency domainChris Robinson2020-06-211-141/+147
| | | | | | This should help avoid destructive phase interference. The occlusion low-pass filter is still applied in the time domain due to no clear topology (cutoff frequency, slope, bandwidth, etc).
* Use multiple threads for magnitude calculationsChris Robinson2020-06-193-46/+107
| | | | Also allow user-declarable thread count.
* Avoid blending multiple IRs for the -90 elevation IRChris Robinson2020-06-191-33/+27
|
* Calculate the HRIR onsets and magnitudes separately from loadingChris Robinson2020-06-171-21/+82
| | | | | This should help improve memory use a bit since the SOFA file can be unloaded before allocating some temp buffers for onset detection and FFT calculation.
* Add a makemhr option to use the farthest field onlyChris Robinson2020-06-171-8/+30
| | | | | All fields are used for equalization, but only the farthest field is resampled, reconstructed, normalized, and written to the mhr.
* Resample HRIRs after equalizationChris Robinson2020-06-171-93/+93
|
* Avoid reinitializing the resampler with each HRIRChris Robinson2020-06-171-10/+11
|
* Resample HRTFs in the frequency domain in makemhrChris Robinson2020-06-171-29/+93
| | | | | | | | | | | | This should produce far better results given it works directly on the frequency response magnitudes prior to phase reconstruction, as it doesn't deal with a linear phase filter on a truncated time-domain response (with the result also getting truncated in both direction). The in-library on-load HRTF resampler still uses the linear filter due to its relative performance and simplicity benefits. It's good enough as a backup, though users with custom HRTFs would benefit from resampling when creating the mhr (adjusting its window size as appropriate/desired).
* Add missing <cstdarg>ArthurSonzogni2020-04-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenAL-Soft fails to compile on some GCC version: https://travis-ci.com/github/ArthurSonzogni/smk/jobs/318304162 It has regressed likely after: https://github.com/kcat/openal-soft/commit/c83609277bed4be4ef40ed306bf2c57fefa19519 va_start is defined in: - <stdarg.h> - <cstdarg> The repository is using it from: - al/error.cpp - al/filter.cpp - alc/alu.cpp - alc/helpers.cpp - common/alexcpt.cpp - utils/makemhr/loaddef.cpp - utils/openal-info.c This patch is adding its definition in the files missing it: - common/alexcpt.cpp - utils/makemhr/loaddef.cpp - utils/openal-info.c Bug: https://travis-ci.com/github/ArthurSonzogni/smk/jobs/318304162
* Update the makemhr utility and default HRTFChris Robinson2020-02-111-17/+13
|
* Scale delays when exceeding the max for generated mhr filesChris Robinson2020-02-101-15/+35
|
* Use the peak IR magnitude to get the onsetChris Robinson2020-01-252-19/+7
| | | | | | | | | | | | While maybe not technically correct, we actually only care about the difference between onsets (any base constant is removed). This should work better since it determines when the IR is most audible, whereas previously it used a variable threshold of when it reached 15% of the max amplitude. An even better method may be to check where the IR amplitude exceeds a fixed threshold (i.e. the same threshold applied to all IRs), but that would need tweaking to find a level that doesn't catch random noise and doesn't potentially miss the more occluded IRs.
* Fix MHR limitsChris Robinson2019-12-111-7/+3
|
* Move duplicate SOFA-related functions to a reusable libraryChris Robinson2019-12-111-244/+16
|