Skip to content

Commit 0f1a56d

Browse files
committed
Changed restrictions for OpenVX HAL calls on small images
1 parent bf62dca commit 0f1a56d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

3rdparty/openvx/hal/openvx_hal.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ inline bool dimTooBig(int size)
8282
}
8383

8484
//OpenVX calls have essential overhead so it make sense to skip them for small images
85-
template <int kernel_id> inline bool skipSmallImages(int w, int h) { return w*h < 7680 * 4320; }
86-
template <> inline bool skipSmallImages<VX_KERNEL_MULTIPLY>(int w, int h) { return w*h < 640 * 480; }
87-
template <> inline bool skipSmallImages<VX_KERNEL_COLOR_CONVERT>(int w, int h) { return w*h < 2048 * 1536; }
85+
template <int kernel_id> inline bool skipSmallImages(int w, int h) { return w*h < 7680 * 4320; }
86+
template <> inline bool skipSmallImages<VX_KERNEL_MULTIPLY>(int w, int h) { return w*h < 640 * 480; }
87+
template <> inline bool skipSmallImages<VX_KERNEL_COLOR_CONVERT>(int w, int h) { return w*h < 2048 * 1536; }
88+
template <> inline bool skipSmallImages<VX_KERNEL_INTEGRAL_IMAGE>(int w, int h) { return w*h < 640 * 480; }
8889

8990
inline void setConstantBorder(ivx::border_t &border, vx_uint8 val)
9091
{

modules/core/include/opencv2/core/openvx/ovx_defs.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ CV_EXPORTS_W ivx::Context& getOpenVXContext();
2828
template <int kernel_id> inline bool skipSmallImages(int w, int h) { return w*h < 3840 * 2160; }
2929
template <> inline bool skipSmallImages<VX_KERNEL_MINMAXLOC>(int w, int h) { return w*h < 3840 * 2160; }
3030
template <> inline bool skipSmallImages<VX_KERNEL_MEDIAN_3x3>(int w, int h) { return w*h < 1280 * 720; }
31-
template <> inline bool skipSmallImages<VX_KERNEL_GAUSSIAN_3x3>(int w, int h) { return w*h < 1280 * 720; }
32-
template <> inline bool skipSmallImages<VX_KERNEL_BOX_3x3>(int w, int h) { return w*h < 1920 * 1080; }
31+
template <> inline bool skipSmallImages<VX_KERNEL_GAUSSIAN_3x3>(int w, int h) { return w*h < 320 * 240; }
32+
template <> inline bool skipSmallImages<VX_KERNEL_BOX_3x3>(int w, int h) { return w*h < 640 * 480; }
3333
template <> inline bool skipSmallImages<VX_KERNEL_HISTOGRAM>(int w, int h) { return w*h < 2048 * 1536; }
34-
template <> inline bool skipSmallImages<VX_KERNEL_SOBEL_3x3>(int w, int h) { return w*h < 1280 * 720; }
35-
template <> inline bool skipSmallImages<VX_KERNEL_CUSTOM_CONVOLUTION>(int w, int h) { return w*h < 1280 * 720; }
34+
template <> inline bool skipSmallImages<VX_KERNEL_SOBEL_3x3>(int w, int h) { return w*h < 320 * 240; }
35+
template <> inline bool skipSmallImages<VX_KERNEL_CUSTOM_CONVOLUTION>(int w, int h) { return w*h < 640 * 480; }
3636

3737
}}
3838

modules/imgproc/src/deriv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ namespace cv
234234
border = VX_BORDER_CONSTANT;
235235
break;
236236
case BORDER_REPLICATE:
237-
border = VX_BORDER_REPLICATE;
238-
break;
237+
// border = VX_BORDER_REPLICATE;
238+
// break;
239239
default:
240240
return false;
241241
}

0 commit comments

Comments
 (0)