From c1277b614700683423d902d2ad8c8b909b8486cd Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 11 Oct 2011 15:00:00 +0000 Subject: [PATCH] reenabled Tegra optimized resize --- modules/imgproc/src/imgwarp.cpp | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index d4050cc..5dcdf66 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -1319,30 +1319,6 @@ typedef void (*ResizeAreaFunc)( const Mat& src, Mat& dst, void cv::resize( InputArray _src, OutputArray _dst, Size dsize, double inv_scale_x, double inv_scale_y, int interpolation ) { - -#ifdef HAVE_TEGRA_OPTIMIZATION__DISABLED - Mat src1 = _src.getMat(); - Size ssize1 = src1.size(); - - int wSrc = ssize1.width; - int hSrc = ssize1.height; - if (hSrc < 1) - return; - int wDst = dsize.width; - int hDst = dsize.height; - _dst.create(dsize, src1.type()); - Mat dst1 = _dst.getMat(); - unsigned int *bSrc = (unsigned int*)(src1.data); - unsigned int *bDst = (unsigned int*)dst1.data; - if(src1.channels()==1){ - tegra::stretch1(bSrc, bDst, wSrc, hSrc, wDst, hDst); - return; - } - if(src1.channels()==4){ - tegra::stretch4(bSrc, bDst, wSrc, hSrc, wDst, hDst); - return; - } -#endif static ResizeFunc linear_tab[] = { resizeGeneric_< @@ -1463,6 +1439,12 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize, _dst.create(dsize, src.type()); Mat dst = _dst.getMat(); + +#ifdef HAVE_TEGRA_OPTIMIZATION + if (tegra::resize(src, dst, inv_scale_x, inv_scale_y, interpolation)) + return; +#endif + int depth = src.depth(), cn = src.channels(); double scale_x = 1./inv_scale_x, scale_y = 1./inv_scale_y; int k, sx, sy, dx, dy; -- 2.7.4