From ab691a4a24789652351d8db7cee1821f6a2982c2 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 9 Apr 2014 16:01:51 +0400 Subject: [PATCH] ipp: some functions are not available in the ICV package #2 --- modules/core/src/convert.cpp | 2 +- modules/core/src/copy.cpp | 2 +- modules/core/src/mathfuncs.cpp | 16 ++++++++-------- modules/core/src/matrix.cpp | 2 +- modules/imgproc/src/accum.cpp | 6 +++--- modules/imgproc/src/smooth.cpp | 4 ++-- modules/imgproc/src/thresh.cpp | 6 +++--- modules/video/src/motempl.cpp | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/core/src/convert.cpp b/modules/core/src/convert.cpp index 66ae7f9..155ca67 100644 --- a/modules/core/src/convert.cpp +++ b/modules/core/src/convert.cpp @@ -1079,7 +1079,7 @@ dtype* dst, size_t dstep, Size size, double* scale) \ cvtScale_(src, sstep, dst, dstep, size, (wtype)scale[0], (wtype)scale[1]); \ } -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) #define DEF_CVT_FUNC_F(suffix, stype, dtype, ippFavor) \ static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \ dtype* dst, size_t dstep, Size size, double*) \ diff --git a/modules/core/src/copy.cpp b/modules/core/src/copy.cpp index 824508f..202e7a9 100644 --- a/modules/core/src/copy.cpp +++ b/modules/core/src/copy.cpp @@ -548,7 +548,7 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode ) Mat dst = _dst.getMat(); size_t esz = CV_ELEM_SIZE(type); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) typedef IppStatus (CV_STDCALL * ippiMirror)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize, IppiAxis flip); ippiMirror ippFunc = type == CV_8UC1 ? (ippiMirror)ippiMirror_8u_C1R : diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index 376cbad..65f78de 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -238,7 +238,7 @@ float cubeRoot( float value ) static void Magnitude_32f(const float* x, const float* y, float* mag, int len) { -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) IppStatus status = ippsMagnitude_32f(x, y, mag, len); if (status >= 0) return; @@ -270,7 +270,7 @@ static void Magnitude_32f(const float* x, const float* y, float* mag, int len) static void Magnitude_64f(const double* x, const double* y, double* mag, int len) { -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) IppStatus status = ippsMagnitude_64f(x, y, mag, len); if (status >= 0) return; @@ -303,7 +303,7 @@ static void Magnitude_64f(const double* x, const double* y, double* mag, int len static void InvSqrt_32f(const float* src, float* dst, int len) { -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (ippsInvSqrt_32f_A21(src, dst, len) >= 0) return; #endif @@ -351,7 +351,7 @@ static void InvSqrt_64f(const double* src, double* dst, int len) static void Sqrt_32f(const float* src, float* dst, int len) { -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (ippsSqrt_32f_A21(src, dst, len) >= 0) return; #endif @@ -384,7 +384,7 @@ static void Sqrt_32f(const float* src, float* dst, int len) static void Sqrt_64f(const double* src, double* dst, int len) { -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (ippsSqrt_64f_A50(src, dst, len) >= 0) return; #endif @@ -755,7 +755,7 @@ void polarToCart( InputArray src1, InputArray src2, dst2.create( Angle.dims, Angle.size, type ); Mat X = dst1.getMat(), Y = dst2.getMat(); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (Mag.isContinuous() && Angle.isContinuous() && X.isContinuous() && Y.isContinuous() && !angleInDegrees) { typedef IppStatus (CV_STDCALL * ippsPolarToCart)(const void * pSrcMagn, const void * pSrcPhase, @@ -2161,7 +2161,7 @@ void pow( InputArray _src, double power, OutputArray _dst ) _src.copyTo(_dst); return; case 2: -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (depth == CV_32F && !same && ( (_src.dims() <= 2 && !ocl::useOpenCL()) || (_src.dims() > 2 && _src.isContinuous() && _dst.isContinuous()) )) { Mat src = _src.getMat(); @@ -2233,7 +2233,7 @@ void pow( InputArray _src, double power, OutputArray _dst ) } else { -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (src.isContinuous() && dst.isContinuous()) { IppStatus status = depth == CV_32F ? diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 7e2976e..4efba46 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -2967,7 +2967,7 @@ void cv::transpose( InputArray _src, OutputArray _dst ) return; } -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) typedef IppStatus (CV_STDCALL * ippiTranspose)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize); ippiTranspose ippFunc = type == CV_8UC1 ? (ippiTranspose)ippiTranspose_8u_C1R : diff --git a/modules/imgproc/src/accum.cpp b/modules/imgproc/src/accum.cpp index 216ddcb..74a63e9 100644 --- a/modules/imgproc/src/accum.cpp +++ b/modules/imgproc/src/accum.cpp @@ -457,7 +457,7 @@ void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _m Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat(); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && (mask.empty() || mask.isContinuous()))) { typedef IppStatus (CV_STDCALL * ippiAddSquare)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize); @@ -535,7 +535,7 @@ void cv::accumulateProduct( InputArray _src1, InputArray _src2, Mat src1 = _src1.getMat(), src2 = _src2.getMat(), dst = _dst.getMat(), mask = _mask.getMat(); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (src1.dims <= 2 || (src1.isContinuous() && src2.isContinuous() && dst.isContinuous())) { typedef IppStatus (CV_STDCALL * ippiAddProduct)(const void * pSrc1, int src1Step, const void * pSrc2, @@ -615,7 +615,7 @@ void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst, Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat(); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && mask.isContinuous())) { typedef IppStatus (CV_STDCALL * ippiAddWeighted)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index c17902c..4318cd1 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -858,7 +858,7 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, return; #endif -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) int ippBorderType = borderType & ~BORDER_ISOLATED; Point ocvAnchor, ippAnchor; ocvAnchor.x = anchor.x < 0 ? ksize.width / 2 : anchor.x; @@ -2018,7 +2018,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize ) _dst.create( src0.size(), src0.type() ); Mat dst = _dst.getMat(); -#if defined HAVE_IPP && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1 +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 801 #define IPP_FILTER_MEDIAN_BORDER(ippType, ippDataType, flavor) \ do \ { \ diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 440f15a..17f323a 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -68,7 +68,7 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) return; #endif -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) IppiSize sz = { roi.width, roi.height }; switch( type ) { @@ -306,7 +306,7 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) return; #endif -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) IppiSize sz = { roi.width, roi.height }; switch( type ) { @@ -497,7 +497,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) return; #endif -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) IppiSize sz = { roi.width, roi.height }; switch( type ) { diff --git a/modules/video/src/motempl.cpp b/modules/video/src/motempl.cpp index 4dfe5d7..152706b 100644 --- a/modules/video/src/motempl.cpp +++ b/modules/video/src/motempl.cpp @@ -80,7 +80,7 @@ void cv::updateMotionHistory( InputArray _silhouette, InputOutputArray _mhi, Mat silh = _silhouette.getMat(), mhi = _mhi.getMat(); Size size = silh.size(); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) int silhstep = (int)silh.step, mhistep = (int)mhi.step; #endif @@ -88,13 +88,13 @@ void cv::updateMotionHistory( InputArray _silhouette, InputOutputArray _mhi, { size.width *= size.height; size.height = 1; -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) silhstep = (int)silh.total(); mhistep = (int)mhi.total() * sizeof(Ipp32f); #endif } -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) IppStatus status = ippiUpdateMotionHistory_8u32f_C1IR((const Ipp8u *)silh.data, silhstep, (Ipp32f *)mhi.data, mhistep, ippiSize(size.width, size.height), (Ipp32f)timestamp, (Ipp32f)duration); if (status >= 0) -- 2.7.4