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
3bd5055a
Commit
3bd5055a
authored
Oct 04, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7336 from K-Shinotsuka:issue23
parents
a3d44d52
1a51a96d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
stereobm.cpp
modules/calib3d/src/stereobm.cpp
+15
-16
No files found.
modules/calib3d/src/stereobm.cpp
View file @
3bd5055a
...
...
@@ -525,28 +525,27 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
if
(
uniquenessRatio
>
0
)
{
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
);
d8
=
_mm_sub_epi16
(
d0_8
,
dd_16
);
__m128i
thresh4
=
_mm_set1_epi32
(
thresh
+
1
);
__m128i
d1
=
_mm_set1_epi32
(
mind
-
1
),
d2
=
_mm_set1_epi32
(
mind
+
1
);
__m128i
dd_4
=
_mm_set1_epi32
(
4
);
__m128i
d4
=
_mm_set_epi32
(
3
,
2
,
1
,
0
);
__m128i
z
=
_mm_setzero_si128
();
for
(
d
=
0
;
d
<
ndisp
;
d
+=
16
)
for
(
d
=
0
;
d
<
ndisp
;
d
+=
8
)
{
__m128i
usad8
=
_mm_load_si128
((
__m128i
*
)(
sad
+
d
));
__m128i
vsad8
=
_mm_load_si128
((
__m128i
*
)(
sad
+
d
+
8
));
mask
=
_mm_cmpgt_epi16
(
thresh8
,
_mm_min_epi16
(
usad8
,
vsad8
));
d8
=
_mm_add_epi16
(
d8
,
dd_16
);
if
(
!
_mm_movemask_epi8
(
mask
)
)
continue
;
mask
=
_mm_cmpgt_epi16
(
thresh8
,
usad8
);
mask
=
_mm_and_si128
(
mask
,
_mm_or_si128
(
_mm_cmpgt_epi16
(
d1
,
d8
),
_mm_cmpgt_epi16
(
d8
,
d2
)));
__m128i
usad4
=
_mm_loadu_si128
((
__m128i
*
)(
sad
+
d
));
__m128i
vsad4
=
_mm_unpackhi_epi16
(
usad4
,
z
);
usad4
=
_mm_unpacklo_epi16
(
usad4
,
z
);
mask
=
_mm_cmpgt_epi32
(
thresh4
,
usad4
);
mask
=
_mm_and_si128
(
mask
,
_mm_or_si128
(
_mm_cmpgt_epi32
(
d1
,
d4
),
_mm_cmpgt_epi32
(
d4
,
d2
)));
if
(
_mm_movemask_epi8
(
mask
)
)
break
;
__m128i
t8
=
_mm_add_epi16
(
d8
,
dd_8
);
mask
=
_mm_cmpgt_epi
16
(
thresh8
,
vsad8
);
mask
=
_mm_and_si128
(
mask
,
_mm_or_si128
(
_mm_cmpgt_epi
16
(
d1
,
t8
),
_mm_cmpgt_epi16
(
t8
,
d2
)));
d4
=
_mm_add_epi16
(
d4
,
dd_4
);
mask
=
_mm_cmpgt_epi
32
(
thresh4
,
vsad4
);
mask
=
_mm_and_si128
(
mask
,
_mm_or_si128
(
_mm_cmpgt_epi
32
(
d1
,
d4
),
_mm_cmpgt_epi32
(
d4
,
d2
)));
if
(
_mm_movemask_epi8
(
mask
)
)
break
;
d4
=
_mm_add_epi16
(
d4
,
dd_4
);
}
if
(
d
<
ndisp
)
{
...
...
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