diff options
author | Chris Robinson <[email protected]> | 2011-07-19 00:43:31 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-19 00:43:31 -0700 |
commit | 244d60fb961336280895413a0c6881388fba9877 (patch) | |
tree | 45a42b325fa846b7743862d6b9fcfa327442c29e /Alc | |
parent | 0ae9638aa58f160a51340ced1812fdafb3b80969 (diff) |
Slightly improve the gain change delta calculation
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/hrtf.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -89,8 +89,9 @@ ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3], ALfloat gainChange, angleChange, delta; // Calculate the normalized dB gain change. - gainChange = aluFabs((log10(__max(newGain, 0.0001f)) - - log10(__max(oldGain, 0.0001f))) / log10(0.0001f)); + newGain = __max(newGain, 0.0001f); + oldGain = __max(oldGain, 0.0001f); + gainChange = aluFabs(log10(newGain / oldGain) / log10(0.0001f)); // Calculate the normalized listener to source angle change when there is // enough gain to notice it. |