From a34f044d19ee12c2882010cc1ad8bce83b5ddba6 Mon Sep 17 00:00:00 2001 From: Vladimir Dudnik Date: Sat, 8 Jan 2011 21:24:31 +0000 Subject: [PATCH] add IPP Sub operations to arithm.cpp for 8u, 16u, 16s, 32s, 32f, 64f data types. --- modules/core/src/arithm.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index 421fe0f..93af560 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -322,6 +322,60 @@ struct ippAdd64f } }; +struct ippSub8u +{ + int operator()(const Ipp8u* src1, const Ipp8u* src2, Ipp8u* dst, int len) const + { + ippsSub_8u_Sfs(src1,src2,dst,len,0); + return len; + } +}; + +struct ippSub16u +{ + int operator()(const Ipp16u* src1, const Ipp16u* src2, Ipp16u* dst, int len) const + { + ippsSub_16u_Sfs(src1,src2,dst,len,0); + return len; + } +}; + +struct ippSub16s +{ + int operator()(const Ipp16s* src1, const Ipp16s* src2, Ipp16s* dst, int len) const + { + ippsSub_16s_Sfs(src1,src2,dst,len,0); + return len; + } +}; + +struct ippSub32s +{ + int operator()(const Ipp32s* src1, const Ipp32s* src2, Ipp32s* dst, int len) const + { + ippsSub_32s_Sfs(src1,src2,dst,len,0); + return len; + } +}; + +struct ippSub32f +{ + int operator()(const Ipp32f* src1, const Ipp32f* src2, Ipp32f* dst, int len) const + { + ippsSub_32f(src1,src2,dst,len); + return len; + } +}; + +struct ippSub64f +{ + int operator()(const Ipp64f* src1, const Ipp64f* src2, Ipp64f* dst, int len) const + { + ippsSub_64f(src1,src2,dst,len); + return len; + } +}; + #endif @@ -708,6 +762,16 @@ static BinaryFunc addTab[] = static BinaryFunc subTab[] = { +#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) + binaryOpC1_, ippSub8u>, + 0, + binaryOpC1_, ippSub16u>, + binaryOpC1_, ippSub16s>, + binaryOpC1_, ippSub32s>, + binaryOpC1_, ippSub32f>, + binaryOpC1_, ippSub64f>, + 0 +#else binaryOpC1_, VSub8u>, 0, binaryOpC1_, VSub16u>, @@ -716,6 +780,7 @@ static BinaryFunc subTab[] = binaryOpC1_, VSub32f>, binaryOpC1_, NoVec>, 0 +#endif }; void add( const Mat& src1, const Mat& src2, Mat& dst ) -- 2.7.4