Merge pull request #2582 from vbystricky:ipp_fix

This commit is contained in:
Andrey Pavlenko 2014-04-08 14:30:48 +04:00 committed by OpenCV Buildbot
commit a6ef45aa13
8 changed files with 17 additions and 13 deletions

View File

@ -216,12 +216,15 @@ CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int un
# else # else
# include "ipp.h" # include "ipp.h"
# endif # endif
# define IPP_VERSION_X100 (IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR)
static inline IppiSize ippiSize(int width, int height) static inline IppiSize ippiSize(int width, int height)
{ {
IppiSize size = { width, height }; IppiSize size = { width, height };
return size; return size;
} }
#else
# define IPP_VERSION_X100 0
#endif #endif
#ifndef IPPI_CALL #ifndef IPPI_CALL

View File

@ -53,7 +53,7 @@ namespace cv
# pragma warning(disable: 4748) # pragma warning(disable: 4748)
#endif #endif
#if defined HAVE_IPP && IPP_VERSION_MAJOR*100 + IPP_VERSION_MINOR >= 701 #if IPP_VERSION_X100 >= 701
#define USE_IPP_DFT 1 #define USE_IPP_DFT 1
#else #else
#undef USE_IPP_DFT #undef USE_IPP_DFT

View File

@ -43,6 +43,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "opencl_kernels.hpp" #include "opencl_kernels.hpp"
#include <climits> #include <climits>
#include <limits>
namespace cv namespace cv
{ {
@ -971,7 +972,7 @@ void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, Input
ippiMeanStdDevFuncC1 ippFuncC1 = ippiMeanStdDevFuncC1 ippFuncC1 =
type == CV_8UC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_8u_C1R : type == CV_8UC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_8u_C1R :
type == CV_16UC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_16u_C1R : type == CV_16UC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_16u_C1R :
#if (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if (IPP_VERSION_X100 >= 801)
type == CV_32FC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_32f_C1R ://Aug 2013: bug in IPP 7.1, 8.0 type == CV_32FC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_32f_C1R ://Aug 2013: bug in IPP 7.1, 8.0
#endif #endif
0; 0;
@ -2112,7 +2113,7 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
type == CV_16UC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_16u_C3R : type == CV_16UC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_16u_C3R :
type == CV_16UC4 ? (ippiNormFuncNoHint)ippiNorm_Inf_16u_C4R : type == CV_16UC4 ? (ippiNormFuncNoHint)ippiNorm_Inf_16u_C4R :
type == CV_16SC1 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C1R : type == CV_16SC1 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C1R :
#if (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if (IPP_VERSION_X100 >= 801)
type == CV_16SC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C3R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768 type == CV_16SC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C3R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
type == CV_16SC4 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C4R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768 type == CV_16SC4 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C4R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
#endif #endif
@ -2544,7 +2545,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
type == CV_16UC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16u_C3R : type == CV_16UC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16u_C3R :
type == CV_16UC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16u_C4R : type == CV_16UC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16u_C4R :
type == CV_16SC1 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C1R : type == CV_16SC1 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C1R :
#if (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if (IPP_VERSION_X100 >= 801)
type == CV_16SC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C3R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768 type == CV_16SC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C3R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
type == CV_16SC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C4R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768 type == CV_16SC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C4R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
#endif #endif

View File

@ -298,7 +298,7 @@ static ippiReorderFunc ippiSwapChannelsC3RTab[] =
0, (ippiReorderFunc)ippiSwapChannels_32f_C3R, 0, 0 0, (ippiReorderFunc)ippiSwapChannels_32f_C3R, 0, 0
}; };
#if (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if (IPP_VERSION_X100 >= 801)
static ippiReorderFunc ippiSwapChannelsC4RTab[] = static ippiReorderFunc ippiSwapChannelsC4RTab[] =
{ {
(ippiReorderFunc)ippiSwapChannels_8u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_16u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_8u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_16u_C4R, 0,
@ -3254,7 +3254,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC3RTab[depth], 2, 1, 0)) ) if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC3RTab[depth], 2, 1, 0)) )
return; return;
} }
#if (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if (IPP_VERSION_X100 >= 801)
else if( code == CV_RGBA2BGRA ) else if( code == CV_RGBA2BGRA )
{ {
if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC4RTab[depth], 2, 1, 0)) ) if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC4RTab[depth], 2, 1, 0)) )

View File

@ -47,7 +47,7 @@
Base Image Filter Base Image Filter
\****************************************************************************************/ \****************************************************************************************/
#if defined HAVE_IPP && IPP_VERSION_MAJOR*100 + IPP_VERSION_MINOR >= 701 #if IPP_VERSION_X100 >= 701
#define USE_IPP_SEP_FILTERS 1 #define USE_IPP_SEP_FILTERS 1
#else #else
#undef USE_IPP_SEP_FILTERS #undef USE_IPP_SEP_FILTERS

View File

@ -55,7 +55,7 @@ static IppStatus sts = ippInit();
namespace cv namespace cv
{ {
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR*100 + IPP_VERSION_MINOR >= 701) #if IPP_VERSION_X100 >= 701
typedef IppStatus (CV_STDCALL* ippiResizeFunc)(const void*, int, const void*, int, IppiPoint, IppiSize, IppiBorderType, void*, void*, Ipp8u*); typedef IppStatus (CV_STDCALL* ippiResizeFunc)(const void*, int, const void*, int, IppiPoint, IppiSize, IppiBorderType, void*, void*, Ipp8u*);
typedef IppStatus (CV_STDCALL* ippiResizeGetBufferSize)(void*, IppiSize, Ipp32u, int*); typedef IppStatus (CV_STDCALL* ippiResizeGetBufferSize)(void*, IppiSize, Ipp32u, int*);
typedef IppStatus (CV_STDCALL* ippiResizeGetSrcOffset)(void*, IppiPoint, IppiPoint*); typedef IppStatus (CV_STDCALL* ippiResizeGetSrcOffset)(void*, IppiPoint, IppiPoint*);
@ -1912,7 +1912,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
getBufferSizeFunc = (ippiResizeGetBufferSize)ippiResizeGetBufferSize_##TYPE;\ getBufferSizeFunc = (ippiResizeGetBufferSize)ippiResizeGetBufferSize_##TYPE;\
getSrcOffsetFunc = (ippiResizeGetSrcOffset)ippiResizeGetSrcOffset_##TYPE; getSrcOffsetFunc = (ippiResizeGetSrcOffset)ippiResizeGetSrcOffset_##TYPE;
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR*100 + IPP_VERSION_MINOR >= 701) #if IPP_VERSION_X100 >= 701
class IPPresizeInvoker : class IPPresizeInvoker :
public ParallelLoopBody public ParallelLoopBody
{ {
@ -2384,7 +2384,7 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
double scale_x = 1./inv_scale_x, scale_y = 1./inv_scale_y; double scale_x = 1./inv_scale_x, scale_y = 1./inv_scale_y;
int k, sx, sy, dx, dy; int k, sx, sy, dx, dy;
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR*100 + IPP_VERSION_MINOR >= 701) #if IPP_VERSION_X100 >= 701
#define IPP_RESIZE_EPS 1.e-10 #define IPP_RESIZE_EPS 1.e-10
double ex = fabs((double)dsize.width/src.cols - inv_scale_x)/inv_scale_x; double ex = fabs((double)dsize.width/src.cols - inv_scale_x)/inv_scale_x;

View File

@ -1136,7 +1136,7 @@ private:
Scalar borderValue; Scalar borderValue;
}; };
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if IPP_VERSION_X100 >= 801
static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kernel, static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kernel,
const Size& ksize, const Point &anchor, bool rectKernel) const Size& ksize, const Point &anchor, bool rectKernel)
{ {
@ -1459,7 +1459,7 @@ static void morphOp( int op, InputArray _src, OutputArray _dst,
Size ksize = kernel.data ? kernel.size() : Size(3,3); Size ksize = kernel.data ? kernel.size() : Size(3,3);
anchor = normalizeAnchor(anchor, ksize); anchor = normalizeAnchor(anchor, ksize);
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if IPP_VERSION_X100 >= 801
if( IPPMorphOp(op, _src, _dst, kernel, anchor, iterations, borderType, borderValue) ) if( IPPMorphOp(op, _src, _dst, kernel, anchor, iterations, borderType, borderValue) )
return; return;
#endif #endif

View File

@ -1109,7 +1109,7 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
return; return;
#endif #endif
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 8) && (IPP_VERSION_MINOR >= 1) #if IPP_VERSION_X100 >= 801
if( type == CV_32FC1 && sigma1 == sigma2 && ksize.width == ksize.height && sigma1 != 0.0 ) if( type == CV_32FC1 && sigma1 == sigma2 && ksize.width == ksize.height && sigma1 != 0.0 )
{ {
Mat src = _src.getMat(), dst = _dst.getMat(); Mat src = _src.getMat(), dst = _dst.getMat();