aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
Commit message (Collapse)AuthorAgeFilesLines
* Use an alternate virtual layout for Ambisonic HRTF decodingChris Robinson2018-02-101-5/+12
| | | | | This uses 16 channels, an 8-channel octagon + 8-channel cube, which should improve horizontal resolution without affecting vertical too much.
* Assign the HRTF storage pointers separatelyChris Robinson2018-01-151-5/+11
|
* Fix up some types for MSVCChris Robinson2018-01-111-1/+2
|
* Move the config function declarations to their own headerChris Robinson2018-01-111-0/+1
| | | | And rename alcConfig.c to alconfig.c for consistency.
* Fix some types to make MSVC happyChris Robinson2017-12-171-5/+5
|
* Store the HRTF distance in the Hrtf handleChris Robinson2017-10-231-8/+11
|
* Update mhr format for 24-bit, multi-field, stereo measurementsChris Robinson2017-10-221-44/+83
| | | | | Currently only single field HRTFs are supported, but the format now allows up to 16.
* Check the right size for the in-progress mhr updateChris Robinson2017-08-091-2/+2
|
* Declare that a couple arrays are alignedChris Robinson2017-08-091-3/+6
|
* Add experimental support for 24-bit, dual-ear HRTFsChris Robinson2017-08-081-3/+230
| | | | | | | 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.
* Don't bother returning the IR length for B-Format decodingChris Robinson2017-07-311-2/+2
|
* Update makehrtf to use a larger FFT by defaultChris Robinson2017-07-251-1/+1
| | | | Also fixes DC offset removal and increases the max IR size.
* Use helpers to get data from byte streamsChris Robinson2017-06-161-51/+51
|
* Round the B-Format HRTF response where the multiple is definedChris Robinson2017-06-161-1/+3
|
* Implement cross-platform embedding of HRTF dataalexey.lysiuk2017-05-051-69/+8
|
* Reimplement bilinear interpolation between HRIRsChris Robinson2017-05-011-25/+82
| | | | | | Some data sets are just too sparse, having noticeably few measurements to properly handle slowly panning sources. Although not perfect, bilinearly interpolating the HRIR measurements improves the positional accuracy.
* Fix a mixed-sign-comparison warning on MSVCChris Robinson2017-04-191-1/+1
|
* Use a different way to get the size of structs with flexible array membersChris Robinson2017-04-181-2/+2
|
* Overwrite the old search path with the new oneChris Robinson2017-04-081-1/+1
|
* Combine a couple loopsChris Robinson2017-04-071-28/+24
|
* Make sure malloc succeeded for 'delays'Chris Robinson2017-04-071-2/+2
|
* Store the HRTF coeffs as a stereo pairChris Robinson2017-04-071-54/+98
| | | | | This will make it easier to handle HRTF data sets that have separate left and right ear responses. Will need an mhr version update to take advantage of that.
* Allocate temp storage for delays when loading HRTFsChris Robinson2017-04-071-8/+11
|
* Reference count HRTFs and unload them when unusedChris Robinson2017-04-061-5/+44
|
* Load embedded HRTF entries as-neededChris Robinson2017-04-061-58/+59
|
* Fix an incorrect messageChris Robinson2017-04-051-10/+13
|
* Load HRTF files as neededChris Robinson2017-04-051-59/+81
| | | | | Currently only applies to external files, rather than embedded datasets. Also, HRTFs aren't unloaded after being loaded, until library shutdown.
* Store the loaded hrtf entry container in the enumerated hrtf entryChris Robinson2017-04-051-40/+34
|
* Store the HRTF's filename separate from the entry storageChris Robinson2017-04-051-45/+72
|
* Rename al_string_* functions to alstr_*Chris Robinson2017-04-041-55/+53
|
* Avoid some unnecessary string reallocationChris Robinson2017-03-311-51/+50
|
* Load HRTF coefficients as pre-normalized floatsChris Robinson2017-03-311-38/+47
|
* Combine some HRTF loading codeChris Robinson2017-03-311-78/+72
|
* Use the correct types' sizes for HRTF storageChris Robinson2017-03-311-8/+8
|
* Rework HRTF coefficient fadingChris Robinson2017-03-111-27/+11
| | | | | | | | | | | | | | | This improves fading between HRIRs as sources pan around. In particular, it improves the issue with individual coefficients having various rounding errors in the stepping values, as well as issues with interpolating delay values. It does this by doing two mixing passes for each source. First using the last coefficients that fade to silence, and then again using the new coefficients that fade from silence. When added together, it creates a linear fade from one to the other. Additionally, the gain is applied separately so the individual coefficients don't step with rounding errors. Although this does increase CPU cost since it's doing two mixes per source, each mix is a bit cheaper now since the stepping is simplified to a single gain value, and the overall quality is improved.
* Allocate as many channels for DirectHrtfState as neededChris Robinson2017-03-111-3/+3
|
* Move the B-Format HRTF virtual speaker stuff to InitHrtfPanningChris Robinson2017-01-181-66/+9
| | | | | This keeps the decoder matrices and coefficient mapping together for if it changes in the future.
* Fix a couple hard-coded array sizesChris Robinson2017-01-161-2/+2
|
* Use ALsizei for sizes and offsets with the mixerChris Robinson2017-01-161-26/+26
| | | | | | Unsigned 32-bit offsets actually have some potential overhead on 64-bit targets for pointer/array accesses due to rules on integer wrapping. No idea how much impact it has in practice, but it's nice to be correct about it.
* Use second-order ambisonics for basic HRTF renderingChris Robinson2017-01-151-10/+29
| | | | | | This should improve positional quality for relatively low cost. Full HRTF rendering still only uses first-order since the only use of the dry buffer there is for first-order content (B-Format buffers, effects).
* One more update for the HRTF B-Format coefficientsChris Robinson2017-01-091-14/+14
| | | | These should better represent the pseudo-inverse matrices with N3D scaling.
* Update the B-Format HRTF coefficients to use the pseudo-inverse matrixChris Robinson2017-01-041-26/+14
| | | | | | It's hard to tell which is ultimately better, although this way does make the FOA output somewhat louder which will help when it's combined with direct HRTF rendering.
* Fixes for embedded HRTFs on OSXChris Robinson2016-11-111-5/+6
| | | | | | | | Use an empty source file to build a stub object file, instead of /dev/null. Use _mh_dylib_header to retrieve the data on 10.7+, instead of _mh_execute_header. And shorten the names to fit in the 16-character limit. Thanks to Anna Cheremnykh for the fixes!
* Try to make embedded HRTF data sets work on OSXChris Robinson2016-11-101-0/+25
|
* Don't use 0 for a resource IDChris Robinson2016-11-101-2/+2
|
* Rebalance the frequencies for B-Format HRTF coefficientsChris Robinson2016-11-011-14/+27
| | | | | | | | | | | | | | | The original pseudo-inverse method that generated the LF matrix expects the high frequencies to be scaled up by ~2.645751 over the low frequencies (or sqrt(7), ~8.45dB). However, the AllRAD method used to generate the HF matrix produced a matrix that was only scaled up by 1.46551981258 (based on the average of the W coefficients). Previously, the LF matrix was scaled down by sqrt(7), as the difference specified in the pseudo-inverse results. This failed to account for the increase already present in the HF matrix, so now the LF matrix is scaled down by the remaining difference between the expected scaling and the scaling already present in the HF matrix (sqrt(7) / 1.46551981258 = 1.80533302205, or roughly 5.13dB, where the reciprocal is 0.553914423 for -5.13 dB).
* Don't interpolate between nearest HRIRsChris Robinson2016-10-091-75/+38
| | | | | | | | It still fades between HRIRs when it changes, but now it selects the nearest one instead of blending the nearest four. Due to the minimum-phase nature of the HRIRs, interpolating between delays lead to some oddities which are exasperated by the fading (and the fading is needed to avoid clicks and pops, and smooth out changes).
* Update the ambisonic coefficients for HRTFChris Robinson2016-09-261-15/+15
| | | | | | | This uses an AllRAD-derived decoder matrix for the high frequencies, which seems to improve positioning response. It also switches back to dual-band. The low frequencies appear to be unexpectedly quiet by comparison, but it's not that bad and can be tweaked later.
* Don't warn if the desired default HRTF is already firstChris Robinson2016-09-101-4/+4
|
* Reduce the volume for the HRTF ambisonic decoderChris Robinson2016-09-081-14/+14
| | | | | | | Since it's accumulating multiple HRIRs for two output speakers, it seems to be a better option to preserve the amplitude of the high-frequency decoder instead of increasing it, and reduce the amplitude of the low-frequency decoder to compensate.