summaryrefslogtreecommitdiff
path: root/indra/llmath/llmath.h
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2011-10-16 08:32:26 -0400
committerDebi King (Dessie) <dessie@lindenlab.com>2011-10-16 08:32:26 -0400
commit4ac1b64665a49c7121411f3db27718f0c37eaf33 (patch)
tree85d7f3ccdacd6f322fb1fa213aa91c12b2d4abf4 /indra/llmath/llmath.h
parent972df2587863737eafde9caf6fce89f330358b5e (diff)
parent2f9edd050669210d651e66a86efb9746c3fa8a34 (diff)
merge
Diffstat (limited to 'indra/llmath/llmath.h')
-rw-r--r--indra/llmath/llmath.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index eea7c977fb..9297bcbac2 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -510,6 +510,13 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k)
VEC_TYPE Q1 = data[data.size()/4];
VEC_TYPE Q3 = data[data.size()-data.size()/4-1];
+ if ((F32)(Q3-Q1) < 1.f)
+ {
+ // not enough variation to detect outliers
+ return;
+ }
+
+
VEC_TYPE min = (VEC_TYPE) ((F32) Q1-k * (F32) (Q3-Q1));
VEC_TYPE max = (VEC_TYPE) ((F32) Q3+k * (F32) (Q3-Q1));