From ccdc71286ca2224a596ac5c5cb350d61d59b7686 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 12 Oct 2014 04:54:27 -0700 Subject: [PATCH] cv::polarToCart --- modules/core/src/mathfuncs.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index 50212e3234..d21ff0e9b5 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -892,11 +892,24 @@ void polarToCart( InputArray src1, InputArray src2, SinCos_32f( angle, y, x, len, angleInDegrees ); if( mag ) - for( k = 0; k < len; k++ ) + { + k = 0; + + #if CV_NEON + for( ; k <= len - 4; k += 4 ) + { + float32x4_t v_m = vld1q_f32(mag + k); + vst1q_f32(x + k, vmulq_f32(vld1q_f32(x + k), v_m)); + vst1q_f32(y + k, vmulq_f32(vld1q_f32(y + k), v_m)); + } + #endif + + for( ; k < len; k++ ) { float m = mag[k]; x[k] *= m; y[k] *= m; } + } } else {