Commit fd3a6f0d authored by Ilya Lavrenov's avatar Ilya Lavrenov

cv::blur

parent a624ec16
...@@ -766,7 +766,7 @@ void polarToCart( InputArray src1, InputArray src2, ...@@ -766,7 +766,7 @@ void polarToCart( InputArray src1, InputArray src2,
CV_Assert(ippFunc != 0); CV_Assert(ippFunc != 0);
IppStatus status = ippFunc(Mag.data, Angle.data, X.data, Y.data, static_cast<int>(cn * X.total())); IppStatus status = ippFunc(Mag.data, Angle.data, X.data, Y.data, static_cast<int>(cn * X.total()));
if (status == ippStsNoErr) if (status >= 0)
return; return;
} }
#endif #endif
...@@ -2240,7 +2240,7 @@ void pow( InputArray _src, double power, OutputArray _dst ) ...@@ -2240,7 +2240,7 @@ void pow( InputArray _src, double power, OutputArray _dst )
ippsPowx_32f_A21((const Ipp32f *)src.data, (Ipp32f)power, (Ipp32f*)dst.data, (Ipp32s)(src.total() * cn)) : 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)); ippsPowx_64f_A50((const Ipp64f *)src.data, power, (Ipp64f*)dst.data, (Ipp32s)(src.total() * cn));
if (status == ippStsNoErr) if (status >= 0)
return; return;
} }
#endif #endif
......
...@@ -2212,7 +2212,7 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray ...@@ -2212,7 +2212,7 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray
Mat src1 = _src1.getMat(), src2 = _src2.getMat(); Mat src1 = _src1.getMat(), src2 = _src2.getMat();
CV_Assert(src1.size == src2.size); 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(); Mat dst = _dst.getMat();
float falpha = (float)alpha; float falpha = (float)alpha;
...@@ -2223,6 +2223,16 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray ...@@ -2223,6 +2223,16 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray
if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() ) if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() )
{ {
size_t len = src1.total()*cn; 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); func(src1.data, src2.data, dst.data, (int)len, palpha);
return; return;
} }
......
...@@ -2987,7 +2987,7 @@ void cv::transpose( InputArray _src, OutputArray _dst ) ...@@ -2987,7 +2987,7 @@ void cv::transpose( InputArray _src, OutputArray _dst )
type == CV_32FC4 ? (ippiTranspose)ippiTranspose_32f_C4R : 0; type == CV_32FC4 ? (ippiTranspose)ippiTranspose_32f_C4R : 0;
IppiSize roiSize = { src.cols, src.rows }; 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; return;
#endif #endif
......
...@@ -501,7 +501,7 @@ void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _m ...@@ -501,7 +501,7 @@ void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _m
status = ippFuncMask(src.data, srcstep, (Ipp8u *)mask.data, maskstep, status = ippFuncMask(src.data, srcstep, (Ipp8u *)mask.data, maskstep,
(Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height)); (Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height));
if (status == ippStsNoErr) if (status >= 0)
return; return;
} }
} }
...@@ -582,7 +582,7 @@ void cv::accumulateProduct( InputArray _src1, InputArray _src2, ...@@ -582,7 +582,7 @@ void cv::accumulateProduct( InputArray _src1, InputArray _src2,
status = ippFuncMask(src1.data, src1step, src2.data, src2step, (Ipp8u *)mask.data, maskstep, status = ippFuncMask(src1.data, src1step, src2.data, src2step, (Ipp8u *)mask.data, maskstep,
(Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height)); (Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height));
if (status == ippStsNoErr) if (status >= 0)
return; return;
} }
} }
...@@ -661,7 +661,7 @@ void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst, ...@@ -661,7 +661,7 @@ void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst,
status = ippFuncMask(src.data, srcstep, (Ipp8u *)mask.data, maskstep, status = ippFuncMask(src.data, srcstep, (Ipp8u *)mask.data, maskstep,
(Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height), (Ipp32f)alpha); (Ipp32f *)dst.data, dststep, ippiSize(size.width, size.height), (Ipp32f)alpha);
if (status == ippStsNoErr) if (status >= 0)
return; return;
} }
} }
......
...@@ -4048,8 +4048,12 @@ public: ...@@ -4048,8 +4048,12 @@ public:
////Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr ////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, IppStatus status = func( src.data, srcsize, (int)src.step[0], srcroi, dst.data,
(int)dst.step[0], dstroi, coeffs, mode ); (int)dst.step[0], dstroi, coeffs, mode );
<<<<<<< HEAD
printf("%d\n", status); printf("%d\n", status);
if( status != ippStsNoErr) if( status != ippStsNoErr)
=======
if( status < 0)
>>>>>>> cv::blur
*ok = false; *ok = false;
} }
private: private:
......
...@@ -858,11 +858,17 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, ...@@ -858,11 +858,17 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
return; return;
#endif #endif
/*
#ifdef HAVE_IPP #ifdef HAVE_IPP
bool isolated = (borderType & BORDER_ISOLATED) != 0; int ippBorderType = borderType & ~BORDER_ISOLATED;
if (!normalize && !isolated && (borderType & ~BORDER_ISOLATED) == BORDER_REPLICATE && ddepth == sdepth && Point ocvAnchor, ippAnchor;
(anchor == Point(-1, -1) || anchor == Point(ksize.width >> 1, ksize.height >> 1)) && ksize.width == ksize.width) 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; Ipp32s bufSize;
IppiSize roiSize = ippiSize(dst.cols, dst.rows), maskSize = ippiSize(ksize.width, ksize.height); IppiSize roiSize = ippiSize(dst.cols, dst.rows), maskSize = ippiSize(ksize.width, ksize.height);
...@@ -874,11 +880,11 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, ...@@ -874,11 +880,11 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
{ \ { \
Ipp8u * buffer = ippsMalloc_8u(bufSize); \ Ipp8u * buffer = ippsMalloc_8u(bufSize); \
ippType borderValue[4] = { 0, 0, 0, 0 }; \ 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, \ IppStatus status = ippiFilterBoxBorder_##flavor((ippType *)src.data, (int)src.step, (ippType *)dst.data, (int)dst.step, roiSize, maskSize, \
ippBorderRepl, borderValue, buffer); \ (IppiBorderType)ippBorderType, borderValue, buffer); \
ippFree(buffer); \ ippsFree(buffer); \
printf("%d\n", status); \
IPPI_CALL(status); \
if (status >= 0) \ if (status >= 0) \
return; \ return; \
} \ } \
...@@ -914,7 +920,6 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, ...@@ -914,7 +920,6 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
} }
#undef IPP_FILTER_BOX_BORDER #undef IPP_FILTER_BOX_BORDER
#endif #endif
*/
Ptr<FilterEngine> f = createBoxFilter( src.type(), dst.type(), Ptr<FilterEngine> f = createBoxFilter( src.type(), dst.type(),
ksize, anchor, normalize, borderType ); ksize, anchor, normalize, borderType );
...@@ -2024,7 +2029,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize ) ...@@ -2024,7 +2029,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
IppStatus status = ippiFilterMedianBorder_##flavor((const ippType *)src0.data, (int)src0.step, \ IppStatus status = ippiFilterMedianBorder_##flavor((const ippType *)src0.data, (int)src0.step, \
(ippType *)dst.data, (int)dst.step, dstRoiSize, maskSize, \ (ippType *)dst.data, (int)dst.step, dstRoiSize, maskSize, \
ippBorderRepl, (ippType)0, buffer); \ ippBorderRepl, (ippType)0, buffer); \
ippiFree(buffer); \ ippsFree(buffer); \
if (status >= 0) \ if (status >= 0) \
return; \ return; \
} \ } \
......
...@@ -102,7 +102,7 @@ typedef BoxFilterBase BoxFilter; ...@@ -102,7 +102,7 @@ typedef BoxFilterBase BoxFilter;
OCL_TEST_P(BoxFilter, Mat) OCL_TEST_P(BoxFilter, Mat)
{ {
for (int j = 0; j < 100; j++) for (int j = 0; j < test_loop_times; j++)
{ {
random_roi(); random_roi();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment