mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
IPP 2017 filter2D fix;
filter2D IPP runtime check;
This commit is contained in:
parent
fb456eb69c
commit
dfb9c574a4
@ -4640,6 +4640,11 @@ struct IppFilter : public hal::Filter2D
|
|||||||
int ddepth = CV_MAT_DEPTH(dtype);
|
int ddepth = CV_MAT_DEPTH(dtype);
|
||||||
int sdepth = CV_MAT_DEPTH(stype);
|
int sdepth = CV_MAT_DEPTH(stype);
|
||||||
|
|
||||||
|
#if IPP_VERSION_X100 >= 201700 && IPP_VERSION_X100 < 201702 // IPP bug with 1x1 kernel
|
||||||
|
if(kernel_width == 1 && kernel_height == 1)
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool runIpp = true
|
bool runIpp = true
|
||||||
&& (borderTypeNI == BORDER_CONSTANT || borderTypeNI == BORDER_REPLICATE)
|
&& (borderTypeNI == BORDER_CONSTANT || borderTypeNI == BORDER_REPLICATE)
|
||||||
&& (sdepth == ddepth)
|
&& (sdepth == ddepth)
|
||||||
@ -4911,26 +4916,29 @@ Ptr<hal::Filter2D> Filter2D::create(uchar* kernel_data, size_t kernel_step, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_IPP
|
#ifdef HAVE_IPP
|
||||||
if (kernel_type == CV_32FC1) {
|
CV_IPP_CHECK()
|
||||||
IppFilter<CV_32F>* impl = new IppFilter<CV_32F>();
|
{
|
||||||
if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
|
if (kernel_type == CV_32FC1) {
|
||||||
max_width, max_height, stype, dtype,
|
IppFilter<CV_32F>* impl = new IppFilter<CV_32F>();
|
||||||
borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
|
if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
|
||||||
{
|
max_width, max_height, stype, dtype,
|
||||||
return Ptr<hal::Filter2D>(impl);
|
borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
|
||||||
|
{
|
||||||
|
return Ptr<hal::Filter2D>(impl);
|
||||||
|
}
|
||||||
|
delete impl;
|
||||||
}
|
}
|
||||||
delete impl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kernel_type == CV_16SC1) {
|
if (kernel_type == CV_16SC1) {
|
||||||
IppFilter<CV_16S>* impl = new IppFilter<CV_16S>();
|
IppFilter<CV_16S>* impl = new IppFilter<CV_16S>();
|
||||||
if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
|
if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
|
||||||
max_width, max_height, stype, dtype,
|
max_width, max_height, stype, dtype,
|
||||||
borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
|
borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
|
||||||
{
|
{
|
||||||
return Ptr<hal::Filter2D>(impl);
|
return Ptr<hal::Filter2D>(impl);
|
||||||
|
}
|
||||||
|
delete impl;
|
||||||
}
|
}
|
||||||
delete impl;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user