mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
fixed
This commit is contained in:
parent
16629bff4c
commit
507ea95265
@ -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, 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;
|
||||
|
||||
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);
|
||||
}
|
@ -2960,7 +2960,7 @@ template <typename Dct>
|
||||
bool DctIPPLoop(const Mat& src, Mat& dst, const Dct& ippidct, bool inv)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user