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
37d01e2d
Commit
37d01e2d
authored
Jul 25, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added license header, using cv::Ptr, small fixes.
parent
66ac4621
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
21 deletions
+28
-21
cvdef.h
modules/core/include/opencv2/core/cvdef.h
+1
-1
dxt.cpp
modules/core/src/dxt.cpp
+0
-0
fft.cl
modules/core/src/opencl/fft.cl
+27
-20
No files found.
modules/core/include/opencv2/core/cvdef.h
View file @
37d01e2d
...
...
@@ -244,7 +244,7 @@ typedef signed char schar;
/* fundamental constants */
#define CV_PI 3.1415926535897932384626433832795
#define CV_
TWO_
PI 6.283185307179586476925286766559
#define CV_
2
PI 6.283185307179586476925286766559
#define CV_LOG2 0.69314718055994530941723212145818
/****************************************************************************************\
...
...
modules/core/src/dxt.cpp
View file @
37d01e2d
This diff is collapsed.
Click to expand it.
modules/core/src/opencl/fft.cl
View file @
37d01e2d
//
This
file
is
part
of
OpenCV
project.
//
It
is
subject
to
the
license
terms
in
the
LICENSE
file
found
in
the
top-level
directory
//
of
this
distribution
and
at
http://opencv.org/license.html.
//
Copyright
(
C
)
2014
,
Itseez,
Inc.,
all
rights
reserved.
//
Third
party
copyrights
are
property
of
their
respective
owners.
#
define
SQRT_2
0.707106781188f
#
define
sin_120
0.866025403784f
#
define
fft5_2
0.559016994374f
...
...
@@ -509,9 +516,9 @@ void fft_radix5_B2(__local float2* smem, __global const float2* twiddles, const
}
#
ifdef
DFT_SCALE
#
define
VAL
(
x,
scale
)
x*scale
#
define
SCALE_
VAL
(
x,
scale
)
x*scale
#
else
#
define
VAL
(
x,
scale
)
x
#
define
SCALE_
VAL
(
x,
scale
)
x
#
endif
__kernel
void
fft_multi_radix_rows
(
__global
const
uchar*
src_ptr,
int
src_step,
int
src_offset,
int
src_rows,
int
src_cols,
...
...
@@ -558,15 +565,15 @@ __kernel void fft_multi_radix_rows(__global const uchar* src_ptr, int src_step,
__global
float2*
dst
=
(
__global
float2*
)(
dst_ptr
+
mad24
(
y,
dst_step,
dst_offset
))
;
#
pragma
unroll
for
(
int
i=x
; i<cols; i+=block_size)
dst[i]
=
VAL
(
smem[i],
scale
)
;
dst[i]
=
SCALE_
VAL
(
smem[i],
scale
)
;
#
else
//
pack
row
to
CCS
__local
float*
smem_1cn
=
(
__local
float*
)
smem
;
__global
float*
dst
=
(
__global
float*
)(
dst_ptr
+
mad24
(
y,
dst_step,
dst_offset
))
;
for
(
int
i=x
; i<dst_cols-1; i+=block_size)
dst[i+1]
=
VAL
(
smem_1cn[i+2],
scale
)
;
dst[i+1]
=
SCALE_
VAL
(
smem_1cn[i+2],
scale
)
;
if
(
x
==
0
)
dst[0]
=
VAL
(
smem_1cn[0],
scale
)
;
dst[0]
=
SCALE_
VAL
(
smem_1cn[0],
scale
)
;
#
endif
}
else
...
...
@@ -611,7 +618,7 @@ __kernel void fft_multi_radix_cols(__global const uchar* src_ptr, int src_step,
__global
uchar*
dst
=
dst_ptr
+
mad24
(
y,
dst_step,
mad24
(
x,
(
int
)(
sizeof
(
float
)
*2
)
,
dst_offset
))
;
#
pragma
unroll
for
(
int
i=0
; i<kercn; i++)
*
((
__global
float2*
)(
dst
+
i*block_size*dst_step
))
=
VAL
(
smem[y
+
i*block_size],
scale
)
;
*
((
__global
float2*
)(
dst
+
i*block_size*dst_step
))
=
SCALE_
VAL
(
smem[y
+
i*block_size],
scale
)
;
#
else
if
(
x
==
0
)
{
...
...
@@ -619,9 +626,9 @@ __kernel void fft_multi_radix_cols(__global const uchar* src_ptr, int src_step,
__local
float*
smem_1cn
=
(
__local
float*
)
smem
;
__global
uchar*
dst
=
dst_ptr
+
mad24
(
y+1,
dst_step,
dst_offset
)
;
for
(
int
i=y
; i<dst_rows-1; i+=block_size, dst+=dst_step*block_size)
*
((
__global
float*
)
dst
)
=
VAL
(
smem_1cn[i+2],
scale
)
;
*
((
__global
float*
)
dst
)
=
SCALE_
VAL
(
smem_1cn[i+2],
scale
)
;
if
(
y
==
0
)
*
((
__global
float*
)
(
dst_ptr
+
dst_offset
))
=
VAL
(
smem_1cn[0],
scale
)
;
*
((
__global
float*
)
(
dst_ptr
+
dst_offset
))
=
SCALE_
VAL
(
smem_1cn[0],
scale
)
;
}
else
if
(
x
==
(
dst_cols+1
)
/2
)
{
...
...
@@ -629,16 +636,16 @@ __kernel void fft_multi_radix_cols(__global const uchar* src_ptr, int src_step,
__local
float*
smem_1cn
=
(
__local
float*
)
smem
;
__global
uchar*
dst
=
dst_ptr
+
mad24
(
dst_cols-1,
(
int
)
sizeof
(
float
)
,
mad24
(
y+1,
dst_step,
dst_offset
))
;
for
(
int
i=y
; i<dst_rows-1; i+=block_size, dst+=dst_step*block_size)
*
((
__global
float*
)
dst
)
=
VAL
(
smem_1cn[i+2],
scale
)
;
*
((
__global
float*
)
dst
)
=
SCALE_
VAL
(
smem_1cn[i+2],
scale
)
;
if
(
y
==
0
)
*
((
__global
float*
)
(
dst_ptr
+
mad24
(
dst_cols-1,
(
int
)
sizeof
(
float
)
,
dst_offset
)))
=
VAL
(
smem_1cn[0],
scale
)
;
*
((
__global
float*
)
(
dst_ptr
+
mad24
(
dst_cols-1,
(
int
)
sizeof
(
float
)
,
dst_offset
)))
=
SCALE_
VAL
(
smem_1cn[0],
scale
)
;
}
else
{
__global
uchar*
dst
=
dst_ptr
+
mad24
(
x,
(
int
)
sizeof
(
float
)
*2,
mad24
(
y,
dst_step,
dst_offset
-
(
int
)
sizeof
(
float
)))
;
#
pragma
unroll
for
(
int
i=y
; i<dst_rows; i+=block_size, dst+=block_size*dst_step)
vstore2
(
VAL
(
smem[i],
scale
)
,
0
,
(
__global
float*
)
dst
)
;
vstore2
(
SCALE_
VAL
(
smem[i],
scale
)
,
0
,
(
__global
float*
)
dst
)
;
}
#
endif
}
...
...
@@ -724,15 +731,15 @@ __kernel void ifft_multi_radix_rows(__global const uchar* src_ptr, int src_step,
#
pragma
unroll
for
(
int
i=0
; i<kercn; i++)
{
dst[i*block_size].x
=
VAL
(
smem[x
+
i*block_size].x,
scale
)
;
dst[i*block_size].y
=
VAL
(
-smem[x
+
i*block_size].y,
scale
)
;
dst[i*block_size].x
=
SCALE_
VAL
(
smem[x
+
i*block_size].x,
scale
)
;
dst[i*block_size].y
=
SCALE_
VAL
(
-smem[x
+
i*block_size].y,
scale
)
;
}
#
else
__global
float*
dst
=
(
__global
float*
)(
dst_ptr
+
mad24
(
y,
dst_step,
mad24
(
x,
(
int
)(
sizeof
(
float
))
,
dst_offset
)))
;
#
pragma
unroll
for
(
int
i=0
; i<kercn; i++)
{
dst[i*block_size]
=
VAL
(
smem[x
+
i*block_size].x,
scale
)
;
dst[i*block_size]
=
SCALE_
VAL
(
smem[x
+
i*block_size].x,
scale
)
;
}
#
endif
}
...
...
@@ -783,9 +790,9 @@ __kernel void ifft_multi_radix_cols(__global const uchar* src_ptr, int src_step,
#
pragma
unroll
for
(
int
i=0
; i<kercn; i++)
{
__global
float2*
re
z
=
(
__global
float2*
)(
dst
+
i*block_size*dst_step
)
;
re
z
[0].x
=
smem[y
+
i*block_size].x
;
re
z
[0].y
=
-smem[y
+
i*block_size].y
;
__global
float2*
re
s
=
(
__global
float2*
)(
dst
+
i*block_size*dst_step
)
;
re
s
[0].x
=
smem[y
+
i*block_size].x
;
re
s
[0].y
=
-smem[y
+
i*block_size].y
;
}
}
#
else
...
...
@@ -848,9 +855,9 @@ __kernel void ifft_multi_radix_cols(__global const uchar* src_ptr, int src_step,
#
pragma
unroll
for
(
int
i=0
; i<kercn; i++)
{
__global
float2*
re
z
=
(
__global
float2*
)(
dst
+
i*block_size*dst_step
)
;
re
z
[0].x
=
smem[y
+
i*block_size].x
;
re
z
[0].y
=
-smem[y
+
i*block_size].y
;
__global
float2*
re
s
=
(
__global
float2*
)(
dst
+
i*block_size*dst_step
)
;
re
s
[0].x
=
smem[y
+
i*block_size].x
;
re
s
[0].y
=
-smem[y
+
i*block_size].y
;
}
}
#
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