From: Ilya Lavrenov Date: Mon, 7 Apr 2014 13:09:11 +0000 (+0400) Subject: fixed (IppiSize&)sz X-Git-Tag: submit/tizen_ivi/20141117.190038~2^2~491^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=444ab0ef0d65dac4f67840592afbb2343e774660;p=profile%2Fivi%2Fopencv.git fixed (IppiSize&)sz --- diff --git a/cmake/OpenCVFindIPP.cmake b/cmake/OpenCVFindIPP.cmake index 495c243..559f70a 100644 --- a/cmake/OpenCVFindIPP.cmake +++ b/cmake/OpenCVFindIPP.cmake @@ -159,12 +159,14 @@ macro(ipp_set_variables _LATEST_VERSION) 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}) list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}) list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}) + if(NOT HAVE_IPP_ICV_ONLY) + list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPM}${IPP_SUFFIX}${IPP_LIB_SUFFIX}) + endif() # FIXIT # if(UNIX AND NOT HAVE_IPP_ICV_ONLY) @@ -186,7 +188,7 @@ macro(ipp_set_variables _LATEST_VERSION) if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32) message(SEND_ERROR "Intel compiler IA32 libraries not found") endif() - if (NOT APLLE) + if (NOT APPLE) set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/ia32) endif() endif() diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp index 45351d1..f516e64 100644 --- a/modules/core/include/opencv2/core/private.hpp +++ b/modules/core/include/opencv2/core/private.hpp @@ -223,6 +223,13 @@ static inline IppiSize ippiSize(int width, int height) IppiSize size = { width, height }; return size; } + +static inline IppiSize ippiSize(const cv::Size & _size) +{ + IppiSize size = { _size.width, _size.height }; + return size; +} + #else # define IPP_VERSION_X100 0 #endif diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index ecc2ca0..aa9469c 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -460,7 +460,7 @@ static void add8u( const uchar* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAdd_8u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz, 0)) + if (0 <= ippiAdd_8u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz), 0)) return; #endif (vBinOp, IF_SIMD(VAdd)>(src1, step1, src2, step2, dst, step, sz)); @@ -479,7 +479,7 @@ static void add16u( const ushort* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAdd_16u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz, 0)) + if (0 <= ippiAdd_16u_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz), 0)) return; #endif (vBinOp, IF_SIMD(VAdd)>(src1, step1, src2, step2, dst, step, sz)); @@ -491,7 +491,7 @@ static void add16s( const short* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAdd_16s_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz, 0)) + if (0 <= ippiAdd_16s_C1RSfs(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz), 0)) return; #endif (vBinOp, IF_SIMD(VAdd)>(src1, step1, src2, step2, dst, step, sz)); @@ -510,7 +510,7 @@ static void add32f( const float* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAdd_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiAdd_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp32, IF_SIMD(VAdd)>(src1, step1, src2, step2, dst, step, sz)); @@ -529,7 +529,7 @@ static void sub8u( const uchar* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiSub_8u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz, 0)) + if (0 <= ippiSub_8u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz), 0)) return; #endif (vBinOp, IF_SIMD(VSub)>(src1, step1, src2, step2, dst, step, sz)); @@ -548,7 +548,7 @@ static void sub16u( const ushort* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiSub_16u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz, 0)) + if (0 <= ippiSub_16u_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz), 0)) return; #endif (vBinOp, IF_SIMD(VSub)>(src1, step1, src2, step2, dst, step, sz)); @@ -560,7 +560,7 @@ static void sub16s( const short* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiSub_16s_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz, 0)) + if (0 <= ippiSub_16s_C1RSfs(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz), 0)) return; #endif (vBinOp, IF_SIMD(VSub)>(src1, step1, src2, step2, dst, step, sz)); @@ -579,7 +579,7 @@ static void sub32f( const float* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiSub_32f_C1R(src2, (int)step2, src1, (int)step1, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiSub_32f_C1R(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp32, IF_SIMD(VSub)>(src1, step1, src2, step2, dst, step, sz)); @@ -801,7 +801,7 @@ static void absdiff8u( const uchar* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAbsDiff_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiAbsDiff_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp, IF_SIMD(VAbsDiff)>(src1, step1, src2, step2, dst, step, sz)); @@ -820,7 +820,7 @@ static void absdiff16u( const ushort* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAbsDiff_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiAbsDiff_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp, IF_SIMD(VAbsDiff)>(src1, step1, src2, step2, dst, step, sz)); @@ -846,7 +846,7 @@ static void absdiff32f( const float* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAbsDiff_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiAbsDiff_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp32, IF_SIMD(VAbsDiff)>(src1, step1, src2, step2, dst, step, sz)); @@ -866,7 +866,7 @@ static void and8u( const uchar* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiAnd_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiAnd_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp, IF_SIMD(VAnd)>(src1, step1, src2, step2, dst, step, sz)); @@ -878,7 +878,7 @@ static void or8u( const uchar* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiOr_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiOr_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp, IF_SIMD(VOr)>(src1, step1, src2, step2, dst, step, sz)); @@ -890,7 +890,7 @@ static void xor8u( const uchar* src1, size_t step1, { #if (ARITHM_USE_IPP == 1) fixSteps(sz, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiXor_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)sz)) + if (0 <= ippiXor_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp, IF_SIMD(VXor)>(src1, step1, src2, step2, dst, step, sz)); @@ -901,8 +901,8 @@ static void not8u( const uchar* src1, size_t step1, uchar* dst, size_t step, Size sz, void* ) { #if (ARITHM_USE_IPP == 1) - fixSteps(sz, sizeof(dst[0]), step1, step2, step); (void *)src2; - if (0 <= ippiNot_8u_C1R(src1, (int)step1, dst, (int)step, (IppiSize&)sz)) + fixSteps(sz, sizeof(dst[0]), step1, step2, step); (void)src2; + if (0 <= ippiNot_8u_C1R(src1, (int)step1, dst, (int)step, ippiSize(sz))) return; #endif (vBinOp, IF_SIMD(VNot)>(src1, step1, src2, step2, dst, step, sz)); @@ -2386,7 +2386,7 @@ static void cmp8u(const uchar* src1, size_t step1, const uchar* src2, size_t ste if( op >= 0 ) { fixSteps(size, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiCompare_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op)) + if (0 <= ippiCompare_8u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op)) return; } #endif @@ -2469,7 +2469,7 @@ static void cmp16u(const ushort* src1, size_t step1, const ushort* src2, size_t if( op >= 0 ) { fixSteps(size, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiCompare_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op)) + if (0 <= ippiCompare_16u_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op)) return; } #endif @@ -2484,7 +2484,7 @@ static void cmp16s(const short* src1, size_t step1, const short* src2, size_t st if( op > 0 ) { fixSteps(size, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiCompare_16s_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op)) + if (0 <= ippiCompare_16s_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op)) return; } #endif @@ -2590,7 +2590,7 @@ static void cmp32f(const float* src1, size_t step1, const float* src2, size_t st if( op >= 0 ) { fixSteps(size, sizeof(dst[0]), step1, step2, step); - if (0 <= ippiCompare_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, (IppiSize&)size, op)) + if (0 <= ippiCompare_32f_C1R(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(size), op)) return; } #endif diff --git a/modules/core/src/matmul.cpp b/modules/core/src/matmul.cpp index 4e0b70a..2373519 100644 --- a/modules/core/src/matmul.cpp +++ b/modules/core/src/matmul.cpp @@ -2227,7 +2227,7 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray 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) + (Ipp32f *)dst.data, (int)dst.step, sizeof(Ipp32f), (int)len, 1) >= 0) return; #endif func(src1.data, src2.data, dst.data, (int)len, palpha); diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 8986abd..c717459 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -2114,11 +2114,7 @@ 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 @@ -2550,11 +2546,7 @@ 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 diff --git a/modules/imgproc/src/accum.cpp b/modules/imgproc/src/accum.cpp index c431a65..216ddcb 100644 --- a/modules/imgproc/src/accum.cpp +++ b/modules/imgproc/src/accum.cpp @@ -487,10 +487,10 @@ void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _m int srcstep = (int)src.step, dststep = (int)dst.step, maskstep = (int)mask.step; if (src.isContinuous() && dst.isContinuous() && mask.isContinuous()) { - srcstep = src.total() * src.elemSize(); - dststep = dst.total() * dst.elemSize(); - maskstep = mask.total() * mask.elemSize(); - size.width = (int)src.total(); + srcstep = static_cast(src.total() * src.elemSize()); + dststep = static_cast(dst.total() * dst.elemSize()); + maskstep = static_cast(mask.total() * mask.elemSize()); + size.width = static_cast(src.total()); size.height = 1; } size.width *= scn; @@ -564,13 +564,13 @@ void cv::accumulateProduct( InputArray _src1, InputArray _src2, Size size = src1.size(); int src1step = (int)src1.step, src2step = (int)src2.step, dststep = (int)dst.step, maskstep = (int)mask.step; - if (src1.isContinuous() && src2.isContinuous() && dst.isContinuous() && mask.empty()) + if (src1.isContinuous() && src2.isContinuous() && dst.isContinuous() && mask.isContinuous()) { - src1step = src1.total() * src1.elemSize(); - src2step = src2.total() * src2.elemSize(); - dststep = dst.total() * dst.elemSize(); - maskstep = mask.total() * mask.elemSize(); - size.width = (int)src1.total(); + src1step = static_cast(src1.total() * src1.elemSize()); + src2step = static_cast(src2.total() * src2.elemSize()); + dststep = static_cast(dst.total() * dst.elemSize()); + maskstep = static_cast(mask.total() * mask.elemSize()); + size.width = static_cast(src1.total()); size.height = 1; } size.width *= scn; @@ -645,12 +645,12 @@ void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst, Size size = src.size(); int srcstep = (int)src.step, dststep = (int)dst.step, maskstep = (int)mask.step; - if (src.isContinuous() && dst.isContinuous() && mask.empty()) + if (src.isContinuous() && dst.isContinuous() && mask.isContinuous()) { - srcstep = src.total() * src.elemSize(); - dststep = dst.total() * dst.elemSize(); - maskstep = mask.total() * mask.elemSize(); - size.width = (int)src.total(); + srcstep = static_cast(src.total() * src.elemSize()); + dststep = static_cast(dst.total() * dst.elemSize()); + maskstep = static_cast(mask.total() * mask.elemSize()); + size.width = static_cast((int)src.total()); size.height = 1; } size.width *= scn; diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index d3443d1..bded528 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -3254,11 +3254,7 @@ 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)) ) diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index 8dec622..344601b 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -61,7 +61,7 @@ namespace cv typedef IppStatus (CV_STDCALL* ippiResizeGetSrcOffset)(void*, IppiPoint, IppiPoint*); #endif -#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) +#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) && 0 typedef IppStatus (CV_STDCALL* ippiSetFunc)(const void*, void *, int, IppiSize); typedef IppStatus (CV_STDCALL* ippiWarpPerspectiveFunc)(const void*, IppiSize, int, IppiRect, void *, int, IppiRect, double [3][3], int); typedef IppStatus (CV_STDCALL* ippiWarpAffineBackFunc)(const void*, IppiSize, int, IppiRect, void *, int, IppiRect, double [2][3], int); @@ -4015,7 +4015,7 @@ private: /* -#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81 +#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR >= 801 class IPPWarpAffineInvoker : public ParallelLoopBody { @@ -4215,7 +4215,7 @@ void cv::warpAffine( InputArray _src, OutputArray _dst, const int AB_SCALE = 1 << AB_BITS; /* -#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81 +#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR >= 801 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 ) && @@ -4381,53 +4381,52 @@ private: }; /* -#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81 +#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR >= 801 class IPPWarpPerspectiveInvoker : - public ParallelLoopBody + public ParallelLoopBody { public: - IPPWarpPerspectiveInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[3][3], int &_interpolation, - int &_borderType, const Scalar &_borderValue, ippiWarpPerspectiveFunc _func, bool *_ok) : - ParallelLoopBody(), src(_src), dst(_dst), mode(_interpolation), coeffs(_coeffs), - borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok) - { - *ok = true; - } - - virtual void operator() (const Range& range) const - { - IppiSize srcsize = {src.cols, src.rows}; - IppiRect srcroi = {0, 0, src.cols, src.rows}; - IppiRect dstroi = {0, range.start, dst.cols, range.end - range.start}; - int cnn = src.channels(); - - if( borderType == BORDER_CONSTANT ) - { - IppiSize setSize = {dst.cols, range.end - range.start}; - void *dataPointer = dst.data + dst.step[0] * range.start; - if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) ) - { - *ok = false; - return; - } - } - - IppStatus status = func(src.data, srcsize, (int)src.step[0], srcroi, dst.data, (int)dst.step[0], dstroi, coeffs, mode); - printf("%d\n", status); - if (status != ippStsNoErr) - *ok = false; - } + IPPWarpPerspectiveInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[3][3], int &_interpolation, + int &_borderType, const Scalar &_borderValue, ippiWarpPerspectiveFunc _func, bool *_ok) : + ParallelLoopBody(), src(_src), dst(_dst), mode(_interpolation), coeffs(_coeffs), + borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok) + { + *ok = true; + } + + virtual void operator() (const Range& range) const + { + IppiSize srcsize = {src.cols, src.rows}; + IppiRect srcroi = {0, 0, src.cols, src.rows}; + IppiRect dstroi = {0, range.start, dst.cols, range.end - range.start}; + int cnn = src.channels(); + + if( borderType == BORDER_CONSTANT ) + { + IppiSize setSize = {dst.cols, range.end - range.start}; + void *dataPointer = dst.data + dst.step[0] * range.start; + if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) ) + { + *ok = false; + return; + } + } + + IppStatus status = func(src.data, srcsize, (int)src.step[0], srcroi, dst.data, (int)dst.step[0], dstroi, coeffs, mode); + if (status != ippStsNoErr) + *ok = false; + } private: - Mat &src; - Mat &dst; - int mode; - double (&coeffs)[3][3]; - int borderType; - const Scalar borderValue; - ippiWarpPerspectiveFunc func; - bool *ok; - - const IPPWarpPerspectiveInvoker& operator= (const IPPWarpPerspectiveInvoker&); + Mat &src; + Mat &dst; + int mode; + double (&coeffs)[3][3]; + int borderType; + const Scalar borderValue; + ippiWarpPerspectiveFunc func; + bool *ok; + + const IPPWarpPerspectiveInvoker& operator= (const IPPWarpPerspectiveInvoker&); }; #endif */ @@ -4464,7 +4463,7 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0, #endif /* -#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 10 + IPP_VERSION_MINOR >= 81 +#if defined (HAVE_IPP) && IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR >= 801 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) && diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index e3aa19a..07aa4c5 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -1136,11 +1136,7 @@ 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) {