aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a front-stablizer config option for surround sound modesChris Robinson2017-07-311-0/+40
| | | | | | | | | | | | 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.
* Don't bother returning the IR length for B-Format decodingChris Robinson2017-07-311-3/+2
|
* Print an error if the input channel isn't in the deviceChris Robinson2017-07-311-22/+16
| | | | Rather than the other way around, if a device channel isn't in the channel map.
* Update default 5.1 and 6.1 coefficients to exclude front-centerChris Robinson2017-07-301-15/+12
| | | | | | | Not all speaker kits have a front-center speaker capable of outputing full- range content. It's best to err on the side of caution and not include front- center for normal positional sound by default, leaving it instead for the dedicated dialog effect.
* Scale the source volume by +3dB for a full spreadChris Robinson2017-07-181-6/+7
| | | | | This effectively turns a full spread source into an ambient response, preventing such sources from being unexpectedly quiet.
* Round the B-Format HRTF response where the multiple is definedChris Robinson2017-06-161-3/+0
|
* Don't enable NFC for a 0 reference delayChris Robinson2017-05-141-1/+1
|
* Correctly enable the ambisonic upsampler for HOA outputChris Robinson2017-04-211-1/+1
|
* Check for the upsampler to determine if HRTF uses HOAChris Robinson2017-04-181-15/+12
|
* Use a different way to get the size of structs with flexible array membersChris Robinson2017-04-181-3/+1
|
* Store the ambisonic order separate from the channel enumChris Robinson2017-04-121-19/+12
|
* Don't explicitly restore the old HRTF when initializing panningChris Robinson2017-04-071-12/+0
| | | | Otherwise it won't store the name in the device.
* Clean up a commentChris Robinson2017-04-071-1/+1
|
* Reference count HRTFs and unload them when unusedChris Robinson2017-04-061-2/+30
|
* Load HRTF files as neededChris Robinson2017-04-051-4/+4
| | | | | 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-6/+8
|
* Rename al_string_* functions to alstr_*Chris Robinson2017-04-041-24/+24
|
* Allocate as many channels for DirectHrtfState as neededChris Robinson2017-03-111-4/+5
|
* Dynamically allocate the device's HRTF stateChris Robinson2017-03-101-26/+29
|
* Implement NFC filters for Ambisonic renderingChris Robinson2017-03-101-61/+111
| | | | | | | | | | | | | | NFC filters currently only work when rendering to ambisonic buffers, which includes HQ rendering and ambisonic output. There are two new config options: 'decoder/nfc' (default on) enables or disables use of NFC filters globally, and 'decoder/nfc-ref-delay' (default 0) specifies the reference delay parameter for NFC-HOA rendering with ambisonic output (a value of 0 disables NFC). Currently, NFC filters rely on having an appropriate value set for AL_METERS_PER_UNIT to get the correct scaling. HQ rendering uses the averaged speaker distances as a control/reference, and currently doesn't correct for individual speaker distances (if the speakers are all equidistant, this is fine, otherwise per-speaker correction should be done as well).
* Dynamically allocate the channel delay buffersChris Robinson2017-02-281-0/+16
|
* Remove an unneeded functionChris Robinson2017-02-281-1/+1
|
* Use separate enums for the ambisonic channel order and normalizationChris Robinson2017-02-271-4/+4
|
* Remove CalcXYZCoeffs and inline CalcAngleCoeffsChris Robinson2017-02-231-11/+1
|
* Alter how panpot/pair-wise panning worksChris Robinson2017-02-231-4/+12
| | | | | | | | | | | | | | | | | | | This change allows pair-wise panning to mostly go through the normal ambisonic panning methods, with one special-case. First, a term is added to the stereo decoder matrix's X coefficient so that a centered sound is reduced by -3dB on each output channel. Panning in front creates a similar gain response to the typical L = sqrt(1-pan) R = sqrt(pan) for pan = [0,1]. Panning behind the listener can reduce (up to) an additional -10dB, creating a audible difference between front and back sounds as if simulating head obstruction. Secondly, as a special-case, the source positions are warped when calculating the ambisonic coefficients so that full left panning is reached at -30 degrees and full right at +30 degrees. This is to retain the expected 60-degree stereo width. This warping does not apply to B-Format buffer input, although it otherwise has the same gain responses.
* Rename stereo-panning option to stereo-encodingChris Robinson2017-02-221-7/+7
| | | | Also rename the 'paired' value to 'panpot', and make it the default.
* Avoid duplicating device buffer layout logicChris Robinson2017-02-201-2/+24
|
* Allow distance compensation for non-HQ rendering as wellChris Robinson2017-02-201-37/+44
| | | | | It still requires a custom configuration to specify appropriate speaker distances.
* Remove the separate surround51rear decoder optionChris Robinson2017-02-191-2/+2
| | | | | | Both 5.1 Side and Rear configurations use 'surround51' to look up the appropriate decoder file. The decoder loader already handles mapping between rear and side channels, so there's no need for separate options.
* Apply distance compensation when writing to the outputChris Robinson2017-02-191-5/+43
|
* Don't use periphonic FOA when the HOA decoder is not periphonicChris Robinson2017-02-191-3/+13
|
* Replace more ALuint with ALsizeiChris Robinson2017-01-291-4/+4
|
* Improve the ambisonic upscaling methodsChris Robinson2017-01-241-29/+40
| | | | | | | | 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.
* Fix coefficient counts for the built-in B-Format decodersChris Robinson2017-01-211-2/+2
|
* Use a flat sqrt(2) scale for non-directional ambient gainsChris Robinson2017-01-211-8/+3
|
* Update the default basic B-Format decodersChris Robinson2017-01-211-47/+36
| | | | This also converts them to ACN/N3D format.
* Move the B-Format HRTF virtual speaker stuff to InitHrtfPanningChris Robinson2017-01-181-7/+55
| | | | | This keeps the decoder matrices and coefficient mapping together for if it changes in the future.
* Use ALsizei in more placesChris Robinson2017-01-181-14/+14
|
* More ALsizei, with the B-Format decoderChris Robinson2017-01-161-2/+2
|
* Use ALsizei for sizes and offsets with the mixerChris Robinson2017-01-161-24/+24
| | | | | | 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-9/+48
| | | | | | 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).
* Be clearer about whether full or basic HRTF rendering is usedChris Robinson2016-11-021-1/+4
|
* Remove use of DECL_CONSTChris Robinson2016-09-061-1/+1
| | | | | No idea if it was really gaining us anything, but removing it fixes a crash I was getting with libs built with Clang.
* Combine related members into a structChris Robinson2016-08-241-25/+26
|
* Use a more specialized mixer function for B-Format to HRTFChris Robinson2016-08-121-14/+4
|
* Decode directly from B-Format to HRTF instead of a cubeChris Robinson2016-08-111-39/+22
| | | | | | | | | | | | | | | | | | | | | Last time this attempted to average the HRIRs according to their contribution to a given B-Format channel as if they were loudspeakers, as well as averaging the HRIR delays. The latter part resulted in the loss of the ITD (inter-aural time delay), a key component of HRTF. This time, the HRIRs are averaged similar to above, except instead of averaging the delays, they're applied to the resulting coefficients (for example, a delay of 8 would apply the HRIR starting at the 8th sample of the target HRIR). This does roughly double the IR length, as the largest delay is about 35 samples while the filter is normally 32 samples. However, this is still smaller the original data set IR (which was 256 samples), it also only needs to be applied to 4 channels for first-order ambisonics, rather than the 8-channel cube. So it's doing twice as much work per sample, but only working on half the number of samples. Additionally, since the resulting HRIRs no longer rely on an extra delay line, a more efficient HRTF mixing function can be made that doesn't use one. Such a function can also avoid the per-sample stepping parameters the original uses.
* Use the ACN and N3D map and scale lookup tables in SetChannelMapChris Robinson2016-08-021-16/+9
|
* Remove DevFmtBFormat3D, which is covered by DevFmtAmbi1Chris Robinson2016-07-311-18/+1
|
* Add an option to specify the ambisonic output configurationChris Robinson2016-07-311-26/+31
|
* Add a stand-alone upsampler for higher-order ambisonic oputputChris Robinson2016-07-301-0/+19
|