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
6f8695c1
Commit
6f8695c1
authored
Jul 16, 2016
by
k-shinotsuka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve RowVec_8u32s().
parent
69c4e84d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
25 deletions
+21
-25
filter.cpp
modules/imgproc/src/filter.cpp
+21
-25
No files found.
modules/imgproc/src/filter.cpp
View file @
6f8695c1
...
...
@@ -506,56 +506,52 @@ struct RowVec_8u32s
if
(
smallValues
)
{
for
(
;
i
<=
width
-
16
;
i
+=
16
)
__m128i
z
=
_mm_setzero_si128
();
for
(
;
i
<=
width
-
8
;
i
+=
8
)
{
const
uchar
*
src
=
_src
+
i
;
__m128i
f
,
z
=
_mm_setzero_si128
(),
s0
=
z
,
s1
=
z
,
s2
=
z
,
s3
=
z
;
__m128i
x0
,
x1
,
x2
,
x3
;
__m128i
s0
=
z
,
s1
=
z
;
for
(
k
=
0
;
k
<
_ksize
;
k
++
,
src
+=
cn
)
{
f
=
_mm_cvtsi32_si128
(
_kx
[
k
]);
__m128i
f
=
_mm_cvtsi32_si128
(
_kx
[
k
]);
f
=
_mm_shuffle_epi32
(
f
,
0
);
f
=
_mm_packs_epi32
(
f
,
f
);
x0
=
_mm_loadu_si128
((
const
__m128i
*
)
src
);
x2
=
_mm_unpackhi_epi8
(
x0
,
z
);
__m128i
x0
=
_mm_loadl_epi64
((
const
__m128i
*
)
src
);
x0
=
_mm_unpacklo_epi8
(
x0
,
z
);
x1
=
_mm_mulhi_epi16
(
x0
,
f
);
x3
=
_mm_mulhi_epi16
(
x2
,
f
);
x0
=
_mm_mullo_epi16
(
x0
,
f
);
x2
=
_mm_mullo_epi16
(
x2
,
f
);
s0
=
_mm_add_epi32
(
s0
,
_mm_unpacklo_epi16
(
x0
,
x1
));
s1
=
_mm_add_epi32
(
s1
,
_mm_unpackhi_epi16
(
x0
,
x1
));
s2
=
_mm_add_epi32
(
s2
,
_mm_unpacklo_epi16
(
x2
,
x3
));
s3
=
_mm_add_epi32
(
s3
,
_mm_unpackhi_epi16
(
x2
,
x3
));
__m128i
x1
=
_mm_unpackhi_epi16
(
x0
,
z
);
x0
=
_mm_unpacklo_epi16
(
x0
,
z
);
x0
=
_mm_madd_epi16
(
x0
,
f
);
x1
=
_mm_madd_epi16
(
x1
,
f
);
s0
=
_mm_add_epi32
(
s0
,
x0
);
s1
=
_mm_add_epi32
(
s1
,
x1
);
}
_mm_store_si128
((
__m128i
*
)(
dst
+
i
),
s0
);
_mm_store_si128
((
__m128i
*
)(
dst
+
i
+
4
),
s1
);
_mm_store_si128
((
__m128i
*
)(
dst
+
i
+
8
),
s2
);
_mm_store_si128
((
__m128i
*
)(
dst
+
i
+
12
),
s3
);
}
for
(
;
i
<=
width
-
4
;
i
+=
4
)
if
(
i
<=
width
-
4
)
{
const
uchar
*
src
=
_src
+
i
;
__m128i
f
,
z
=
_mm_setzero_si128
(),
s0
=
z
,
x0
,
x1
;
__m128i
s0
=
z
;
for
(
k
=
0
;
k
<
_ksize
;
k
++
,
src
+=
cn
)
{
f
=
_mm_cvtsi32_si128
(
_kx
[
k
]);
__m128i
f
=
_mm_cvtsi32_si128
(
_kx
[
k
]);
f
=
_mm_shuffle_epi32
(
f
,
0
);
f
=
_mm_packs_epi32
(
f
,
f
);
x0
=
_mm_cvtsi32_si128
(
*
(
const
int
*
)
src
);
__m128i
x0
=
_mm_cvtsi32_si128
(
*
(
const
int
*
)
src
);
x0
=
_mm_unpacklo_epi8
(
x0
,
z
);
x
1
=
_mm_mulhi_epi16
(
x0
,
f
);
x0
=
_mm_m
ullo
_epi16
(
x0
,
f
);
s0
=
_mm_add_epi32
(
s0
,
_mm_unpacklo_epi16
(
x0
,
x1
)
);
x
0
=
_mm_unpacklo_epi16
(
x0
,
z
);
x0
=
_mm_m
add
_epi16
(
x0
,
f
);
s0
=
_mm_add_epi32
(
s0
,
x0
);
}
_mm_store_si128
((
__m128i
*
)(
dst
+
i
),
s0
);
i
+=
4
;
}
}
return
i
;
...
...
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