Implementation detector and selector for IPP and OpenCL;
IPP can be switched on and off on runtime; Optional implementation collector was added (switched off by default in CMake). Gathers data of implementation used in functions and report this info through performance TS; TS modifications for implementations control;
This commit is contained in:
@@ -375,27 +375,33 @@ void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
|
||||
Mat patch = _patch.getMat();
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
typedef IppStatus (CV_STDCALL *ippiGetRectSubPixFunc)( const void* src, int src_step,
|
||||
IppiSize src_size, void* dst,
|
||||
int dst_step, IppiSize win_size,
|
||||
IppiPoint_32f center,
|
||||
IppiPoint* minpt, IppiPoint* maxpt );
|
||||
|
||||
IppiPoint minpt={0,0}, maxpt={0,0};
|
||||
IppiPoint_32f icenter = {center.x, center.y};
|
||||
IppiSize src_size={image.cols, image.rows}, win_size={patch.cols, patch.rows};
|
||||
int srctype = image.type();
|
||||
ippiGetRectSubPixFunc ippfunc =
|
||||
srctype == CV_8UC1 && ddepth == CV_8U ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R :
|
||||
srctype == CV_8UC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R :
|
||||
srctype == CV_32FC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0;
|
||||
|
||||
if( ippfunc)
|
||||
CV_IPP_CHECK()
|
||||
{
|
||||
if (ippfunc(image.ptr(), (int)image.step, src_size, patch.ptr(),
|
||||
(int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0 )
|
||||
return;
|
||||
setIppErrorStatus();
|
||||
typedef IppStatus (CV_STDCALL *ippiGetRectSubPixFunc)( const void* src, int src_step,
|
||||
IppiSize src_size, void* dst,
|
||||
int dst_step, IppiSize win_size,
|
||||
IppiPoint_32f center,
|
||||
IppiPoint* minpt, IppiPoint* maxpt );
|
||||
|
||||
IppiPoint minpt={0,0}, maxpt={0,0};
|
||||
IppiPoint_32f icenter = {center.x, center.y};
|
||||
IppiSize src_size={image.cols, image.rows}, win_size={patch.cols, patch.rows};
|
||||
int srctype = image.type();
|
||||
ippiGetRectSubPixFunc ippfunc =
|
||||
srctype == CV_8UC1 && ddepth == CV_8U ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R :
|
||||
srctype == CV_8UC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R :
|
||||
srctype == CV_32FC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0;
|
||||
|
||||
if( ippfunc)
|
||||
{
|
||||
if (ippfunc(image.ptr(), (int)image.step, src_size, patch.ptr(),
|
||||
(int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0 )
|
||||
{
|
||||
CV_IMPL_ADD(CV_IMPL_IPP);
|
||||
return;
|
||||
}
|
||||
setIppErrorStatus();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user