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
504bc763
Commit
504bc763
authored
Jun 16, 2014
by
vbystricky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pre_invalid parameter
parent
45f21e4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
integral_sum.cl
modules/imgproc/src/opencl/integral_sum.cl
+8
-8
sumpixels.cpp
modules/imgproc/src/sumpixels.cpp
+3
-3
No files found.
modules/imgproc/src/opencl/integral_sum.cl
View file @
504bc763
...
...
@@ -63,7 +63,7 @@
#
if
sdepth
==
4
kernel
void
integral_sum_cols
(
__global
uchar4
*src,
__global
int
*sum,
int
src_offset,
int
pre_invalid,
int
rows,
int
cols,
int
src_step,
int
dst_step
)
int
src_offset,
int
rows,
int
cols,
int
src_step,
int
dst_step
)
{
int
lid
=
get_local_id
(
0
)
;
int
gid
=
get_group_id
(
0
)
;
...
...
@@ -122,19 +122,19 @@ kernel void integral_sum_cols(__global uchar4 *src, __global int *sum,
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
lid
>
0
&&
(
i+lid
)
<=
rows
)
{
int
loc_s0
=
gid
*
dst_step
+
i
+
lid
-
1
-
pre_invalid
*
dst_step
/
4
,
loc_s1
=
loc_s0
+
dst_step
;
int
loc_s0
=
gid
*
dst_step
+
i
+
lid
-
1
,
loc_s1
=
loc_s0
+
dst_step
;
lm_sum[0][bf_loc]
+=
sum_t[0]
;
lm_sum[1][bf_loc]
+=
sum_t[1]
;
sum_p
=
(
__local
int*
)(
&
(
lm_sum[0][bf_loc]
))
;
for
(
int
k
=
0
; k < 4; k++)
{
if
(
gid
*
4
+
k
>=
cols
+
pre_invalid
|
| gid * 4 + k < pre_invalid
) continue;
if
(
gid
*
4
+
k
>=
cols
)
continue
;
sum[loc_s0
+
k
*
dst_step
/
4]
=
sum_p[k]
;
}
sum_p
=
(
__local
int*
)(
&
(
lm_sum[1][bf_loc]
))
;
for
(
int
k
=
0
; k < 4; k++)
{
if(gid * 4 + k + 4 >= cols
+ pre_invalid
) break;
if
(
gid
*
4
+
k
+
4
>=
cols
)
break
;
sum[loc_s1
+
k
*
dst_step
/
4]
=
sum_p[k]
;
}
}
...
...
@@ -238,7 +238,7 @@ kernel void integral_sum_rows(__global int4 *srcsum, __global int *sum,
#
elif
sdepth
==
5
kernel
void
integral_sum_cols
(
__global
uchar4
*src,
__global
float
*sum,
int src_offset, int
pre_invalid, int
rows, int cols, int src_step, int dst_step)
int
src_offset,
int
rows,
int
cols,
int
src_step,
int
dst_step
)
{
int
lid
=
get_local_id
(
0
)
;
int
gid
=
get_group_id
(
0
)
;
...
...
@@ -297,19 +297,19 @@ kernel void integral_sum_cols(__global uchar4 *src, __global float *sum,
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
lid
>
0
&&
(
i+lid
)
<=
rows
)
{
int loc_s0 = gid * dst_step + i + lid - 1
- pre_invalid * dst_step / 4
, loc_s1 = loc_s0 + dst_step ;
int
loc_s0
=
gid
*
dst_step
+
i
+
lid
-
1
,
loc_s1
=
loc_s0
+
dst_step
;
lm_sum[0][bf_loc]
+=
sum_t[0]
;
lm_sum[1][bf_loc]
+=
sum_t[1]
;
sum_p
=
(
__local
float*
)(
&
(
lm_sum[0][bf_loc]
))
;
for
(
int
k
=
0
; k < 4; k++)
{
if(gid * 4 + k >= cols
+ pre_invalid |
|
gid
*
4
+
k
<
pre_invalid
)
continue
;
if
(
gid
*
4
+
k
>=
cols
)
continue
;
sum[loc_s0
+
k
*
dst_step
/
4]
=
sum_p[k]
;
}
sum_p
=
(
__local
float*
)(
&
(
lm_sum[1][bf_loc]
))
;
for
(
int
k
=
0
; k < 4; k++)
{
if
(
gid
*
4
+
k
+
4
>=
cols
+
pre_invalid
)
break
;
if
(
gid
*
4
+
k
+
4
>=
cols
)
break
;
sum[loc_s1
+
k
*
dst_step
/
4]
=
sum_p[k]
;
}
}
...
...
modules/imgproc/src/sumpixels.cpp
View file @
504bc763
...
...
@@ -254,12 +254,12 @@ static bool ocl_integral( InputArray _src, OutputArray _sum, int sdepth )
UMat
src
=
_src
.
getUMat
(),
t_sum
(
t_size
,
sdepth
),
sum
=
_sum
.
getUMat
();
t_sum
=
t_sum
(
Range
::
all
(),
Range
(
0
,
size
.
height
));
int
offset
=
(
int
)
src
.
offset
/
vlen
,
pre_invalid
=
(
int
)
src
.
offset
%
vlen
;
int
vcols
=
(
pre_invalid
+
src
.
cols
+
vlen
-
1
)
/
vlen
;
int
offset
=
(
int
)
src
.
offset
/
vlen
;
int
vcols
=
(
src
.
cols
+
vlen
-
1
)
/
vlen
;
int
sum_offset
=
(
int
)
sum
.
offset
/
vlen
;
k1
.
args
(
ocl
::
KernelArg
::
PtrReadOnly
(
src
),
ocl
::
KernelArg
::
PtrWriteOnly
(
t_sum
),
offset
,
pre_invalid
,
src
.
rows
,
src
.
cols
,
(
int
)
src
.
step
,
(
int
)
t_sum
.
step
);
offset
,
src
.
rows
,
src
.
cols
,
(
int
)
src
.
step
,
(
int
)
t_sum
.
step
);
size_t
gt
=
((
vcols
+
1
)
/
2
)
*
256
,
lt
=
256
;
if
(
!
k1
.
run
(
1
,
&
gt
,
&
lt
,
false
))
return
false
;
...
...
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