Commit 0ae89fe2 authored by f-morozov's avatar f-morozov

AKAZE optimizations

parent 1a1097ab
...@@ -74,4 +74,24 @@ inline int fRound(float flt) { ...@@ -74,4 +74,24 @@ inline int fRound(float flt) {
return (int)(flt + 0.5f); return (int)(flt + 0.5f);
} }
/* ************************************************************************* */
/**
* @brief Exponentiation by squaring
* @param flt Exponentiation base
* @return dst Exponentiation value
*/
inline int fastpow(int base, int exp) {
int res = 1;
while(exp > 0) {
if(exp & 1) {
exp--;
res *= base;
} else {
exp /= 2;
base *= base;
}
}
return res;
}
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment