From 38913bf5f6e1e160b9768893fef4e792d0edad47 Mon Sep 17 00:00:00 2001 From: vbystricky Date: Mon, 7 Apr 2014 10:51:22 +0400 Subject: [PATCH] Change all 'ippStsNoErr==' to '0<=', and all 'ippStsNoErr!=' to '0>' --- modules/core/src/mathfuncs.cpp | 8 +++---- modules/imgproc/src/deriv.cpp | 48 +++++++++++++++++++-------------------- modules/imgproc/src/morph.cpp | 16 ++++++------- modules/imgproc/src/smooth.cpp | 12 +++++----- modules/imgproc/src/sumpixels.cpp | 2 +- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index 30307aa..12ba4fa 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -1276,14 +1276,14 @@ static void Exp_64f( const double *_x, double *y, int n ) #ifdef HAVE_IPP static void Exp_32f_ipp(const float *x, float *y, int n) { - if (ippStsNoErr == ippsExp_32f_A21(x, y, n)) + if (0 <= ippsExp_32f_A21(x, y, n)) return; Exp_32f(x, y, n); } static void Exp_64f_ipp(const double *x, double *y, int n) { - if (ippStsNoErr == ippsExp_64f_A50(x, y, n)) + if (0 <= ippsExp_64f_A50(x, y, n)) return; Exp_64f(x, y, n); } @@ -1934,14 +1934,14 @@ static void Log_64f( const double *x, double *y, int n ) #ifdef HAVE_IPP static void Log_32f_ipp(const float *x, float *y, int n) { - if (ippStsNoErr == ippsLn_32f_A21(x, y, n)) + if (0 <= ippsLn_32f_A21(x, y, n)) return; Log_32f(x, y, n); } static void Log_64f_ipp(const double *x, double *y, int n) { - if (ippStsNoErr == ippsLn_64f_A50(x, y, n)) + if (0 <= ippsLn_64f_A50(x, y, n)) return; Log_64f(x, y, n); } diff --git a/modules/imgproc/src/deriv.cpp b/modules/imgproc/src/deriv.cpp index 887162e..0b19f22 100644 --- a/modules/imgproc/src/deriv.cpp +++ b/modules/imgproc/src/deriv.cpp @@ -212,18 +212,18 @@ static bool IPPDerivScharr(const Mat& src, Mat& dst, int ddepth, int dx, int dy, { if ((dx == 1) && (dy == 0)) { - if (ippStsNoErr != ippiFilterScharrVertGetBufferSize_8u16s_C1R(roi,&bufSize)) + if (0 > ippiFilterScharrVertGetBufferSize_8u16s_C1R(roi,&bufSize)) return false; buffer.allocate(bufSize); - return (ippStsNoErr == ippiFilterScharrVertBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, + return (0 <= ippiFilterScharrVertBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, (Ipp16s*)dst.data, (int)dst.step, roi, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)); } if ((dx == 0) && (dy == 1)) { - if (ippStsNoErr != ippiFilterScharrHorizGetBufferSize_8u16s_C1R(roi,&bufSize)) + if (0 > ippiFilterScharrHorizGetBufferSize_8u16s_C1R(roi,&bufSize)) return false; buffer.allocate(bufSize); - return (ippStsNoErr == ippiFilterScharrHorizBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, + return (0 <= ippiFilterScharrHorizBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, (Ipp16s*)dst.data, (int)dst.step, roi, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)); } return false; @@ -240,11 +240,11 @@ static bool IPPDerivScharr(const Mat& src, Mat& dst, int ddepth, int dx, int dy, { if ((dx == 1) && (dy == 0)) { - if (ippStsNoErr != ippiFilterScharrVertGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows),&bufSize)) + if (0 > ippiFilterScharrVertGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows),&bufSize)) return false; buffer.allocate(bufSize); - if (ippStsNoErr != ippiFilterScharrVertBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, + if (0 > ippiFilterScharrVertBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, (Ipp32f*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) { @@ -259,11 +259,11 @@ static bool IPPDerivScharr(const Mat& src, Mat& dst, int ddepth, int dx, int dy, } if ((dx == 0) && (dy == 1)) { - if (ippStsNoErr != ippiFilterScharrHorizGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows),&bufSize)) + if (0 > ippiFilterScharrHorizGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows),&bufSize)) return false; buffer.allocate(bufSize); - if (ippStsNoErr != ippiFilterScharrHorizBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, + if (0 > ippiFilterScharrHorizBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, (Ipp32f*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; @@ -296,44 +296,44 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k { if ((dx == 1) && (dy == 0)) { - if (ippStsNoErr != ippiFilterSobelNegVertGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelNegVertGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - return (ippStsNoErr == ippiFilterSobelNegVertBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, + return (0 <= ippiFilterSobelNegVertBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, (Ipp16s*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)); } if ((dx == 0) && (dy == 1)) { - if (ippStsNoErr != ippiFilterSobelHorizGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelHorizGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - return (ippStsNoErr == ippiFilterSobelHorizBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, + return (0 <= ippiFilterSobelHorizBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, (Ipp16s*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)); } if ((dx == 2) && (dy == 0)) { - if (ippStsNoErr != ippiFilterSobelVertSecondGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelVertSecondGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - return (ippStsNoErr == ippiFilterSobelVertSecondBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, + return (0 <= ippiFilterSobelVertSecondBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, (Ipp16s*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)); } if ((dx == 0) && (dy == 2)) { - if (ippStsNoErr != ippiFilterSobelHorizSecondGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelHorizSecondGetBufferSize_8u16s_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - return (ippStsNoErr == ippiFilterSobelHorizSecondBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, + return (0 <= ippiFilterSobelHorizSecondBorder_8u16s_C1R((const Ipp8u*)src.data, (int)src.step, (Ipp16s*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)); } @@ -343,11 +343,11 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k { if ((dx == 1) && (dy == 0)) { - if (ippStsNoErr != ippiFilterSobelNegVertGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), &bufSize)) + if (0 > ippiFilterSobelNegVertGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), &bufSize)) return false; buffer.allocate(bufSize); - if (ippStsNoErr != ippiFilterSobelNegVertBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, + if (0 > ippiFilterSobelNegVertBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, (Ipp32f*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) { @@ -360,11 +360,11 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k if ((dx == 0) && (dy == 1)) { - if (ippStsNoErr != ippiFilterSobelHorizGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelHorizGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - if (ippStsNoErr != ippiFilterSobelHorizBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, + if (0 > ippiFilterSobelHorizBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, (Ipp32f*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) { @@ -377,11 +377,11 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k if((dx == 2) && (dy == 0)) { - if (ippStsNoErr != ippiFilterSobelVertSecondGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelVertSecondGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - if (ippStsNoErr != ippiFilterSobelVertSecondBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, + if (0 > ippiFilterSobelVertSecondBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, (Ipp32f*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) { @@ -394,11 +394,11 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k if((dx == 0) && (dy == 2)) { - if (ippStsNoErr != ippiFilterSobelHorizSecondGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) + if (0 > ippiFilterSobelHorizSecondGetBufferSize_32f_C1R(ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize),&bufSize)) return false; buffer.allocate(bufSize); - if (ippStsNoErr != ippiFilterSobelHorizSecondBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, + if (0 > ippiFilterSobelHorizSecondBorder_32f_C1R((const Ipp32f*)src.data, (int)src.step, (Ipp32f*)dst.data, (int)dst.step, ippiSize(src.cols, src.rows), (IppiMaskSize)(ksize*10+ksize), ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) { diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 7c6d08c..b343354 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -1161,11 +1161,11 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne case cvtype: \ {\ int specSize = 0, bufferSize = 0;\ - if (ippStsNoErr != ippiMorphologyBorderGetSize_##flavor(roiSize.width, kernelSize, &specSize, &bufferSize))\ + if (0 > ippiMorphologyBorderGetSize_##flavor(roiSize.width, kernelSize, &specSize, &bufferSize))\ return false;\ IppiMorphState *pSpec = (IppiMorphState*)ippMalloc(specSize);\ Ipp8u *pBuffer = (Ipp8u*)ippMalloc(bufferSize);\ - if (ippStsNoErr != ippiMorphologyBorderInit_##flavor(roiSize.width, kernel.data, kernelSize, pSpec, pBuffer))\ + if (0 > ippiMorphologyBorderInit_##flavor(roiSize.width, kernel.data, kernelSize, pSpec, pBuffer))\ {\ ippFree(pBuffer);\ ippFree(pSpec);\ @@ -1173,10 +1173,10 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne }\ bool ok = false;\ if (op == MORPH_ERODE)\ - ok = (ippStsNoErr == ippiErodeBorder_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0],\ + ok = (0 <= ippiErodeBorder_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0],\ roiSize, ippBorderRepl, 0, pSpec, pBuffer));\ else\ - ok = (ippStsNoErr == ippiDilateBorder_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0],\ + ok = (0 <= ippiDilateBorder_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0],\ roiSize, ippBorderRepl, 0, pSpec, pBuffer));\ ippFree(pBuffer);\ ippFree(pSpec);\ @@ -1192,7 +1192,7 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne {\ int specSize = 0;\ int bufferSize = 0;\ - if (ippStsNoErr != ippiMorphologyGetSize_##flavor( roiSize.width, kernel.data kernelSize, &specSize))\ + if (0 > ippiMorphologyGetSize_##flavor( roiSize.width, kernel.data kernelSize, &specSize))\ return false;\ bool ok = false;\ IppiMorphState* pState = (IppiMorphState*)ippMalloc(specSize);\ @@ -1234,13 +1234,13 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne case cvtype: \ {\ int bufSize = 0;\ - if (ippStsNoErr != ippiFilterMinGetBufferSize_##flavor(src.cols, kernelSize, &bufSize))\ + if (0 > ippiFilterMinGetBufferSize_##flavor(src.cols, kernelSize, &bufSize))\ return false;\ AutoBuffer buf(bufSize + 64);\ uchar* buffer = alignPtr((uchar*)buf, 32);\ if (op == MORPH_ERODE)\ - return (ippStsNoErr == ippiFilterMinBorderReplicate_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0], roiSize, kernelSize, point, buffer));\ - return (ippStsNoErr == ippiFilterMaxBorderReplicate_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0], roiSize, kernelSize, point, buffer));\ + return (0 <= ippiFilterMinBorderReplicate_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0], roiSize, kernelSize, point, buffer));\ + return (0 <= ippiFilterMaxBorderReplicate_##flavor((Ipp##data_type *)_src->data, (int)_src->step[0], (Ipp##data_type *)dst.data, (int)dst.step[0], roiSize, kernelSize, point, buffer));\ }\ break; diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index 85978c9..7499e24 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -1115,18 +1115,18 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, Mat src = _src.getMat(), dst = _dst.getMat(); IppiSize roi = { src.cols, src.rows }; int specSize = 0, bufferSize = 0; - if (ippStsNoErr == ippiFilterGaussianGetBufferSize(roi, (Ipp32u)ksize.width, ipp32f, 1, &specSize, &bufferSize)) + if (0 <= ippiFilterGaussianGetBufferSize(roi, (Ipp32u)ksize.width, ipp32f, 1, &specSize, &bufferSize)) { IppFilterGaussianSpec *pSpec = (IppFilterGaussianSpec*)ippMalloc(specSize); Ipp8u *pBuffer = (Ipp8u*)ippMalloc(bufferSize); - if (ippStsNoErr == ippiFilterGaussianInit(roi, (Ipp32u)ksize.width, (Ipp32f)sigma1, (IppiBorderType)borderType, ipp32f, 1, pSpec, pBuffer)) + if (0 <= ippiFilterGaussianInit(roi, (Ipp32u)ksize.width, (Ipp32f)sigma1, (IppiBorderType)borderType, ipp32f, 1, pSpec, pBuffer)) { IppStatus sts = ippiFilterGaussianBorder_32f_C1R( (const Ipp32f *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roi, 0.0, pSpec, pBuffer); ippFree(pBuffer); ippFree(pSpec); - if (ippStsNoErr == sts) + if (0 <= sts) return; } } @@ -2187,19 +2187,19 @@ public: IppiSize kernel = {d, d}; IppiSize roi={dst.cols, range.end - range.start}; int bufsize=0; - if (ippStsNoErr != ippiFilterBilateralGetBufSize_8u_C1R( ippiFilterBilateralGauss, roi, kernel, &bufsize)) + if (0 > ippiFilterBilateralGetBufSize_8u_C1R( ippiFilterBilateralGauss, roi, kernel, &bufsize)) { *ok = false; return; } AutoBuffer buf(bufsize); IppiFilterBilateralSpec *pSpec = (IppiFilterBilateralSpec *)alignPtr(&buf[0], 32); - if (ippStsNoErr != ippiFilterBilateralInit_8u_C1R( ippiFilterBilateralGauss, kernel, (Ipp32f)sigma_color, (Ipp32f)sigma_space, 1, pSpec )) + if (0 > ippiFilterBilateralInit_8u_C1R( ippiFilterBilateralGauss, kernel, (Ipp32f)sigma_color, (Ipp32f)sigma_space, 1, pSpec )) { *ok = false; return; } - if (ippStsNoErr != ippiFilterBilateral_8u_C1R( src.ptr(range.start) + radius * ((int)src.step[0] + 1), (int)src.step[0], dst.ptr(range.start), (int)dst.step[0], roi, kernel, pSpec )) + if (0 > ippiFilterBilateral_8u_C1R( src.ptr(range.start) + radius * ((int)src.step[0] + 1), (int)src.step[0], dst.ptr(range.start), (int)dst.step[0], roi, kernel, pSpec )) *ok = false; } private: diff --git a/modules/imgproc/src/sumpixels.cpp b/modules/imgproc/src/sumpixels.cpp index 649eeb6..c32813f 100644 --- a/modules/imgproc/src/sumpixels.cpp +++ b/modules/imgproc/src/sumpixels.cpp @@ -389,7 +389,7 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output status = ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, srcRoiSize, 0 ); } } - if (ippStsNoErr == status) + if (0 <= status) return; } #endif -- 2.7.4