Commit e224e72b authored by mletavin's avatar mletavin

Added condition to use optimized kernels for images of size that multiple of 4 only

parent 68883775
......@@ -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) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment