@@ -470,9 +470,14 @@ static bool openvx_gaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
470
470
471
471
#endif
472
472
473
- #if 0 //defined HAVE_IPP
473
+ #if defined ENABLE_IPP_GAUSSIAN_BLUR // see CMake's OPENCV_IPP_GAUSSIAN_BLUR option
474
+
475
+ #define IPP_DISABLE_GAUSSIAN_BLUR_LARGE_KERNELS_1TH 1
476
+ #define IPP_DISABLE_GAUSSIAN_BLUR_16SC4_1TH 1
477
+ #define IPP_DISABLE_GAUSSIAN_BLUR_32FC4_1TH 1
478
+
474
479
// IW 2017u2 has bug which doesn't allow use of partial inMem with tiling
475
- #if IPP_DISABLE_GAUSSIANBLUR_PARALLEL
480
+ #if IPP_VERSION_X100 < 201900
476
481
#define IPP_GAUSSIANBLUR_PARALLEL 0
477
482
#else
478
483
#define IPP_GAUSSIANBLUR_PARALLEL 1
@@ -555,6 +560,14 @@ static bool ipp_GaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
555
560
return false ;
556
561
557
562
const int threads = ippiSuggestThreadsNum (iwDst, 2 );
563
+
564
+ if (IPP_DISABLE_GAUSSIAN_BLUR_LARGE_KERNELS_1TH && (threads == 1 && ksize.width > 25 ))
565
+ return false ;
566
+ if (IPP_DISABLE_GAUSSIAN_BLUR_16SC4_1TH && (threads == 1 && src.type () == CV_16SC4))
567
+ return false ;
568
+ if (IPP_DISABLE_GAUSSIAN_BLUR_32FC4_1TH && (threads == 1 && src.type () == CV_32FC4))
569
+ return false ;
570
+
558
571
if (IPP_GAUSSIANBLUR_PARALLEL && threads > 1 ) {
559
572
bool ok;
560
573
ipp_gaussianBlurParallel invoker (iwSrc, iwDst, ksize.width , (float ) sigma1, ippBorder, &ok);
@@ -655,8 +668,6 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
655
668
CV_OVX_RUN (true ,
656
669
openvx_gaussianBlur (src, dst, ksize, sigma1, sigma2, borderType))
657
670
658
- // CV_IPP_RUN_FAST(ipp_GaussianBlur(src, dst, ksize, sigma1, sigma2, borderType));
659
-
660
671
if (sdepth == CV_8U && ((borderType & BORDER_ISOLATED) || !_src.getMat ().isSubmatrix ()))
661
672
{
662
673
std::vector<ufixedpoint16> fkx, fky;
@@ -681,6 +692,11 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize,
681
692
}
682
693
}
683
694
695
+ #if defined ENABLE_IPP_GAUSSIAN_BLUR
696
+ // IPP is not bit-exact to OpenCV implementation
697
+ CV_IPP_RUN_FAST (ipp_GaussianBlur (src, dst, ksize, sigma1, sigma2, borderType));
698
+ #endif
699
+
684
700
sepFilter2D (src, dst, sdepth, kx, ky, Point (-1 , -1 ), 0 , borderType);
685
701
}
686
702
0 commit comments