Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
504bc763
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
504bc763
编写于
6月 16, 2014
作者:
V
vbystricky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove pre_invalid parameter
上级
45f21e4f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
11 deletion
+11
-11
modules/imgproc/src/opencl/integral_sum.cl
modules/imgproc/src/opencl/integral_sum.cl
+8
-8
modules/imgproc/src/sumpixels.cpp
modules/imgproc/src/sumpixels.cpp
+3
-3
未找到文件。
modules/imgproc/src/opencl/integral_sum.cl
浏览文件 @
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
浏览文件 @
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录