From e224e72bbca1041655f0ccbc6f8f7beda06bd490 Mon Sep 17 00:00:00 2001 From: mletavin Date: Mon, 2 Jun 2014 15:58:59 +0400 Subject: [PATCH] Added condition to use optimized kernels for images of size that multiple of 4 only --- modules/imgproc/src/smooth.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index e12be360e5..ec96a83ee5 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -2025,6 +2025,8 @@ static bool ocl_medianFilter(InputArray _src, OutputArray _dst, int m) bool useOptimized = (1 == cn) && (size_t)imgSize.width >= localsize[0] * 8 && (size_t)imgSize.height >= localsize[1] * 8 && + imgSize.width % 4 == 0 && + imgSize.height % 4 == 0 && (ocl::Device::getDefault().isIntel()); cv::String kname = format( useOptimized ? "medianFilter%d_u" : "medianFilter%d", m) ;