Commit 8e7eb79f authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed compile errors and warnings when building master branch with IPP enabled

parent c0c575d6
...@@ -1616,8 +1616,10 @@ double cv::norm( InputArray _src, int normType, InputArray _mask ) ...@@ -1616,8 +1616,10 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src.total(); size_t total_size = src.total();
int rows = src.size[0], cols = (int)(total_size/rows); int rows = src.size[0], cols = (int)(total_size/rows);
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) if( (src.dims == 2 || (src.isContinuous() && mask.isContinuous()))
&& (normType == NORM_INF || normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR) ) && cols > 0 && (size_t)rows*cols == total_size
&& (normType == NORM_INF || normType == NORM_L1 ||
normType == NORM_L2 || normType == NORM_L2SQR) )
{ {
IppiSize sz = { cols, rows }; IppiSize sz = { cols, rows };
int type = src.type(); int type = src.type();
...@@ -1903,8 +1905,10 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m ...@@ -1903,8 +1905,10 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
((normType == NORM_HAMMING || normType == NORM_HAMMING2) && src1.type() == CV_8U) ); ((normType == NORM_HAMMING || normType == NORM_HAMMING2) && src1.type() == CV_8U) );
size_t total_size = src1.total(); size_t total_size = src1.total();
int rows = src1.size[0], cols = (int)(total_size/rows); int rows = src1.size[0], cols = (int)(total_size/rows);
if( src1.dims == 2 || (src1.isContinuous() && src2.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) if( (src1.dims == 2 || (src1.isContinuous() && src2.isContinuous() && mask.isContinuous()))
&& (normType == NORM_INF || normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR) ) && cols > 0 && (size_t)rows*cols == total_size
&& (normType == NORM_INF || normType == NORM_L1 ||
normType == NORM_L2 || normType == NORM_L2SQR) )
{ {
IppiSize sz = { cols, rows }; IppiSize sz = { cols, rows };
int type = src1.type(); int type = src1.type();
...@@ -1983,8 +1987,10 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m ...@@ -1983,8 +1987,10 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src1.total(); size_t total_size = src1.total();
int rows = src1.size[0], cols = (int)(total_size/rows); int rows = src1.size[0], cols = (int)(total_size/rows);
if( src1.dims == 2 || (src1.isContinuous() && src2.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) if( (src1.dims == 2 || (src1.isContinuous() && src2.isContinuous() && mask.isContinuous()))
&& (normType == NORM_INF || normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR) ) && cols > 0 && (size_t)rows*cols == total_size
&& (normType == NORM_INF || normType == NORM_L1 ||
normType == NORM_L2 || normType == NORM_L2SQR) )
{ {
IppiSize sz = { cols, rows }; IppiSize sz = { cols, rows };
int type = src1.type(); int type = src1.type();
......
...@@ -747,10 +747,10 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe ...@@ -747,10 +747,10 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
if( maskSize == CV_DIST_MASK_5 ) if( maskSize == CV_DIST_MASK_5 )
{ {
IppiSize roi = { src->cols, src->rows }; IppiSize roi = { src.cols, src.rows };
if( ippiDistanceTransform_5x5_8u32f_C1R( if( ippiDistanceTransform_5x5_8u32f_C1R(
src->data.ptr, src->step, src.ptr<uchar>(), (int)src.step,
dst->data.fl, dst->step, roi, _mask) >= 0 ) dst.ptr<float>(), (int)dst.step, roi, _mask) >= 0 )
return; return;
} }
#endif #endif
......
...@@ -267,12 +267,6 @@ static void getRectSubPix_8u32f ...@@ -267,12 +267,6 @@ static void getRectSubPix_8u32f
} }
} }
typedef CvStatus (CV_STDCALL *CvIPPGetRectSubPixFunc)( const void* src, int src_step,
CvSize src_size, void* dst,
int dst_step, CvSize win_size,
CvPoint2D32f center,
CvPoint* minpt, CvPoint* maxpt );
static void static void
getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size, getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size,
float* dst, size_t dst_step, Size win_size, float* dst, size_t dst_step, Size win_size,
...@@ -367,6 +361,7 @@ getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size, ...@@ -367,6 +361,7 @@ getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size,
} }
void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center, void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
OutputArray _patch, int patchType ) OutputArray _patch, int patchType )
{ {
...@@ -380,15 +375,23 @@ void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center, ...@@ -380,15 +375,23 @@ void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
Mat patch = _patch.getMat(); Mat patch = _patch.getMat();
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
CvPoint minpt, maxpt; typedef IppStatus (CV_STDCALL *ippiGetRectSubPixFunc)( const void* src, int src_step,
int srctype = CV_MAT_TYPE(src->type), dsttype = CV_MAT_TYPE(dst->type); IppiSize src_size, void* dst,
CvIPPGetRectSubPixFunc ippfunc = int dst_step, IppiSize win_size,
srctype == CV_8UC1 && dsttype == CV_8UC1 ? (CvIPPGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R : IppiPoint_32f center,
srctype == CV_8UC1 && dsttype == CV_32FC1 ? (CvIPPGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R : IppiPoint* minpt, IppiPoint* maxpt );
srctype == CV_32FC1 && dsttype == CV_32FC1 ? (CvIPPGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0;
IppiPoint minpt={0,0}, maxpt={0,0};
if( ippfunc && ippfunc(src->data.ptr, src->step, src_size, dst->data.ptr, IppiPoint_32f icenter = {center.x, center.y};
dst->step, dst_size, center, &minpt, &maxpt) >= 0 ) IppiSize src_size={image.cols, image.rows}, win_size={patch.cols, patch.rows};
int srctype = image.type();
ippiGetRectSubPixFunc ippfunc =
srctype == CV_8UC1 && ddepth == CV_8U ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R :
srctype == CV_8UC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R :
srctype == CV_32FC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0;
if( ippfunc && ippfunc(image.data, (int)image.step, src_size, patch.data,
(int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0 )
return; return;
#endif #endif
......
...@@ -1564,7 +1564,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img, ...@@ -1564,7 +1564,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
int use_ipp = cascade->hid_cascade->ipp_stages != 0; int use_ipp = cascade->hid_cascade->ipp_stages != 0;
if( use_ipp ) if( use_ipp )
normImg = cvCreateMat( img->rows, img->cols, CV_32FC1 ); normImg.reset(cvCreateMat( img->rows, img->cols, CV_32FC1));
#endif #endif
imgSmall.reset(cvCreateMat( img->rows + 1, img->cols + 1, CV_8UC1 )); imgSmall.reset(cvCreateMat( img->rows + 1, img->cols + 1, CV_8UC1 ));
......
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