aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-01-27 15:50:02 -0800
committerChris Robinson <[email protected]>2019-01-27 15:50:02 -0800
commitb3fe540c49a52e1b99e8513eb6209bb134708ce0 (patch)
tree0d81a2ecfa329747d49d852ff5320262e6c2a421
parente55f9b42e9f1f51f1d4af4537d10dbf63c55d4e5 (diff)
Don't normalize HRIRs per-field
-rw-r--r--utils/makehrtf.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/makehrtf.cpp b/utils/makehrtf.cpp
index c20e0655..4e894e7e 100644
--- a/utils/makehrtf.cpp
+++ b/utils/makehrtf.cpp
@@ -2450,18 +2450,16 @@ static void SynthesizeHrirs(HrirDataT *hData)
// The following routines assume a full set of HRIRs for all elevations.
-// Normalize the HRIR set and slightly attenuate the result. This is done
-// per-field since distance attenuation is ignored.
+// Normalize the HRIR set and slightly attenuate the result.
static void NormalizeHrirs(const HrirDataT *hData)
{
- uint channels = (hData->mChannelType == CT_STEREO) ? 2 : 1;
- uint n = hData->mIrPoints;
+ uint channels{(hData->mChannelType == CT_STEREO) ? 2u : 1u};
+ uint n{hData->mIrPoints};
uint ti, fi, ei, ai, i;
+ double maxLevel{0.0};
for(fi = 0;fi < hData->mFdCount;fi++)
{
- double maxLevel = 0.0;
-
for(ei = 0;ei < hData->mFds[fi].mEvCount;ei++)
{
for(ai = 0;ai < hData->mFds[fi].mEvs[ei].mAzCount;ai++)
@@ -2474,9 +2472,11 @@ static void NormalizeHrirs(const HrirDataT *hData)
}
}
}
+ }
+ maxLevel = 1.01 * maxLevel;
- maxLevel = 1.01 * maxLevel;
-
+ for(fi = 0;fi < hData->mFdCount;fi++)
+ {
for(ei = 0;ei < hData->mFds[fi].mEvCount;ei++)
{
for(ai = 0;ai < hData->mFds[fi].mEvs[ei].mAzCount;ai++)