1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #12877 from maver1:3.4

* Updated ICV packages and IPP integration

* core(test): minMaxIdx IPP regression test

* core(ipp): workaround minMaxIdx problem

* core(ipp): workaround meanStdDev() CV_32FC3 buffer overrun

* Returned semicolon after CV_INSTRUMENT_REGION_IPP()
This commit is contained in:
maver1
2018-10-24 15:02:53 +03:00
committed by Alexander Alekhin
parent c8fc8d210b
commit e397434cb6
17 changed files with 201 additions and 297 deletions
+2 -2
View File
@@ -341,7 +341,7 @@ namespace cv
{
static bool ipp_extractChannel(const Mat &src, Mat &dst, int channel)
{
#ifdef HAVE_IPP_IW
#ifdef HAVE_IPP_IW_LL
CV_INSTRUMENT_REGION_IPP();
int srcChannels = src.channels();
@@ -379,7 +379,7 @@ static bool ipp_extractChannel(const Mat &src, Mat &dst, int channel)
static bool ipp_insertChannel(const Mat &src, Mat &dst, int channel)
{
#ifdef HAVE_IPP_IW
#ifdef HAVE_IPP_IW_LL
CV_INSTRUMENT_REGION_IPP();
int srcChannels = src.channels();
+3 -3
View File
@@ -328,7 +328,7 @@ void Mat::copyTo( OutputArray _dst ) const
#ifdef HAVE_IPP
static bool ipp_copyTo(const Mat &src, Mat &dst, const Mat &mask)
{
#ifdef HAVE_IPP_IW
#ifdef HAVE_IPP_IW_LL
CV_INSTRUMENT_REGION_IPP();
if(mask.channels() > 1 || mask.depth() != CV_8U)
@@ -463,7 +463,7 @@ Mat& Mat::operator = (const Scalar& s)
#ifdef HAVE_IPP
static bool ipp_Mat_setTo_Mat(Mat &dst, Mat &_val, Mat &mask)
{
#ifdef HAVE_IPP_IW
#ifdef HAVE_IPP_IW_LL
CV_INSTRUMENT_REGION_IPP();
if(mask.empty())
@@ -1152,7 +1152,7 @@ namespace cv {
static bool ipp_copyMakeBorder( Mat &_src, Mat &_dst, int top, int bottom,
int left, int right, int _borderType, const Scalar& value )
{
#if defined HAVE_IPP_IW && !IPP_DISABLE_PERF_COPYMAKE
#if defined HAVE_IPP_IW_LL && !IPP_DISABLE_PERF_COPYMAKE
CV_INSTRUMENT_REGION_IPP();
::ipp::IwiBorderSize borderSize(left, top, right, bottom);
+5
View File
@@ -674,6 +674,11 @@ static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& m
if (cn > 1)
return false;
#endif
#if IPP_VERSION_X100 < 201901
// IPP_DISABLE: 32f C3C functions can read outside of allocated memory
if (cn > 1 && src.depth() == CV_32F)
return false;
#endif
size_t total_size = src.total();
int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0;
+1 -1
View File
@@ -228,7 +228,7 @@ static MergeFunc getMergeFunc(int depth)
namespace cv {
static bool ipp_merge(const Mat* mv, Mat& dst, int channels)
{
#ifdef HAVE_IPP_IW
#ifdef HAVE_IPP_IW_LL
CV_INSTRUMENT_REGION_IPP();
if(channels != 3 && channels != 4)
+6
View File
@@ -8,6 +8,8 @@
#include "opencv2/core/openvx/ovx_defs.hpp"
#include "stat.hpp"
#define IPP_DISABLE_MINMAXIDX_MANY_ROWS 1 // see Core_MinMaxIdx.rows_overflow test
/****************************************************************************************\
* minMaxLoc *
\****************************************************************************************/
@@ -624,6 +626,10 @@ static bool ipp_minMaxIdx(Mat &src, double* _minVal, double* _maxVal, int* _minI
if(src.dims <= 2)
{
IppiSize size = ippiSize(src.size());
#if defined(_WIN32) && !defined(_WIN64) && IPP_VERSION_X100 == 201900 && IPP_DISABLE_MINMAXIDX_MANY_ROWS
if (size.height > 65536)
return false; // test: Core_MinMaxIdx.rows_overflow
#endif
size.width *= src.channels();
status = ippMinMaxFun(src.ptr(), (int)src.step, size, dataType, pMinVal, pMaxVal, pMinIdx, pMaxIdx, (Ipp8u*)mask.ptr(), (int)mask.step);
+1 -1
View File
@@ -236,7 +236,7 @@ static SplitFunc getSplitFunc(int depth)
namespace cv {
static bool ipp_split(const Mat& src, Mat* mv, int channels)
{
#ifdef HAVE_IPP_IW
#ifdef HAVE_IPP_IW_LL
CV_INSTRUMENT_REGION_IPP();
if(channels != 3 && channels != 4)
+21 -4
View File
@@ -2078,7 +2078,12 @@ public:
cv::String env = pIppEnv;
if(env.size())
{
#if IPP_VERSION_X100 >= 201703
#if IPP_VERSION_X100 >= 201900
const Ipp64u minorFeatures = ippCPUID_MOVBE|ippCPUID_AES|ippCPUID_CLMUL|ippCPUID_ABR|ippCPUID_RDRAND|ippCPUID_F16C|
ippCPUID_ADCOX|ippCPUID_RDSEED|ippCPUID_PREFETCHW|ippCPUID_SHA|ippCPUID_MPX|ippCPUID_AVX512CD|ippCPUID_AVX512ER|
ippCPUID_AVX512PF|ippCPUID_AVX512BW|ippCPUID_AVX512DQ|ippCPUID_AVX512VL|ippCPUID_AVX512VBMI|ippCPUID_AVX512_4FMADDPS|
ippCPUID_AVX512_4VNNIW|ippCPUID_AVX512IFMA;
#elif IPP_VERSION_X100 >= 201703
const Ipp64u minorFeatures = ippCPUID_MOVBE|ippCPUID_AES|ippCPUID_CLMUL|ippCPUID_ABR|ippCPUID_RDRAND|ippCPUID_F16C|
ippCPUID_ADCOX|ippCPUID_RDSEED|ippCPUID_PREFETCHW|ippCPUID_SHA|ippCPUID_MPX|ippCPUID_AVX512CD|ippCPUID_AVX512ER|
ippCPUID_AVX512PF|ippCPUID_AVX512BW|ippCPUID_AVX512DQ|ippCPUID_AVX512VL|ippCPUID_AVX512VBMI;
@@ -2279,7 +2284,7 @@ void setUseIPP(bool flag)
#endif
}
bool useIPP_NE()
bool useIPP_NotExact()
{
#ifdef HAVE_IPP
CoreTLSData* data = getCoreTlsData().get();
@@ -2293,17 +2298,29 @@ bool useIPP_NE()
#endif
}
void setUseIPP_NE(bool flag)
void setUseIPP_NotExact(bool flag)
{
CoreTLSData* data = getCoreTlsData().get();
#ifdef HAVE_IPP
data->useIPP_NE = (getIPPSingleton().useIPP_NE)?flag:false;
data->useIPP_NE = flag;
#else
CV_UNUSED(flag);
data->useIPP_NE = false;
#endif
}
#if OPENCV_ABI_COMPATIBILITY < 400
bool useIPP_NE()
{
return useIPP_NotExact();
}
void setUseIPP_NE(bool flag)
{
setUseIPP_NotExact(flag);
}
#endif
} // namespace ipp
} // namespace cv