From: Pavel Vlasov Date: Wed, 24 Jun 2015 11:55:45 +0000 (+0300) Subject: Accidentally removed tegra checks were returned; X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~2398^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e02195b3dc38727bbb4e4dc96b7b055382667d7d;p=platform%2Fupstream%2Fopencv.git Accidentally removed tegra checks were returned; --- diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index 6f53a12..5d4a943 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -7323,17 +7323,13 @@ static bool ocl_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) #endif -}//namespace cv - #ifdef HAVE_IPP -namespace cv -{ -static bool ipp_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) +static bool ipp_cvtColor( Mat &src, OutputArray _dst, int code, int dcn ) { - int stype = _src.type(); + int stype = src.type(); int scn = CV_MAT_CN(stype), depth = CV_MAT_DEPTH(stype); - Mat src = _src.getMat(), dst; + Mat dst; Size sz = src.size(); switch( code ) @@ -7916,8 +7912,8 @@ static bool ipp_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) return false; } } -} #endif +} ////////////////////////////////////////////////////////////////////////////////////////// // The main function // @@ -7933,8 +7929,9 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) Mat src = _src.getMat(), dst; Size sz = src.size(); + CV_Assert( depth == CV_8U || depth == CV_16U || depth == CV_32F ); - CV_IPP_RUN(true, ipp_cvtColor(_src, _dst, code, dcn)); + CV_IPP_RUN(true, ipp_cvtColor(src, _dst, code, dcn)); switch( code ) { @@ -7947,13 +7944,13 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create( sz, CV_MAKETYPE(depth, dcn)); dst = _dst.getMat(); - if( depth == CV_8U ) { #ifdef HAVE_TEGRA_OPTIMIZATION - if(!tegra::cvtBGR2RGB(src, dst, bidx)) + if(tegra::useTegra() && tegra::cvtBGR2RGB(src, dst, bidx)) + break; #endif - CvtColorLoop(src, dst, RGB2RGB(scn, dcn, bidx)); + CvtColorLoop(src, dst, RGB2RGB(scn, dcn, bidx)); } else if( depth == CV_16U ) CvtColorLoop(src, dst, RGB2RGB(scn, dcn, bidx)); @@ -7967,10 +7964,9 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_8UC2); dst = _dst.getMat(); - #ifdef HAVE_TEGRA_OPTIMIZATION if(code == CV_BGR2BGR565 || code == CV_BGRA2BGR565 || code == CV_RGB2BGR565 || code == CV_RGBA2BGR565) - if(tegra::cvtRGB2RGB565(src, dst, code == CV_RGB2BGR565 || code == CV_RGBA2BGR565 ? 0 : 2)) + if(tegra::useTegra() && tegra::cvtRGB2RGB565(src, dst, code == CV_RGB2BGR565 || code == CV_RGBA2BGR565 ? 0 : 2)) break; #endif @@ -8002,13 +7998,13 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, 1)); dst = _dst.getMat(); - bidx = code == CV_BGR2GRAY || code == CV_BGRA2GRAY ? 0 : 2; if( depth == CV_8U ) { #ifdef HAVE_TEGRA_OPTIMIZATION - if(!tegra::cvtRGB2Gray(src, dst, bidx)) + if(tegra::useTegra() && tegra::cvtRGB2Gray(src, dst, bidx)) + break; #endif CvtColorLoop(src, dst, RGB2Gray(scn, bidx, 0)); } @@ -8032,11 +8028,11 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, dcn)); dst = _dst.getMat(); - if( depth == CV_8U ) { #ifdef HAVE_TEGRA_OPTIMIZATION - if(!tegra::cvtGray2RGB(src, dst)) + if(tegra::useTegra() && tegra::cvtGray2RGB(src, dst)) + break; #endif CvtColorLoop(src, dst, Gray2RGB(dcn)); } @@ -8070,7 +8066,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) if( depth == CV_8U ) { #ifdef HAVE_TEGRA_OPTIMIZATION - if((code == CV_RGB2YCrCb || code == CV_BGR2YCrCb) && tegra::cvtRGB2YCrCb(src, dst, bidx)) + if((code == CV_RGB2YCrCb || code == CV_BGR2YCrCb) && tegra::useTegra() && tegra::cvtRGB2YCrCb(src, dst, bidx)) break; #endif CvtColorLoop(src, dst, RGB2YCrCb_i(scn, bidx, coeffs_i)); @@ -8096,7 +8092,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, dcn)); dst = _dst.getMat(); - if( depth == CV_8U ) CvtColorLoop(src, dst, YCrCb2RGB_i(dcn, bidx, coeffs_i)); else if( depth == CV_16U ) @@ -8149,12 +8144,11 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, 3)); dst = _dst.getMat(); - if( code == CV_BGR2HSV || code == CV_RGB2HSV || code == CV_BGR2HSV_FULL || code == CV_RGB2HSV_FULL ) { #ifdef HAVE_TEGRA_OPTIMIZATION - if(tegra::cvtRGB2HSV(src, dst, bidx, hrange)) + if(tegra::useTegra() && tegra::cvtRGB2HSV(src, dst, bidx, hrange)) break; #endif if( depth == CV_8U ) @@ -8185,7 +8179,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, dcn)); dst = _dst.getMat(); - if( code == CV_HSV2BGR || code == CV_HSV2RGB || code == CV_HSV2BGR_FULL || code == CV_HSV2RGB_FULL ) { @@ -8216,7 +8209,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, 3)); dst = _dst.getMat(); - if( code == CV_BGR2Lab || code == CV_RGB2Lab || code == CV_LBGR2Lab || code == CV_LRGB2Lab ) { @@ -8248,7 +8240,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_MAKETYPE(depth, dcn)); dst = _dst.getMat(); - if( code == CV_Lab2BGR || code == CV_Lab2RGB || code == CV_Lab2LBGR || code == CV_Lab2LRGB ) {