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
07b18b0e
Commit
07b18b0e
authored
Jul 14, 2016
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6863 from SorcererX:patch-1
parents
3e77731f
551b5d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
7 deletions
+43
-7
stereosgbm.cpp
modules/calib3d/src/stereosgbm.cpp
+43
-7
No files found.
modules/calib3d/src/stereosgbm.cpp
View file @
07b18b0e
...
...
@@ -759,14 +759,50 @@ static void computeDisparitySGBM( const Mat& img1, const Mat& img2,
}
else
{
for
(
d
=
0
;
d
<
D
;
d
++
)
#if CV_SSE2
if
(
useSIMD
)
{
int
Sval
=
Sp
[
d
];
if
(
Sval
<
minS
)
{
minS
=
Sval
;
bestDisp
=
d
;
}
__m128i
_minS
=
_mm_set1_epi16
(
MAX_COST
),
_bestDisp
=
_mm_set1_epi16
(
-
1
);
__m128i
_d8
=
_mm_setr_epi16
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
),
_8
=
_mm_set1_epi16
(
8
);
for
(
d
=
0
;
d
<
D
;
d
+=
8
)
{
__m128i
L0
=
_mm_load_si128
((
const
__m128i
*
)(
Sp
+
d
));
__m128i
mask
=
_mm_cmplt_epi16
(
L0
,
_minS
);
_minS
=
_mm_min_epi16
(
L0
,
_minS
);
_bestDisp
=
_mm_xor_si128
(
_bestDisp
,
_mm_and_si128
(
_mm_xor_si128
(
_bestDisp
,
_d8
),
mask
));
_d8
=
_mm_adds_epi16
(
_d8
,
_8
);
}
short
CV_DECL_ALIGNED
(
16
)
bestDispBuf
[
8
];
_mm_store_si128
((
__m128i
*
)
bestDispBuf
,
_bestDisp
);
short
CV_DECL_ALIGNED
(
16
)
minSBuf
[
8
];
_mm_store_si128
((
__m128i
*
)
minSBuf
,
_minS
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
int
Sval
=
minSBuf
[
i
];
if
(
Sval
<=
minS
)
{
if
(
(
Sval
<
minS
)
||
(
bestDispBuf
[
i
]
<
bestDisp
)
)
{
bestDisp
=
bestDispBuf
[
i
];
}
minS
=
Sval
;
}
}
}
else
#endif
{
for
(
d
=
0
;
d
<
D
;
d
++
)
{
int
Sval
=
Sp
[
d
];
if
(
Sval
<
minS
)
{
minS
=
Sval
;
bestDisp
=
d
;
}
}
}
}
...
...
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