removed HAL calls from public OpenCV headers; put IPP calls back to hall:sqrt() and such (but they are disabled for now)

This commit is contained in:
Vadim Pisarevsky
2015-05-22 16:04:10 +03:00
parent ef8182e12a
commit d2aaa70e93
5 changed files with 100 additions and 23 deletions

View File

@@ -492,17 +492,9 @@ _AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n)
return s;
}
inline float normL2Sqr(const float* a, const float* b, int n)
static inline float normL2Sqr(const float* a, const float* b, int n)
{
if( n >= 8 )
return hal::normL2Sqr_(a, b, n);
float s = 0;
for( int i = 0; i < n; i++ )
{
float v = a[i] - b[i];
s += v*v;
}
return s;
return normL2Sqr<float, float>(a, b, n);
}
template<typename _Tp, typename _AccTp> static inline
@@ -527,20 +519,12 @@ _AccTp normL1(const _Tp* a, const _Tp* b, int n)
inline float normL1(const float* a, const float* b, int n)
{
if( n >= 8 )
return hal::normL1_(a, b, n);
float s = 0;
for( int i = 0; i < n; i++ )
{
float v = a[i] - b[i];
s += std::abs(v);
}
return s;
return normL1<float, float>(a, b, n);
}
inline int normL1(const uchar* a, const uchar* b, int n)
{
return hal::normL1_(a, b, n);
return normL1<uchar, int>(a, b, n);
}
template<typename _Tp, typename _AccTp> static inline
@@ -573,6 +557,15 @@ CV_EXPORTS_W float cubeRoot(float val);
*/
CV_EXPORTS_W float fastAtan2(float y, float x);
/** proxy for hal::LU */
CV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n);
/** proxy for hal::LU */
CV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n);
/** proxy for hal::Cholesky */
CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n);
/** proxy for hal::Cholesky */
CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n);
////////////////// forward declarations for important OpenCV types //////////////////
//! @cond IGNORED

View File

@@ -427,7 +427,7 @@ template<typename _Tp, int m> struct Matx_DetOp
double operator ()(const Matx<_Tp, m, m>& a) const
{
Matx<_Tp, m, m> temp = a;
double p = hal::LU(temp.val, m*sizeof(_Tp), m, 0, 0, 0);
double p = LU(temp.val, m*sizeof(_Tp), m, 0, 0, 0);
if( p == 0 )
return p;
for( int i = 0; i < m; i++ )

View File

@@ -72,9 +72,9 @@ template<typename _Tp, int m> struct Matx_FastInvOp
b(i, i) = (_Tp)1;
if( method == DECOMP_CHOLESKY )
return hal::Cholesky(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m);
return Cholesky(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m);
return hal::LU(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m) != 0;
return LU(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m) != 0;
}
};