diff options
author | Chris Robinson <[email protected]> | 2011-06-03 01:06:00 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-06-03 01:06:00 -0700 |
commit | 7ddfacb58f941b21da26b2749d3204307e3a0bbd (patch) | |
tree | 2cb41f7de025705f38a634781e6413c7c004829e /Alc/ALu.c | |
parent | c7a80418d9291cad29dc293b95a5c328f4408b08 (diff) |
Use a minimum phase HRTF data set
This reduces the coefficient size from 128 down to 32, with a set of delays
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -245,7 +245,9 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) if(c == lfe_chan) { /* Skip LFE */ - for(i = 0;i < HRTF_LENGTH;i++) + ALSource->Params.HrtfDelay[c][0] = 0; + ALSource->Params.HrtfDelay[c][1] = 0; + for(i = 0;i < HRIR_LENGTH;i++) { ALSource->Params.HrtfCoeffs[c][i][0] = 0.0f; ALSource->Params.HrtfCoeffs[c][i][1] = 0.0f; @@ -253,8 +255,11 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) continue; } - GetHrtfCoeffs(0.0, angles[c], &hrtf_left, &hrtf_right); - for(i = 0;i < HRTF_LENGTH;i++) + GetHrtfCoeffs(0.0, angles[c] * (M_PI/180.0), + &hrtf_left, &hrtf_right, + &ALSource->Params.HrtfDelay[c][0], + &ALSource->Params.HrtfDelay[c][1]); + for(i = 0;i < HRIR_LENGTH;i++) { ALSource->Params.HrtfCoeffs[c][i][0] = hrtf_left[i]*(1.0/32767.0)*DryGain*ListenerGain; @@ -676,10 +681,11 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) Position[2] *= invlen; } - GetHrtfCoeffs(asin(Position[1]) * (180.0/M_PI), - atan2(Position[0], -Position[2]*ZScale) * (180.0/M_PI), - &hrtf_left, &hrtf_right); - for(i = 0;i < HRTF_LENGTH;i++) + GetHrtfCoeffs(asin(Position[1]), atan2(Position[0], -Position[2]*ZScale), + &hrtf_left, &hrtf_right, + &ALSource->Params.HrtfDelay[0][0], + &ALSource->Params.HrtfDelay[0][1]); + for(i = 0;i < HRIR_LENGTH;i++) { ALSource->Params.HrtfCoeffs[0][i][0] = hrtf_left[i]*(1.0/32767.0) * DryGain; ALSource->Params.HrtfCoeffs[0][i][1] = hrtf_right[i]*(1.0/32767.0) * DryGain; |