mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge branch 4.x
This commit is contained in:
+26
-26
@@ -1335,7 +1335,7 @@ struct InRange_SIMD
|
||||
}
|
||||
};
|
||||
|
||||
#if CV_SIMD
|
||||
#if (CV_SIMD || CV_SIMD_SCALABLE)
|
||||
|
||||
template <>
|
||||
struct InRange_SIMD<uchar>
|
||||
@@ -1344,7 +1344,7 @@ struct InRange_SIMD<uchar>
|
||||
uchar * dst, int len) const
|
||||
{
|
||||
int x = 0;
|
||||
const int width = v_uint8::nlanes;
|
||||
const int width = VTraits<v_uint8>::vlanes();
|
||||
|
||||
for (; x <= len - width; x += width)
|
||||
{
|
||||
@@ -1352,7 +1352,7 @@ struct InRange_SIMD<uchar>
|
||||
v_uint8 low = vx_load(src2 + x);
|
||||
v_uint8 high = vx_load(src3 + x);
|
||||
|
||||
v_store(dst + x, (values >= low) & (high >= values));
|
||||
v_store(dst + x, v_and(v_ge(values, low), v_ge(high, values)));
|
||||
}
|
||||
vx_cleanup();
|
||||
return x;
|
||||
@@ -1366,7 +1366,7 @@ struct InRange_SIMD<schar>
|
||||
uchar * dst, int len) const
|
||||
{
|
||||
int x = 0;
|
||||
const int width = v_int8::nlanes;
|
||||
const int width = VTraits<v_int8>::vlanes();
|
||||
|
||||
for (; x <= len - width; x += width)
|
||||
{
|
||||
@@ -1374,7 +1374,7 @@ struct InRange_SIMD<schar>
|
||||
v_int8 low = vx_load(src2 + x);
|
||||
v_int8 high = vx_load(src3 + x);
|
||||
|
||||
v_store((schar*)(dst + x), (values >= low) & (high >= values));
|
||||
v_store((schar*)(dst + x), v_and(v_ge(values, low), v_ge(high, values)));
|
||||
}
|
||||
vx_cleanup();
|
||||
return x;
|
||||
@@ -1388,7 +1388,7 @@ struct InRange_SIMD<ushort>
|
||||
uchar * dst, int len) const
|
||||
{
|
||||
int x = 0;
|
||||
const int width = v_uint16::nlanes * 2;
|
||||
const int width = VTraits<v_uint16>::vlanes() * 2;
|
||||
|
||||
for (; x <= len - width; x += width)
|
||||
{
|
||||
@@ -1396,11 +1396,11 @@ struct InRange_SIMD<ushort>
|
||||
v_uint16 low1 = vx_load(src2 + x);
|
||||
v_uint16 high1 = vx_load(src3 + x);
|
||||
|
||||
v_uint16 values2 = vx_load(src1 + x + v_uint16::nlanes);
|
||||
v_uint16 low2 = vx_load(src2 + x + v_uint16::nlanes);
|
||||
v_uint16 high2 = vx_load(src3 + x + v_uint16::nlanes);
|
||||
v_uint16 values2 = vx_load(src1 + x + VTraits<v_uint16>::vlanes());
|
||||
v_uint16 low2 = vx_load(src2 + x + VTraits<v_uint16>::vlanes());
|
||||
v_uint16 high2 = vx_load(src3 + x + VTraits<v_uint16>::vlanes());
|
||||
|
||||
v_store(dst + x, v_pack((values1 >= low1) & (high1 >= values1), (values2 >= low2) & (high2 >= values2)));
|
||||
v_store(dst + x, v_pack(v_and(v_ge(values1, low1), v_ge(high1, values1)), v_and(v_ge(values2, low2), v_ge(high2, values2))));
|
||||
}
|
||||
vx_cleanup();
|
||||
return x;
|
||||
@@ -1414,7 +1414,7 @@ struct InRange_SIMD<short>
|
||||
uchar * dst, int len) const
|
||||
{
|
||||
int x = 0;
|
||||
const int width = (int)v_int16::nlanes * 2;
|
||||
const int width = (int)VTraits<v_int16>::vlanes() * 2;
|
||||
|
||||
for (; x <= len - width; x += width)
|
||||
{
|
||||
@@ -1422,11 +1422,11 @@ struct InRange_SIMD<short>
|
||||
v_int16 low1 = vx_load(src2 + x);
|
||||
v_int16 high1 = vx_load(src3 + x);
|
||||
|
||||
v_int16 values2 = vx_load(src1 + x + v_int16::nlanes);
|
||||
v_int16 low2 = vx_load(src2 + x + v_int16::nlanes);
|
||||
v_int16 high2 = vx_load(src3 + x + v_int16::nlanes);
|
||||
v_int16 values2 = vx_load(src1 + x + VTraits<v_int16>::vlanes());
|
||||
v_int16 low2 = vx_load(src2 + x + VTraits<v_int16>::vlanes());
|
||||
v_int16 high2 = vx_load(src3 + x + VTraits<v_int16>::vlanes());
|
||||
|
||||
v_store((schar*)(dst + x), v_pack((values1 >= low1) & (high1 >= values1), (values2 >= low2) & (high2 >= values2)));
|
||||
v_store((schar*)(dst + x), v_pack(v_and(v_ge(values1, low1), v_ge(high1, values1)), v_and(v_ge(values2, low2), v_ge(high2, values2))));
|
||||
}
|
||||
vx_cleanup();
|
||||
return x;
|
||||
@@ -1440,7 +1440,7 @@ struct InRange_SIMD<int>
|
||||
uchar * dst, int len) const
|
||||
{
|
||||
int x = 0;
|
||||
const int width = (int)v_int32::nlanes * 2;
|
||||
const int width = (int)VTraits<v_int32>::vlanes() * 2;
|
||||
|
||||
for (; x <= len - width; x += width)
|
||||
{
|
||||
@@ -1448,11 +1448,11 @@ struct InRange_SIMD<int>
|
||||
v_int32 low1 = vx_load(src2 + x);
|
||||
v_int32 high1 = vx_load(src3 + x);
|
||||
|
||||
v_int32 values2 = vx_load(src1 + x + v_int32::nlanes);
|
||||
v_int32 low2 = vx_load(src2 + x + v_int32::nlanes);
|
||||
v_int32 high2 = vx_load(src3 + x + v_int32::nlanes);
|
||||
v_int32 values2 = vx_load(src1 + x + VTraits<v_int32>::vlanes());
|
||||
v_int32 low2 = vx_load(src2 + x + VTraits<v_int32>::vlanes());
|
||||
v_int32 high2 = vx_load(src3 + x + VTraits<v_int32>::vlanes());
|
||||
|
||||
v_pack_store(dst + x, v_reinterpret_as_u16(v_pack((values1 >= low1) & (high1 >= values1), (values2 >= low2) & (high2 >= values2))));
|
||||
v_pack_store(dst + x, v_reinterpret_as_u16(v_pack(v_and(v_ge(values1, low1), v_ge(high1, values1)), v_and(v_ge(values2, low2), v_ge(high2, values2)))));
|
||||
}
|
||||
vx_cleanup();
|
||||
return x;
|
||||
@@ -1466,7 +1466,7 @@ struct InRange_SIMD<float>
|
||||
uchar * dst, int len) const
|
||||
{
|
||||
int x = 0;
|
||||
const int width = (int)v_float32::nlanes * 2;
|
||||
const int width = (int)VTraits<v_float32>::vlanes() * 2;
|
||||
|
||||
for (; x <= len - width; x += width)
|
||||
{
|
||||
@@ -1474,12 +1474,12 @@ struct InRange_SIMD<float>
|
||||
v_float32 low1 = vx_load(src2 + x);
|
||||
v_float32 high1 = vx_load(src3 + x);
|
||||
|
||||
v_float32 values2 = vx_load(src1 + x + v_float32::nlanes);
|
||||
v_float32 low2 = vx_load(src2 + x + v_float32::nlanes);
|
||||
v_float32 high2 = vx_load(src3 + x + v_float32::nlanes);
|
||||
v_float32 values2 = vx_load(src1 + x + VTraits<v_float32>::vlanes());
|
||||
v_float32 low2 = vx_load(src2 + x + VTraits<v_float32>::vlanes());
|
||||
v_float32 high2 = vx_load(src3 + x + VTraits<v_float32>::vlanes());
|
||||
|
||||
v_pack_store(dst + x, v_pack(v_reinterpret_as_u32(values1 >= low1) & v_reinterpret_as_u32(high1 >= values1),
|
||||
v_reinterpret_as_u32(values2 >= low2) & v_reinterpret_as_u32(high2 >= values2)));
|
||||
v_pack_store(dst + x, v_pack(v_and(v_reinterpret_as_u32(v_ge(values1, low1)), v_reinterpret_as_u32(v_ge(high1, values1))),
|
||||
v_and(v_reinterpret_as_u32(v_ge(values2, low2)), v_reinterpret_as_u32(v_ge(high2, values2)))));
|
||||
}
|
||||
vx_cleanup();
|
||||
return x;
|
||||
|
||||
Reference in New Issue
Block a user