opencv2/core/hal/intrin_cpp.hpp#
#include <limits>
#include <cstring>
#include <algorithm>
#include <opencv2/core/utility.hpp>
#include <opencv2/core/saturate.hpp>
Include dependency graph for intrin_cpp.hpp:
This graph shows which files directly or indirectly include intrin_cpp.hpp:
Classes#
struct cv::v_reg
Namespaces#
namespace cv
Enumerations#
enum cv { simd128_width = 16, simd256_width = 32, simd512_width = 64, simdmax_width = simd512_width }
Functions#
v_reg< uchar, 2 *n > cv::v_pack_b (const v_reg< ushort, n > &a, const v_reg< ushort, n > &b)
! For 16-bit boolean values
v_reg< uchar, 4 *n > cv::v_pack_b (const v_reg< unsigned, n > &a, const v_reg< unsigned, n > &b, const v_reg< unsigned, n > &c, const v_reg< unsigned, n > &d)
v_reg< uchar, 8 *n > cv::v_pack_b (const v_reg< uint64, n > &a, const v_reg< uint64, n > &b, const v_reg< uint64, n > &c, const v_reg< uint64, n > &d, const v_reg< uint64, n > &e, const v_reg< uint64, n > &f, const v_reg< uint64, n > &g, const v_reg< uint64, n > &h)
void cv::v256_cleanup ()
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load (const _Tp *ptr)
Load 256-bit length register contents from memory.
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_aligned (const _Tp *ptr)
Load register contents from memory (aligned)
v_reg< typename V_TypeTraits< _Tp >::w_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v256_load_expand (const _Tp *ptr)
Load register contents from memory with double expand.
v_reg< float, simd256_width/sizeof(float)> cv::v256_load_expand (const hfloat *ptr)
v_reg< typename V_TypeTraits< _Tp >::q_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::q_type)> cv::v256_load_expand_q (const _Tp *ptr)
Load register contents from memory with quad expand.
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_halves (const _Tp *loptr, const _Tp *hiptr)
Load register contents from two memory blocks.
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_low (const _Tp *ptr)
Load 128-bits of data to lower part (high part is undefined).
void cv::v512_cleanup ()
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load (const _Tp *ptr)
Load 512-bit length register contents from memory.
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_aligned (const _Tp *ptr)
Load register contents from memory (aligned)
v_reg< typename V_TypeTraits< _Tp >::w_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v512_load_expand (const _Tp *ptr)
Load register contents from memory with double expand.
v_reg< float, simd512_width/sizeof(float)> cv::v512_load_expand (const hfloat *ptr)
v_reg< typename V_TypeTraits< _Tp >::q_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::q_type)> cv::v512_load_expand_q (const _Tp *ptr)
Load register contents from memory with quad expand.
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_halves (const _Tp *loptr, const _Tp *hiptr)
Load register contents from two memory blocks.
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_low (const _Tp *ptr)
Load 256-bits of data to lower part (high part is undefined).
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_absdiff (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Add values without saturation.
v_reg< double, n > cv::v_absdiff (const v_reg< double, n > &a, const v_reg< double, n > &b)
v_reg< float, n > cv::v_absdiff (const v_reg< float, n > &a, const v_reg< float, n > &b)
v_reg< _Tp, n > cv::v_absdiffs (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Saturating absolute difference.
v_reg< _Tp, n > cv::v_add (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Add values.
v_reg< _Tp, n > cv::v_and (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Bitwise AND.
v_reg< _Tp, n > cv::v_broadcast_element (const v_reg< _Tp, n > &a)
Broadcast i-th element of vector.
v_reg< int, n *2 > cv::v_ceil (const v_reg< double, n > &a)
v_reg< int, n > cv::v_ceil (const v_reg< float, n > &a)
Ceil elements.
bool cv::v_check_all (const v_reg< _Tp, n > &a)
Check if all packed values are less than zero.
bool cv::v_check_any (const v_reg< _Tp, n > &a)
Check if any of packed values is less than zero.
void cv::v_cleanup ()
v_reg< _Tp, n > cv::v_combine_high (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Combine vector from last elements of two vectors.
v_reg< _Tp, n > cv::v_combine_low (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Combine vector from first elements of two vectors.
v_reg< float, n *2 > cv::v_cvt_f32 (const v_reg< double, n > &a)
Convert lower half to float.
v_reg< float, n *2 > cv::v_cvt_f32 (const v_reg< double, n > &a, const v_reg< double, n > &b)
Convert to float.
v_reg< float, n > cv::v_cvt_f32 (const v_reg< int, n > &a)
Convert to float.
v_reg< double,(n/2)> cv::v_cvt_f64 (const v_reg< float, n > &a)
Convert lower half to double.
v_reg< double, n/2 > cv::v_cvt_f64 (const v_reg< int, n > &a)
Convert lower half to double.
v_reg< double, n > cv::v_cvt_f64 (const v_reg< int64, n > &a)
Convert to double.
v_reg< double,(n/2)> cv::v_cvt_f64_high (const v_reg< float, n > &a)
Convert to double high part of vector.
v_reg< double,(n/2)> cv::v_cvt_f64_high (const v_reg< int, n > &a)
Convert to double high part of vector.
v_reg< _Tp, n > cv::v_div (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Divide values.
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_dotprod (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Dot product of elements.
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_dotprod (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > &c)
Dot product of elements.
v_reg< typename V_TypeTraits< _Tp >::q_type, n/4 > cv::v_dotprod_expand (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Dot product of elements and expand.
v_reg< typename V_TypeTraits< _Tp >::q_type, n/4 > cv::v_dotprod_expand (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< typename V_TypeTraits< _Tp >::q_type, n/4 > &c)
Dot product of elements.
v_reg< double, n/2 > cv::v_dotprod_expand (const v_reg< int, n > &a, const v_reg< int, n > &b)
v_reg< double, n/2 > cv::v_dotprod_expand (const v_reg< int, n > &a, const v_reg< int, n > &b, const v_reg< double, n/2 > &c)
v_reg< typename V_TypeTraits< _Tp >::q_type, n/4 > cv::v_dotprod_expand_fast (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Fast Dot product of elements and expand.
v_reg< typename V_TypeTraits< _Tp >::q_type, n/4 > cv::v_dotprod_expand_fast (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< typename V_TypeTraits< _Tp >::q_type, n/4 > &c)
Fast Dot product of elements.
v_reg< double, n/2 > cv::v_dotprod_expand_fast (const v_reg< int, n > &a, const v_reg< int, n > &b)
v_reg< double, n/2 > cv::v_dotprod_expand_fast (const v_reg< int, n > &a, const v_reg< int, n > &b, const v_reg< double, n/2 > &c)
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_dotprod_fast (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Fast Dot product of elements.
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_dotprod_fast (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > &c)
Fast Dot product of elements.
void cv::v_expand (const v_reg< _Tp, n > &a, v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > &b0, v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > &b1)
Expand values to the wider pack type.
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_expand_high (const v_reg< _Tp, n > &a)
Expand higher values to the wider pack type.
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_expand_low (const v_reg< _Tp, n > &a)
Expand lower values to the wider pack type.
v_reg< _Tp, n > cv::v_extract (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Vector extract.
_Tp cv::v_extract_n (const v_reg< _Tp, n > &v)
Vector extract.
v_reg< int, n *2 > cv::v_floor (const v_reg< double, n > &a)
v_reg< int, n > cv::v_floor (const v_reg< float, n > &a)
Floor elements.
v_reg< _Tp, n > cv::v_fma (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< _Tp, n > &c)
Multiply and add.
v_reg< _Tp, n > cv::v_interleave_pairs (const v_reg< _Tp, n > &vec)
v_reg< _Tp, n > cv::v_interleave_quads (const v_reg< _Tp, n > &vec)
v_reg< _Tp, n > cv::v_invsqrt (const v_reg< _Tp, n > &a)
Inversed square root.
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load (const _Tp *ptr)
Load register contents from memory.
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_aligned (const _Tp *ptr)
Load register contents from memory (aligned)
void cv::v_load_deinterleave (const _Tp *ptr, v_reg< _Tp, n > &a, v_reg< _Tp, n > &b)
Load and deinterleave (2 channels)
void cv::v_load_deinterleave (const _Tp *ptr, v_reg< _Tp, n > &a, v_reg< _Tp, n > &b, v_reg< _Tp, n > &c)
Load and deinterleave (3 channels)
void cv::v_load_deinterleave (const _Tp *ptr, v_reg< _Tp, n > &a, v_reg< _Tp, n > &b, v_reg< _Tp, n > &c, v_reg< _Tp, n > &d)
Load and deinterleave (4 channels)
v_reg< typename V_TypeTraits< _Tp >::w_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v_load_expand (const _Tp *ptr)
Load register contents from memory with double expand.
v_reg< float, simd128_width/sizeof(float)> cv::v_load_expand (const hfloat *ptr)
v_reg< typename V_TypeTraits< _Tp >::q_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::q_type)> cv::v_load_expand_q (const _Tp *ptr)
Load register contents from memory with quad expand.
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_halves (const _Tp *loptr, const _Tp *hiptr)
Load register contents from two memory blocks.
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_low (const _Tp *ptr)
Load 64-bits of data to lower part (high part is undefined).
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut (const _Tp *tab, const int *idx)
v_reg< double, n/2 > cv::v_lut (const double *tab, const v_reg< int, n > &idx)
v_reg< float, n > cv::v_lut (const float *tab, const v_reg< int, n > &idx)
v_reg< int, n > cv::v_lut (const int *tab, const v_reg< int, n > &idx)
v_reg< unsigned, n > cv::v_lut (const unsigned *tab, const v_reg< int, n > &idx)
void cv::v_lut_deinterleave (const double *tab, const v_reg< int, n *2 > &idx, v_reg< double, n > &x, v_reg< double, n > &y)
void cv::v_lut_deinterleave (const float *tab, const v_reg< int, n > &idx, v_reg< float, n > &x, v_reg< float, n > &y)
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut_pairs (const _Tp *tab, const int *idx)
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut_quads (const _Tp *tab, const int *idx)
v_reg< _Tp, n > cv::v_magnitude (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Magnitude.
v_reg< float, n > cv::v_matmul (const v_reg< float, n > &v, const v_reg< float, n > &a, const v_reg< float, n > &b, const v_reg< float, n > &c, const v_reg< float, n > &d)
Matrix multiplication.
v_reg< float, n > cv::v_matmuladd (const v_reg< float, n > &v, const v_reg< float, n > &a, const v_reg< float, n > &b, const v_reg< float, n > &c, const v_reg< float, n > &d)
Matrix multiplication and add.
v_reg< _Tp, n > cv::v_mul (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Multiply values.
void cv::v_mul_expand (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > &c, v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > &d)
Multiply and expand.
v_reg< _Tp, n > cv::v_mul_hi (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Multiply and extract high part.
v_reg< _Tp, n > cv::v_muladd (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< _Tp, n > &c)
A synonym for v_fma.
v_reg< _Tp, n > cv::v_not (const v_reg< _Tp, n > &a)
Bitwise NOT.
v_reg< double, n > cv::v_not_nan (const v_reg< double, n > &a)
v_reg< float, n > cv::v_not_nan (const v_reg< float, n > &a)
Less-than comparison.
v_reg< _Tp, n > cv::v_or (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Bitwise OR.
void cv::v_pack_store (hfloat *ptr, const v_reg< float, n > &v)
v_reg< _Tp, n > cv::v_pack_triplets (const v_reg< _Tp, n > &vec)
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_popcount (const v_reg< _Tp, n > &a)
Count the 1 bits in the vector lanes and return result as corresponding unsigned type.
void cv::v_recombine (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, v_reg< _Tp, n > &low, v_reg< _Tp, n > &high)
Combine two vectors from lower and higher parts of two other vectors.
V_TypeTraits< typenameV_TypeTraits< _Tp >::abs_type >::sum_type cv::v_reduce_sad (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Sum absolute differences of values.
V_TypeTraits< _Tp >::sum_type cv::v_reduce_sum (const v_reg< _Tp, n > &a)
Element shift left among vector.
v_reg< float, n > cv::v_reduce_sum4 (const v_reg< float, n > &a, const v_reg< float, n > &b, const v_reg< float, n > &c, const v_reg< float, n > &d)
Sums all elements of each input vector, returns the vector of sums.
v_reg< _Tp, n > cv::v_reverse (const v_reg< _Tp, n > &a)
Vector reverse order.
v_reg< int, n *2 > cv::v_round (const v_reg< double, n > &a)
v_reg< int, n *2 > cv::v_round (const v_reg< double, n > &a, const v_reg< double, n > &b)
v_reg< int, n > cv::v_round (const v_reg< float, n > &a)
Round elements.
int cv::v_scan_forward (const v_reg< _Tp, n > &a)
Get first negative lane index.
v_reg< _Tp, n > cv::v_select (const v_reg< _Tp, n > &mask, const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Per-element select (blend operation)
int cv::v_signmask (const v_reg< _Tp, n > &a)
Get negative values mask.
void cv::v_sincos (const v_reg< _Tp, n > &x, v_reg< _Tp, n > &s, v_reg< _Tp, n > &c)
Natural logarithm \( \log(x) \) of elements.
v_reg< _Tp, n > cv::v_sqr_magnitude (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Square of the magnitude.
void cv::v_store (_Tp *ptr, const v_reg< _Tp, n > &a)
Store data to memory.
void cv::v_store (_Tp *ptr, const v_reg< _Tp, n > &a, hal::StoreMode)
void cv::v_store_aligned (_Tp *ptr, const v_reg< _Tp, n > &a)
Store data to memory (aligned)
void cv::v_store_aligned (_Tp *ptr, const v_reg< _Tp, n > &a, hal::StoreMode)
void cv::v_store_aligned_nocache (_Tp *ptr, const v_reg< _Tp, n > &a)
void cv::v_store_high (_Tp *ptr, const v_reg< _Tp, n > &a)
Store data to memory (higher half)
void cv::v_store_interleave (_Tp *ptr, const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< _Tp, n > &c, const v_reg< _Tp, n > &d, hal::StoreMode=hal::STORE_UNALIGNED)
Interleave and store (4 channels)
void cv::v_store_interleave (_Tp *ptr, const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, const v_reg< _Tp, n > &c, hal::StoreMode=hal::STORE_UNALIGNED)
Interleave and store (3 channels)
void cv::v_store_interleave (_Tp *ptr, const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, hal::StoreMode=hal::STORE_UNALIGNED)
Interleave and store (2 channels)
void cv::v_store_low (_Tp *ptr, const v_reg< _Tp, n > &a)
Store data to memory (lower half)
v_reg< _Tp, n > cv::v_sub (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Subtract values.
void cv::v_transpose4x4 (v_reg< _Tp, n > &a0, const v_reg< _Tp, n > &a1, const v_reg< _Tp, n > &a2, const v_reg< _Tp, n > &a3, v_reg< _Tp, n > &b0, v_reg< _Tp, n > &b1, v_reg< _Tp, n > &b2, v_reg< _Tp, n > &b3)
Transpose 4x4 matrix.
v_reg< int, n *2 > cv::v_trunc (const v_reg< double, n > &a)
v_reg< int, n > cv::v_trunc (const v_reg< float, n > &a)
Truncate elements.
v_reg< _Tp, n > cv::v_xor (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Bitwise XOR.
void cv::v_zip (const v_reg< _Tp, n > &a0, const v_reg< _Tp, n > &a1, v_reg< _Tp, n > &b0, v_reg< _Tp, n > &b1)
Interleave two vectors.
cv::OPENCV_HAL_IMPL_MATH_FUNC (v_abs,(typename V_TypeTraits< _Tp >::abs_type) std::abs, typename V_TypeTraits< _Tp >::abs_type) static const unsigned char popCountTable[]
Sine \( sin(x) \) of elements.