cv::scaleAdd

pull/2583/head
Ilya Lavrenov 11 years ago
parent fd3a6f0db7
commit c735594178
  1. 2
      cmake/OpenCVFindIPP.cmake
  2. 19
      modules/core/src/matmul.cpp
  3. 16
      modules/core/src/stat.cpp
  4. 10
      modules/imgproc/src/color.cpp
  5. 15
      modules/imgproc/src/imgwarp.cpp
  6. 4
      modules/imgproc/src/morph.cpp
  7. 2
      modules/imgproc/src/smooth.cpp

@ -156,8 +156,10 @@ macro(ipp_set_variables _LATEST_VERSION)
set(IPPCC "cc") # color conversion
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
set(IPPM "m") # matrix math
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPM}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX})

@ -2220,19 +2220,16 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray
ScaleAddFunc func = depth == CV_32F ? (ScaleAddFunc)scaleAdd_32f : (ScaleAddFunc)scaleAdd_64f;
if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() )
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
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
if (depth == CV_32F &&
ippmSaxpy_vava_32f((const Ipp32f *)src1.data, (int)src1.step, sizeof(Ipp32f), falpha,
(const Ipp32f *)src2.data, (int)src2.step, sizeof(Ipp32f),
(Ipp32f *)dst.data, (int)dst.step, sizeof(Ipp32f), len, 1) >= 0)
return;
#endif
func(src1.data, src2.data, dst.data, (int)len, palpha);
return;
}

@ -933,10 +933,10 @@ void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, Input
dcn_stddev = (int)stddev.total();
pstddev = (Ipp64f *)stddev.data;
}
for( int k = cn; k < dcn_mean; k++ )
pmean[k] = 0;
for( int k = cn; k < dcn_stddev; k++ )
pstddev[k] = 0;
for( int c = cn; c < dcn_mean; c++ )
pmean[c] = 0;
for( int c = cn; c < dcn_stddev; c++ )
pstddev[c] = 0;
IppiSize sz = { cols, rows };
int type = src.type();
if( !mask.empty() )
@ -2114,7 +2114,11 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
type == CV_16UC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_16u_C3R :
type == CV_16UC4 ? (ippiNormFuncNoHint)ippiNorm_Inf_16u_C4R :
type == CV_16SC1 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C1R :
<<<<<<< HEAD
#if (IPP_VERSION_X100 >= 801)
=======
#if IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
>>>>>>> cv::scaleAdd
type == CV_16SC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C3R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
type == CV_16SC4 ? (ippiNormFuncNoHint)ippiNorm_Inf_16s_C4R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
#endif
@ -2546,7 +2550,11 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
type == CV_16UC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16u_C3R :
type == CV_16UC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16u_C4R :
type == CV_16SC1 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C1R :
<<<<<<< HEAD
#if (IPP_VERSION_X100 >= 801)
=======
#if IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
>>>>>>> cv::scaleAdd
type == CV_16SC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C3R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
type == CV_16SC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_16s_C4R : //Aug 2013: problem in IPP 7.1, 8.0 : -32768
#endif

@ -298,7 +298,7 @@ static ippiReorderFunc ippiSwapChannelsC3RTab[] =
0, (ippiReorderFunc)ippiSwapChannels_32f_C3R, 0, 0
};
#if (IPP_VERSION_X100 >= 801)
#if IPP_VERSION_X100 >= 801
static ippiReorderFunc ippiSwapChannelsC4RTab[] =
{
(ippiReorderFunc)ippiSwapChannels_8u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_16u_C4R, 0,
@ -3254,7 +3254,11 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC3RTab[depth], 2, 1, 0)) )
return;
}
<<<<<<< HEAD
#if (IPP_VERSION_X100 >= 801)
=======
#if IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
>>>>>>> cv::scaleAdd
else if( code == CV_RGBA2BGRA )
{
if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC4RTab[depth], 2, 1, 0)) )
@ -3315,7 +3319,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
CV_Assert( scn == 3 || scn == 4 );
_dst.create(sz, CV_MAKETYPE(depth, 1));
dst = _dst.getMat();
/**/
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
/*
if( code == CV_BGR2GRAY )
@ -3341,7 +3345,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
return;
}
#endif
/**/
bidx = code == CV_BGR2GRAY || code == CV_BGRA2GRAY ? 0 : 2;
if( depth == CV_8U )

@ -4015,7 +4015,7 @@ private:
/*
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
class IPPWarpAffineInvoker :
public ParallelLoopBody
{
@ -4045,15 +4045,10 @@ 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,
(int)dst.step[0], dstroi, coeffs, mode );
<<<<<<< HEAD
printf("%d\n", status);
if( status != ippStsNoErr)
=======
if( status < 0)
>>>>>>> cv::blur
*ok = false;
}
private:
@ -4220,7 +4215,7 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
const int AB_SCALE = 1 << AB_BITS;
/*
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
if( ( depth == CV_8U || depth == CV_16U || depth == CV_32F ) &&
( cn == 1 || cn == 3 || cn == 4 ) &&
@ -4386,7 +4381,7 @@ private:
};
/*
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
class IPPWarpPerspectiveInvoker :
public ParallelLoopBody
{
@ -4469,7 +4464,7 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
#endif
/*
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
if( (depth == CV_8U || depth == CV_16U || depth == CV_32F) &&
(cn == 1 || cn == 3 || cn == 4) &&

@ -1136,7 +1136,11 @@ private:
Scalar borderValue;
};
<<<<<<< HEAD
#if IPP_VERSION_X100 >= 801
=======
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81
>>>>>>> cv::scaleAdd
static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kernel,
const Size& ksize, const Point &anchor, bool rectKernel)
{

@ -2018,7 +2018,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
_dst.create( src0.size(), src0.type() );
Mat dst = _dst.getMat();
#ifdef HAVE_IPP
#if defined HAVE_IPP && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1
#define IPP_FILTER_MEDIAN_BORDER(ippType, ippDataType, flavor) \
do \
{ \

Loading…
Cancel
Save