From 680ca88ce06ed5d7ef7d232c1f6233650ca1991c Mon Sep 17 00:00:00 2001 From: Pavel Vlasov Date: Wed, 17 Aug 2016 10:25:19 +0300 Subject: [PATCH] Outdated ICV restrictions were removed; --- modules/core/include/opencv2/core/private.hpp | 11 ----------- modules/core/src/copy.cpp | 2 +- modules/core/src/stat.cpp | 8 ++------ modules/imgproc/perf/perf_houghLines.cpp | 2 +- modules/imgproc/src/color.cpp | 2 +- modules/imgproc/src/deriv.cpp | 5 +---- modules/imgproc/src/filter.cpp | 4 ---- modules/imgproc/src/hough.cpp | 4 ++-- modules/imgproc/src/imgwarp.cpp | 4 ++-- modules/imgproc/src/smooth.cpp | 7 ++----- modules/imgproc/src/sumpixels.cpp | 2 +- modules/imgproc/src/thresh.cpp | 16 ++-------------- modules/imgproc/test/test_houghLines.cpp | 2 +- 13 files changed, 16 insertions(+), 53 deletions(-) diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp index 6fcd1713c2..c839327823 100644 --- a/modules/core/include/opencv2/core/private.hpp +++ b/modules/core/include/opencv2/core/private.hpp @@ -288,17 +288,6 @@ private: #define IPP_VERSION_X100 0 #endif -// There shoud be no API difference in OpenCV between ICV and IPP since 9.0 -#if (defined HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 900 -#undef HAVE_IPP_ICV_ONLY -#endif - -#ifdef HAVE_IPP_ICV_ONLY -#define HAVE_ICV 1 -#else -#define HAVE_ICV 0 -#endif - #if defined HAVE_IPP #if IPP_VERSION_X100 >= 900 #define IPP_INITIALIZER(FEAT) \ diff --git a/modules/core/src/copy.cpp b/modules/core/src/copy.cpp index f2201e66fe..5acb1dac0a 100644 --- a/modules/core/src/copy.cpp +++ b/modules/core/src/copy.cpp @@ -375,7 +375,7 @@ Mat& Mat::operator = (const Scalar& s) if( is[0] == 0 && is[1] == 0 && is[2] == 0 && is[3] == 0 ) { -#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_DISABLE_BLOCK CV_IPP_CHECK() { if (dims <= 2 || isContinuous()) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 727d89554d..b586fe2aca 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1299,7 +1299,6 @@ namespace cv { static bool ipp_countNonZero( Mat &src, int &res ) { -#if !defined HAVE_IPP_ICV_ONLY Ipp32s count = 0; IppStatus status = ippStsNoErr; @@ -1323,9 +1322,6 @@ static bool ipp_countNonZero( Mat &src, int &res ) res = ((Ipp32s)src.total() - count); return true; } -#else - CV_UNUSED(src); CV_UNUSED(res); -#endif return false; } } @@ -2282,10 +2278,10 @@ static bool ipp_minMaxIdx( Mat &src, double* minVal, double* maxVal, int* minIdx depth == CV_8S ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_8s_C1R : #endif depth == CV_16U ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_16u_C1R : -#if !((defined _MSC_VER && defined _M_IX86) || defined __i386__) +#if IPP_DISABLE_BLOCK && !((defined _MSC_VER && defined _M_IX86) || defined __i386__) // See bug #4955: the function fails with SEGFAULT when the source matrix contains NANs // IPPICV version is 9.0.1. - // depth == CV_32F ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_32f_C1R : + depth == CV_32F ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_32f_C1R : #endif 0; CV_SUPPRESS_DEPRECATED_END diff --git a/modules/imgproc/perf/perf_houghLines.cpp b/modules/imgproc/perf/perf_houghLines.cpp index 6dfaa56aa3..a6ab50e644 100644 --- a/modules/imgproc/perf/perf_houghLines.cpp +++ b/modules/imgproc/perf/perf_houghLines.cpp @@ -37,7 +37,7 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines, TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold); transpose(lines, lines); -#if (0 && defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810) +#if (0 && defined(HAVE_IPP) && IPP_VERSION_X100 >= 810) SANITY_CHECK_NOTHING(); #else SANITY_CHECK(lines); diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index af75445e61..1d83577b95 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -393,7 +393,7 @@ static ippiGeneralFunc ippiHLS2RGBTab[] = 0, (ippiGeneralFunc)ippiHLSToRGB_32f_C3R, 0, 0 }; -#if !defined(HAVE_IPP_ICV_ONLY) && IPP_DISABLE_BLOCK +#if IPP_DISABLE_BLOCK static ippiGeneralFunc ippiRGBToLUVTab[] = { (ippiGeneralFunc)ippiRGBToLUV_8u_C3R, 0, (ippiGeneralFunc)ippiRGBToLUV_16u_C3R, 0, diff --git a/modules/imgproc/src/deriv.cpp b/modules/imgproc/src/deriv.cpp index e660d2e3b0..06592d8b2d 100644 --- a/modules/imgproc/src/deriv.cpp +++ b/modules/imgproc/src/deriv.cpp @@ -359,7 +359,6 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, return true; } -#if !defined(HAVE_IPP_ICV_ONLY) if ((dx == 2) && (dy == 0)) { #if IPP_VERSION_X100 >= 900 @@ -397,7 +396,6 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, return false; return true; } -#endif } if (src.type() == CV_32F && dst.type() == CV_32F) @@ -445,7 +443,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, return true; } #endif -#if !defined(HAVE_IPP_ICV_ONLY) + if((dx == 2) && (dy == 0)) { #if IPP_VERSION_X100 >= 900 @@ -488,7 +486,6 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, ippiMulC_32f_C1R(dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows)); return true; } -#endif } return false; } diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index 1a7f27af3b..e2c79a6bfd 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -4540,7 +4540,6 @@ struct ReplacementFilter : public hal::Filter2D }; #ifdef HAVE_IPP -#if !HAVE_ICV typedef IppStatus(CV_STDCALL* ippiFilterBorder)( const void* pSrc, int srcStep, void* pDst, int dstStep, IppiSize dstRoiSize, IppiBorderType border, const void* borderValue, @@ -4702,7 +4701,6 @@ struct IppFilter : public hal::Filter2D } }; #endif -#endif struct DftFilter : public hal::Filter2D { @@ -4907,7 +4905,6 @@ Ptr Filter2D::create(uchar* kernel_data, size_t kernel_step, int } #ifdef HAVE_IPP -#if !HAVE_ICV if (kernel_type == CV_32FC1) { IppFilter* impl = new IppFilter(); if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height, @@ -4929,7 +4926,6 @@ Ptr Filter2D::create(uchar* kernel_data, size_t kernel_step, int } delete impl; } -#endif #endif if (DftFilter::isAppropriate(stype, dtype, kernel_width, kernel_height)) diff --git a/modules/imgproc/src/hough.cpp b/modules/imgproc/src/hough.cpp index e77544e902..d2d215489c 100644 --- a/modules/imgproc/src/hough.cpp +++ b/modules/imgproc/src/hough.cpp @@ -96,7 +96,7 @@ HoughLinesStandard( const Mat& img, float rho, float theta, int numangle = cvRound((max_theta - min_theta) / theta); int numrho = cvRound(((width + height) * 2 + 1) / rho); -#if defined HAVE_IPP && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK CV_IPP_CHECK() { IppiSize srcSize = { width, height }; @@ -429,7 +429,7 @@ HoughLinesProbabilistic( Mat& image, int numangle = cvRound(CV_PI / theta); int numrho = cvRound(((width + height) * 2 + 1) / rho); -#if defined HAVE_IPP && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK CV_IPP_CHECK() { IppiSize srcSize = { width, height }; diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index ff96c2fe1e..d103a4ab28 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -4740,7 +4740,7 @@ static bool ocl_logPolar(InputArray _src, OutputArray _dst, } #endif -#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_DISABLE_BLOCK typedef IppStatus (CV_STDCALL * ippiRemap)(const void * pSrc, IppiSize srcSize, int srcStep, IppiRect srcRoi, const Ipp32f* pxMap, int xMapStep, const Ipp32f* pyMap, int yMapStep, @@ -4848,7 +4848,7 @@ void cv::remap( InputArray _src, OutputArray _dst, int type = src.type(), depth = CV_MAT_DEPTH(type); -#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_DISABLE_BLOCK CV_IPP_CHECK() { if ((interpolation == INTER_LINEAR || interpolation == INTER_CUBIC || interpolation == INTER_NEAREST) && diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index 8245a62057..034a2c0923 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -1783,7 +1783,6 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, } IppStatus status = ippStsErr; -#if !HAVE_ICV #if IPP_VERSION_X100 > 900 // Buffer overflow may happen in IPP 9.0.0 and less if (type == CV_8UC1) IPP_FILTER_GAUSS_C1(8u) @@ -1801,9 +1800,7 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, IPP_FILTER_GAUSS_CN(16s, 3) else if (type == CV_32FC3) IPP_FILTER_GAUSS_CN(32f, 3) - else -#endif - if (type == CV_32FC1) + else if (type == CV_32FC1) IPP_FILTER_GAUSS_C1(32f) if(status >= 0) @@ -3060,7 +3057,7 @@ private: float *space_weight, *color_weight; }; -#if defined (HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_DISABLE_BLOCK +#if defined (HAVE_IPP) && IPP_DISABLE_BLOCK class IPPBilateralFilter_8u_Invoker : public ParallelLoopBody { diff --git a/modules/imgproc/src/sumpixels.cpp b/modules/imgproc/src/sumpixels.cpp index 7771d2cab4..348ac18ecf 100755 --- a/modules/imgproc/src/sumpixels.cpp +++ b/modules/imgproc/src/sumpixels.cpp @@ -425,7 +425,7 @@ namespace cv { static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum, OutputArray _tilted, int sdepth, int sqdepth) { -#if !defined(HAVE_IPP_ICV_ONLY) && (IPP_VERSION_X100 != 900) // Disabled on ICV due invalid results +#if IPP_VERSION_X100 != 900 // Disabled on ICV due invalid results int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); if( sdepth <= 0 ) sdepth = depth == CV_8U ? CV_32S : CV_64F; diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 804e7616c7..1513bdafa1 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -91,13 +91,11 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) switch( type ) { case THRESH_TRUNC: -#ifndef HAVE_IPP_ICV_ONLY if (_src.data == _dst.data && ippiThreshold_GT_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif if (ippiThreshold_GT_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -106,13 +104,11 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO: -#ifndef HAVE_IPP_ICV_ONLY if (_src.data == _dst.data && ippiThreshold_LTVal_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif if (ippiThreshold_LTVal_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -121,13 +117,11 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO_INV: -#ifndef HAVE_IPP_ICV_ONLY if (_src.data == _dst.data && ippiThreshold_GTVal_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif if (ippiThreshold_GTVal_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -434,13 +428,11 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) switch( type ) { case THRESH_TRUNC: -#ifndef HAVE_IPP_ICV_ONLY if (_src.data == _dst.data && ippiThreshold_GT_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif if (ippiThreshold_GT_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -449,13 +441,11 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO: -#ifndef HAVE_IPP_ICV_ONLY if (_src.data == _dst.data && ippiThreshold_LTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif if (ippiThreshold_LTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -464,13 +454,11 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO_INV: -#ifndef HAVE_IPP_ICV_ONLY if (_src.data == _dst.data && ippiThreshold_GTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif if (ippiThreshold_GTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -1188,7 +1176,7 @@ thresh_64f(const Mat& _src, Mat& _dst, double thresh, double maxval, int type) #ifdef HAVE_IPP static bool ipp_getThreshVal_Otsu_8u( const unsigned char* _src, int step, Size size, unsigned char &thresh) { -#if IPP_VERSION_X100 >= 810 && !HAVE_ICV +#if IPP_VERSION_X100 >= 810 int ippStatus = -1; IppiSize srcSize = { size.width, size.height }; CV_SUPPRESS_DEPRECATED_START @@ -1218,7 +1206,7 @@ getThreshVal_Otsu_8u( const Mat& _src ) #ifdef HAVE_IPP unsigned char thresh; - CV_IPP_RUN(IPP_VERSION_X100 >= 810 && !HAVE_ICV, ipp_getThreshVal_Otsu_8u(_src.ptr(), step, size, thresh), thresh); + CV_IPP_RUN(IPP_VERSION_X100 >= 810, ipp_getThreshVal_Otsu_8u(_src.ptr(), step, size, thresh), thresh); #endif const int N = 256; diff --git a/modules/imgproc/test/test_houghLines.cpp b/modules/imgproc/test/test_houghLines.cpp index a508841714..93a1202ee1 100644 --- a/modules/imgproc/test/test_houghLines.cpp +++ b/modules/imgproc/test/test_houghLines.cpp @@ -189,7 +189,7 @@ void BaseHoughLineTest::run_test(int type) else if (type == PROBABILISTIC) count = countMatIntersection(exp_lines, lines, 1e-4f, 0.f); -#if defined HAVE_IPP && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK EXPECT_GE( count, (int) (exp_lines.total() * 0.8) ); #else EXPECT_EQ( count, (int) exp_lines.total());