Mercurial > hg > qm-dsp
diff maths/MathUtilities.h @ 55:7fe29d8a7eaf
* Various fixes related to the bar estimator code
author | cannam |
---|---|
date | Tue, 10 Feb 2009 16:37:11 +0000 |
parents | 5bec06ecc88a |
children | 054c384d860d |
line wrap: on
line diff
--- a/maths/MathUtilities.h Tue Feb 10 12:52:43 2009 +0000 +++ b/maths/MathUtilities.h Tue Feb 10 16:37:11 2009 +0000 @@ -52,6 +52,11 @@ // moving mean threshholding: static void adaptiveThreshold(std::vector<double> &data); + + static bool isPowerOfTwo(int x); + static int nextPowerOfTwo(int x); // e.g. 1300 -> 2048, 2048 -> 2048 + static int previousPowerOfTwo(int x); // e.g. 1300 -> 1024, 2048 -> 2048 + static int nearestPowerOfTwo(int x); // e.g. 1300 -> 1024, 1700 -> 2048 }; #endif