From b28f5949172b941a72bf408137657521f6774fc7 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Sat, 30 Mar 2013 22:11:35 +0400 Subject: [PATCH] Drop fast_abs --- modules/core/include/opencv2/core/base.hpp | 2 +- modules/core/include/opencv2/core/operations.hpp | 8 -------- modules/core/src/stat.cpp | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/modules/core/include/opencv2/core/base.hpp b/modules/core/include/opencv2/core/base.hpp index 5257782d4f..f98b4c2ffb 100644 --- a/modules/core/include/opencv2/core/base.hpp +++ b/modules/core/include/opencv2/core/base.hpp @@ -333,7 +333,7 @@ _AccTp normL1(const _Tp* a, int n) } #endif for( ; i < n; i++ ) - s += fast_abs(a[i]); + s += std::abs(a[i]); return s; } diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index bbfc0dc374..c27e7c915a 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -63,14 +63,6 @@ namespace cv { -inline int fast_abs(uchar v) { return v; } -inline int fast_abs(schar v) { return std::abs((int)v); } -inline int fast_abs(ushort v) { return v; } -inline int fast_abs(short v) { return std::abs((int)v); } -inline int fast_abs(int v) { return std::abs(v); } -inline float fast_abs(float v) { return std::abs(v); } -inline double fast_abs(double v) { return std::abs(v); } - namespace internal { diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index b62f10a2a8..c5d63c3f8d 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1111,7 +1111,7 @@ normInf_(const T* src, const uchar* mask, ST* _result, int len, int cn) if( mask[i] ) { for( int k = 0; k < cn; k++ ) - result = std::max(result, ST(fast_abs(src[k]))); + result = std::max(result, ST(std::abs(src[k]))); } } *_result = result; @@ -1132,7 +1132,7 @@ normL1_(const T* src, const uchar* mask, ST* _result, int len, int cn) if( mask[i] ) { for( int k = 0; k < cn; k++ ) - result += fast_abs(src[k]); + result += std::abs(src[k]); } } *_result = result;