Skip to content

Commit 617e6b4

Browse files
committed
Merge pull request opencv#9145 from alalek:ipp_minmaxidx_nan
2 parents 9365817 + 5ebfb52 commit 617e6b4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

modules/core/include/opencv2/core/private.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int un
209209
#define IPP_DISABLE_RESIZE_NEAREST 1 // Accuracy mismatch (max diff 1)
210210
#define IPP_DISABLE_RESIZE_AREA 1 // Accuracy mismatch (max diff 1)
211211

212+
#define IPP_DISABLE_MINMAX_NAN_SSE42 1 // cv::minMaxIdx problem with NaN input
213+
212214
// Temporary disabled named IPP region. Performance
213215
#define IPP_DISABLE_PERF_COPYMAKE 1 // performance variations
214216
#define IPP_DISABLE_PERF_LUT 1 // there are no performance benefits (PR #2653)

modules/core/src/stat.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,6 +2534,12 @@ static bool ipp_minMaxIdx(Mat &src, double* _minVal, double* _maxVal, int* _minI
25342534
#if IPP_VERSION_X100 >= 700
25352535
CV_INSTRUMENT_REGION_IPP()
25362536

2537+
#if IPP_DISABLE_MINMAX_NAN_SSE42
2538+
// Disable 32F processing only
2539+
if(src.depth() == CV_32F && !(ipp::getIppFeatures()&ippCPUID_AVX))
2540+
return false;
2541+
#endif
2542+
25372543
IppStatus status;
25382544
IppDataType dataType = ippiGetDataType(src.depth());
25392545
float minVal = 0;

0 commit comments

Comments
 (0)