mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Image pyramids upsampling optimization
Add new ocl kernel for image pyramids upsampling, It is 35% faster than current OCL kernel in perf test. Signed-off-by: Li Peng <peng.li@intel.com>
This commit is contained in:
@@ -134,6 +134,24 @@ OCL_TEST_P(PyrUp, Mat)
|
||||
}
|
||||
}
|
||||
|
||||
typedef PyrTestBase PyrUp_cols2;
|
||||
|
||||
OCL_TEST_P(PyrUp_cols2, Mat)
|
||||
{
|
||||
for (int j = 0; j < test_loop_times; j++)
|
||||
{
|
||||
Size src_roiSize = randomSize(1, MAX_VALUE);
|
||||
src_roiSize.width += (src_roiSize.width % 2);
|
||||
Size dst_roiSize = Size(2 * src_roiSize.width, 2 * src_roiSize.height);
|
||||
generateTestData(src_roiSize, dst_roiSize);
|
||||
|
||||
OCL_OFF(pyrUp(src_roi, dst_roi, dst_roiSize, borderType));
|
||||
OCL_ON(pyrUp(usrc_roi, udst_roi, dst_roiSize, borderType));
|
||||
|
||||
Near(depth == CV_32F ? 1e-4f : 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
OCL_INSTANTIATE_TEST_CASE_P(ImgprocPyr, PyrUp, Combine(
|
||||
Values(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F),
|
||||
Values(1, 2, 3, 4),
|
||||
@@ -141,6 +159,13 @@ OCL_INSTANTIATE_TEST_CASE_P(ImgprocPyr, PyrUp, Combine(
|
||||
Bool()
|
||||
));
|
||||
|
||||
OCL_INSTANTIATE_TEST_CASE_P(ImgprocPyr, PyrUp_cols2, Combine(
|
||||
Values((MatDepth)CV_8U),
|
||||
Values((Channels)1),
|
||||
Values((BorderType)BORDER_REFLECT_101),
|
||||
Bool()
|
||||
));
|
||||
|
||||
} } // namespace cvtest::ocl
|
||||
|
||||
#endif // HAVE_OPENCL
|
||||
|
||||
Reference in New Issue
Block a user