mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #11332 from alalek:v_select_x86
This commit is contained in:
@@ -91,11 +91,7 @@ copyMask_<uchar>(const uchar* _src, size_t sstep, const uchar* mask, size_t mste
|
||||
uchar* dst = (uchar*)_dst;
|
||||
int x = 0;
|
||||
#if CV_SIMD128
|
||||
if( hasSIMD128()
|
||||
#if CV_SSE4_2
|
||||
&& USE_SSE4_2
|
||||
#endif
|
||||
) {
|
||||
{
|
||||
v_uint8x16 v_zero = v_setzero_u8();
|
||||
|
||||
for( ; x <= size.width - 16; x += 16 )
|
||||
@@ -104,11 +100,7 @@ copyMask_<uchar>(const uchar* _src, size_t sstep, const uchar* mask, size_t mste
|
||||
v_dst = v_load(dst + x),
|
||||
v_nmask = v_load(mask + x) == v_zero;
|
||||
|
||||
#if CV_SSE4_2
|
||||
v_dst = v_uint8x16(_mm_blendv_epi8(v_src.val, v_dst.val, v_nmask.val));
|
||||
#else
|
||||
v_dst = v_select(v_nmask, v_dst, v_src);
|
||||
#endif
|
||||
v_store(dst + x, v_dst);
|
||||
}
|
||||
}
|
||||
@@ -130,11 +122,7 @@ copyMask_<ushort>(const uchar* _src, size_t sstep, const uchar* mask, size_t mst
|
||||
ushort* dst = (ushort*)_dst;
|
||||
int x = 0;
|
||||
#if CV_SIMD128
|
||||
if( hasSIMD128()
|
||||
#if CV_SSE4_2
|
||||
&& USE_SSE4_2
|
||||
#endif
|
||||
) {
|
||||
{
|
||||
v_uint8x16 v_zero = v_setzero_u8();
|
||||
|
||||
for( ; x <= size.width - 16; x += 16 )
|
||||
@@ -146,13 +134,8 @@ copyMask_<ushort>(const uchar* _src, size_t sstep, const uchar* mask, size_t mst
|
||||
v_uint8x16 v_nmask = v_load(mask + x) == v_zero;
|
||||
v_zip(v_nmask, v_nmask, v_nmask1, v_nmask2);
|
||||
|
||||
#if CV_SSE4_2
|
||||
v_dst1 = v_uint16x8(_mm_blendv_epi8(v_src1.val, v_dst1.val, v_nmask1.val));
|
||||
v_dst2 = v_uint16x8(_mm_blendv_epi8(v_src2.val, v_dst2.val, v_nmask2.val));
|
||||
#else
|
||||
v_dst1 = v_select(v_reinterpret_as_u16(v_nmask1), v_dst1, v_src1);
|
||||
v_dst2 = v_select(v_reinterpret_as_u16(v_nmask2), v_dst2, v_src2);
|
||||
#endif
|
||||
v_store(dst + x, v_dst1);
|
||||
v_store(dst + x + 8, v_dst2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user