Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
57b6850d
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
57b6850d
编写于
2月 27, 2014
作者:
A
Andrey Pavlenko
提交者:
OpenCV Buildbot
2月 27, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2415 from vpisarev:fix_stereobm_sse
上级
bd5d8404
a3aced20
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
21 deletion
+12
-21
modules/calib3d/src/stereobm.cpp
modules/calib3d/src/stereobm.cpp
+12
-21
未找到文件。
modules/calib3d/src/stereobm.cpp
浏览文件 @
57b6850d
...
...
@@ -252,7 +252,7 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
int
width1
=
width
-
rofs
-
ndisp
+
1
;
int
ftzero
=
state
.
preFilterCap
;
int
textureThreshold
=
state
.
textureThreshold
;
int
uniquenessRatio
=
state
.
uniquenessRatio
*
256
/
100
;
int
uniquenessRatio
=
state
.
uniquenessRatio
;
short
FILTERED
=
(
short
)((
mindisp
-
1
)
<<
DISPARITY_SHIFT
);
ushort
*
sad
,
*
hsad0
,
*
hsad
,
*
hsad_sub
;
...
...
@@ -274,7 +274,7 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
sad
=
(
ushort
*
)
alignPtr
(
buf
+
sizeof
(
sad
[
0
]),
ALIGN
);
hsad0
=
(
ushort
*
)
alignPtr
(
sad
+
ndisp
+
1
+
dy0
*
ndisp
,
ALIGN
);
htext
=
(
int
*
)
alignPtr
((
int
*
)(
hsad0
+
(
height
+
dy1
)
*
ndisp
)
+
wsz2
+
2
,
ALIGN
);
cbuf0
=
(
uchar
*
)
alignPtr
(
htext
+
height
+
wsz2
+
2
+
dy0
*
ndisp
,
ALIGN
);
cbuf0
=
(
uchar
*
)
alignPtr
(
(
uchar
*
)(
htext
+
height
+
wsz2
+
2
)
+
dy0
*
ndisp
,
ALIGN
);
for
(
x
=
0
;
x
<
TABSZ
;
x
++
)
tab
[
x
]
=
(
uchar
)
std
::
abs
(
x
-
ftzero
);
...
...
@@ -427,28 +427,19 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
continue
;
}
__m128i
minsad82
=
_mm_unpackhi_epi64
(
minsad8
,
minsad8
);
__m128i
mind82
=
_mm_unpackhi_epi64
(
mind8
,
mind8
);
mask
=
_mm_cmpgt_epi16
(
minsad8
,
minsad82
);
mind8
=
_mm_xor_si128
(
mind8
,
_mm_and_si128
(
_mm_xor_si128
(
mind82
,
mind8
),
mask
));
minsad8
=
_mm_min_epi16
(
minsad8
,
minsad82
);
minsad82
=
_mm_shufflelo_epi16
(
minsad8
,
_MM_SHUFFLE
(
3
,
2
,
3
,
2
));
mind82
=
_mm_shufflelo_epi16
(
mind8
,
_MM_SHUFFLE
(
3
,
2
,
3
,
2
));
mask
=
_mm_cmpgt_epi16
(
minsad8
,
minsad82
);
mind8
=
_mm_xor_si128
(
mind8
,
_mm_and_si128
(
_mm_xor_si128
(
mind82
,
mind8
),
mask
));
minsad8
=
_mm_min_epi16
(
minsad8
,
minsad82
);
minsad82
=
_mm_shufflelo_epi16
(
minsad8
,
1
);
mind82
=
_mm_shufflelo_epi16
(
mind8
,
1
);
mask
=
_mm_cmpgt_epi16
(
minsad8
,
minsad82
);
mind8
=
_mm_xor_si128
(
mind8
,
_mm_and_si128
(
_mm_xor_si128
(
mind82
,
mind8
),
mask
));
mind
=
(
short
)
_mm_cvtsi128_si32
(
mind8
);
minsad
=
sad
[
mind
];
ushort
CV_DECL_ALIGNED
(
16
)
minsad_buf
[
8
],
mind_buf
[
8
];
_mm_store_si128
((
__m128i
*
)
minsad_buf
,
minsad8
);
_mm_store_si128
((
__m128i
*
)
mind_buf
,
mind8
);
for
(
d
=
0
;
d
<
8
;
d
++
)
if
(
minsad
>
(
int
)
minsad_buf
[
d
]
||
(
minsad
==
(
int
)
minsad_buf
[
d
]
&&
mind
>
mind_buf
[
d
]))
{
minsad
=
minsad_buf
[
d
];
mind
=
mind_buf
[
d
];
}
if
(
uniquenessRatio
>
0
)
{
int
thresh
=
minsad
+
(
(
minsad
*
uniquenessRatio
)
>>
8
);
int
thresh
=
minsad
+
(
minsad
*
uniquenessRatio
/
100
);
__m128i
thresh8
=
_mm_set1_epi16
((
short
)(
thresh
+
1
));
__m128i
d1
=
_mm_set1_epi16
((
short
)(
mind
-
1
)),
d2
=
_mm_set1_epi16
((
short
)(
mind
+
1
));
__m128i
dd_16
=
_mm_add_epi16
(
dd_8
,
dd_8
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录