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
285e6ad1
Commit
285e6ad1
authored
Oct 06, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7404 from K-Shinotsuka:issue30
parents
01848505
880ace2e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
color.cpp
modules/imgproc/src/color.cpp
+28
-0
No files found.
modules/imgproc/src/color.cpp
View file @
285e6ad1
...
...
@@ -4481,6 +4481,7 @@ struct HSV2RGB_b
v_alpha
=
vdup_n_u8
(
ColorChannel
<
uchar
>::
max
());
#elif CV_SSE2
v_scale
=
_mm_set1_ps
(
255.0
f
);
v_alpha
=
_mm_set1_ps
(
ColorChannel
<
uchar
>::
max
());
v_zero
=
_mm_setzero_si128
();
haveSIMD
=
checkHardwareSupport
(
CV_CPU_SSE2
);
#endif
...
...
@@ -4633,6 +4634,32 @@ struct HSV2RGB_b
if
(
jr
)
dst
-=
jr
,
j
-=
jr
;
}
else
if
(
dcn
==
4
&&
haveSIMD
)
{
for
(
;
j
<=
(
dn
*
3
-
12
);
j
+=
12
,
dst
+=
16
)
{
__m128
v_buf0
=
_mm_mul_ps
(
_mm_load_ps
(
buf
+
j
),
v_scale
);
__m128
v_buf1
=
_mm_mul_ps
(
_mm_load_ps
(
buf
+
j
+
4
),
v_scale
);
__m128
v_buf2
=
_mm_mul_ps
(
_mm_load_ps
(
buf
+
j
+
8
),
v_scale
);
__m128
v_ba0
=
_mm_unpackhi_ps
(
v_buf0
,
v_alpha
);
__m128
v_ba1
=
_mm_unpacklo_ps
(
v_buf2
,
v_alpha
);
__m128i
v_src0
=
_mm_cvtps_epi32
(
_mm_shuffle_ps
(
v_buf0
,
v_ba0
,
0x44
));
__m128i
v_src1
=
_mm_shuffle_epi32
(
_mm_cvtps_epi32
(
_mm_shuffle_ps
(
v_ba0
,
v_buf1
,
0x4e
)),
0x78
);
__m128i
v_src2
=
_mm_cvtps_epi32
(
_mm_shuffle_ps
(
v_buf1
,
v_ba1
,
0x4e
));
__m128i
v_src3
=
_mm_shuffle_epi32
(
_mm_cvtps_epi32
(
_mm_shuffle_ps
(
v_ba1
,
v_buf2
,
0xee
)),
0x78
);
__m128i
v_dst0
=
_mm_packs_epi32
(
v_src0
,
v_src1
);
__m128i
v_dst1
=
_mm_packs_epi32
(
v_src2
,
v_src3
);
_mm_storeu_si128
((
__m128i
*
)
dst
,
_mm_packus_epi16
(
v_dst0
,
v_dst1
));
}
int
jr
=
j
%
3
;
if
(
jr
)
dst
-=
jr
,
j
-=
jr
;
}
#endif
for
(
;
j
<
dn
*
3
;
j
+=
3
,
dst
+=
dcn
)
...
...
@@ -4653,6 +4680,7 @@ struct HSV2RGB_b
uint8x8_t
v_alpha
;
#elif CV_SSE2
__m128
v_scale
;
__m128
v_alpha
;
__m128i
v_zero
;
bool
haveSIMD
;
#endif
...
...
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