Slightly improve the gain change delta calculation

This commit is contained in:
Chris Robinson
2011-07-19 00:43:31 -07:00
parent 0ae9638aa5
commit 244d60fb96
+3 -2
View File
@@ -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.