summaryrefslogtreecommitdiffstats
path: root/raul/Quantizer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'raul/Quantizer.hpp')
-rw-r--r--raul/Quantizer.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/raul/Quantizer.hpp b/raul/Quantizer.hpp
index 9a40751..2295ceb 100644
--- a/raul/Quantizer.hpp
+++ b/raul/Quantizer.hpp
@@ -33,6 +33,12 @@ public:
const double td = t.to_double();
return TimeStamp(t.unit(), (qd > 0) ? lrint(td / qd) * qd : td);
}
+
+ inline static double quantize(double q, double t) {
+ return (q > 0)
+ ? lrint(t / q) * q
+ : t;
+ }
};