From: Alexander Kapustin Date: Fri, 8 Jun 2012 08:49:59 +0000 (+0000) Subject: New Tegra Optimized thresh_16s and thresh_32f functions were added X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~4784 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=018d85dddb64a682e699ecfa5fe871f46a5693fa;p=platform%2Fupstream%2Fopencv.git New Tegra Optimized thresh_16s and thresh_32f functions were added --- diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 8b7ce8e..7f3b705 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -63,19 +63,34 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) switch( type ) { case THRESH_BINARY: - if(tegra::thresh_8u_binary(_src, _dst, roi.width, roi.height, thresh, maxval)) return; - break; + if(tegra::thresh_8u_binary(_src, _dst, roi.width, roi.height, thresh, maxval)) + { + return; + } + break; case THRESH_BINARY_INV: - if(tegra::thresh_8u_binary_inv(_src, _dst, roi.width, roi.height, thresh, maxval)) return; + if(tegra::thresh_8u_binary_inv(_src, _dst, roi.width, roi.height, thresh, maxval)) + { + return; + } break; case THRESH_TRUNC: - if(tegra::thresh_8u_trunc(_src, _dst, roi.width, roi.height, thresh)) return; - break; + if(tegra::thresh_8u_trunc(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; case THRESH_TOZERO: - if(tegra::thresh_8u_tozero(_src, _dst, roi.width, roi.height, thresh)) return; + if(tegra::thresh_8u_tozero(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } break; case THRESH_TOZERO_INV: - if(tegra::thresh_8u_tozero_inv(_src, _dst, roi.width, roi.height, thresh)) return; + if(tegra::thresh_8u_tozero_inv(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } break; } #endif @@ -292,7 +307,41 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) roi.width *= roi.height; roi.height = 1; } - +#ifdef HAVE_TEGRA_OPTIMIZATION + switch( type ) + { + case THRESH_BINARY: + if(tegra::thresh_16s_binary(_src, _dst, roi.width, roi.height, thresh, maxval)) + { + return; + } + break; + case THRESH_BINARY_INV: + if(tegra::thresh_16s_binary_inv(_src, _dst, roi.width, roi.height, thresh, maxval)) + { + return; + } + break; + case THRESH_TRUNC: + if(tegra::thresh_16s_trunc(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; + case THRESH_TOZERO: + if(tegra::thresh_16s_tozero(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; + case THRESH_TOZERO_INV: + if(tegra::thresh_16s_tozero_inv(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; + } +#endif switch( type ) { case THRESH_BINARY: @@ -460,6 +509,41 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) roi.height = 1; } +#ifdef HAVE_TEGRA_OPTIMIZATION + switch( type ) + { + case THRESH_BINARY: + if(tegra::thresh_32f_binary(_src, _dst, roi.width, roi.height, thresh, maxval)) + { + return; + } + break; + case THRESH_BINARY_INV: + if(tegra::thresh_32f_binary_inv(_src, _dst, roi.width, roi.height, thresh, maxval)) + { + return; + } + break; + case THRESH_TRUNC: + if(tegra::thresh_32f_trunc(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; + case THRESH_TOZERO: + if(tegra::thresh_32f_tozero(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; + case THRESH_TOZERO_INV: + if(tegra::thresh_32f_tozero_inv(_src, _dst, roi.width, roi.height, thresh)) + { + return; + } + break; + } +#endif switch( type ) { case THRESH_BINARY: