diff options
author | Chris Robinson <[email protected]> | 2019-10-22 16:30:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-10-22 16:30:07 -0700 |
commit | 0dfdebdf6d2a27a7af666a64aab976c3ef2102b0 (patch) | |
tree | 23e6120ee4d1dc2d13079bf1571fbe15251f468b /utils/sofa-info.cpp | |
parent | 4733fc6f1e2ba1bcdaca9d7c1941b2abbf150b67 (diff) |
Limit the number of azimuths and elevations used in SOFA files
Diffstat (limited to 'utils/sofa-info.cpp')
-rw-r--r-- | utils/sofa-info.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/sofa-info.cpp b/utils/sofa-info.cpp index a0ed9ff4..bc5b709a 100644 --- a/utils/sofa-info.cpp +++ b/utils/sofa-info.cpp @@ -174,9 +174,17 @@ static double GetUniformStepSize(const double epsilon, const uint m, const doubl count = 1; if(counts[0] > m/2) - return steps[0]; + break; } + if(counts[0] > 255) + { + uint i{2u}; + while(counts[0]/i > 255 && (counts[0]%i) != 0) + ++i; + counts[0] /= i; + steps[0] *= i; + } if(counts[0] > 5) return steps[0]; return 0.0; |