1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
16 // Third party copyrights are property of their respective owners.
18 // Redistribution and use in source and binary forms, with or without modification,
19 // are permitted provided that the following conditions are met:
21 // * Redistribution's of source code must retain the above copyright notice,
22 // this list of conditions and the following disclaimer.
24 // * Redistribution's in binary form must reproduce the above copyright notice,
25 // this list of conditions and the following disclaimer in the documentation
26 // and/or other materials provided with the distribution.
28 // * The name of the copyright holders may not be used to endorse or promote products
29 // derived from this software without specific prior written permission.
31 // This software is provided by the copyright holders and contributors "as is" and
32 // any express or implied warranties, including, but not limited to, the implied
33 // warranties of merchantability and fitness for a particular purpose are disclaimed.
34 // In no event shall the Intel Corporation or contributors be liable for any direct,
35 // indirect, incidental, special, exemplary, or consequential damages
36 // (including, but not limited to, procurement of substitute goods or services;
37 // loss of use, data, or profits; or business interruption) however caused
38 // and on any theory of liability, whether in contract, strict liability,
39 // or tort (including negligence or otherwise) arising in any way out of
40 // the use of this software, even if advised of the possibility of such damage.
44 #ifndef __OPENCV_CORE_BASE_HPP__
45 #define __OPENCV_CORE_BASE_HPP__
48 # error base.hpp header must be compiled as C++
53 #include "opencv2/core/cvdef.h"
54 #include "opencv2/core/cvstd.hpp"
62 StsOk= 0, /* everithing is ok */
63 StsBackTrace= -1, /* pseudo error for back trace */
64 StsError= -2, /* unknown /unspecified error */
65 StsInternal= -3, /* internal error (bad state) */
66 StsNoMem= -4, /* insufficient memory */
67 StsBadArg= -5, /* function arg/param is bad */
68 StsBadFunc= -6, /* unsupported function */
69 StsNoConv= -7, /* iter. didn't converge */
70 StsAutoTrace= -8, /* tracing */
71 HeaderIsNull= -9, /* image header is NULL */
72 BadImageSize= -10, /* image size is invalid */
73 BadOffset= -11, /* offset is invalid */
76 BadModelOrChSeq= -14, /**/
77 BadNumChannels= -15, /**/
78 BadNumChannel1U= -16, /**/
80 BadAlphaChannel= -18, /**/
84 BadCallBack= -22, /**/
85 BadTileSize= -23, /**/
88 MaskIsTiled= -26, /**/
89 StsNullPtr= -27, /* null pointer */
90 StsVecLengthErr= -28, /* incorrect vector length */
91 StsFilterStructContentErr= -29, /* incorr. filter structure content */
92 StsKernelStructContentErr= -30, /* incorr. transform kernel content */
93 StsFilterOffsetErr= -31, /* incorrect filter ofset value */
94 StsBadSize= -201, /* the input/output structure size is incorrect */
95 StsDivByZero= -202, /* division by zero */
96 StsInplaceNotSupported= -203, /* in-place operation is not supported */
97 StsObjectNotFound= -204, /* request can't be completed */
98 StsUnmatchedFormats= -205, /* formats of input/output arrays differ */
99 StsBadFlag= -206, /* flag is wrong or not supported */
100 StsBadPoint= -207, /* bad CvPoint */
101 StsBadMask= -208, /* bad format of mask (neither 8uC1 nor 8sC1)*/
102 StsUnmatchedSizes= -209, /* sizes of input/output structures do not match */
103 StsUnsupportedFormat= -210, /* the data format/type is not supported by the function*/
104 StsOutOfRange= -211, /* some of parameters are out of range */
105 StsParseError= -212, /* invalid syntax/structure of the parsed file */
106 StsNotImplemented= -213, /* the requested function/feature is not implemented */
107 StsBadMemBlock= -214, /* an allocated block has been corrupted */
108 StsAssert= -215, /* assertion failed */
109 GpuNotSupported= -216,
110 GpuApiCallError= -217,
111 OpenGlNotSupported= -218,
112 OpenGlApiCallError= -219,
113 OpenCLApiCallError= -220,
114 OpenCLDoubleNotSupported= -221,
115 OpenCLInitError= -222,
116 OpenCLNoAMDBlasFft= -223
120 // matrix decomposition types
121 enum { DECOMP_LU = 0,
155 enum { DFT_INVERSE = 1,
158 DFT_COMPLEX_OUTPUT = 16,
159 DFT_REAL_OUTPUT = 32,
160 DCT_INVERSE = DFT_INVERSE,
164 //! Various border types, image boundaries are denoted with '|'
166 BORDER_CONSTANT = 0, // iiiiii|abcdefgh|iiiiiii with some specified 'i'
167 BORDER_REPLICATE = 1, // aaaaaa|abcdefgh|hhhhhhh
168 BORDER_REFLECT = 2, // fedcba|abcdefgh|hgfedcb
169 BORDER_WRAP = 3, // cdefgh|abcdefgh|abcdefg
170 BORDER_REFLECT_101 = 4, // gfedcb|abcdefgh|gfedcba
171 BORDER_TRANSPARENT = 5, // uvwxyz|absdefgh|ijklmno
173 BORDER_REFLECT101 = BORDER_REFLECT_101,
174 BORDER_DEFAULT = BORDER_REFLECT_101,
175 BORDER_ISOLATED = 16 // do not look outside of ROI
180 //////////////// static assert /////////////////
182 #define CVAUX_CONCAT_EXP(a, b) a##b
183 #define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
185 #if defined(__clang__)
186 # ifndef __has_extension
187 # define __has_extension __has_feature /* compatibility, for older versions of clang */
189 # if __has_extension(cxx_static_assert)
190 # define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
192 #elif defined(__GNUC__)
193 # if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
194 # define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
196 #elif defined(_MSC_VER)
197 # if _MSC_VER >= 1600 /* MSVC 10 */
198 # define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
201 #ifndef CV_StaticAssert
202 # if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 2)
203 # define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })
205 template <bool x> struct CV_StaticAssert_failed;
206 template <> struct CV_StaticAssert_failed<true> { enum { val = 1 }; };
207 template<int x> struct CV_StaticAssert_test {};
208 # define CV_StaticAssert(condition, reason)\
209 typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast<bool>(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__)
213 //! Suppress warning "-Wdeprecated-declarations" / C4996
215 #if defined(_MSC_VER)
216 #define CV_DO_PRAGMA(x) __pragma(x)
217 #elif defined(__GNUC__)
218 #define CV_DO_PRAGMA(x) _Pragma (#x)
220 #define CV_DO_PRAGMA(x)
224 #define CV_SUPPRESS_DEPRECATED_START \
225 CV_DO_PRAGMA(warning(push)) \
226 CV_DO_PRAGMA(warning(disable: 4996))
227 #define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(warning(pop))
228 #elif defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
229 #define CV_SUPPRESS_DEPRECATED_START \
230 CV_DO_PRAGMA(GCC diagnostic push) \
231 CV_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
232 #define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(GCC diagnostic pop)
234 #define CV_SUPPRESS_DEPRECATED_START
235 #define CV_SUPPRESS_DEPRECATED_END
238 /*! @brief Signals an error and raises the exception.
239 By default the function prints information about the error to stderr,
240 then it either stops if setBreakOnError() had been called before or raises the exception.
241 It is possible to alternate error processing by using redirectError().
242 @param _code - error code @see CVStatus
243 @param _err - error description
244 @param _func - function name. Available only when the compiler supports getting it
245 @param _file - source file name where the error has occured
246 @param _line - line number in the source file where the error has occured
248 CV_EXPORTS void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
251 # if defined __clang__ || defined __APPLE__
252 # pragma GCC diagnostic push
253 # pragma GCC diagnostic ignored "-Winvalid-noreturn"
256 CV_INLINE CV_NORETURN void errorNoReturn(int _code, const String& _err, const char* _func, const char* _file, int _line)
258 error(_code, _err, _func, _file, _line);
260 # if !defined __clang__ && !defined __APPLE__
261 // this suppresses this warning: "noreturn" function does return [enabled by default]
263 // or use infinite loop: for (;;) {}
268 # if defined __clang__ || defined __APPLE__
269 # pragma GCC diagnostic pop
275 #define CV_Func __func__
276 #elif defined _MSC_VER
277 #define CV_Func __FUNCTION__
282 #define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
283 #define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
284 #define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
286 #define CV_ErrorNoReturn( code, msg ) cv::errorNoReturn( code, msg, CV_Func, __FILE__, __LINE__ )
287 #define CV_ErrorNoReturn_( code, args ) cv::errorNoReturn( code, cv::format args, CV_Func, __FILE__, __LINE__ )
290 # define CV_DbgAssert(expr) CV_Assert(expr)
292 # define CV_DbgAssert(expr)
297 /////////////// saturate_cast (used in image & signal processing) ///////////////////
299 template<typename _Tp> static inline _Tp saturate_cast(uchar v) { return _Tp(v); }
300 template<typename _Tp> static inline _Tp saturate_cast(schar v) { return _Tp(v); }
301 template<typename _Tp> static inline _Tp saturate_cast(ushort v) { return _Tp(v); }
302 template<typename _Tp> static inline _Tp saturate_cast(short v) { return _Tp(v); }
303 template<typename _Tp> static inline _Tp saturate_cast(unsigned v) { return _Tp(v); }
304 template<typename _Tp> static inline _Tp saturate_cast(int v) { return _Tp(v); }
305 template<typename _Tp> static inline _Tp saturate_cast(float v) { return _Tp(v); }
306 template<typename _Tp> static inline _Tp saturate_cast(double v) { return _Tp(v); }
308 template<> inline uchar saturate_cast<uchar>(schar v) { return (uchar)std::max((int)v, 0); }
309 template<> inline uchar saturate_cast<uchar>(ushort v) { return (uchar)std::min((unsigned)v, (unsigned)UCHAR_MAX); }
310 template<> inline uchar saturate_cast<uchar>(int v) { return (uchar)((unsigned)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); }
311 template<> inline uchar saturate_cast<uchar>(short v) { return saturate_cast<uchar>((int)v); }
312 template<> inline uchar saturate_cast<uchar>(unsigned v) { return (uchar)std::min(v, (unsigned)UCHAR_MAX); }
313 template<> inline uchar saturate_cast<uchar>(float v) { int iv = cvRound(v); return saturate_cast<uchar>(iv); }
314 template<> inline uchar saturate_cast<uchar>(double v) { int iv = cvRound(v); return saturate_cast<uchar>(iv); }
316 template<> inline schar saturate_cast<schar>(uchar v) { return (schar)std::min((int)v, SCHAR_MAX); }
317 template<> inline schar saturate_cast<schar>(ushort v) { return (schar)std::min((unsigned)v, (unsigned)SCHAR_MAX); }
318 template<> inline schar saturate_cast<schar>(int v) { return (schar)((unsigned)(v-SCHAR_MIN) <= (unsigned)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); }
319 template<> inline schar saturate_cast<schar>(short v) { return saturate_cast<schar>((int)v); }
320 template<> inline schar saturate_cast<schar>(unsigned v) { return (schar)std::min(v, (unsigned)SCHAR_MAX); }
321 template<> inline schar saturate_cast<schar>(float v) { int iv = cvRound(v); return saturate_cast<schar>(iv); }
322 template<> inline schar saturate_cast<schar>(double v) { int iv = cvRound(v); return saturate_cast<schar>(iv); }
324 template<> inline ushort saturate_cast<ushort>(schar v) { return (ushort)std::max((int)v, 0); }
325 template<> inline ushort saturate_cast<ushort>(short v) { return (ushort)std::max((int)v, 0); }
326 template<> inline ushort saturate_cast<ushort>(int v) { return (ushort)((unsigned)v <= (unsigned)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); }
327 template<> inline ushort saturate_cast<ushort>(unsigned v) { return (ushort)std::min(v, (unsigned)USHRT_MAX); }
328 template<> inline ushort saturate_cast<ushort>(float v) { int iv = cvRound(v); return saturate_cast<ushort>(iv); }
329 template<> inline ushort saturate_cast<ushort>(double v) { int iv = cvRound(v); return saturate_cast<ushort>(iv); }
331 template<> inline short saturate_cast<short>(ushort v) { return (short)std::min((int)v, SHRT_MAX); }
332 template<> inline short saturate_cast<short>(int v) { return (short)((unsigned)(v - SHRT_MIN) <= (unsigned)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); }
333 template<> inline short saturate_cast<short>(unsigned v) { return (short)std::min(v, (unsigned)SHRT_MAX); }
334 template<> inline short saturate_cast<short>(float v) { int iv = cvRound(v); return saturate_cast<short>(iv); }
335 template<> inline short saturate_cast<short>(double v) { int iv = cvRound(v); return saturate_cast<short>(iv); }
337 template<> inline int saturate_cast<int>(float v) { return cvRound(v); }
338 template<> inline int saturate_cast<int>(double v) { return cvRound(v); }
340 // we intentionally do not clip negative numbers, to make -1 become 0xffffffff etc.
341 template<> inline unsigned saturate_cast<unsigned>(float v) { return cvRound(v); }
342 template<> inline unsigned saturate_cast<unsigned>(double v) { return cvRound(v); }
346 //////////////////////////////// low-level functions ////////////////////////////////
348 CV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n);
349 CV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n);
350 CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n);
351 CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n);
353 CV_EXPORTS int normL1_(const uchar* a, const uchar* b, int n);
354 CV_EXPORTS int normHamming(const uchar* a, const uchar* b, int n);
355 CV_EXPORTS int normHamming(const uchar* a, const uchar* b, int n, int cellSize);
356 CV_EXPORTS float normL1_(const float* a, const float* b, int n);
357 CV_EXPORTS float normL2Sqr_(const float* a, const float* b, int n);
359 CV_EXPORTS void exp(const float* src, float* dst, int n);
360 CV_EXPORTS void log(const float* src, float* dst, int n);
361 CV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees);
362 CV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n);
364 //! computes cube root of the argument
365 CV_EXPORTS_W float cubeRoot(float val);
366 //! computes the angle in degrees (0..360) of the vector (x,y)
367 CV_EXPORTS_W float fastAtan2(float y, float x);
371 /////////////////////////////////// inline norms ////////////////////////////////////
373 template<typename _Tp, typename _AccTp> static inline
374 _AccTp normL2Sqr(const _Tp* a, int n)
378 #if CV_ENABLE_UNROLLED
379 for( ; i <= n - 4; i += 4 )
381 _AccTp v0 = a[i], v1 = a[i+1], v2 = a[i+2], v3 = a[i+3];
382 s += v0*v0 + v1*v1 + v2*v2 + v3*v3;
393 template<typename _Tp, typename _AccTp> static inline
394 _AccTp normL1(const _Tp* a, int n)
398 #if CV_ENABLE_UNROLLED
399 for(; i <= n - 4; i += 4 )
401 s += (_AccTp)std::abs(a[i]) + (_AccTp)std::abs(a[i+1]) +
402 (_AccTp)std::abs(a[i+2]) + (_AccTp)std::abs(a[i+3]);
410 template<typename _Tp, typename _AccTp> static inline
411 _AccTp normInf(const _Tp* a, int n)
414 for( int i = 0; i < n; i++ )
415 s = std::max(s, (_AccTp)std::abs(a[i]));
419 template<typename _Tp, typename _AccTp> static inline
420 _AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n)
424 #if CV_ENABLE_UNROLLED
425 for(; i <= n - 4; i += 4 )
427 _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]);
428 s += v0*v0 + v1*v1 + v2*v2 + v3*v3;
433 _AccTp v = _AccTp(a[i] - b[i]);
440 float normL2Sqr(const float* a, const float* b, int n)
443 return normL2Sqr_(a, b, n);
445 for( int i = 0; i < n; i++ )
447 float v = a[i] - b[i];
453 template<typename _Tp, typename _AccTp> static inline
454 _AccTp normL1(const _Tp* a, const _Tp* b, int n)
458 #if CV_ENABLE_UNROLLED
459 for(; i <= n - 4; i += 4 )
461 _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]);
462 s += std::abs(v0) + std::abs(v1) + std::abs(v2) + std::abs(v3);
467 _AccTp v = _AccTp(a[i] - b[i]);
474 float normL1(const float* a, const float* b, int n)
477 return normL1_(a, b, n);
479 for( int i = 0; i < n; i++ )
481 float v = a[i] - b[i];
488 int normL1(const uchar* a, const uchar* b, int n)
490 return normL1_(a, b, n);
493 template<typename _Tp, typename _AccTp> static inline
494 _AccTp normInf(const _Tp* a, const _Tp* b, int n)
497 for( int i = 0; i < n; i++ )
499 _AccTp v0 = a[i] - b[i];
500 s = std::max(s, std::abs(v0));
507 ////////////////// forward declarations for important OpenCV types //////////////////
509 template<typename _Tp, int cn> class Vec;
510 template<typename _Tp, int m, int n> class Matx;
512 template<typename _Tp> class Complex;
513 template<typename _Tp> class Point_;
514 template<typename _Tp> class Point3_;
515 template<typename _Tp> class Size_;
516 template<typename _Tp> class Rect_;
517 template<typename _Tp> class Scalar_;
519 class CV_EXPORTS RotatedRect;
520 class CV_EXPORTS Range;
521 class CV_EXPORTS TermCriteria;
522 class CV_EXPORTS KeyPoint;
523 class CV_EXPORTS DMatch;
524 class CV_EXPORTS RNG;
526 class CV_EXPORTS Mat;
527 class CV_EXPORTS MatExpr;
529 class CV_EXPORTS UMat;
531 class CV_EXPORTS SparseMat;
534 template<typename _Tp> class Mat_;
535 template<typename _Tp> class SparseMat_;
537 class CV_EXPORTS MatConstIterator;
538 class CV_EXPORTS SparseMatIterator;
539 class CV_EXPORTS SparseMatConstIterator;
540 template<typename _Tp> class MatIterator_;
541 template<typename _Tp> class MatConstIterator_;
542 template<typename _Tp> class SparseMatIterator_;
543 template<typename _Tp> class SparseMatConstIterator_;
547 class CV_EXPORTS Buffer;
548 class CV_EXPORTS Texture2D;
549 class CV_EXPORTS Arrays;
554 class CV_EXPORTS GpuMat;
555 class CV_EXPORTS CudaMem;
556 class CV_EXPORTS Stream;
557 class CV_EXPORTS Event;
562 template <typename _Tp> class GpuMat_;
567 CV_EXPORTS void setIppStatus(int status, const char * const funcname = NULL, const char * const filename = NULL,
569 CV_EXPORTS int getIppStatus();
570 CV_EXPORTS String getIppErrorLocation();
571 CV_EXPORTS bool useIPP();
572 CV_EXPORTS void setUseIPP(bool flag);
578 inline int32x2_t cv_vrnd_s32_f32(float32x2_t v)
580 static int32x2_t v_sign = vdup_n_s32(1 << 31),
581 v_05 = vreinterpret_s32_f32(vdup_n_f32(0.5f));
583 int32x2_t v_addition = vorr_s32(v_05, vand_s32(v_sign, vreinterpret_s32_f32(v)));
584 return vcvt_s32_f32(vadd_f32(v, vreinterpret_f32_s32(v_addition)));
587 inline int32x4_t cv_vrndq_s32_f32(float32x4_t v)
589 static int32x4_t v_sign = vdupq_n_s32(1 << 31),
590 v_05 = vreinterpretq_s32_f32(vdupq_n_f32(0.5f));
592 int32x4_t v_addition = vorrq_s32(v_05, vandq_s32(v_sign, vreinterpretq_s32_f32(v)));
593 return vcvtq_s32_f32(vaddq_f32(v, vreinterpretq_f32_s32(v_addition)));
596 inline uint32x2_t cv_vrnd_u32_f32(float32x2_t v)
598 static float32x2_t v_05 = vdup_n_f32(0.5f);
599 return vcvt_u32_f32(vadd_f32(v, v_05));
602 inline uint32x4_t cv_vrndq_u32_f32(float32x4_t v)
604 static float32x4_t v_05 = vdupq_n_f32(0.5f);
605 return vcvtq_u32_f32(vaddq_f32(v, v_05));
608 inline float32x4_t cv_vrecpq_f32(float32x4_t val)
610 float32x4_t reciprocal = vrecpeq_f32(val);
611 reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal);
612 reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal);
616 inline float32x2_t cv_vrecp_f32(float32x2_t val)
618 float32x2_t reciprocal = vrecpe_f32(val);
619 reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal);
620 reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal);
624 inline float32x4_t cv_vrsqrtq_f32(float32x4_t val)
626 float32x4_t e = vrsqrteq_f32(val);
627 e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e);
628 e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e);
632 inline float32x2_t cv_vrsqrt_f32(float32x2_t val)
634 float32x2_t e = vrsqrte_f32(val);
635 e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e);
636 e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e);
640 inline float32x4_t cv_vsqrtq_f32(float32x4_t val)
642 return cv_vrecpq_f32(cv_vrsqrtq_f32(val));
645 inline float32x2_t cv_vsqrt_f32(float32x2_t val)
647 return cv_vrecp_f32(cv_vrsqrt_f32(val));
654 #endif //__OPENCV_CORE_BASE_HPP__