Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ OCV_OPTION(WITH_NGRAPH "Include nGraph support" WITH_INF_ENGINE
OCV_OPTION(WITH_JASPER "Include JPEG2K support (Jasper)" ON
VISIBLE_IF NOT IOS
VERIFY HAVE_JASPER)
OCV_OPTION(WITH_OPENJPEG "Include JPEG2K support (OpenJPEG)" ON
OCV_OPTION(WITH_OPENJPEG "Include JPEG2K support (OpenJPEG)" OFF
VISIBLE_IF NOT IOS
VERIFY HAVE_OPENJPEG)
OCV_OPTION(WITH_JPEG "Include JPEG support" ON
Expand Down
10 changes: 5 additions & 5 deletions modules/core/src/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,11 +981,11 @@ static bool ipp_flip(Mat &src, Mat &dst, int flip_mode)
CV_INSTRUMENT_REGION_IPP();

// Details: https://github.com/opencv/opencv/issues/12943
if (flip_mode <= 0 /* swap rows */
&& cv::ipp::getIppTopFeatures() != ippCPUID_SSE42
&& (int64_t)(src.total()) * src.elemSize() >= CV_BIG_INT(0x80000000)/*2Gb*/
)
return false;
// if (flip_mode <= 0 /* swap rows */
// && cv::ipp::getIppTopFeatures() != ippCPUID_SSE42
// && (int64_t)(src.total()) * src.elemSize() >= CV_BIG_INT(0x80000000)/*2Gb*/
// )
// return false;

IppiAxis ippMode;
if(flip_mode < 0)
Expand Down
10 changes: 5 additions & 5 deletions modules/core/src/matrix_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include "opencl_kernels_core.hpp"
#include "precomp.hpp"

#undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#define CV_IPP_RUN(c, f, ...)
// #undef HAVE_IPP
// #undef CV_IPP_RUN_FAST
// #define CV_IPP_RUN_FAST(f, ...)
// #undef CV_IPP_RUN
// #define CV_IPP_RUN(c, f, ...)

/*************************************************************************************************\
Matrix Operations
Expand Down
10 changes: 5 additions & 5 deletions modules/core/src/mean.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include "opencv2/core/openvx/ovx_defs.hpp"
#include "stat.hpp"

#undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#define CV_IPP_RUN(c, f, ...)
// #undef HAVE_IPP
// #undef CV_IPP_RUN_FAST
// #define CV_IPP_RUN_FAST(f, ...)
// #undef CV_IPP_RUN
// #define CV_IPP_RUN(c, f, ...)

#include "mean.simd.hpp"
#include "mean.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content
Expand Down
10 changes: 5 additions & 5 deletions modules/core/src/minmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include "opencv2/core/openvx/ovx_defs.hpp"
#include "stat.hpp"

#undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#define CV_IPP_RUN(c, f, ...)
// #undef HAVE_IPP
// #undef CV_IPP_RUN_FAST
// #define CV_IPP_RUN_FAST(f, ...)
// #undef CV_IPP_RUN
// #define CV_IPP_RUN(c, f, ...)

#define IPP_DISABLE_MINMAXIDX_MANY_ROWS 1 // see Core_MinMaxIdx.rows_overflow test

Expand Down
21 changes: 11 additions & 10 deletions modules/core/src/norm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1008,16 +1008,17 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra
type == CV_16UC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_L2_16u_C3CMR :
type == CV_32FC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_L2_32f_C3CMR :
0) : 0;
if (cv::ipp::getIppTopFeatures() & (
#if IPP_VERSION_X100 >= 201700
ippCPUID_AVX512F |
#endif
ippCPUID_AVX2)
) // IPP_DISABLE_NORM_16UC3_mask_small (#11399)
{
if (normType == NORM_L1 && type == CV_16UC3 && sz.width < 16)
return false;
}
// if (cv::ipp::getIppTopFeatures() & ippCPUID_AVX2)
// if (cv::ipp::getIppTopFeatures() & (
// #if IPP_VERSION_X100 >= 201700
// ippCPUID_AVX512F |
// #endif
// ippCPUID_AVX2)
// ) // IPP_DISABLE_NORM_16UC3_mask_small (#11399)
// {
// if (normType == NORM_L1 && type == CV_16UC3 && sz.width < 16)
// return false;
// }
if( ippiNormDiff_C3CMR )
{
Ipp64f norm1, norm2, norm3;
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/sum.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "sum.simd.hpp"
#include "sum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content

#undef HAVE_IPP
/* #undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#define CV_IPP_RUN(c, f, ...)
#define CV_IPP_RUN(c, f, ...) */

namespace cv
{
Expand Down
7 changes: 7 additions & 0 deletions modules/core/src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,7 @@ struct IPPInitSingleton

if(env == "disabled")
{
printf("Hi there! env is disabled!!!\n");
std::cerr << "WARNING: IPP was disabled by OPENCV_IPP environment variable" << std::endl;
useIPP = false;
}
Expand Down Expand Up @@ -2337,6 +2338,12 @@ struct IPPInitSingleton
))
{
useIPP = false;
printf("cpuFeatures = %lu\n", cpuFeatures);
printf("cpuFeatures&ippCPUID_AVX512F = %lu\n", cpuFeatures&ippCPUID_AVX512F);
printf("cpuFeatures&ippCPUID_AVX2 = %lu\n", cpuFeatures&ippCPUID_AVX2);
printf("cpuFeatures&ippCPUID_SSE42 = %lu\n", cpuFeatures&ippCPUID_SSE42);
printf("ippCPUID_SSE42 = %lu\n", ippCPUID_SSE42);
printf("useIPP 0 = %d\n", useIPP);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions modules/core/test/test_arithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2445,9 +2445,9 @@ TEST(Core_MinMaxIdx, rows_overflow)

double minVal0 = 0, maxVal0 = 0;
int minIdx0[CV_MAX_DIM] = { 0 }, maxIdx0[CV_MAX_DIM] = { 0 };
cv::ipp::setUseIPP(false);
// cv::ipp::setUseIPP(false);
cv::minMaxIdx(m, &minVal0, &maxVal0, minIdx0, maxIdx0);
cv::ipp::setUseIPP(true);
// cv::ipp::setUseIPP(true);

EXPECT_FALSE(fabs(minVal0 - minVal) > 1e-6 || fabs(maxVal0 - maxVal) > 1e-6) << "NxM=" << N << "x" << M <<
" min=" << minVal0 << " vs " << minVal <<
Expand Down
2 changes: 1 addition & 1 deletion modules/core/test/test_mat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ TEST(Core_Eigen, cv2eigen_tensormap_check_tensormap_access)

TEST(Mat, regression_12943) // memory usage: ~4.5 Gb
{
applyTestTag(CV_TEST_TAG_MEMORY_6GB);
// applyTestTag(CV_TEST_TAG_MEMORY_6GB);

const int width = 0x8000;
const int height = 0x10001;
Expand Down
7 changes: 4 additions & 3 deletions modules/imgproc/src/corner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ static bool ocl_preCornerDetect( InputArray _src, OutputArray _dst, int ksize, i

}

#if 0 //defined(HAVE_IPP)
#if defined(HAVE_IPP)
// #if 0 //defined(HAVE_IPP)
namespace cv
{
static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType )
Expand Down Expand Up @@ -554,15 +555,15 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
ocl_cornerMinEigenValVecs(_src, _dst, blockSize, ksize, 0.0, borderType, MINEIGENVAL))

/*#ifdef HAVE_IPP
#ifdef HAVE_IPP
int kerSize = (ksize < 0)?3:ksize;
bool isolated = (borderType & BORDER_ISOLATED) != 0;
int borderTypeNI = borderType & ~BORDER_ISOLATED;
#endif
CV_IPP_RUN(((borderTypeNI == BORDER_REPLICATE && (!_src.isSubmatrix() || isolated)) &&
(kerSize == 3 || kerSize == 5) && (blockSize == 3 || blockSize == 5)) && IPP_VERSION_X100 >= 800,
ipp_cornerMinEigenVal( _src, _dst, blockSize, ksize, borderType ));
*/


Mat src = _src.getMat();
_dst.create( src.size(), CV_32FC1 );
Expand Down
7 changes: 4 additions & 3 deletions modules/imgproc/src/deriv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ namespace cv
}
#endif

#if 0 //defined HAVE_IPP
#if defined HAVE_IPP
// #if 0 //defined HAVE_IPP
namespace cv
{

Expand Down Expand Up @@ -459,7 +460,7 @@ void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
CV_OVX_RUN(true,
openvx_sobel(src, dst, dx, dy, ksize, scale, delta, borderType))

//CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, ksize, scale, delta, borderType));
CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, ksize, scale, delta, borderType));

sepFilter2D(src, dst, ddepth, kx, ky, Point(-1, -1), delta, borderType );
}
Expand Down Expand Up @@ -511,7 +512,7 @@ void cv::Scharr( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
CALL_HAL(scharr, cv_hal_scharr, src.ptr(), src.step, dst.ptr(), dst.step, src.cols, src.rows, sdepth, ddepth, cn,
ofs.x, ofs.y, wsz.width - src.cols - ofs.x, wsz.height - src.rows - ofs.y, dx, dy, scale, delta, borderType&~BORDER_ISOLATED);

//CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, 0, scale, delta, borderType));
CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, 0, scale, delta, borderType));

sepFilter2D( src, dst, ddepth, kx, ky, Point(-1, -1), delta, borderType );
}
Expand Down
2 changes: 1 addition & 1 deletion modules/imgproc/src/distransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
{
if( maskSize == CV_DIST_MASK_3 )
{
#if defined (HAVE_IPP) && (IPP_VERSION_X100 >= 700) && 0 // disabled: https://github.com/opencv/opencv/issues/15904
#if defined (HAVE_IPP) && (IPP_VERSION_X100 >= 700) //&& 0 // disabled: https://github.com/opencv/opencv/issues/15904
CV_IPP_CHECK()
{
IppiSize roi = { src.cols, src.rows };
Expand Down
7 changes: 4 additions & 3 deletions modules/imgproc/src/filter.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,8 @@ static bool replacementFilter2D(int stype, int dtype, int kernel_type,
return success;
}

#if 0 //defined HAVE_IPP
#if defined HAVE_IPP
// #if 0 //defined HAVE_IPP
static bool ippFilter2D(int stype, int dtype, int kernel_type,
uchar * src_data, size_t src_step,
uchar * dst_data, size_t dst_step,
Expand Down Expand Up @@ -1451,7 +1452,7 @@ void filter2D(int stype, int dtype, int kernel_type,
if (res)
return;

/*CV_IPP_RUN_FAST(ippFilter2D(stype, dtype, kernel_type,
CV_IPP_RUN_FAST(ippFilter2D(stype, dtype, kernel_type,
src_data, src_step,
dst_data, dst_step,
width, height,
Expand All @@ -1460,7 +1461,7 @@ void filter2D(int stype, int dtype, int kernel_type,
kernel_data, kernel_step,
kernel_width, kernel_height,
anchor_x, anchor_y,
delta, borderType, isSubmatrix))*/
delta, borderType, isSubmatrix))

res = dftFilter2D(stype, dtype, kernel_type,
src_data, src_step,
Expand Down
5 changes: 3 additions & 2 deletions modules/imgproc/src/median_blur.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ static bool openvx_medianFilter(InputArray _src, OutputArray _dst, int ksize)
}
#endif

#if 0 //defined HAVE_IPP
#if defined HAVE_IPP
// #if 0 //defined HAVE_IPP
static bool ipp_medianFilter(Mat &src0, Mat &dst, int ksize)
{
CV_INSTRUMENT_REGION_IPP();
Expand Down Expand Up @@ -303,7 +304,7 @@ void medianBlur( InputArray _src0, OutputArray _dst, int ksize )
CV_OVX_RUN(true,
openvx_medianFilter(_src0, _dst, ksize))

//CV_IPP_RUN_FAST(ipp_medianFilter(src0, dst, ksize));
CV_IPP_RUN_FAST(ipp_medianFilter(src0, dst, ksize));

CV_CPU_DISPATCH(medianBlur, (src0, dst, ksize),
CV_CPU_DISPATCH_MODES_ALL);
Expand Down
12 changes: 7 additions & 5 deletions modules/imgproc/src/morph.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ static bool halMorph(int op, int src_type, int dst_type,
}

// ===== 2. IPP implementation
#if 0 //defined HAVE_IPP
#if defined HAVE_IPP
// #if 0 //defined HAVE_IPP
#ifdef HAVE_IPP_IW
static inline IwiMorphologyType ippiGetMorphologyType(int morphOp)
{
Expand Down Expand Up @@ -495,12 +496,12 @@ void morph(int op, int src_type, int dst_type,
return;
}

/*CV_IPP_RUN_FAST(ippMorph(op, src_type, dst_type, src_data, src_step, dst_data, dst_step, width, height,
CV_IPP_RUN_FAST(ippMorph(op, src_type, dst_type, src_data, src_step, dst_data, dst_step, width, height,
roi_width, roi_height, roi_x, roi_y,
roi_width2, roi_height2, roi_x2, roi_y2,
kernel_type, kernel_data, kernel_step,
kernel_width, kernel_height, anchor_x, anchor_y,
borderType, borderValue, iterations, isSubmatrix));*/
borderType, borderValue, iterations, isSubmatrix));

ocvMorph(op, src_type, dst_type, src_data, src_step, dst_data, dst_step, width, height,
roi_width, roi_height, roi_x, roi_y,
Expand Down Expand Up @@ -1085,7 +1086,8 @@ static bool ocl_morphologyEx(InputArray _src, OutputArray _dst, int op,
#endif

#define IPP_DISABLE_MORPH_ADV 1
#if 0 //defined HAVE_IPP
#if defined HAVE_IPP
// #if 0 //defined HAVE_IPP
#if !IPP_DISABLE_MORPH_ADV
static bool ipp_morphologyEx(int op, InputArray _src, OutputArray _dst,
InputArray _kernel,
Expand Down Expand Up @@ -1182,7 +1184,7 @@ void morphologyEx( InputArray _src, OutputArray _dst, int op,
Mat dst = _dst.getMat();

#if !IPP_DISABLE_MORPH_ADV
//CV_IPP_RUN_FAST(ipp_morphologyEx(op, src, dst, kernel, anchor, iterations, borderType, borderValue));
CV_IPP_RUN_FAST(ipp_morphologyEx(op, src, dst, kernel, anchor, iterations, borderType, borderValue));
#endif

switch( op )
Expand Down
4 changes: 2 additions & 2 deletions modules/imgproc/src/thresh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
}
setIppErrorStatus();
break;
#if 0 // details: https://github.com/opencv/opencv/pull/16085
// #if 0 // details: https://github.com/opencv/opencv/pull/16085
case THRESH_TOZERO:
if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh + FLT_EPSILON, 0))
{
Expand All @@ -766,7 +766,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
}
setIppErrorStatus();
break;
#endif
// #endif
case THRESH_TOZERO_INV:
if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0))
{
Expand Down
1 change: 1 addition & 0 deletions modules/ts/src/ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ void SystemInfoCollector::OnTestProgramStart(const testing::UnitTest&)
}
recordPropertyVerbose("cv_cpu_features", "CPU features", cv::getCPUFeaturesLine());
#ifdef HAVE_IPP
printf("Hi there! IPP is %d\n", cv::ipp::useIPP());
recordPropertyVerbose("cv_ipp_version", "Intel(R) IPP version", cv::ipp::useIPP() ? cv::ipp::getIppVersion() : "disabled");
#endif
#ifdef HAVE_OPENCL
Expand Down
5 changes: 3 additions & 2 deletions modules/ts/src/ts_tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ static std::vector<std::string>& getTestTagsSkipList()
#if OPENCV_32BIT_CONFIGURATION
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_2GB);
#else
if (!cvtest::runBigDataTests)
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB);
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB);
// if (!cvtest::runBigDataTests)
// testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB);
#endif
testSkipWithTags.push_back(CV_TEST_TAG_VERYLONG);
#if defined(_DEBUG)
Expand Down