node-native-win-utils 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +144 -27
  2. package/binding.gyp +18 -5
  3. package/dist/index.d.ts +146 -4
  4. package/dist/index.js +107 -3
  5. package/include/opencv2/core/affine.hpp +678 -0
  6. package/include/opencv2/core/async.hpp +105 -0
  7. package/include/opencv2/core/base.hpp +664 -0
  8. package/include/opencv2/core/bindings_utils.hpp +325 -0
  9. package/include/opencv2/core/bufferpool.hpp +40 -0
  10. package/include/opencv2/core/check.hpp +170 -0
  11. package/include/opencv2/core/core.hpp +48 -0
  12. package/include/opencv2/core/core_c.h +3128 -0
  13. package/include/opencv2/core/cuda/block.hpp +211 -0
  14. package/include/opencv2/core/cuda/border_interpolate.hpp +722 -0
  15. package/include/opencv2/core/cuda/color.hpp +309 -0
  16. package/include/opencv2/core/cuda/common.hpp +131 -0
  17. package/include/opencv2/core/cuda/datamov_utils.hpp +113 -0
  18. package/include/opencv2/core/cuda/detail/color_detail.hpp +2018 -0
  19. package/include/opencv2/core/cuda/detail/reduce.hpp +365 -0
  20. package/include/opencv2/core/cuda/detail/reduce_key_val.hpp +502 -0
  21. package/include/opencv2/core/cuda/detail/transform_detail.hpp +392 -0
  22. package/include/opencv2/core/cuda/detail/type_traits_detail.hpp +191 -0
  23. package/include/opencv2/core/cuda/detail/vec_distance_detail.hpp +121 -0
  24. package/include/opencv2/core/cuda/dynamic_smem.hpp +88 -0
  25. package/include/opencv2/core/cuda/emulation.hpp +269 -0
  26. package/include/opencv2/core/cuda/filters.hpp +293 -0
  27. package/include/opencv2/core/cuda/funcattrib.hpp +79 -0
  28. package/include/opencv2/core/cuda/functional.hpp +805 -0
  29. package/include/opencv2/core/cuda/limits.hpp +128 -0
  30. package/include/opencv2/core/cuda/reduce.hpp +209 -0
  31. package/include/opencv2/core/cuda/saturate_cast.hpp +292 -0
  32. package/include/opencv2/core/cuda/scan.hpp +258 -0
  33. package/include/opencv2/core/cuda/simd_functions.hpp +869 -0
  34. package/include/opencv2/core/cuda/transform.hpp +75 -0
  35. package/include/opencv2/core/cuda/type_traits.hpp +90 -0
  36. package/include/opencv2/core/cuda/utility.hpp +230 -0
  37. package/include/opencv2/core/cuda/vec_distance.hpp +232 -0
  38. package/include/opencv2/core/cuda/vec_math.hpp +923 -0
  39. package/include/opencv2/core/cuda/vec_traits.hpp +288 -0
  40. package/include/opencv2/core/cuda/warp.hpp +139 -0
  41. package/include/opencv2/core/cuda/warp_reduce.hpp +76 -0
  42. package/include/opencv2/core/cuda/warp_shuffle.hpp +162 -0
  43. package/include/opencv2/core/cuda.hpp +1279 -0
  44. package/include/opencv2/core/cuda.inl.hpp +763 -0
  45. package/include/opencv2/core/cuda_stream_accessor.hpp +86 -0
  46. package/include/opencv2/core/cuda_types.hpp +144 -0
  47. package/include/opencv2/core/cv_cpu_dispatch.h +381 -0
  48. package/include/opencv2/core/cv_cpu_helper.h +550 -0
  49. package/include/opencv2/core/cvdef.h +973 -0
  50. package/include/opencv2/core/cvstd.hpp +190 -0
  51. package/include/opencv2/core/cvstd.inl.hpp +197 -0
  52. package/include/opencv2/core/cvstd_wrapper.hpp +154 -0
  53. package/include/opencv2/core/detail/async_promise.hpp +71 -0
  54. package/include/opencv2/core/detail/dispatch_helper.impl.hpp +49 -0
  55. package/include/opencv2/core/detail/exception_ptr.hpp +27 -0
  56. package/include/opencv2/core/directx.hpp +184 -0
  57. package/include/opencv2/core/dualquaternion.hpp +979 -0
  58. package/include/opencv2/core/dualquaternion.inl.hpp +487 -0
  59. package/include/opencv2/core/eigen.hpp +402 -0
  60. package/include/opencv2/core/fast_math.hpp +433 -0
  61. package/include/opencv2/core/hal/hal.hpp +256 -0
  62. package/include/opencv2/core/hal/interface.h +190 -0
  63. package/include/opencv2/core/hal/intrin.hpp +939 -0
  64. package/include/opencv2/core/hal/intrin_avx.hpp +3177 -0
  65. package/include/opencv2/core/hal/intrin_avx512.hpp +3090 -0
  66. package/include/opencv2/core/hal/intrin_cpp.hpp +3321 -0
  67. package/include/opencv2/core/hal/intrin_forward.hpp +191 -0
  68. package/include/opencv2/core/hal/intrin_lasx.hpp +3236 -0
  69. package/include/opencv2/core/hal/intrin_msa.hpp +1887 -0
  70. package/include/opencv2/core/hal/intrin_neon.hpp +2610 -0
  71. package/include/opencv2/core/hal/intrin_rvv.hpp +3320 -0
  72. package/include/opencv2/core/hal/intrin_rvv071.hpp +2545 -0
  73. package/include/opencv2/core/hal/intrin_rvv_scalable.hpp +2080 -0
  74. package/include/opencv2/core/hal/intrin_sse.hpp +3467 -0
  75. package/include/opencv2/core/hal/intrin_sse_em.hpp +180 -0
  76. package/include/opencv2/core/hal/intrin_vsx.hpp +1608 -0
  77. package/include/opencv2/core/hal/intrin_wasm.hpp +2782 -0
  78. package/include/opencv2/core/hal/msa_macros.h +1558 -0
  79. package/include/opencv2/core/hal/simd_utils.impl.hpp +186 -0
  80. package/include/opencv2/core/llapi/llapi.h +102 -0
  81. package/include/opencv2/core/mat.hpp +3775 -0
  82. package/include/opencv2/core/mat.inl.hpp +3422 -0
  83. package/include/opencv2/core/matx.hpp +1536 -0
  84. package/include/opencv2/core/neon_utils.hpp +128 -0
  85. package/include/opencv2/core/ocl.hpp +917 -0
  86. package/include/opencv2/core/ocl_genbase.hpp +69 -0
  87. package/include/opencv2/core/opencl/ocl_defs.hpp +82 -0
  88. package/include/opencv2/core/opencl/opencl_info.hpp +212 -0
  89. package/include/opencv2/core/opencl/opencl_svm.hpp +81 -0
  90. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp +602 -0
  91. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp +146 -0
  92. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp +371 -0
  93. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp +272 -0
  94. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp +62 -0
  95. package/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp +42 -0
  96. package/include/opencv2/core/opencl/runtime/opencl_clblas.hpp +53 -0
  97. package/include/opencv2/core/opencl/runtime/opencl_clfft.hpp +53 -0
  98. package/include/opencv2/core/opencl/runtime/opencl_core.hpp +84 -0
  99. package/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp +47 -0
  100. package/include/opencv2/core/opencl/runtime/opencl_gl.hpp +53 -0
  101. package/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp +47 -0
  102. package/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp +48 -0
  103. package/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp +42 -0
  104. package/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp +166 -0
  105. package/include/opencv2/core/opengl.hpp +733 -0
  106. package/include/opencv2/core/openvx/ovx_defs.hpp +48 -0
  107. package/include/opencv2/core/operations.hpp +610 -0
  108. package/include/opencv2/core/optim.hpp +302 -0
  109. package/include/opencv2/core/ovx.hpp +28 -0
  110. package/include/opencv2/core/parallel/backend/parallel_for.openmp.hpp +72 -0
  111. package/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp +153 -0
  112. package/include/opencv2/core/parallel/parallel_backend.hpp +90 -0
  113. package/include/opencv2/core/persistence.hpp +1350 -0
  114. package/include/opencv2/core/private/cv_cpu_include_simd_declarations.hpp +30 -0
  115. package/include/opencv2/core/private.cuda.hpp +169 -0
  116. package/include/opencv2/core/private.hpp +896 -0
  117. package/include/opencv2/core/quaternion.hpp +1696 -0
  118. package/include/opencv2/core/quaternion.inl.hpp +1063 -0
  119. package/include/opencv2/core/saturate.hpp +180 -0
  120. package/include/opencv2/core/simd_intrinsics.hpp +87 -0
  121. package/include/opencv2/core/softfloat.hpp +514 -0
  122. package/include/opencv2/core/sse_utils.hpp +652 -0
  123. package/include/opencv2/core/traits.hpp +417 -0
  124. package/include/opencv2/core/types.hpp +2457 -0
  125. package/include/opencv2/core/types_c.h +2126 -0
  126. package/include/opencv2/core/utility.hpp +1229 -0
  127. package/include/opencv2/core/utils/allocator_stats.hpp +29 -0
  128. package/include/opencv2/core/utils/allocator_stats.impl.hpp +158 -0
  129. package/include/opencv2/core/utils/buffer_area.private.hpp +136 -0
  130. package/include/opencv2/core/utils/configuration.private.hpp +22 -0
  131. package/include/opencv2/core/utils/filesystem.hpp +82 -0
  132. package/include/opencv2/core/utils/filesystem.private.hpp +66 -0
  133. package/include/opencv2/core/utils/fp_control.private.hpp +29 -0
  134. package/include/opencv2/core/utils/fp_control_utils.hpp +69 -0
  135. package/include/opencv2/core/utils/instrumentation.hpp +125 -0
  136. package/include/opencv2/core/utils/lock.private.hpp +119 -0
  137. package/include/opencv2/core/utils/logger.defines.hpp +42 -0
  138. package/include/opencv2/core/utils/logger.hpp +218 -0
  139. package/include/opencv2/core/utils/logtag.hpp +28 -0
  140. package/include/opencv2/core/utils/plugin_loader.private.hpp +165 -0
  141. package/include/opencv2/core/utils/tls.hpp +235 -0
  142. package/include/opencv2/core/utils/trace.hpp +252 -0
  143. package/include/opencv2/core/utils/trace.private.hpp +421 -0
  144. package/include/opencv2/core/va_intel.hpp +75 -0
  145. package/include/opencv2/core/version.hpp +26 -0
  146. package/include/opencv2/core/vsx_utils.hpp +1047 -0
  147. package/include/opencv2/core.hpp +3365 -0
  148. package/include/opencv2/imgcodecs/imgcodecs.hpp +48 -0
  149. package/include/opencv2/imgcodecs/imgcodecs_c.h +1 -0
  150. package/include/opencv2/imgcodecs/ios.h +59 -0
  151. package/include/opencv2/imgcodecs/legacy/constants_c.h +54 -0
  152. package/include/opencv2/imgcodecs/macosx.h +20 -0
  153. package/include/opencv2/imgcodecs.hpp +407 -0
  154. package/include/opencv2/imgproc/bindings.hpp +34 -0
  155. package/include/opencv2/imgproc/detail/gcgraph.hpp +395 -0
  156. package/include/opencv2/imgproc/hal/hal.hpp +246 -0
  157. package/include/opencv2/imgproc/hal/interface.h +46 -0
  158. package/include/opencv2/imgproc/imgproc.hpp +48 -0
  159. package/include/opencv2/imgproc/imgproc_c.h +1177 -0
  160. package/include/opencv2/imgproc/segmentation.hpp +141 -0
  161. package/include/opencv2/imgproc/types_c.h +659 -0
  162. package/include/opencv2/imgproc.hpp +5035 -0
  163. package/include/opencv2/opencv_modules.hpp +17 -0
  164. package/libs/libjpeg-turbo.lib +0 -0
  165. package/libs/libpng.lib +0 -0
  166. package/libs/opencv_core470.lib +0 -0
  167. package/libs/opencv_imgcodecs470.lib +0 -0
  168. package/libs/opencv_imgproc470.lib +0 -0
  169. package/libs/zlib.lib +0 -0
  170. package/package.json +8 -2
  171. package/prebuilds/win32-x64/node.napi.node +0 -0
  172. package/src/cpp/capturewindow.cpp +36 -46
  173. package/src/cpp/main.cpp +10 -2
  174. package/src/cpp/opencv.cpp +425 -0
@@ -0,0 +1,939 @@
1
+ /*M///////////////////////////////////////////////////////////////////////////////////////
2
+ //
3
+ // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4
+ //
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.
8
+ //
9
+ //
10
+ // License Agreement
11
+ // For Open Source Computer Vision Library
12
+ //
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
+ // Copyright (C) 2015, Itseez Inc., all rights reserved.
17
+ // Third party copyrights are property of their respective owners.
18
+ //
19
+ // Redistribution and use in source and binary forms, with or without modification,
20
+ // are permitted provided that the following conditions are met:
21
+ //
22
+ // * Redistribution's of source code must retain the above copyright notice,
23
+ // this list of conditions and the following disclaimer.
24
+ //
25
+ // * Redistribution's in binary form must reproduce the above copyright notice,
26
+ // this list of conditions and the following disclaimer in the documentation
27
+ // and/or other materials provided with the distribution.
28
+ //
29
+ // * The name of the copyright holders may not be used to endorse or promote products
30
+ // derived from this software without specific prior written permission.
31
+ //
32
+ // This software is provided by the copyright holders and contributors "as is" and
33
+ // any express or implied warranties, including, but not limited to, the implied
34
+ // warranties of merchantability and fitness for a particular purpose are disclaimed.
35
+ // In no event shall the Intel Corporation or contributors be liable for any direct,
36
+ // indirect, incidental, special, exemplary, or consequential damages
37
+ // (including, but not limited to, procurement of substitute goods or services;
38
+ // loss of use, data, or profits; or business interruption) however caused
39
+ // and on any theory of liability, whether in contract, strict liability,
40
+ // or tort (including negligence or otherwise) arising in any way out of
41
+ // the use of this software, even if advised of the possibility of such damage.
42
+ //
43
+ //M*/
44
+
45
+ #ifndef OPENCV_HAL_INTRIN_HPP
46
+ #define OPENCV_HAL_INTRIN_HPP
47
+
48
+ #include <cmath>
49
+ #include <float.h>
50
+ #include <stdlib.h>
51
+ #include "opencv2/core/cvdef.h"
52
+
53
+ #if defined(__GNUC__) && __GNUC__ == 12
54
+ #pragma GCC diagnostic push
55
+ #pragma GCC diagnostic ignored "-Wuninitialized"
56
+ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
57
+ #endif
58
+
59
+ #define OPENCV_HAL_ADD(a, b) ((a) + (b))
60
+ #define OPENCV_HAL_AND(a, b) ((a) & (b))
61
+ #define OPENCV_HAL_NOP(a) (a)
62
+ #define OPENCV_HAL_1ST(a, b) (a)
63
+
64
+ namespace {
65
+ inline unsigned int trailingZeros32(unsigned int value) {
66
+ #if defined(_MSC_VER)
67
+ #if (_MSC_VER < 1700) || defined(_M_ARM) || defined(_M_ARM64)
68
+ unsigned long index = 0;
69
+ _BitScanForward(&index, value);
70
+ return (unsigned int)index;
71
+ #elif defined(__clang__)
72
+ // clang-cl doesn't export _tzcnt_u32 for non BMI systems
73
+ return value ? __builtin_ctz(value) : 32;
74
+ #else
75
+ return _tzcnt_u32(value);
76
+ #endif
77
+ #elif defined(__GNUC__) || defined(__GNUG__)
78
+ return __builtin_ctz(value);
79
+ #elif defined(__ICC) || defined(__INTEL_COMPILER)
80
+ return _bit_scan_forward(value);
81
+ #elif defined(__clang__)
82
+ return llvm.cttz.i32(value, true);
83
+ #else
84
+ static const int MultiplyDeBruijnBitPosition[32] = {
85
+ 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
86
+ 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 };
87
+ return MultiplyDeBruijnBitPosition[((uint32_t)((value & -value) * 0x077CB531U)) >> 27];
88
+ #endif
89
+ }
90
+ }
91
+
92
+ // unlike HAL API, which is in cv::hal,
93
+ // we put intrinsics into cv namespace to make its
94
+ // access from within opencv code more accessible
95
+ namespace cv {
96
+
97
+ namespace hal {
98
+
99
+ enum StoreMode
100
+ {
101
+ STORE_UNALIGNED = 0,
102
+ STORE_ALIGNED = 1,
103
+ STORE_ALIGNED_NOCACHE = 2
104
+ };
105
+
106
+ }
107
+
108
+ // TODO FIXIT: Don't use "God" traits. Split on separate cases.
109
+ template<typename _Tp> struct V_TypeTraits
110
+ {
111
+ };
112
+
113
+ #define CV_INTRIN_DEF_TYPE_TRAITS(type, int_type_, uint_type_, abs_type_, w_type_, q_type_, sum_type_) \
114
+ template<> struct V_TypeTraits<type> \
115
+ { \
116
+ typedef type value_type; \
117
+ typedef int_type_ int_type; \
118
+ typedef abs_type_ abs_type; \
119
+ typedef uint_type_ uint_type; \
120
+ typedef w_type_ w_type; \
121
+ typedef q_type_ q_type; \
122
+ typedef sum_type_ sum_type; \
123
+ \
124
+ static inline int_type reinterpret_int(type x) \
125
+ { \
126
+ union { type l; int_type i; } v; \
127
+ v.l = x; \
128
+ return v.i; \
129
+ } \
130
+ \
131
+ static inline type reinterpret_from_int(int_type x) \
132
+ { \
133
+ union { type l; int_type i; } v; \
134
+ v.i = x; \
135
+ return v.l; \
136
+ } \
137
+ }
138
+
139
+ #define CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(type, int_type_, uint_type_, abs_type_, w_type_, sum_type_) \
140
+ template<> struct V_TypeTraits<type> \
141
+ { \
142
+ typedef type value_type; \
143
+ typedef int_type_ int_type; \
144
+ typedef abs_type_ abs_type; \
145
+ typedef uint_type_ uint_type; \
146
+ typedef w_type_ w_type; \
147
+ typedef sum_type_ sum_type; \
148
+ \
149
+ static inline int_type reinterpret_int(type x) \
150
+ { \
151
+ union { type l; int_type i; } v; \
152
+ v.l = x; \
153
+ return v.i; \
154
+ } \
155
+ \
156
+ static inline type reinterpret_from_int(int_type x) \
157
+ { \
158
+ union { type l; int_type i; } v; \
159
+ v.i = x; \
160
+ return v.l; \
161
+ } \
162
+ }
163
+
164
+ CV_INTRIN_DEF_TYPE_TRAITS(uchar, schar, uchar, uchar, ushort, unsigned, unsigned);
165
+ CV_INTRIN_DEF_TYPE_TRAITS(schar, schar, uchar, uchar, short, int, int);
166
+ CV_INTRIN_DEF_TYPE_TRAITS(ushort, short, ushort, ushort, unsigned, uint64, unsigned);
167
+ CV_INTRIN_DEF_TYPE_TRAITS(short, short, ushort, ushort, int, int64, int);
168
+ CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(unsigned, int, unsigned, unsigned, uint64, unsigned);
169
+ CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(int, int, unsigned, unsigned, int64, int);
170
+ CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(float, int, unsigned, float, double, float);
171
+ CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(uint64, int64, uint64, uint64, void, uint64);
172
+ CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(int64, int64, uint64, uint64, void, int64);
173
+ CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(double, int64, uint64, double, void, double);
174
+
175
+ #ifndef CV_DOXYGEN
176
+
177
+ #ifndef CV_CPU_OPTIMIZATION_HAL_NAMESPACE
178
+ #ifdef CV_FORCE_SIMD128_CPP
179
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_EMULATOR_CPP
180
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_EMULATOR_CPP {
181
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
182
+ #elif defined(CV_CPU_DISPATCH_MODE)
183
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE __CV_CAT(hal_, CV_CPU_DISPATCH_MODE)
184
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) {
185
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
186
+ #else
187
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline
188
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline {
189
+ #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
190
+ #endif
191
+ #endif // CV_CPU_OPTIMIZATION_HAL_NAMESPACE
192
+
193
+ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
194
+ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
195
+ using namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE;
196
+ #endif
197
+ }
198
+
199
+ #ifdef CV_DOXYGEN
200
+ # undef CV_AVX2
201
+ # undef CV_SSE2
202
+ # undef CV_NEON
203
+ # undef CV_VSX
204
+ # undef CV_FP16
205
+ # undef CV_MSA
206
+ # undef CV_RVV
207
+ #endif
208
+
209
+ #if (CV_SSE2 || CV_NEON || CV_VSX || CV_MSA || CV_WASM_SIMD || CV_RVV071) && !defined(CV_FORCE_SIMD128_CPP)
210
+ #define CV__SIMD_FORWARD 128
211
+ #include "opencv2/core/hal/intrin_forward.hpp"
212
+ #endif
213
+
214
+ #if CV_SSE2 && !defined(CV_FORCE_SIMD128_CPP)
215
+
216
+ #include "opencv2/core/hal/intrin_sse_em.hpp"
217
+ #include "opencv2/core/hal/intrin_sse.hpp"
218
+
219
+ #elif CV_NEON && !defined(CV_FORCE_SIMD128_CPP)
220
+
221
+ #include "opencv2/core/hal/intrin_neon.hpp"
222
+
223
+ #elif CV_RVV071 && !defined(CV_FORCE_SIMD128_CPP)
224
+ #define CV_SIMD128_CPP 0
225
+ #include "opencv2/core/hal/intrin_rvv071.hpp"
226
+
227
+ #elif CV_VSX && !defined(CV_FORCE_SIMD128_CPP)
228
+
229
+ #include "opencv2/core/hal/intrin_vsx.hpp"
230
+
231
+ #elif CV_MSA && !defined(CV_FORCE_SIMD128_CPP)
232
+
233
+ #include "opencv2/core/hal/intrin_msa.hpp"
234
+
235
+ #elif CV_WASM_SIMD && !defined(CV_FORCE_SIMD128_CPP)
236
+ #include "opencv2/core/hal/intrin_wasm.hpp"
237
+
238
+ #elif CV_RVV && !defined(CV_FORCE_SIMD128_CPP)
239
+ #if defined(CV_RVV_SCALABLE)
240
+ #include "opencv2/core/hal/intrin_rvv_scalable.hpp"
241
+ #else
242
+ #include "opencv2/core/hal/intrin_rvv.hpp"
243
+ #endif
244
+
245
+ #elif CV_LASX
246
+ #if !defined(CV_FORCE_SIMD128_CPP)
247
+ #define CV_FORCE_SIMD128_CPP 1
248
+ #endif
249
+ #include "opencv2/core/hal/intrin_cpp.hpp"
250
+
251
+ #else
252
+
253
+ #include "opencv2/core/hal/intrin_cpp.hpp"
254
+
255
+ #endif
256
+
257
+ // AVX2 can be used together with SSE2, so
258
+ // we define those two sets of intrinsics at once.
259
+ // Most of the intrinsics do not conflict (the proper overloaded variant is
260
+ // resolved by the argument types, e.g. v_float32x4 ~ SSE2, v_float32x8 ~ AVX2),
261
+ // but some of AVX2 intrinsics get v256_ prefix instead of v_, e.g. v256_load() vs v_load().
262
+ // Correspondingly, the wide intrinsics (which are mapped to the "widest"
263
+ // available instruction set) will get vx_ prefix
264
+ // (and will be mapped to v256_ counterparts) (e.g. vx_load() => v256_load())
265
+ #if CV_AVX2
266
+
267
+ #define CV__SIMD_FORWARD 256
268
+ #include "opencv2/core/hal/intrin_forward.hpp"
269
+ #include "opencv2/core/hal/intrin_avx.hpp"
270
+
271
+ #endif
272
+
273
+ // AVX512 can be used together with SSE2 and AVX2, so
274
+ // we define those sets of intrinsics at once.
275
+ // For some of AVX512 intrinsics get v512_ prefix instead of v_, e.g. v512_load() vs v_load().
276
+ // Wide intrinsics will be mapped to v512_ counterparts in this case(e.g. vx_load() => v512_load())
277
+ #if CV_AVX512_SKX
278
+
279
+ #define CV__SIMD_FORWARD 512
280
+ #include "opencv2/core/hal/intrin_forward.hpp"
281
+ #include "opencv2/core/hal/intrin_avx512.hpp"
282
+
283
+ #endif
284
+
285
+ #if CV_LASX
286
+
287
+ #define CV__SIMD_FORWARD 256
288
+ #include "opencv2/core/hal/intrin_forward.hpp"
289
+ #include "opencv2/core/hal/intrin_lasx.hpp"
290
+
291
+ #endif
292
+
293
+ //! @cond IGNORED
294
+
295
+ namespace cv {
296
+
297
+ #ifndef CV_DOXYGEN
298
+ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
299
+ #endif
300
+
301
+ #ifndef CV_SIMD128
302
+ #define CV_SIMD128 0
303
+ #endif
304
+
305
+ #ifndef CV_SIMD128_CPP
306
+ #define CV_SIMD128_CPP 0
307
+ #endif
308
+
309
+ #ifndef CV_SIMD128_64F
310
+ #define CV_SIMD128_64F 0
311
+ #endif
312
+
313
+ #ifndef CV_SIMD256
314
+ #define CV_SIMD256 0
315
+ #endif
316
+
317
+ #ifndef CV_SIMD256_64F
318
+ #define CV_SIMD256_64F 0
319
+ #endif
320
+
321
+ #ifndef CV_SIMD512
322
+ #define CV_SIMD512 0
323
+ #endif
324
+
325
+ #ifndef CV_SIMD512_64F
326
+ #define CV_SIMD512_64F 0
327
+ #endif
328
+
329
+ #ifndef CV_SIMD128_FP16
330
+ #define CV_SIMD128_FP16 0
331
+ #endif
332
+
333
+ #ifndef CV_SIMD256_FP16
334
+ #define CV_SIMD256_FP16 0
335
+ #endif
336
+
337
+ #ifndef CV_SIMD512_FP16
338
+ #define CV_SIMD512_FP16 0
339
+ #endif
340
+
341
+ #ifndef CV_SIMD_SCALABLE
342
+ #define CV_SIMD_SCALABLE 0
343
+ #endif
344
+
345
+ #ifndef CV_SIMD_SCALABLE_64F
346
+ #define CV_SIMD_SCALABLE_64F 0
347
+ #endif
348
+
349
+ //==================================================================================================
350
+
351
+ template<typename _Tp> struct V_RegTraits
352
+ {
353
+ };
354
+
355
+ #define CV_DEF_REG_TRAITS(prefix, _reg, lane_type, suffix, _u_reg, _w_reg, _q_reg, _int_reg, _round_reg) \
356
+ template<> struct V_RegTraits<_reg> \
357
+ { \
358
+ typedef _reg reg; \
359
+ typedef _u_reg u_reg; \
360
+ typedef _w_reg w_reg; \
361
+ typedef _q_reg q_reg; \
362
+ typedef _int_reg int_reg; \
363
+ typedef _round_reg round_reg; \
364
+ }
365
+
366
+ #if CV_SIMD128 || CV_SIMD128_CPP
367
+ CV_DEF_REG_TRAITS(v, v_uint8x16, uchar, u8, v_uint8x16, v_uint16x8, v_uint32x4, v_int8x16, void);
368
+ CV_DEF_REG_TRAITS(v, v_int8x16, schar, s8, v_uint8x16, v_int16x8, v_int32x4, v_int8x16, void);
369
+ CV_DEF_REG_TRAITS(v, v_uint16x8, ushort, u16, v_uint16x8, v_uint32x4, v_uint64x2, v_int16x8, void);
370
+ CV_DEF_REG_TRAITS(v, v_int16x8, short, s16, v_uint16x8, v_int32x4, v_int64x2, v_int16x8, void);
371
+ CV_DEF_REG_TRAITS(v, v_uint32x4, unsigned, u32, v_uint32x4, v_uint64x2, void, v_int32x4, void);
372
+ CV_DEF_REG_TRAITS(v, v_int32x4, int, s32, v_uint32x4, v_int64x2, void, v_int32x4, void);
373
+ #if CV_SIMD128_64F || CV_SIMD128_CPP
374
+ CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, v_float64x2, void, v_int32x4, v_int32x4);
375
+ #else
376
+ CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, void, void, v_int32x4, v_int32x4);
377
+ #endif
378
+ CV_DEF_REG_TRAITS(v, v_uint64x2, uint64, u64, v_uint64x2, void, void, v_int64x2, void);
379
+ CV_DEF_REG_TRAITS(v, v_int64x2, int64, s64, v_uint64x2, void, void, v_int64x2, void);
380
+ #if CV_SIMD128_64F
381
+ CV_DEF_REG_TRAITS(v, v_float64x2, double, f64, v_float64x2, void, void, v_int64x2, v_int32x4);
382
+ #endif
383
+ #endif
384
+
385
+ #if CV_SIMD256
386
+ CV_DEF_REG_TRAITS(v256, v_uint8x32, uchar, u8, v_uint8x32, v_uint16x16, v_uint32x8, v_int8x32, void);
387
+ CV_DEF_REG_TRAITS(v256, v_int8x32, schar, s8, v_uint8x32, v_int16x16, v_int32x8, v_int8x32, void);
388
+ CV_DEF_REG_TRAITS(v256, v_uint16x16, ushort, u16, v_uint16x16, v_uint32x8, v_uint64x4, v_int16x16, void);
389
+ CV_DEF_REG_TRAITS(v256, v_int16x16, short, s16, v_uint16x16, v_int32x8, v_int64x4, v_int16x16, void);
390
+ CV_DEF_REG_TRAITS(v256, v_uint32x8, unsigned, u32, v_uint32x8, v_uint64x4, void, v_int32x8, void);
391
+ CV_DEF_REG_TRAITS(v256, v_int32x8, int, s32, v_uint32x8, v_int64x4, void, v_int32x8, void);
392
+ CV_DEF_REG_TRAITS(v256, v_float32x8, float, f32, v_float32x8, v_float64x4, void, v_int32x8, v_int32x8);
393
+ CV_DEF_REG_TRAITS(v256, v_uint64x4, uint64, u64, v_uint64x4, void, void, v_int64x4, void);
394
+ CV_DEF_REG_TRAITS(v256, v_int64x4, int64, s64, v_uint64x4, void, void, v_int64x4, void);
395
+ CV_DEF_REG_TRAITS(v256, v_float64x4, double, f64, v_float64x4, void, void, v_int64x4, v_int32x8);
396
+ #endif
397
+
398
+ #if CV_SIMD512
399
+ CV_DEF_REG_TRAITS(v512, v_uint8x64, uchar, u8, v_uint8x64, v_uint16x32, v_uint32x16, v_int8x64, void);
400
+ CV_DEF_REG_TRAITS(v512, v_int8x64, schar, s8, v_uint8x64, v_int16x32, v_int32x16, v_int8x64, void);
401
+ CV_DEF_REG_TRAITS(v512, v_uint16x32, ushort, u16, v_uint16x32, v_uint32x16, v_uint64x8, v_int16x32, void);
402
+ CV_DEF_REG_TRAITS(v512, v_int16x32, short, s16, v_uint16x32, v_int32x16, v_int64x8, v_int16x32, void);
403
+ CV_DEF_REG_TRAITS(v512, v_uint32x16, unsigned, u32, v_uint32x16, v_uint64x8, void, v_int32x16, void);
404
+ CV_DEF_REG_TRAITS(v512, v_int32x16, int, s32, v_uint32x16, v_int64x8, void, v_int32x16, void);
405
+ CV_DEF_REG_TRAITS(v512, v_float32x16, float, f32, v_float32x16, v_float64x8, void, v_int32x16, v_int32x16);
406
+ CV_DEF_REG_TRAITS(v512, v_uint64x8, uint64, u64, v_uint64x8, void, void, v_int64x8, void);
407
+ CV_DEF_REG_TRAITS(v512, v_int64x8, int64, s64, v_uint64x8, void, void, v_int64x8, void);
408
+ CV_DEF_REG_TRAITS(v512, v_float64x8, double, f64, v_float64x8, void, void, v_int64x8, v_int32x16);
409
+ #endif
410
+ #if CV_SIMD_SCALABLE
411
+ CV_DEF_REG_TRAITS(v, v_uint8, uchar, u8, v_uint8, v_uint16, v_uint32, v_int8, void);
412
+ CV_DEF_REG_TRAITS(v, v_int8, schar, s8, v_uint8, v_int16, v_int32, v_int8, void);
413
+ CV_DEF_REG_TRAITS(v, v_uint16, ushort, u16, v_uint16, v_uint32, v_uint64, v_int16, void);
414
+ CV_DEF_REG_TRAITS(v, v_int16, short, s16, v_uint16, v_int32, v_int64, v_int16, void);
415
+ CV_DEF_REG_TRAITS(v, v_uint32, unsigned, u32, v_uint32, v_uint64, void, v_int32, void);
416
+ CV_DEF_REG_TRAITS(v, v_int32, int, s32, v_uint32, v_int64, void, v_int32, void);
417
+ CV_DEF_REG_TRAITS(v, v_float32, float, f32, v_float32, v_float64, void, v_int32, v_int32);
418
+ CV_DEF_REG_TRAITS(v, v_uint64, uint64, u64, v_uint64, void, void, v_int64, void);
419
+ CV_DEF_REG_TRAITS(v, v_int64, int64, s64, v_uint64, void, void, v_int64, void);
420
+ CV_DEF_REG_TRAITS(v, v_float64, double, f64, v_float64, void, void, v_int64, v_int32);
421
+ #endif
422
+ //! @endcond
423
+
424
+ #if CV_SIMD512 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 512)
425
+ #define CV__SIMD_NAMESPACE simd512
426
+ namespace CV__SIMD_NAMESPACE {
427
+ #define CV_SIMD 1
428
+ #define CV_SIMD_64F CV_SIMD512_64F
429
+ #define CV_SIMD_FP16 CV_SIMD512_FP16
430
+ #define CV_SIMD_WIDTH 64
431
+ //! @addtogroup core_hal_intrin
432
+ //! @{
433
+ //! @brief Maximum available vector register capacity 8-bit unsigned integer values
434
+ typedef v_uint8x64 v_uint8;
435
+ //! @brief Maximum available vector register capacity 8-bit signed integer values
436
+ typedef v_int8x64 v_int8;
437
+ //! @brief Maximum available vector register capacity 16-bit unsigned integer values
438
+ typedef v_uint16x32 v_uint16;
439
+ //! @brief Maximum available vector register capacity 16-bit signed integer values
440
+ typedef v_int16x32 v_int16;
441
+ //! @brief Maximum available vector register capacity 32-bit unsigned integer values
442
+ typedef v_uint32x16 v_uint32;
443
+ //! @brief Maximum available vector register capacity 32-bit signed integer values
444
+ typedef v_int32x16 v_int32;
445
+ //! @brief Maximum available vector register capacity 64-bit unsigned integer values
446
+ typedef v_uint64x8 v_uint64;
447
+ //! @brief Maximum available vector register capacity 64-bit signed integer values
448
+ typedef v_int64x8 v_int64;
449
+ //! @brief Maximum available vector register capacity 32-bit floating point values (single precision)
450
+ typedef v_float32x16 v_float32;
451
+ #if CV_SIMD512_64F
452
+ //! @brief Maximum available vector register capacity 64-bit floating point values (double precision)
453
+ typedef v_float64x8 v_float64;
454
+ #endif
455
+ //! @}
456
+
457
+ #define VXPREFIX(func) v512##func
458
+ } // namespace
459
+ using namespace CV__SIMD_NAMESPACE;
460
+ #elif CV_SIMD256 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 256)
461
+ #define CV__SIMD_NAMESPACE simd256
462
+ namespace CV__SIMD_NAMESPACE {
463
+ #define CV_SIMD 1
464
+ #define CV_SIMD_64F CV_SIMD256_64F
465
+ #define CV_SIMD_FP16 CV_SIMD256_FP16
466
+ #define CV_SIMD_WIDTH 32
467
+ //! @addtogroup core_hal_intrin
468
+ //! @{
469
+ //! @brief Maximum available vector register capacity 8-bit unsigned integer values
470
+ typedef v_uint8x32 v_uint8;
471
+ //! @brief Maximum available vector register capacity 8-bit signed integer values
472
+ typedef v_int8x32 v_int8;
473
+ //! @brief Maximum available vector register capacity 16-bit unsigned integer values
474
+ typedef v_uint16x16 v_uint16;
475
+ //! @brief Maximum available vector register capacity 16-bit signed integer values
476
+ typedef v_int16x16 v_int16;
477
+ //! @brief Maximum available vector register capacity 32-bit unsigned integer values
478
+ typedef v_uint32x8 v_uint32;
479
+ //! @brief Maximum available vector register capacity 32-bit signed integer values
480
+ typedef v_int32x8 v_int32;
481
+ //! @brief Maximum available vector register capacity 64-bit unsigned integer values
482
+ typedef v_uint64x4 v_uint64;
483
+ //! @brief Maximum available vector register capacity 64-bit signed integer values
484
+ typedef v_int64x4 v_int64;
485
+ //! @brief Maximum available vector register capacity 32-bit floating point values (single precision)
486
+ typedef v_float32x8 v_float32;
487
+ #if CV_SIMD256_64F
488
+ //! @brief Maximum available vector register capacity 64-bit floating point values (double precision)
489
+ typedef v_float64x4 v_float64;
490
+ #endif
491
+ //! @}
492
+
493
+ #define VXPREFIX(func) v256##func
494
+ } // namespace
495
+ using namespace CV__SIMD_NAMESPACE;
496
+ #elif (CV_SIMD128 || CV_SIMD128_CPP) && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 128)
497
+ #if defined CV_SIMD128_CPP
498
+ #define CV__SIMD_NAMESPACE simd128_cpp
499
+ #else
500
+ #define CV__SIMD_NAMESPACE simd128
501
+ #endif
502
+ namespace CV__SIMD_NAMESPACE {
503
+ #define CV_SIMD CV_SIMD128
504
+ #define CV_SIMD_64F CV_SIMD128_64F
505
+ #define CV_SIMD_WIDTH 16
506
+ //! @addtogroup core_hal_intrin
507
+ //! @{
508
+ //! @brief Maximum available vector register capacity 8-bit unsigned integer values
509
+ typedef v_uint8x16 v_uint8;
510
+ //! @brief Maximum available vector register capacity 8-bit signed integer values
511
+ typedef v_int8x16 v_int8;
512
+ //! @brief Maximum available vector register capacity 16-bit unsigned integer values
513
+ typedef v_uint16x8 v_uint16;
514
+ //! @brief Maximum available vector register capacity 16-bit signed integer values
515
+ typedef v_int16x8 v_int16;
516
+ //! @brief Maximum available vector register capacity 32-bit unsigned integer values
517
+ typedef v_uint32x4 v_uint32;
518
+ //! @brief Maximum available vector register capacity 32-bit signed integer values
519
+ typedef v_int32x4 v_int32;
520
+ //! @brief Maximum available vector register capacity 64-bit unsigned integer values
521
+ typedef v_uint64x2 v_uint64;
522
+ //! @brief Maximum available vector register capacity 64-bit signed integer values
523
+ typedef v_int64x2 v_int64;
524
+ //! @brief Maximum available vector register capacity 32-bit floating point values (single precision)
525
+ typedef v_float32x4 v_float32;
526
+ #if CV_SIMD128_64F
527
+ //! @brief Maximum available vector register capacity 64-bit floating point values (double precision)
528
+ typedef v_float64x2 v_float64;
529
+ #endif
530
+ //! @}
531
+
532
+ #define VXPREFIX(func) v##func
533
+ } // namespace
534
+ using namespace CV__SIMD_NAMESPACE;
535
+
536
+ #elif CV_SIMD_SCALABLE
537
+ #define CV__SIMD_NAMESPACE simd
538
+ namespace CV__SIMD_NAMESPACE {
539
+ #define CV_SIMD 0
540
+ #define CV_SIMD_WIDTH 128 /* 1024/8 */
541
+
542
+ #define VXPREFIX(func) v##func
543
+ } // namespace
544
+ using namespace CV__SIMD_NAMESPACE;
545
+
546
+ #endif
547
+
548
+ //! @cond IGNORED
549
+ #ifndef CV_SIMD_64F
550
+ #define CV_SIMD_64F 0
551
+ #endif
552
+
553
+ namespace CV__SIMD_NAMESPACE {
554
+ //! @addtogroup core_hal_intrin
555
+ //! @{
556
+ //! @name Wide init with value
557
+ //! @{
558
+ //! @brief Create maximum available capacity vector with elements set to a specific value
559
+ inline v_uint8 vx_setall_u8(uchar v) { return VXPREFIX(_setall_u8)(v); }
560
+ inline v_int8 vx_setall_s8(schar v) { return VXPREFIX(_setall_s8)(v); }
561
+ inline v_uint16 vx_setall_u16(ushort v) { return VXPREFIX(_setall_u16)(v); }
562
+ inline v_int16 vx_setall_s16(short v) { return VXPREFIX(_setall_s16)(v); }
563
+ inline v_int32 vx_setall_s32(int v) { return VXPREFIX(_setall_s32)(v); }
564
+ inline v_uint32 vx_setall_u32(unsigned v) { return VXPREFIX(_setall_u32)(v); }
565
+ inline v_float32 vx_setall_f32(float v) { return VXPREFIX(_setall_f32)(v); }
566
+ inline v_int64 vx_setall_s64(int64 v) { return VXPREFIX(_setall_s64)(v); }
567
+ inline v_uint64 vx_setall_u64(uint64 v) { return VXPREFIX(_setall_u64)(v); }
568
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
569
+ inline v_float64 vx_setall_f64(double v) { return VXPREFIX(_setall_f64)(v); }
570
+ #endif
571
+ //! @}
572
+
573
+ //! @name Wide init with zero
574
+ //! @{
575
+ //! @brief Create maximum available capacity vector with elements set to zero
576
+ inline v_uint8 vx_setzero_u8() { return VXPREFIX(_setzero_u8)(); }
577
+ inline v_int8 vx_setzero_s8() { return VXPREFIX(_setzero_s8)(); }
578
+ inline v_uint16 vx_setzero_u16() { return VXPREFIX(_setzero_u16)(); }
579
+ inline v_int16 vx_setzero_s16() { return VXPREFIX(_setzero_s16)(); }
580
+ inline v_int32 vx_setzero_s32() { return VXPREFIX(_setzero_s32)(); }
581
+ inline v_uint32 vx_setzero_u32() { return VXPREFIX(_setzero_u32)(); }
582
+ inline v_float32 vx_setzero_f32() { return VXPREFIX(_setzero_f32)(); }
583
+ inline v_int64 vx_setzero_s64() { return VXPREFIX(_setzero_s64)(); }
584
+ inline v_uint64 vx_setzero_u64() { return VXPREFIX(_setzero_u64)(); }
585
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
586
+ inline v_float64 vx_setzero_f64() { return VXPREFIX(_setzero_f64)(); }
587
+ #endif
588
+ //! @}
589
+
590
+ //! @name Wide load from memory
591
+ //! @{
592
+ //! @brief Load maximum available capacity register contents from memory
593
+ inline v_uint8 vx_load(const uchar * ptr) { return VXPREFIX(_load)(ptr); }
594
+ inline v_int8 vx_load(const schar * ptr) { return VXPREFIX(_load)(ptr); }
595
+ inline v_uint16 vx_load(const ushort * ptr) { return VXPREFIX(_load)(ptr); }
596
+ inline v_int16 vx_load(const short * ptr) { return VXPREFIX(_load)(ptr); }
597
+ inline v_int32 vx_load(const int * ptr) { return VXPREFIX(_load)(ptr); }
598
+ inline v_uint32 vx_load(const unsigned * ptr) { return VXPREFIX(_load)(ptr); }
599
+ inline v_float32 vx_load(const float * ptr) { return VXPREFIX(_load)(ptr); }
600
+ inline v_int64 vx_load(const int64 * ptr) { return VXPREFIX(_load)(ptr); }
601
+ inline v_uint64 vx_load(const uint64 * ptr) { return VXPREFIX(_load)(ptr); }
602
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
603
+ inline v_float64 vx_load(const double * ptr) { return VXPREFIX(_load)(ptr); }
604
+ #endif
605
+ //! @}
606
+
607
+ //! @name Wide load from memory(aligned)
608
+ //! @{
609
+ //! @brief Load maximum available capacity register contents from memory(aligned)
610
+ inline v_uint8 vx_load_aligned(const uchar * ptr) { return VXPREFIX(_load_aligned)(ptr); }
611
+ inline v_int8 vx_load_aligned(const schar * ptr) { return VXPREFIX(_load_aligned)(ptr); }
612
+ inline v_uint16 vx_load_aligned(const ushort * ptr) { return VXPREFIX(_load_aligned)(ptr); }
613
+ inline v_int16 vx_load_aligned(const short * ptr) { return VXPREFIX(_load_aligned)(ptr); }
614
+ inline v_int32 vx_load_aligned(const int * ptr) { return VXPREFIX(_load_aligned)(ptr); }
615
+ inline v_uint32 vx_load_aligned(const unsigned * ptr) { return VXPREFIX(_load_aligned)(ptr); }
616
+ inline v_float32 vx_load_aligned(const float * ptr) { return VXPREFIX(_load_aligned)(ptr); }
617
+ inline v_int64 vx_load_aligned(const int64 * ptr) { return VXPREFIX(_load_aligned)(ptr); }
618
+ inline v_uint64 vx_load_aligned(const uint64 * ptr) { return VXPREFIX(_load_aligned)(ptr); }
619
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
620
+ inline v_float64 vx_load_aligned(const double * ptr) { return VXPREFIX(_load_aligned)(ptr); }
621
+ #endif
622
+ //! @}
623
+
624
+ //! @name Wide load lower half from memory
625
+ //! @{
626
+ //! @brief Load lower half of maximum available capacity register from memory
627
+ inline v_uint8 vx_load_low(const uchar * ptr) { return VXPREFIX(_load_low)(ptr); }
628
+ inline v_int8 vx_load_low(const schar * ptr) { return VXPREFIX(_load_low)(ptr); }
629
+ inline v_uint16 vx_load_low(const ushort * ptr) { return VXPREFIX(_load_low)(ptr); }
630
+ inline v_int16 vx_load_low(const short * ptr) { return VXPREFIX(_load_low)(ptr); }
631
+ inline v_int32 vx_load_low(const int * ptr) { return VXPREFIX(_load_low)(ptr); }
632
+ inline v_uint32 vx_load_low(const unsigned * ptr) { return VXPREFIX(_load_low)(ptr); }
633
+ inline v_float32 vx_load_low(const float * ptr) { return VXPREFIX(_load_low)(ptr); }
634
+ inline v_int64 vx_load_low(const int64 * ptr) { return VXPREFIX(_load_low)(ptr); }
635
+ inline v_uint64 vx_load_low(const uint64 * ptr) { return VXPREFIX(_load_low)(ptr); }
636
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
637
+ inline v_float64 vx_load_low(const double * ptr) { return VXPREFIX(_load_low)(ptr); }
638
+ #endif
639
+ //! @}
640
+
641
+ //! @name Wide load halfs from memory
642
+ //! @{
643
+ //! @brief Load maximum available capacity register contents from two memory blocks
644
+ inline v_uint8 vx_load_halves(const uchar * ptr0, const uchar * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
645
+ inline v_int8 vx_load_halves(const schar * ptr0, const schar * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
646
+ inline v_uint16 vx_load_halves(const ushort * ptr0, const ushort * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
647
+ inline v_int16 vx_load_halves(const short * ptr0, const short * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
648
+ inline v_int32 vx_load_halves(const int * ptr0, const int * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
649
+ inline v_uint32 vx_load_halves(const unsigned * ptr0, const unsigned * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
650
+ inline v_float32 vx_load_halves(const float * ptr0, const float * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
651
+ inline v_int64 vx_load_halves(const int64 * ptr0, const int64 * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
652
+ inline v_uint64 vx_load_halves(const uint64 * ptr0, const uint64 * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
653
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
654
+ inline v_float64 vx_load_halves(const double * ptr0, const double * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }
655
+ #endif
656
+ //! @}
657
+
658
+ //! @name Wide LUT of elements
659
+ //! @{
660
+ //! @brief Load maximum available capacity register contents with array elements by provided indexes
661
+ inline v_uint8 vx_lut(const uchar * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
662
+ inline v_int8 vx_lut(const schar * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
663
+ inline v_uint16 vx_lut(const ushort * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
664
+ inline v_int16 vx_lut(const short* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
665
+ inline v_int32 vx_lut(const int* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
666
+ inline v_uint32 vx_lut(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
667
+ inline v_float32 vx_lut(const float* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
668
+ inline v_int64 vx_lut(const int64 * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
669
+ inline v_uint64 vx_lut(const uint64 * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
670
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
671
+ inline v_float64 vx_lut(const double* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }
672
+ #endif
673
+ //! @}
674
+
675
+ //! @name Wide LUT of element pairs
676
+ //! @{
677
+ //! @brief Load maximum available capacity register contents with array element pairs by provided indexes
678
+ inline v_uint8 vx_lut_pairs(const uchar * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
679
+ inline v_int8 vx_lut_pairs(const schar * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
680
+ inline v_uint16 vx_lut_pairs(const ushort * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
681
+ inline v_int16 vx_lut_pairs(const short* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
682
+ inline v_int32 vx_lut_pairs(const int* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
683
+ inline v_uint32 vx_lut_pairs(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
684
+ inline v_float32 vx_lut_pairs(const float* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
685
+ inline v_int64 vx_lut_pairs(const int64 * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
686
+ inline v_uint64 vx_lut_pairs(const uint64 * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
687
+ #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
688
+ inline v_float64 vx_lut_pairs(const double* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }
689
+ #endif
690
+ //! @}
691
+
692
+ //! @name Wide LUT of element quads
693
+ //! @{
694
+ //! @brief Load maximum available capacity register contents with array element quads by provided indexes
695
+ inline v_uint8 vx_lut_quads(const uchar* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
696
+ inline v_int8 vx_lut_quads(const schar* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
697
+ inline v_uint16 vx_lut_quads(const ushort* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
698
+ inline v_int16 vx_lut_quads(const short* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
699
+ inline v_int32 vx_lut_quads(const int* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
700
+ inline v_uint32 vx_lut_quads(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
701
+ inline v_float32 vx_lut_quads(const float* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }
702
+ //! @}
703
+
704
+ //! @name Wide load with double expansion
705
+ //! @{
706
+ //! @brief Load maximum available capacity register contents from memory with double expand
707
+ inline v_uint16 vx_load_expand(const uchar * ptr) { return VXPREFIX(_load_expand)(ptr); }
708
+ inline v_int16 vx_load_expand(const schar * ptr) { return VXPREFIX(_load_expand)(ptr); }
709
+ inline v_uint32 vx_load_expand(const ushort * ptr) { return VXPREFIX(_load_expand)(ptr); }
710
+ inline v_int32 vx_load_expand(const short* ptr) { return VXPREFIX(_load_expand)(ptr); }
711
+ inline v_int64 vx_load_expand(const int* ptr) { return VXPREFIX(_load_expand)(ptr); }
712
+ inline v_uint64 vx_load_expand(const unsigned* ptr) { return VXPREFIX(_load_expand)(ptr); }
713
+ inline v_float32 vx_load_expand(const float16_t * ptr) { return VXPREFIX(_load_expand)(ptr); }
714
+ //! @}
715
+
716
+ //! @name Wide load with quad expansion
717
+ //! @{
718
+ //! @brief Load maximum available capacity register contents from memory with quad expand
719
+ inline v_uint32 vx_load_expand_q(const uchar * ptr) { return VXPREFIX(_load_expand_q)(ptr); }
720
+ inline v_int32 vx_load_expand_q(const schar * ptr) { return VXPREFIX(_load_expand_q)(ptr); }
721
+ //! @}
722
+
723
+ /** @brief SIMD processing state cleanup call */
724
+ inline void vx_cleanup() { VXPREFIX(_cleanup)(); }
725
+
726
+ #if !CV_SIMD_SCALABLE
727
+ // Compatibility layer
728
+
729
+ template<typename T> struct VTraits {
730
+ static inline int vlanes() { return T::nlanes; }
731
+ enum { nlanes = T::nlanes, max_nlanes = T::nlanes };
732
+ using lane_type = typename T::lane_type;
733
+ };
734
+
735
+ #define OPENCV_HAL_WRAP_BIN_OP_ADDSUB(_Tpvec) \
736
+ inline _Tpvec v_add(const _Tpvec& a, const _Tpvec& b) \
737
+ { \
738
+ return a + b; \
739
+ } \
740
+ inline _Tpvec v_sub(const _Tpvec& a, const _Tpvec& b) \
741
+ { \
742
+ return a - b; \
743
+ } \
744
+ template<typename... Args> \
745
+ inline _Tpvec v_add(const _Tpvec& f1, const _Tpvec& f2, const Args&... vf) { \
746
+ return v_add(f1 + f2, vf...); \
747
+ }
748
+
749
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint8)
750
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint16)
751
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint32)
752
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint64)
753
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int8)
754
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int16)
755
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int32)
756
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int64)
757
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float32)
758
+ #if CV_SIMD_64F
759
+ OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float64)
760
+ #endif
761
+
762
+ #define OPENCV_HAL_WRAP_BIN_OP_LOGIC(_Tpvec) \
763
+ inline _Tpvec v_and(const _Tpvec& a, const _Tpvec& b) \
764
+ { \
765
+ return a & b; \
766
+ } \
767
+ inline _Tpvec v_or(const _Tpvec& a, const _Tpvec& b) \
768
+ { \
769
+ return a | b; \
770
+ } \
771
+ inline _Tpvec v_xor(const _Tpvec& a, const _Tpvec& b) \
772
+ { \
773
+ return a ^ b; \
774
+ } \
775
+ inline _Tpvec v_not(const _Tpvec& a) \
776
+ { \
777
+ return ~a; \
778
+ }
779
+
780
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint8)
781
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint16)
782
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint32)
783
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint64)
784
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int8)
785
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int16)
786
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int32)
787
+ OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int64)
788
+
789
+ #define OPENCV_HAL_WRAP_BIN_OP_MUL(_Tpvec) \
790
+ inline _Tpvec v_mul(const _Tpvec& a, const _Tpvec& b) \
791
+ { \
792
+ return a * b; \
793
+ } \
794
+ template<typename... Args> \
795
+ inline _Tpvec v_mul(const _Tpvec& f1, const _Tpvec& f2, const Args&... vf) { \
796
+ return v_mul(f1 * f2, vf...); \
797
+ }
798
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint8)
799
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_int8)
800
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint16)
801
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint32)
802
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_int16)
803
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_int32)
804
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_float32)
805
+ #if CV_SIMD_64F
806
+ OPENCV_HAL_WRAP_BIN_OP_MUL(v_float64)
807
+ #endif
808
+
809
+
810
+ inline v_float32 v_div(const v_float32& a, const v_float32& b) \
811
+ { \
812
+ return a / b; \
813
+ }
814
+ #if CV_SIMD_64F
815
+ inline v_float64 v_div(const v_float64& a, const v_float64& b) \
816
+ { \
817
+ return a / b; \
818
+ }
819
+ #endif
820
+
821
+ #define OPENCV_HAL_WRAP_CMP_OP(_Tpvec, intrin, op) \
822
+ inline _Tpvec v_##intrin(const _Tpvec& a, const _Tpvec& b) \
823
+ { \
824
+ return a op b; \
825
+ }
826
+
827
+ #define OPENCV_HAL_WRAP_CMP(_Tpvec) \
828
+ OPENCV_HAL_WRAP_CMP_OP(_Tpvec, eq, ==) \
829
+ OPENCV_HAL_WRAP_CMP_OP(_Tpvec, ne, !=) \
830
+ OPENCV_HAL_WRAP_CMP_OP(_Tpvec, lt, <) \
831
+ OPENCV_HAL_WRAP_CMP_OP(_Tpvec, gt, >) \
832
+ OPENCV_HAL_WRAP_CMP_OP(_Tpvec, le, <=) \
833
+ OPENCV_HAL_WRAP_CMP_OP(_Tpvec, ge, >=)
834
+
835
+ OPENCV_HAL_WRAP_CMP(v_uint8)
836
+ OPENCV_HAL_WRAP_CMP(v_uint16)
837
+ OPENCV_HAL_WRAP_CMP(v_uint32)
838
+ // OPENCV_HAL_WRAP_CMP(v_uint64)
839
+ OPENCV_HAL_WRAP_CMP(v_int8)
840
+ OPENCV_HAL_WRAP_CMP(v_int16)
841
+ OPENCV_HAL_WRAP_CMP(v_int32)
842
+ // OPENCV_HAL_WRAP_CMP(v_int64)
843
+ OPENCV_HAL_WRAP_CMP(v_float32)
844
+ #if CV_SIMD_64F
845
+ OPENCV_HAL_WRAP_CMP(v_float64)
846
+ #endif
847
+
848
+ //////////// get0 ////////////
849
+ #define OPENCV_HAL_WRAP_GRT0_INT(_Tpvec, _Tp) \
850
+ inline _Tp v_get0(const v_##_Tpvec& v) \
851
+ { \
852
+ return v.get0(); \
853
+ }
854
+
855
+ OPENCV_HAL_WRAP_GRT0_INT(uint8, uchar)
856
+ OPENCV_HAL_WRAP_GRT0_INT(int8, schar)
857
+ OPENCV_HAL_WRAP_GRT0_INT(uint16, ushort)
858
+ OPENCV_HAL_WRAP_GRT0_INT(int16, short)
859
+ OPENCV_HAL_WRAP_GRT0_INT(uint32, unsigned)
860
+ OPENCV_HAL_WRAP_GRT0_INT(int32, int)
861
+ OPENCV_HAL_WRAP_GRT0_INT(uint64, uint64)
862
+ OPENCV_HAL_WRAP_GRT0_INT(int64, int64)
863
+ OPENCV_HAL_WRAP_GRT0_INT(float32, float)
864
+ #if CV_SIMD_64F
865
+ OPENCV_HAL_WRAP_GRT0_INT(float64, double)
866
+ #endif
867
+
868
+ #define OPENCV_HAL_WRAP_EXTRACT(_Tpvec, _Tp, vl) \
869
+ inline _Tp v_extract_highest(const _Tpvec& v) \
870
+ { \
871
+ return v_extract_n<vl-1>(v); \
872
+ }
873
+
874
+ OPENCV_HAL_WRAP_EXTRACT(v_uint8, uchar, VTraits<v_uint8>::nlanes)
875
+ OPENCV_HAL_WRAP_EXTRACT(v_int8, schar, VTraits<v_int8>::nlanes)
876
+ OPENCV_HAL_WRAP_EXTRACT(v_uint16, ushort, VTraits<v_uint16>::nlanes)
877
+ OPENCV_HAL_WRAP_EXTRACT(v_int16, short, VTraits<v_int16>::nlanes)
878
+ OPENCV_HAL_WRAP_EXTRACT(v_uint32, unsigned int, VTraits<v_uint32>::nlanes)
879
+ OPENCV_HAL_WRAP_EXTRACT(v_int32, int, VTraits<v_int32>::nlanes)
880
+ OPENCV_HAL_WRAP_EXTRACT(v_uint64, uint64, VTraits<v_uint64>::nlanes)
881
+ OPENCV_HAL_WRAP_EXTRACT(v_int64, int64, VTraits<v_int64>::nlanes)
882
+ OPENCV_HAL_WRAP_EXTRACT(v_float32, float, VTraits<v_float32>::nlanes)
883
+ #if CV_SIMD_64F
884
+ OPENCV_HAL_WRAP_EXTRACT(v_float64, double, VTraits<v_float64>::nlanes)
885
+ #endif
886
+
887
+ #define OPENCV_HAL_WRAP_BROADCAST(_Tpvec) \
888
+ inline _Tpvec v_broadcast_highest(const _Tpvec& v) \
889
+ { \
890
+ return v_broadcast_element<VTraits<_Tpvec>::nlanes-1>(v); \
891
+ }
892
+
893
+ OPENCV_HAL_WRAP_BROADCAST(v_uint32)
894
+ OPENCV_HAL_WRAP_BROADCAST(v_int32)
895
+ OPENCV_HAL_WRAP_BROADCAST(v_float32)
896
+
897
+
898
+ #endif //!CV_SIMD_SCALABLE
899
+
900
+ //! @cond IGNORED
901
+
902
+ // backward compatibility
903
+ template<typename _Tp, typename _Tvec> static inline
904
+ void vx_store(_Tp* dst, const _Tvec& v) { return v_store(dst, v); }
905
+ // backward compatibility
906
+ template<typename _Tp, typename _Tvec> static inline
907
+ void vx_store_aligned(_Tp* dst, const _Tvec& v) { return v_store_aligned(dst, v); }
908
+
909
+ //! @endcond
910
+
911
+
912
+ //! @}
913
+ #undef VXPREFIX
914
+ } // namespace
915
+
916
+
917
+ #ifndef CV_SIMD_FP16
918
+ #define CV_SIMD_FP16 0 //!< Defined to 1 on native support of operations with float16x8_t / float16x16_t (SIMD256) types
919
+ #endif
920
+
921
+ #ifndef CV_SIMD
922
+ #define CV_SIMD 0
923
+ #endif
924
+
925
+ #include "simd_utils.impl.hpp"
926
+
927
+ #ifndef CV_DOXYGEN
928
+ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
929
+ #endif
930
+
931
+ } // cv::
932
+
933
+ //! @endcond
934
+
935
+ #if defined(__GNUC__) && __GNUC__ == 12
936
+ #pragma GCC diagnostic pop
937
+ #endif
938
+
939
+ #endif