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
3ae95150
Commit
3ae95150
authored
Aug 25, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added double support for OCL version of DFT
parent
3b59a105
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
dxt.cpp
modules/core/src/dxt.cpp
+13
-7
fft.cl
modules/core/src/opencl/fft.cl
+0
-0
No files found.
modules/core/src/dxt.cpp
View file @
3ae95150
...
...
@@ -1867,13 +1867,17 @@ public:
UMat
src
=
_src
.
getUMat
();
UMat
dst
=
_dst
.
getUMat
();
int
type
=
src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
);
size_t
globalsize
[
2
];
size_t
localsize
[
2
];
String
kernel_name
;
bool
is1d
=
(
flags
&
DFT_ROWS
)
!=
0
||
num_dfts
==
1
;
bool
inv
=
(
flags
&
DFT_INVERSE
)
!=
0
;
String
options
=
buildOptions
;
String
options
=
buildOptions
+
format
(
" -D FT=%s CT=%s%s"
,
ocl
::
typeToStr
(
depth
),
ocl
::
typeToStr
(
CV_MAKE_TYPE
(
depth
,
2
)),
depth
==
CV_64F
?
" -D DOUBLE_SUPPORT"
:
""
);
if
(
rows
)
{
...
...
@@ -2039,9 +2043,11 @@ static bool ocl_dft_cols(InputArray _src, OutputArray _dst, int nonzero_cols, in
static
bool
ocl_dft
(
InputArray
_src
,
OutputArray
_dst
,
int
flags
,
int
nonzero_rows
)
{
int
type
=
_src
.
type
(),
cn
=
CV_MAT_CN
(
type
);
int
type
=
_src
.
type
(),
cn
=
CV_MAT_CN
(
type
)
,
depth
=
CV_MAT_DEPTH
(
type
)
;
Size
ssize
=
_src
.
size
();
if
(
!
(
type
==
CV_32FC1
||
type
==
CV_32FC2
)
)
bool
doubleSupport
=
ocl
::
Device
::
getDefault
().
doubleFPConfig
();
if
(
!
((
cn
==
1
||
cn
==
2
)
&&
(
depth
==
CV_32F
||
(
depth
==
CV_64F
&&
doubleSupport
)))
)
return
false
;
// if is not a multiplication of prime numbers { 2, 3, 5 }
...
...
@@ -2082,7 +2088,7 @@ static bool ocl_dft(InputArray _src, OutputArray _dst, int flags, int nonzero_ro
if
(
fftType
==
C2C
||
fftType
==
R2C
)
{
// complex output
_dst
.
create
(
src
.
size
(),
CV_
32FC2
);
_dst
.
create
(
src
.
size
(),
CV_
MAKETYPE
(
depth
,
2
)
);
output
=
_dst
.
getUMat
();
}
else
...
...
@@ -2090,13 +2096,13 @@ static bool ocl_dft(InputArray _src, OutputArray _dst, int flags, int nonzero_ro
// real output
if
(
is1d
)
{
_dst
.
create
(
src
.
size
(),
CV_
32FC1
);
_dst
.
create
(
src
.
size
(),
CV_
MAKETYPE
(
depth
,
1
)
);
output
=
_dst
.
getUMat
();
}
else
{
_dst
.
create
(
src
.
size
(),
CV_
32FC1
);
output
.
create
(
src
.
size
(),
CV_
32FC2
);
_dst
.
create
(
src
.
size
(),
CV_
MAKETYPE
(
depth
,
1
)
);
output
.
create
(
src
.
size
(),
CV_
MAKETYPE
(
depth
,
2
)
);
}
}
...
...
modules/core/src/opencl/fft.cl
View file @
3ae95150
This diff is collapsed.
Click to expand it.
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