Commit 507ea952 authored by Elena Gvozdeva's avatar Elena Gvozdeva

fixed

parent 16629bff
...@@ -30,19 +30,20 @@ PERF_TEST_P(Size_MatType_FlagsType, dft, TEST_MATS_DFT) ...@@ -30,19 +30,20 @@ PERF_TEST_P(Size_MatType_FlagsType, dft, TEST_MATS_DFT)
TEST_CYCLE() dft(src, dst, flags); TEST_CYCLE() dft(src, dst, flags);
SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE); SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE);
}
///////////////////////////////////////////////////////dct////////////////////////////////////////////////////// ///////////////////////////////////////////////////////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, FlagsType> Size_MatType_Flag_t; typedef std::tr1::tuple<Size, MatType, DCT_FlagsType> Size_MatType_Flag_t;
typedef perf::TestBaseWithParam<Size_MatType_Flag_t> Size_MatType_Flag; typedef perf::TestBaseWithParam<Size_MatType_Flag_t> Size_MatType_Flag;
PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine( PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine(
testing::Values(cv::Size(320, 240),cv::Size(800, 600), testing::Values(cv::Size(320, 240),cv::Size(800, 600),
cv::Size(1024, 768), cv::Size(1280, 1024), cv::Size(1024, 768), cv::Size(1280, 1024),
sz1080p, sz2K), sz1080p, sz2K),
testing::Values(CV_32FC1, CV_64FC1), FlagsType::all())) testing::Values(CV_32FC1, CV_64FC1), DCT_FlagsType::all()))
{ {
Size sz = get<0>(GetParam()); Size sz = get<0>(GetParam());
int type = get<1>(GetParam()); int type = get<1>(GetParam());
...@@ -56,7 +57,7 @@ PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine( ...@@ -56,7 +57,7 @@ PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine(
.out(dst) .out(dst)
.time(60); .time(60);
TEST_CYCLE() dct(src, dst,flags); TEST_CYCLE() dct(src, dst, flags);
SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE); SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE);
} }
\ No newline at end of file
...@@ -2960,7 +2960,7 @@ template <typename Dct> ...@@ -2960,7 +2960,7 @@ template <typename Dct>
bool DctIPPLoop(const Mat& src, Mat& dst, const Dct& ippidct, bool inv) bool DctIPPLoop(const Mat& src, Mat& dst, const Dct& ippidct, bool inv)
{ {
bool ok; bool ok;
parallel_for_(Range(0, src.rows), DctIPPLoop_Invoker<Dct>(src, dst, ippidct, inv, &ok), src.total()/(double)(1<<16) ); parallel_for_(Range(0, src.rows), DctIPPLoop_Invoker<Dct>(src, dst, ippidct, inv, &ok), src.rows/(double)(1<<4) );
return ok; return ok;
} }
...@@ -2976,11 +2976,8 @@ private: ...@@ -2976,11 +2976,8 @@ private:
ippiDCTFunc func; 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 ; ippiDCTFunc ippFunc = inv ? (ippiDCTFunc)ippiDCTInv_32f_C1R : (ippiDCTFunc)ippiDCTFwd_32f_C1R ;
if (row) if (row)
...@@ -3066,9 +3063,9 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags ) ...@@ -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 #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) && !defined HAVE_IPP_ICV_ONLY
bool row = (flags & DCT_ROWS) != 0; 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; return;
setIppErrorStatus(); setIppErrorStatus();
} }
......
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