Tegra optimized cvRound; perf test for cvRound; fixed perf test for stitching

This commit is contained in:
Andrey Kamaev
2011-09-29 12:11:18 +00:00
parent 3c9979cd6a
commit 5d363e67a0
3 changed files with 37 additions and 4 deletions

View File

@@ -259,6 +259,10 @@ enum {
* Common macros and inline functions *
\****************************************************************************************/
#ifdef HAVE_TEGRA_OPTIMIZATION
# include "tegra_round.hpp"
#endif
#define CV_PI 3.1415926535897932384626433832795
#define CV_LOG2 0.69314718055994530941723212145818
@@ -300,7 +304,11 @@ CV_INLINE int cvRound( double value )
}
return t;
#elif defined HAVE_LRINT || defined CV_ICC || defined __GNUC__
# ifdef HAVE_TEGRA_OPTIMIZATION
TEGRA_ROUND(value);
# else
return (int)lrint(value);
# endif
#else
// while this is not IEEE754-compliant rounding, it's usually a good enough approximation
return (int)(value + (value >= 0 ? 0.5 : -0.5));