Commit 11b01cd8 authored by Ilya Lavrenov's avatar Ilya Lavrenov

added ipp threshold inplace

parent 72e095b8
...@@ -70,24 +70,38 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) ...@@ -70,24 +70,38 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
#if defined(HAVE_IPP) #if defined(HAVE_IPP)
IppiSize sz = { roi.width, roi.height }; IppiSize sz = { roi.width, roi.height };
CV_SUPPRESS_DEPRECATED_START
switch( type ) switch( type )
{ {
case THRESH_TRUNC: case THRESH_TRUNC:
if (0 <= ippiThreshold_GT_8u_C1R(_src.data, (int)src_step, _dst.data, (int)dst_step, sz, thresh)) #ifndef HAVE_IPP_ICV_ONLY
if (_src.data == _dst.data && ippiThreshold_GT_8u_C1IR(_src.data, (int)src_step, sz, thresh) >= 0)
return;
#endif
if (ippiThreshold_GT_8u_C1R(_src.data, (int)src_step, _dst.data, (int)dst_step, sz, thresh) >= 0)
return; return;
setIppErrorStatus(); setIppErrorStatus();
break; break;
case THRESH_TOZERO: case THRESH_TOZERO:
if (0 <= ippiThreshold_LTVal_8u_C1R(_src.data, (int)src_step, _dst.data, (int)dst_step, sz, thresh+1, 0)) #ifndef HAVE_IPP_ICV_ONLY
if (_src.data == _dst.data && ippiThreshold_LTVal_8u_C1IR(_src.data, (int)src_step, sz, thresh+1, 0) >= 0)
return;
#endif
if (ippiThreshold_LTVal_8u_C1R(_src.data, (int)src_step, _dst.data, (int)dst_step, sz, thresh+1, 0) >= 0)
return; return;
setIppErrorStatus(); setIppErrorStatus();
break; break;
case THRESH_TOZERO_INV: case THRESH_TOZERO_INV:
if (0 <= ippiThreshold_GTVal_8u_C1R(_src.data, (int)src_step, _dst.data, (int)dst_step, sz, thresh, 0)) #ifndef HAVE_IPP_ICV_ONLY
if (_src.data == _dst.data && ippiThreshold_GTVal_8u_C1IR(_src.data, (int)src_step, sz, thresh, 0) >= 0)
return;
#endif
if (ippiThreshold_GTVal_8u_C1R(_src.data, (int)src_step, _dst.data, (int)dst_step, sz, thresh, 0) >= 0)
return; return;
setIppErrorStatus(); setIppErrorStatus();
break; break;
} }
CV_SUPPRESS_DEPRECATED_END
#endif #endif
switch( type ) switch( type )
...@@ -311,24 +325,38 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) ...@@ -311,24 +325,38 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
#if defined(HAVE_IPP) #if defined(HAVE_IPP)
IppiSize sz = { roi.width, roi.height }; IppiSize sz = { roi.width, roi.height };
CV_SUPPRESS_DEPRECATED_START
switch( type ) switch( type )
{ {
case THRESH_TRUNC: case THRESH_TRUNC:
if (0 <= ippiThreshold_GT_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh)) #ifndef HAVE_IPP_ICV_ONLY
if (_src.data == _dst.data && ippiThreshold_GT_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0)
return;
#endif
if (ippiThreshold_GT_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0)
return; return;
setIppErrorStatus(); setIppErrorStatus();
break; break;
case THRESH_TOZERO: case THRESH_TOZERO:
if (0 <= ippiThreshold_LTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+1, 0)) #ifndef HAVE_IPP_ICV_ONLY
if (_src.data == _dst.data && ippiThreshold_LTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0)
return;
#endif
if (ippiThreshold_LTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+1, 0) >= 0)
return; return;
setIppErrorStatus(); setIppErrorStatus();
break; break;
case THRESH_TOZERO_INV: case THRESH_TOZERO_INV:
if (0 <= ippiThreshold_GTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0)) #ifndef HAVE_IPP_ICV_ONLY
if (_src.data == _dst.data && ippiThreshold_GTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0)
return;
#endif
if (ippiThreshold_GTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0)
return; return;
setIppErrorStatus(); setIppErrorStatus();
break; break;
} }
CV_SUPPRESS_DEPRECATED_END
#endif #endif
switch( type ) switch( type )
......
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