mirror of
https://github.com/opencv/opencv.git
synced 2025-06-06 00:43:52 +08:00
Outdated ICV restrictions were removed;
This commit is contained in:
parent
93e5947f55
commit
680ca88ce0
@ -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) \
|
||||
|
@ -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())
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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<Ipp32f>(), (int)dst.step, (Ipp32f)scale, dst.ptr<Ipp32f>(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -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<hal::Filter2D> Filter2D::create(uchar* kernel_data, size_t kernel_step, int
|
||||
}
|
||||
|
||||
#ifdef HAVE_IPP
|
||||
#if !HAVE_ICV
|
||||
if (kernel_type == CV_32FC1) {
|
||||
IppFilter<CV_32F>* impl = new IppFilter<CV_32F>();
|
||||
if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
|
||||
@ -4929,7 +4926,6 @@ Ptr<hal::Filter2D> Filter2D::create(uchar* kernel_data, size_t kernel_step, int
|
||||
}
|
||||
delete impl;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (DftFilter::isAppropriate(stype, dtype, kernel_width, kernel_height))
|
||||
|
@ -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 };
|
||||
|
@ -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) &&
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -189,7 +189,7 @@ void BaseHoughLineTest::run_test(int type)
|
||||
else if (type == PROBABILISTIC)
|
||||
count = countMatIntersection<Vec4i>(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());
|
||||
|
Loading…
Reference in New Issue
Block a user