From 0dfdebdf6d2a27a7af666a64aab976c3ef2102b0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 22 Oct 2019 16:30:07 -0700 Subject: Limit the number of azimuths and elevations used in SOFA files --- utils/sofa-info.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'utils/sofa-info.cpp') 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; -- cgit v1.2.3