From afb157df676a536125abcc58cf743cc6e9cb6c88 Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Sat, 27 Apr 2019 02:01:24 +0200 Subject: [PATCH] core:vsx fix sum of v_reduce_sad --- modules/core/include/opencv2/core/hal/intrin_vsx.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/hal/intrin_vsx.hpp b/modules/core/include/opencv2/core/hal/intrin_vsx.hpp index c5ceb11324..390977b55e 100644 --- a/modules/core/include/opencv2/core/hal/intrin_vsx.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_vsx.hpp @@ -763,7 +763,7 @@ inline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b) inline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b) { vec_ushort8 ad = vec_absd(a.val, b.val); - VSX_UNUSED(vec_int4) sum = vec_sums(vec_int4_c(vec_unpackhu(ad)), vec_int4_c(vec_unpacklu(ad))); + VSX_UNUSED(vec_int4) sum = vec_sums(vec_int4_c(vec_unpackhu(ad)) + vec_int4_c(vec_unpacklu(ad)), vec_int4_z); return (unsigned)vec_extract(sum, 3); } inline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b)