From 15af3f7114bec3dd6e2f6a3a1348d39693356f5a Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 12 Oct 2014 12:40:41 -0700 Subject: [PATCH] fixes in VResizeLinearVec_32s8u --- modules/imgproc/src/imgwarp.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index 95c7dd355d..aa432e9fcb 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -917,22 +917,26 @@ struct VResizeLinearVec_32s8u int16x8_t v_src0 = vcombine_s16(vmovn_s32(v_src00), vmovn_s32(v_src01)); int16x8_t v_src1 = vcombine_s16(vmovn_s32(v_src10), vmovn_s32(v_src11)); - int16x8_t v_dst0 = vmlaq_s16(vmulq_s16(v_src0, v_b0), v_src1, v_b1); + int16x8_t v_dst0 = vaddq_s16(vshrq_n_s16(vqdmulhq_s16(v_src0, v_b0), 1), + vshrq_n_s16(vqdmulhq_s16(v_src1, v_b1), 1)); v_dst0 = vshrq_n_s16(vaddq_s16(v_dst0, v_delta), 2); - v_src00 = vshrq_n_s32(vld1q_s32(S0 + x + 8), 4), v_src10 = vshrq_n_s32(vld1q_s32(S1 + x + 8), 4); - v_src01 = vshrq_n_s32(vld1q_s32(S0 + x + 12), 4), v_src11 = vshrq_n_s32(vld1q_s32(S1 + x + 12), 4); + v_src00 = vshrq_n_s32(vld1q_s32(S0 + x + 8), 4); + v_src10 = vshrq_n_s32(vld1q_s32(S1 + x + 8), 4); + v_src01 = vshrq_n_s32(vld1q_s32(S0 + x + 12), 4); + v_src11 = vshrq_n_s32(vld1q_s32(S1 + x + 12), 4); v_src0 = vcombine_s16(vmovn_s32(v_src00), vmovn_s32(v_src01)); v_src1 = vcombine_s16(vmovn_s32(v_src10), vmovn_s32(v_src11)); - int16x8_t v_dst1 = vmlaq_s16(vmulq_s16(v_src0, v_b0), v_src1, v_b1); + int16x8_t v_dst1 = vaddq_s16(vshrq_n_s16(vqdmulhq_s16(v_src0, v_b0), 1), + vshrq_n_s16(vqdmulhq_s16(v_src1, v_b1), 1)); v_dst1 = vshrq_n_s16(vaddq_s16(v_dst1, v_delta), 2); vst1q_u8(dst + x, vcombine_u8(vqmovun_s16(v_dst0), vqmovun_s16(v_dst1))); } - return 0; + return x; } };