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
1a73aa1f
Commit
1a73aa1f
authored
Jun 26, 2014
by
vbystricky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change local size
parent
730ead44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
filter.cpp
modules/imgproc/src/filter.cpp
+6
-5
filterSep_singlePass.cl
modules/imgproc/src/opencl/filterSep_singlePass.cl
+4
-6
No files found.
modules/imgproc/src/filter.cpp
View file @
1a73aa1f
...
...
@@ -3471,7 +3471,8 @@ static bool ocl_sepColFilter2D(const UMat & buf, UMat & dst, const Mat & kernelY
return
k
.
run
(
2
,
globalsize
,
localsize
,
false
);
}
const
int
optimizedSepFilterLocalSize
=
16
;
const
int
optimizedSepFilterLocalWidth
=
16
;
const
int
optimizedSepFilterLocalHeight
=
8
;
static
bool
ocl_sepFilter2D_SinglePass
(
InputArray
_src
,
OutputArray
_dst
,
Mat
row_kernel
,
Mat
col_kernel
,
...
...
@@ -3491,8 +3492,8 @@ static bool ocl_sepFilter2D_SinglePass(InputArray _src, OutputArray _dst,
borderType
==
BORDER_REFLECT_101
))
return
false
;
size_t
lt2
[
2
]
=
{
optimizedSepFilterLocal
Size
,
optimizedSepFilterLocalSize
};
size_t
gt2
[
2
]
=
{
lt2
[
0
]
*
(
1
+
(
size
.
width
-
1
)
/
lt2
[
0
]),
optimizedSepFilterLocalSize
};
size_t
lt2
[
2
]
=
{
optimizedSepFilterLocal
Width
,
optimizedSepFilterLocalHeight
};
size_t
gt2
[
2
]
=
{
lt2
[
0
]
*
(
1
+
(
size
.
width
-
1
)
/
lt2
[
0
]),
lt2
[
1
]
};
char
cvt
[
2
][
40
];
const
char
*
const
borderMap
[]
=
{
"BORDER_CONSTANT"
,
"BORDER_REPLICATE"
,
"BORDER_REFLECT"
,
"BORDER_WRAP"
,
...
...
@@ -3584,8 +3585,8 @@ static bool ocl_sepFilter2D( InputArray _src, OutputArray _dst, int ddepth,
}
CV_OCL_RUN_
(
kernelY
.
cols
<=
21
&&
kernelX
.
cols
<=
21
&&
imgSize
.
width
>
optimizedSepFilterLocal
Size
+
anchor
.
x
&&
imgSize
.
height
>
optimizedSepFilterLocal
Size
+
anchor
.
y
&&
imgSize
.
width
>
optimizedSepFilterLocal
Width
+
anchor
.
x
&&
imgSize
.
height
>
optimizedSepFilterLocal
Height
+
anchor
.
y
&&
(
!
(
borderType
&
BORDER_ISOLATED
)
||
_src
.
offset
()
==
0
)
&&
anchor
==
Point
(
kernelX
.
cols
>>
1
,
kernelY
.
cols
>>
1
)
&&
(
d
.
isIntel
()
||
(
d
.
isAMD
()
&&
!
d
.
hostUnifiedMemory
())),
...
...
modules/imgproc/src/opencl/filterSep_singlePass.cl
View file @
1a73aa1f
...
...
@@ -127,10 +127,9 @@ __kernel void sep_filter(__global uchar* Src, int src_step, int srcOffsetX, int
//
and
read
my
own
source
pixel
into
local
memory
//
with
account
for
extra
border
pixels,
which
will
be
read
by
starting
workitems
int
clocY
=
liy
;
int
cSrcY
=
liy
+
srcOffsetY
-
RADIUSY
;
do
{
int
yb
=
c
Src
Y
;
int
yb
=
c
locY
+
srcOffsetY
-
RADIUS
Y
;
EXTRAPOLATE
(
yb,
(
height
))
;
int
clocX
=
lix
;
...
...
@@ -147,7 +146,6 @@ __kernel void sep_filter(__global uchar* Src, int src_step, int srcOffsetX, int
while
(
clocX
<
BLK_X+
(
RADIUSX*2
))
;
clocY
+=
BLK_Y
;
cSrcY
+=
BLK_Y
;
}
while
(
clocY
<
BLK_Y+
(
RADIUSY*2
))
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
...
...
@@ -206,8 +204,8 @@ __kernel void sep_filter(__global uchar* Src, int src_step, int srcOffsetX, int
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
int
cSrcY
=
y
+
BLK_Y
+
liy
+
srcOffsetY
+
RADIUSY
;
EXTRAPOLATE
(
cSrcY
,
(
height
))
;
int
yb
=
y
+
liy
+
BLK_Y
+
srcOffsetY
+
RADIUSY
;
EXTRAPOLATE
(
yb
,
(
height
))
;
clocX
=
lix
;
int
cSrcX
=
x
+
srcOffsetX
-
RADIUSX
;
...
...
@@ -215,7 +213,7 @@ __kernel void sep_filter(__global uchar* Src, int src_step, int srcOffsetX, int
{
int
xb
=
cSrcX
;
EXTRAPOLATE
(
xb,
(
width
))
;
lsmem[liy
+
2*RADIUSY][clocX]
=
ELEM
(
xb,
cSrcY
,
(
width
)
,
(
height
)
,
0
)
;
lsmem[liy
+
2*RADIUSY][clocX]
=
ELEM
(
xb,
yb
,
(
width
)
,
(
height
)
,
0
)
;
clocX
+=
BLK_X
;
cSrcX
+=
BLK_X
;
...
...
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