Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
aaa25546
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,发现更多精彩内容 >>
提交
aaa25546
编写于
9月 11, 2016
作者:
M
matze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed haveSSE2 in haveSIMD. Conditional compilation for function header removed
上级
fd6f54c8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
36 deletion
+17
-36
modules/imgproc/src/contours.cpp
modules/imgproc/src/contours.cpp
+17
-36
未找到文件。
modules/imgproc/src/contours.cpp
浏览文件 @
aaa25546
...
...
@@ -1002,7 +1002,7 @@ cvFindNextContour( CvContourScanner scanner )
CV_Error
(
CV_StsNullPtr
,
""
);
#if CV_SSE2
bool
haveS
SE2
=
cv
::
checkHardwareSupport
(
CPU_SSE2
);
bool
haveS
IMD
=
cv
::
checkHardwareSupport
(
CPU_SSE2
);
#endif
icvEndProcessContour
(
scanner
);
...
...
@@ -1052,7 +1052,7 @@ cvFindNextContour( CvContourScanner scanner )
#if CV_SSE2
if
((
p
=
img
[
x
])
!=
prev
)
{
goto
_next_contour
;
}
else
if
(
haveS
SE2
)
{
}
else
if
(
haveS
IMD
)
{
__m128i
v_prev
=
_mm_set1_epi8
((
char
)
prev
);
int
v_size
=
width
-
32
;
...
...
@@ -1337,7 +1337,6 @@ cvEndFindContours( CvContourScanner * _scanner )
#define ICV_SINGLE 0
#define ICV_CONNECTING_ABOVE 1
#define ICV_CONNECTING_BELOW -1
//#define ICV_IS_COMPONENT_POINT(val) ((val) != 0)
#define CV_GET_WRITTEN_ELEM( writer ) ((writer).ptr - (writer).seq->elem_size)
...
...
@@ -1349,13 +1348,9 @@ typedef struct CvLinkedRunPoint
}
CvLinkedRunPoint
;
inline
int
findStartContourPoint
(
uchar
*
src_data
,
CvSize
img_size
,
int
j
,
bool
haveSIMD
)
{
#if CV_SSE2
inline
int
findStartContourPoint
(
uchar
*
src_data
,
CvSize
img_size
,
int
j
,
bool
haveSSE2
)
{
#else
inline
int
findStartContourPoint
(
uchar
*
src_data
,
CvSize
img_size
,
int
j
)
{
#endif
#if CV_SSE2
if
(
haveSSE2
)
{
if
(
haveSIMD
)
{
__m128i
v_zero
=
_mm_setzero_si128
();
int
v_size
=
img_size
.
width
-
32
;
...
...
@@ -1401,15 +1396,11 @@ inline int findStartContourPoint(uchar *src_data, CvSize img_size, int j) {
return
j
;
}
#if CV_SSE2
inline
int
findEndContourPoint
(
uchar
*
src_data
,
CvSize
img_size
,
int
j
,
bool
haveSSE2
)
{
#else
inline
int
findEndContourPoint
(
uchar
*
src_data
,
CvSize
img_size
,
int
j
)
{
#endif
inline
int
findEndContourPoint
(
uchar
*
src_data
,
CvSize
img_size
,
int
j
,
bool
haveSIMD
)
{
#if CV_SSE2
if
(
j
<
img_size
.
width
&&
!
src_data
[
j
])
{
return
j
;
}
else
if
(
haveS
SE2
)
{
}
else
if
(
haveS
IMD
)
{
__m128i
v_zero
=
_mm_setzero_si128
();
int
v_size
=
img_size
.
width
-
32
;
...
...
@@ -1505,7 +1496,7 @@ icvFindContoursInInterval( const CvArr* src,
if
(
contourHeaderSize
<
(
int
)
sizeof
(
CvContour
))
CV_Error
(
CV_StsBadSize
,
"Contour header size must be >= sizeof(CvContour)"
);
#if CV_SSE2
bool
haveS
SE2
=
cv
::
checkHardwareSupport
(
CPU_SSE2
);
bool
haveS
IMD
=
cv
::
checkHardwareSupport
(
CPU_SSE2
);
#endif
storage00
.
reset
(
cvCreateChildMemStorage
(
storage
));
storage01
.
reset
(
cvCreateChildMemStorage
(
storage
));
...
...
@@ -1539,11 +1530,8 @@ icvFindContoursInInterval( const CvArr* src,
tmp_prev
=
upper_line
;
for
(
j
=
0
;
j
<
img_size
.
width
;
)
{
#if CV_SSE2
j
=
findStartContourPoint
(
src_data
,
img_size
,
j
,
haveSSE2
);
#else
j
=
findStartContourPoint
(
src_data
,
img_size
,
j
);
#endif
j
=
findStartContourPoint
(
src_data
,
img_size
,
j
,
haveSIMD
);
if
(
j
==
img_size
.
width
)
break
;
...
...
@@ -1551,11 +1539,9 @@ icvFindContoursInInterval( const CvArr* src,
CV_WRITE_SEQ_ELEM
(
tmp
,
writer
);
tmp_prev
->
next
=
(
CvLinkedRunPoint
*
)
CV_GET_WRITTEN_ELEM
(
writer
);
tmp_prev
=
tmp_prev
->
next
;
#if CV_SSE2
j
=
findEndContourPoint
(
src_data
,
img_size
,
j
+
1
,
haveSSE2
);
#else
j
=
findEndContourPoint
(
src_data
,
img_size
,
j
+
1
);
#endif
j
=
findEndContourPoint
(
src_data
,
img_size
,
j
+
1
,
haveSIMD
);
tmp
.
pt
.
x
=
j
-
1
;
CV_WRITE_SEQ_ELEM
(
tmp
,
writer
);
tmp_prev
->
next
=
(
CvLinkedRunPoint
*
)
CV_GET_WRITTEN_ELEM
(
writer
);
...
...
@@ -1578,22 +1564,17 @@ icvFindContoursInInterval( const CvArr* src,
all_total
=
runs
->
total
;
for
(
j
=
0
;
j
<
img_size
.
width
;
)
{
#if CV_SSE2
j
=
findStartContourPoint
(
src_data
,
img_size
,
j
,
haveSSE2
);
#else
j
=
findStartContourPoint
(
src_data
,
img_size
,
j
);
#endif
j
=
findStartContourPoint
(
src_data
,
img_size
,
j
,
haveSIMD
);
if
(
j
==
img_size
.
width
)
break
;
tmp
.
pt
.
x
=
j
;
CV_WRITE_SEQ_ELEM
(
tmp
,
writer
);
tmp_prev
->
next
=
(
CvLinkedRunPoint
*
)
CV_GET_WRITTEN_ELEM
(
writer
);
tmp_prev
=
tmp_prev
->
next
;
#if CV_SSE2
j
=
findEndContourPoint
(
src_data
,
img_size
,
j
+
1
,
haveSSE2
);
#else
j
=
findEndContourPoint
(
src_data
,
img_size
,
j
+
1
);
#endif
j
=
findEndContourPoint
(
src_data
,
img_size
,
j
+
1
,
haveSIMD
);
tmp
.
pt
.
x
=
j
-
1
;
CV_WRITE_SEQ_ELEM
(
tmp
,
writer
);
tmp_prev
=
tmp_prev
->
next
=
(
CvLinkedRunPoint
*
)
CV_GET_WRITTEN_ELEM
(
writer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录