Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
849228ac
Commit
849228ac
authored
May 07, 2014
by
Alexander Alekhin
Committed by
OpenCV Buildbot
May 07, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2684 from ElenaGvozdeva:ippiDFT
parents
9e47672b
e362c3fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
42 deletions
+61
-42
perf_dft.cpp
modules/core/perf/perf_dft.cpp
+11
-5
dxt.cpp
modules/core/src/dxt.cpp
+50
-37
No files found.
modules/core/perf/perf_dft.cpp
View file @
849228ac
...
...
@@ -11,23 +11,29 @@ using std::tr1::get;
#define MAT_TYPES_DFT CV_32FC1, CV_32FC2, CV_64FC1
#define MAT_SIZES_DFT cv::Size(320, 480), cv::Size(800, 600), cv::Size(1280, 1024), sz1080p, sz2K
CV_ENUM
(
FlagsType
,
0
,
DFT_INVERSE
,
DFT_SCALE
,
DFT_COMPLEX_OUTPUT
,
DFT_ROWS
,
DFT_INVERSE
|
DFT_COMPLEX_OUTPUT
)
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_DFT), FlagsType::all())
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_DFT), FlagsType::all()
, testing::Values(true, false)
)
typedef
std
::
tr1
::
tuple
<
Size
,
MatType
,
FlagsType
>
Size_MatType_FlagsType
_t
;
typedef
perf
::
TestBaseWithParam
<
Size_MatType_FlagsType_
t
>
Size_MatType_FlagsType
;
typedef
std
::
tr1
::
tuple
<
Size
,
MatType
,
FlagsType
,
bool
>
Size_MatType_FlagsType_NzeroRows
_t
;
typedef
perf
::
TestBaseWithParam
<
Size_MatType_FlagsType_
NzeroRows_t
>
Size_MatType_FlagsType_NzeroRows
;
PERF_TEST_P
(
Size_MatType_FlagsType
,
dft
,
TEST_MATS_DFT
)
PERF_TEST_P
(
Size_MatType_FlagsType
_NzeroRows
,
dft
,
TEST_MATS_DFT
)
{
Size
sz
=
get
<
0
>
(
GetParam
());
int
type
=
get
<
1
>
(
GetParam
());
int
flags
=
get
<
2
>
(
GetParam
());
bool
isNzeroRows
=
get
<
3
>
(
GetParam
());
int
nonzero_rows
=
0
;
Mat
src
(
sz
,
type
);
Mat
dst
(
sz
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
time
(
60
);
TEST_CYCLE
()
dft
(
src
,
dst
,
flags
);
if
(
isNzeroRows
)
nonzero_rows
=
sz
.
height
/
2
;
TEST_CYCLE
()
dft
(
src
,
dst
,
flags
,
nonzero_rows
);
SANITY_CHECK
(
dst
,
1e-5
,
ERROR_RELATIVE
);
}
...
...
modules/core/src/dxt.cpp
View file @
849228ac
...
...
@@ -466,56 +466,56 @@ template<> struct DFT_VecR4<float>
#endif
#ifdef USE_IPP_DFT
static
void
ippsDFTFwd_CToC
(
const
Complex
<
float
>*
src
,
Complex
<
float
>*
dst
,
static
IppStatus
ippsDFTFwd_CToC
(
const
Complex
<
float
>*
src
,
Complex
<
float
>*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTFwd_CToC_32fc
(
(
const
Ipp32fc
*
)
src
,
(
Ipp32fc
*
)
dst
,
(
const
IppsDFTSpec_C_32fc
*
)
spec
,
buf
);
return
ippsDFTFwd_CToC_32fc
(
(
const
Ipp32fc
*
)
src
,
(
Ipp32fc
*
)
dst
,
(
const
IppsDFTSpec_C_32fc
*
)
spec
,
buf
);
}
static
void
ippsDFTFwd_CToC
(
const
Complex
<
double
>*
src
,
Complex
<
double
>*
dst
,
static
IppStatus
ippsDFTFwd_CToC
(
const
Complex
<
double
>*
src
,
Complex
<
double
>*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTFwd_CToC_64fc
(
(
const
Ipp64fc
*
)
src
,
(
Ipp64fc
*
)
dst
,
(
const
IppsDFTSpec_C_64fc
*
)
spec
,
buf
);
return
ippsDFTFwd_CToC_64fc
(
(
const
Ipp64fc
*
)
src
,
(
Ipp64fc
*
)
dst
,
(
const
IppsDFTSpec_C_64fc
*
)
spec
,
buf
);
}
static
void
ippsDFTInv_CToC
(
const
Complex
<
float
>*
src
,
Complex
<
float
>*
dst
,
static
IppStatus
ippsDFTInv_CToC
(
const
Complex
<
float
>*
src
,
Complex
<
float
>*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTInv_CToC_32fc
(
(
const
Ipp32fc
*
)
src
,
(
Ipp32fc
*
)
dst
,
(
const
IppsDFTSpec_C_32fc
*
)
spec
,
buf
);
return
ippsDFTInv_CToC_32fc
(
(
const
Ipp32fc
*
)
src
,
(
Ipp32fc
*
)
dst
,
(
const
IppsDFTSpec_C_32fc
*
)
spec
,
buf
);
}
static
void
ippsDFTInv_CToC
(
const
Complex
<
double
>*
src
,
Complex
<
double
>*
dst
,
const
void
*
spec
,
uchar
*
buf
)
static
IppStatus
ippsDFTInv_CToC
(
const
Complex
<
double
>*
src
,
Complex
<
double
>*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTInv_CToC_64fc
(
(
const
Ipp64fc
*
)
src
,
(
Ipp64fc
*
)
dst
,
(
const
IppsDFTSpec_C_64fc
*
)
spec
,
buf
);
return
ippsDFTInv_CToC_64fc
(
(
const
Ipp64fc
*
)
src
,
(
Ipp64fc
*
)
dst
,
(
const
IppsDFTSpec_C_64fc
*
)
spec
,
buf
);
}
static
void
ippsDFTFwd_RToPack
(
const
float
*
src
,
float
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
static
IppStatus
ippsDFTFwd_RToPack
(
const
float
*
src
,
float
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTFwd_RToPack_32f
(
src
,
dst
,
(
const
IppsDFTSpec_R_32f
*
)
spec
,
buf
);
return
ippsDFTFwd_RToPack_32f
(
src
,
dst
,
(
const
IppsDFTSpec_R_32f
*
)
spec
,
buf
);
}
static
void
ippsDFTFwd_RToPack
(
const
double
*
src
,
double
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
static
IppStatus
ippsDFTFwd_RToPack
(
const
double
*
src
,
double
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTFwd_RToPack_64f
(
src
,
dst
,
(
const
IppsDFTSpec_R_64f
*
)
spec
,
buf
);
return
ippsDFTFwd_RToPack_64f
(
src
,
dst
,
(
const
IppsDFTSpec_R_64f
*
)
spec
,
buf
);
}
static
void
ippsDFTInv_PackToR
(
const
float
*
src
,
float
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
static
IppStatus
ippsDFTInv_PackToR
(
const
float
*
src
,
float
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTInv_PackToR_32f
(
src
,
dst
,
(
const
IppsDFTSpec_R_32f
*
)
spec
,
buf
);
return
ippsDFTInv_PackToR_32f
(
src
,
dst
,
(
const
IppsDFTSpec_R_32f
*
)
spec
,
buf
);
}
static
void
ippsDFTInv_PackToR
(
const
double
*
src
,
double
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
static
IppStatus
ippsDFTInv_PackToR
(
const
double
*
src
,
double
*
dst
,
const
void
*
spec
,
uchar
*
buf
)
{
ippsDFTInv_PackToR_64f
(
src
,
dst
,
(
const
IppsDFTSpec_R_64f
*
)
spec
,
buf
);
return
ippsDFTInv_PackToR_64f
(
src
,
dst
,
(
const
IppsDFTSpec_R_64f
*
)
spec
,
buf
);
}
#endif
...
...
@@ -551,10 +551,16 @@ DFT( const Complex<T>* src, Complex<T>* dst, int n,
if
(
spec
)
{
if
(
!
inv
)
ippsDFTFwd_CToC
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
);
{
if
(
ippsDFTFwd_CToC
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
)
>=
0
)
return
;
}
else
ippsDFTInv_CToC
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
);
return
;
{
if
(
ippsDFTInv_CToC
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
)
>=
0
)
return
;
}
setIppErrorStatus
();
}
#endif
...
...
@@ -981,15 +987,18 @@ RealDFT( const T* src, T* dst, int n, int nf, int* factors, const int* itab,
#ifdef USE_IPP_DFT
if
(
spec
)
{
ippsDFTFwd_RToPack
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
);
if
(
complex_output
)
if
(
ippsDFTFwd_RToPack
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
)
>=
0
)
{
dst
[
-
1
]
=
dst
[
0
];
dst
[
0
]
=
0
;
if
(
(
n
&
1
)
==
0
)
dst
[
n
]
=
0
;
if
(
complex_output
)
{
dst
[
-
1
]
=
dst
[
0
];
dst
[
0
]
=
0
;
if
(
(
n
&
1
)
==
0
)
dst
[
n
]
=
0
;
}
return
;
}
return
;
setIppErrorStatus
()
;
}
#endif
assert
(
tab_size
==
n
);
...
...
@@ -1113,8 +1122,10 @@ CCSIDFT( const T* src, T* dst, int n, int nf, int* factors, const int* itab,
#ifdef USE_IPP_DFT
if
(
spec
)
{
ippsDFTInv_PackToR
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
);
goto
finalize
;
if
(
ippsDFTInv_PackToR
(
src
,
dst
,
spec
,
(
uchar
*
)
buf
)
>=
0
)
goto
finalize
;
setIppErrorStatus
();
}
#endif
if
(
n
==
1
)
...
...
@@ -2186,6 +2197,8 @@ void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows )
spec
=
0
;
sz
+=
worksize
;
}
else
setIppErrorStatus
();
}
else
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment