CV_Assert(ippFunc != 0);
IppStatus status = ippFunc(Mag.data, Angle.data, X.data, Y.data, static_cast<int>(cn * X.total()));
- if (status == ippStsNoErr)
+ if (status >= 0)
return;
}
#endif
ippsPowx_32f_A21((const Ipp32f *)src.data, (Ipp32f)power, (Ipp32f*)dst.data, (Ipp32s)(src.total() * cn)) :
ippsPowx_64f_A50((const Ipp64f *)src.data, power, (Ipp64f*)dst.data, (Ipp32s)(src.total() * cn));
- if (status == ippStsNoErr)
+ if (status >= 0)
return;
}
#endif
Mat src1 = _src1.getMat(), src2 = _src2.getMat();
CV_Assert(src1.size == src2.size);
- _dst.create(src1.dims, src1.size, src1.type());
+ _dst.create(src1.dims, src1.size, type);
Mat dst = _dst.getMat();
float falpha = (float)alpha;
if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() )
{
size_t len = src1.total()*cn;
+//#ifdef HAVE_IPP
+// if (depth == CV_32F)
+// {
+// IppStatus status = ippmSaxpy_vava_32f((const Ipp32f *)src1.data, 1, 0, falpha,
+// (const Ipp32f *)src2.data, 1, 0, (Ipp32f *)dst.data, 1, 0, (int)len, 1);
+// printf("%s\n", ippGetStatusString(status));
+// if (status >= 0)
+// return;
+// }
+//#endif
func(src1.data, src2.data, dst.data, (int)len, palpha);
return;
}
type == CV_32FC4 ? (ippiTranspose)ippiTranspose_32f_C4R : 0;
IppiSize roiSize = { src.cols, src.rows };
- if (ippFunc != 0 && ippFunc(src.data, (int)src.step, dst.data, (int)dst.step, roiSize) == ippStsNoErr)
+ if (ippFunc != 0 && ippFunc(src.data, (int)src.step, dst.data, (int)dst.step, roiSize) >= 0)
return;
#endif
status = ippFuncMask(src.data, srcstep, (Ipp8u *)mask.data, maskstep,
(Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height));
- if (status == ippStsNoErr)
+ if (status >= 0)
return;
}
}
status = ippFuncMask(src1.data, src1step, src2.data, src2step, (Ipp8u *)mask.data, maskstep,
(Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height));
- if (status == ippStsNoErr)
+ if (status >= 0)
return;
}
}
status = ippFuncMask(src.data, srcstep, (Ipp8u *)mask.data, maskstep,
(Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height), (Ipp32f)alpha);
- if (status == ippStsNoErr)
+ if (status >= 0)
return;
}
}
////Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr
IppStatus status = func( src.data, srcsize, (int)src.step[0], srcroi, dst.data,
(int)dst.step[0], dstroi, coeffs, mode );
+<<<<<<< HEAD
printf("%d\n", status);
if( status != ippStsNoErr)
+=======
+ if( status < 0)
+>>>>>>> cv::blur
*ok = false;
}
private:
return;
#endif
- /*
#ifdef HAVE_IPP
- bool isolated = (borderType & BORDER_ISOLATED) != 0;
- if (!normalize && !isolated && (borderType & ~BORDER_ISOLATED) == BORDER_REPLICATE && ddepth == sdepth &&
- (anchor == Point(-1, -1) || anchor == Point(ksize.width >> 1, ksize.height >> 1)) && ksize.width == ksize.width)
+ int ippBorderType = borderType & ~BORDER_ISOLATED;
+ Point ocvAnchor, ippAnchor;
+ ocvAnchor.x = anchor.x < 0 ? ksize.width / 2 : anchor.x;
+ ocvAnchor.y = anchor.y < 0 ? ksize.height / 2 : anchor.y;
+ ippAnchor.x = ksize.width / 2 - (ksize.width % 2 == 0 ? 1 : 0);
+ ippAnchor.y = ksize.height / 2 - (ksize.height % 2 == 0 ? 1 : 0);
+
+ if (normalize && !src.isSubmatrix() && ddepth == sdepth &&
+ (ippBorderType == BORDER_REPLICATE || ippBorderType == BORDER_CONSTANT) &&
+ ocvAnchor == ippAnchor )
{
Ipp32s bufSize;
IppiSize roiSize = ippiSize(dst.cols, dst.rows), maskSize = ippiSize(ksize.width, ksize.height);
{ \
Ipp8u * buffer = ippsMalloc_8u(bufSize); \
ippType borderValue[4] = { 0, 0, 0, 0 }; \
+ ippBorderType = ippBorderType == BORDER_CONSTANT ? ippBorderConst : ippBorderType == BORDER_REPLICATE ? ippBorderRepl : -1; \
+ CV_Assert(ippBorderType >= 0); \
IppStatus status = ippiFilterBoxBorder_##flavor((ippType *)src.data, (int)src.step, (ippType *)dst.data, (int)dst.step, roiSize, maskSize, \
- ippBorderRepl, borderValue, buffer); \
- ippFree(buffer); \
- printf("%d\n", status); \
- IPPI_CALL(status); \
+ (IppiBorderType)ippBorderType, borderValue, buffer); \
+ ippsFree(buffer); \
if (status >= 0) \
return; \
} \
}
#undef IPP_FILTER_BOX_BORDER
#endif
- */
Ptr<FilterEngine> f = createBoxFilter( src.type(), dst.type(),
ksize, anchor, normalize, borderType );
IppStatus status = ippiFilterMedianBorder_##flavor((const ippType *)src0.data, (int)src0.step, \
(ippType *)dst.data, (int)dst.step, dstRoiSize, maskSize, \
ippBorderRepl, (ippType)0, buffer); \
- ippiFree(buffer); \
+ ippsFree(buffer); \
if (status >= 0) \
return; \
} \
OCL_TEST_P(BoxFilter, Mat)
{
- for (int j = 0; j < 100; j++)
+ for (int j = 0; j < test_loop_times; j++)
{
random_roi();