mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Fix for SSE2 intrinsics problem in the part of saturation arithmetic processing during 32s->16u packed conversion -
for some big negative values less than -INT_MAX+32767 the sign of the numbers is lost due to overflow that leads to incorrect saturation to MAX value, instead of zero. The issue is not reproduced with CV_ENABLED_INTRINSICS=OFF
This commit is contained in:
@@ -453,9 +453,9 @@ struct Cvt_SIMD<int, uchar>
|
||||
{
|
||||
v_int32x4 v_src1 = v_load(src + x), v_src2 = v_load(src + x + cWidth);
|
||||
v_int32x4 v_src3 = v_load(src + x + cWidth * 2), v_src4 = v_load(src + x + cWidth * 3);
|
||||
v_uint16x8 v_dst1 = v_pack_u(v_src1, v_src2);
|
||||
v_uint16x8 v_dst2 = v_pack_u(v_src3, v_src4);
|
||||
v_store(dst + x, v_pack(v_dst1, v_dst2));
|
||||
v_int16x8 v_dst1 = v_pack(v_src1, v_src2);
|
||||
v_int16x8 v_dst2 = v_pack(v_src3, v_src4);
|
||||
v_store(dst + x, v_pack_u(v_dst1, v_dst2));
|
||||
}
|
||||
}
|
||||
return x;
|
||||
|
||||
Reference in New Issue
Block a user