MCPcopy Create free account
hub / github.com/creatale/node-dv / Magnitude_64f

Function Magnitude_64f

deps/opencv/modules/core/src/mathfuncs.cpp:222–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222static void Magnitude_64f(const double* x, const double* y, double* mag, int len)
223{
224 int i = 0;
225
226#if CV_SSE2
227 if( USE_SSE2 )
228 {
229 for( ; i <= len - 4; i += 4 )
230 {
231 __m128d x0 = _mm_loadu_pd(x + i), x1 = _mm_loadu_pd(x + i + 2);
232 __m128d y0 = _mm_loadu_pd(y + i), y1 = _mm_loadu_pd(y + i + 2);
233 x0 = _mm_add_pd(_mm_mul_pd(x0, x0), _mm_mul_pd(y0, y0));
234 x1 = _mm_add_pd(_mm_mul_pd(x1, x1), _mm_mul_pd(y1, y1));
235 x0 = _mm_sqrt_pd(x0); x1 = _mm_sqrt_pd(x1);
236 _mm_storeu_pd(mag + i, x0); _mm_storeu_pd(mag + i + 2, x1);
237 }
238 }
239#endif
240
241 for( ; i < len; i++ )
242 {
243 double x0 = x[i], y0 = y[i];
244 mag[i] = std::sqrt(x0*x0 + y0*y0);
245 }
246}
247
248
249static void InvSqrt_32f(const float* src, float* dst, int len)

Callers 2

magnitudeFunction · 0.85
cartToPolarFunction · 0.85

Calls 1

sqrtFunction · 0.85

Tested by

no test coverage detected