From 507ea95265686e17987abff0c1003320e9f854a3 Mon Sep 17 00:00:00 2001 From: Elena Gvozdeva Date: Fri, 25 Apr 2014 12:30:30 +0400 Subject: [PATCH] fixed --- modules/core/perf/perf_dft.cpp | 9 +++++---- modules/core/src/dxt.cpp | 11 ++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/core/perf/perf_dft.cpp b/modules/core/perf/perf_dft.cpp index f3e1d24e36..1a025affc3 100644 --- a/modules/core/perf/perf_dft.cpp +++ b/modules/core/perf/perf_dft.cpp @@ -30,19 +30,20 @@ PERF_TEST_P(Size_MatType_FlagsType, dft, TEST_MATS_DFT) TEST_CYCLE() dft(src, dst, flags); SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE); +} ///////////////////////////////////////////////////////dct////////////////////////////////////////////////////// -CV_ENUM(FlagsType, 0, DCT_INVERSE , DCT_ROWS, DCT_INVERSE|DCT_ROWS) +CV_ENUM(DCT_FlagsType, 0, DCT_INVERSE , DCT_ROWS, DCT_INVERSE|DCT_ROWS) -typedef std::tr1::tuple Size_MatType_Flag_t; +typedef std::tr1::tuple Size_MatType_Flag_t; typedef perf::TestBaseWithParam Size_MatType_Flag; PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine( testing::Values(cv::Size(320, 240),cv::Size(800, 600), cv::Size(1024, 768), cv::Size(1280, 1024), sz1080p, sz2K), - testing::Values(CV_32FC1, CV_64FC1), FlagsType::all())) + testing::Values(CV_32FC1, CV_64FC1), DCT_FlagsType::all())) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -56,7 +57,7 @@ PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine( .out(dst) .time(60); - TEST_CYCLE() dct(src, dst,flags); + TEST_CYCLE() dct(src, dst, flags); SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE); } \ No newline at end of file diff --git a/modules/core/src/dxt.cpp b/modules/core/src/dxt.cpp index a5976a3cc4..31c375c492 100644 --- a/modules/core/src/dxt.cpp +++ b/modules/core/src/dxt.cpp @@ -2960,7 +2960,7 @@ template bool DctIPPLoop(const Mat& src, Mat& dst, const Dct& ippidct, bool inv) { bool ok; - parallel_for_(Range(0, src.rows), DctIPPLoop_Invoker(src, dst, ippidct, inv, &ok), src.total()/(double)(1<<16) ); + parallel_for_(Range(0, src.rows), DctIPPLoop_Invoker(src, dst, ippidct, inv, &ok), src.rows/(double)(1<<4) ); return ok; } @@ -2976,11 +2976,8 @@ private: ippiDCTFunc func; }; -static bool ippi_DCT(const Mat& src, Mat& dst, bool inv, bool row) +static bool ippi_DCT_32f(const Mat& src, Mat& dst, bool inv, bool row) { - if (src.type() != CV_32F) - return false; - ippiDCTFunc ippFunc = inv ? (ippiDCTFunc)ippiDCTInv_32f_C1R : (ippiDCTFunc)ippiDCTFwd_32f_C1R ; if (row) @@ -3066,9 +3063,9 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags ) #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) && !defined HAVE_IPP_ICV_ONLY bool row = (flags & DCT_ROWS) != 0; - if(!row || src.rows>(int)(1<<8)) + if (src.type() == CV_32F) { - if(ippi_DCT(src,dst,inv, row)) + if(ippi_DCT_32f(src,dst,inv, row)) return; setIppErrorStatus(); }