OpenCV 4.12.0
開源計算機視覺
載入中...
搜尋中...
無匹配項
通用行內函數

主題

 私有實現助手
 

詳細描述

"通用行內函數" 是一組型別和函式,旨在簡化不同平臺上程式碼的向量化。目前支援不同架構上的多種SIMD擴充套件。針對包括x86 (SSE/SSE2/SSE4.2)、ARM (NEON)、PowerPC (VSX)、MIPS (MSA) 在內的多種架構,實現了對128位各種型別暫存器的支援。x86架構支援256位長暫存器 (AVX2),x86架構還支援512位長暫存器 (AVX512)。如果在編譯時沒有可用的SIMD擴充套件,將選擇行內函數的C++回退實現,程式碼仍將按預期工作,儘管速度可能會較慢。

型別

有幾種型別表示打包值的向量暫存器,每種型別都作為基於一個SIMD暫存器的結構體實現。

所列型別的確切位長度(和值數量)是在編譯時推導的,取決於在庫編譯期間選擇的架構SIMD能力。所有型別都包含 nlanes 列舉,用於檢查該型別的確切值數量。

如果型別的確切位長度很重要,則可以使用特定的固定長度暫存器型別。

有幾種型別表示128位暫存器。

有幾種型別表示256位暫存器。

注意
目前256位暫存器僅為AVX2 SIMD擴充套件實現,如果想直接使用此型別,請不要忘記檢查CV_SIMD256預處理器定義
#if CV_SIMD256
//...
#endif

有幾種型別表示512位暫存器。

載入和儲存操作

這些操作允許顯式設定暫存器內容,或從某個記憶體塊載入,以及將暫存器內容儲存到記憶體塊。

有可變大小的暫存器載入操作,它們根據所選平臺功能提供最大可用大小的結果。

此外,還有固定大小的暫存器載入/儲存操作。

對於128位暫存器

對於256位暫存器(請檢查CV_SIMD256預處理器定義)

對於512位暫存器(請檢查CV_SIMD512預處理器定義)

儲存到記憶體的操作在不同的平臺功能上是相似的:v_store, v_store_aligned, v_store_high, v_store_low

值重排序

這些操作允許重排序或重組一個或多個向量中的元素。

算術、位運算和比較操作

元素級二元和一元操作。

歸約和掩碼

這些操作大多數只返回一個值。

其他數學函式

轉換

不同的型別轉換和型別轉換

矩陣操作

在這些操作中,向量代表矩陣的行/列:v_dotprod, v_dotprod_fast, v_dotprod_expand, v_dotprod_expand_fast, v_matmul, v_transpose4x4

可用性

大多數操作僅針對可用型別的子集實現,下表顯示了不同操作對這些型別的適用性。

常規整數

操作\型別uint 8int 8uint 16int 16uint 32int 32
load, storexxxxxx
interleavexxxxxx
expandxxxxxx
expand_lowxxxxxx
expand_highxxxxxx
expand_qxx
add, subxxxxxx
add_wrap, sub_wrapxxxx
mul_wrapxxxx
mulxxxxxx
mul_expandxxxxx
comparexxxxxx
移位 (shift)xxxx
dotprodxx
dotprod_fastxx
dotprod_expandxxxxx
dotprod_expand_fastxxxxx
logicalxxxxxx
min, maxxxxxxx
absdiffxxxxxx
absdiffsxx
reducexxxxxx
maskxxxxxx
packxxxxxx
pack_uxx
pack_bx
unpackxxxxxx
extractxxxxxx
rotate (lanes)xxxxxx
cvt_flt32x
cvt_flt64x
transpose4x4xx
reverse(反向)xxxxxx
extract_nxxxxxx
broadcast_elementxx

大整數

操作\型別uint 64int 64
load, storexx
add, subxx
移位 (shift)xx
logicalxx
reverse(反向)xx
extractxx
rotate (lanes)xx
cvt_flt64x
extract_nxx

浮點數

操作\型別float 32float 64
load, storexx
interleavex
add, subxx
mulxx
divxx
comparexx
min, maxxx
absdiffxx
reducex
maskxx
unpackxx
cvt_flt32x
cvt_flt64x
sqrt, absxx
float mathxx
transpose4x4x
extractxx
rotate (lanes)xx
reverse(反向)xx
extract_nxx
broadcast_elementx
expxx
logxx
sin, cosxx

結構體  cv::v_reg< _Tp, n >
 

#define OPENCV_HAL_MATH_HAVE_EXP   1
 

型別定義

typedef v_float32x16 simd512::v_float32
 最大可用向量暫存器容量 32位浮點值(單精度)
 
typedef v_reg< float, 16 > cv::v_float32x16
 十六個32位浮點值(單精度)
 
typedef v_reg< float, 4 > cv::v_float32x4
 四個32位浮點值(單精度)
 
typedef v_reg< float, 8 > cv::v_float32x8
 八個32位浮點值(單精度)
 
typedef v_float64x8 simd512::v_float64
 最大可用向量暫存器容量 64位浮點值(雙精度)
 
typedef v_reg< double, 2 > cv::v_float64x2
 兩個64位浮點值(雙精度)
 
typedef v_reg< double, 4 > cv::v_float64x4
 四個64位浮點值(雙精度)
 
typedef v_reg< double, 8 > cv::v_float64x8
 八個64位浮點值(雙精度)
 
typedef v_int16x32 simd512::v_int16
 最大可用向量暫存器容量 16位有符號整數值。
 
typedef v_reg< short, 16 > cv::v_int16x16
 十六個16位有符號整數值。
 
typedef v_reg< short, 32 > cv::v_int16x32
 三十二個16位有符號整數值。
 
typedef v_reg< short, 8 > cv::v_int16x8
 八個16位有符號整數值。
 
typedef v_int32x16 simd512::v_int32
 最大可用向量暫存器容量 32位有符號整數值。
 
typedef v_reg< int, 16 > cv::v_int32x16
 十六個32位有符號整數值。
 
typedef v_reg< int, 4 > cv::v_int32x4
 四個32位有符號整數值。
 
typedef v_reg< int, 8 > cv::v_int32x8
 八個32位有符號整數值。
 
typedef v_int64x8 simd512::v_int64
 最大可用向量暫存器容量 64位有符號整數值。
 
typedef v_reg< int64, 2 > cv::v_int64x2
 兩個64位有符號整數值。
 
typedef v_reg< int64, 4 > cv::v_int64x4
 四個64位有符號整數值。
 
typedef v_reg< int64, 8 > cv::v_int64x8
 八個64位有符號整數值。
 
typedef v_int8x64 simd512::v_int8
 最大可用向量暫存器容量 8位有符號整數值。
 
typedef v_reg< schar, 16 > cv::v_int8x16
 十六個8位有符號整數值。
 
typedef v_reg< schar, 32 > cv::v_int8x32
 三十二個8位有符號整數值。
 
typedef v_reg< schar, 64 > cv::v_int8x64
 六十四個8位有符號整數值。
 
typedef v_uint16x32 simd512::v_uint16
 最大可用向量暫存器容量 16位無符號整數值。
 
typedef v_reg< ushort, 16 > cv::v_uint16x16
 十六個16位無符號整數值。
 
typedef v_reg< ushort, 32 > cv::v_uint16x32
 三十二個16位無符號整數值。
 
typedef v_reg< ushort, 8 > cv::v_uint16x8
 八個16位無符號整數值。
 
typedef v_uint32x16 simd512::v_uint32
 最大可用向量暫存器容量 32位無符號整數值。
 
typedef v_reg< unsigned, 16 > cv::v_uint32x16
 十六個32位無符號整數值。
 
typedef v_reg< unsigned, 4 > cv::v_uint32x4
 四個32位無符號整數值。
 
typedef v_reg< unsigned, 8 > cv::v_uint32x8
 八個32位無符號整數值。
 
typedef v_uint64x8 simd512::v_uint64
 最大可用向量暫存器容量 64位無符號整數值。
 
typedef v_reg< uint64, 2 > cv::v_uint64x2
 兩個64位無符號整數值。
 
typedef v_reg< uint64, 4 > cv::v_uint64x4
 四個64位無符號整數值。
 
typedef v_reg< uint64, 8 > cv::v_uint64x8
 八個64位無符號整數值。
 
typedef v_uint8x64 simd512::v_uint8
 最大可用向量暫存器容量 8位無符號整數值。
 
typedef v_reg< uchar, 16 > cv::v_uint8x16
 十六個8位無符號整數值。
 
typedef v_reg< uchar, 32 > cv::v_uint8x32
 三十二個8位無符號整數值。
 
typedef v_reg< uchar, 64 > cv::v_uint8x64
 六十四個8位無符號整數值。
 

列舉

列舉  {
  cv::simd128_width = 16 ,
  cv::simd256_width = 32 ,
  cv::simd512_width = 64 ,
  cv::simdmax_width = simd512_width
}
 

函式

void cv::v256_cleanup ()
 
template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load (const _Tp *ptr)
 從記憶體載入256位長度暫存器內容。
 
template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_aligned (const _Tp *ptr)
 從記憶體載入暫存器內容(對齊)
 
template<typename _Tp >
v_reg< typename V_TypeTraits< _Tp >::w_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v256_load_expand (const _Tp *ptr)
 從記憶體載入暫存器內容並雙重擴充套件。
 
v_reg< float, simd256_width/sizeof(float)> cv::v256_load_expand (const hfloat *ptr)
 
template<typename _Tp >
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)
 從記憶體載入暫存器內容並四重擴充套件。
 
template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_halves (const _Tp *loptr, const _Tp *hiptr)
 從兩個記憶體塊載入暫存器內容。
 
template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_low (const _Tp *ptr)
 載入128位資料到低位部分(高位部分未定義)。
 
void cv::v512_cleanup ()
 
template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load (const _Tp *ptr)
 從記憶體載入512位長度暫存器內容。
 
template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_aligned (const _Tp *ptr)
 從記憶體載入暫存器內容(對齊)
 
template<typename _Tp >
v_reg< typename V_TypeTraits< _Tp >::w_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v512_load_expand (const _Tp *ptr)
 從記憶體載入暫存器內容並雙重擴充套件。
 
v_reg< float, simd512_width/sizeof(float)> cv::v512_load_expand (const hfloat *ptr)
 
template<typename _Tp >
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)
 從記憶體載入暫存器內容並四重擴充套件。
 
template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_halves (const _Tp *loptr, const _Tp *hiptr)
 從兩個記憶體塊載入暫存器內容。
 
template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_low (const _Tp *ptr)
 載入256位資料到低位部分(高位部分未定義)。
 
template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_abs (const v_reg< _Tp, n > &a)
 元素的絕對值。
 
template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_absdiff (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 絕對差。
 
template<int n>
v_reg< double, n > cv::v_absdiff (const v_reg< double, n > &a, const v_reg< double, n > &b)
 
template<int n>
v_reg< float, n > cv::v_absdiff (const v_reg< float, n > &a, const v_reg< float, n > &b)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_absdiffs (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 飽和絕對差。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_add (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 新增值。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_add_wrap (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 無飽和新增值。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_and (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 按位與。
 
template<int i, typename _Tp , int n>
v_reg< _Tp, n > cv::v_broadcast_element (const v_reg< _Tp, n > &a)
 廣播向量的第i個元素。
 
template<int n>
v_reg< int, n *2 > cv::v_ceil (const v_reg< double, n > &a)
 
template<int n>
v_reg< int, n > cv::v_ceil (const v_reg< float, n > &a)
 向上取整元素。
 
template<typename _Tp , int n>
bool cv::v_check_all (const v_reg< _Tp, n > &a)
 檢查所有打包值是否都小於零。
 
template<typename _Tp , int n>
bool cv::v_check_any (const v_reg< _Tp, n > &a)
 檢查是否有任何打包值小於零。
 
void cv::v_cleanup ()
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_combine_high (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 從兩個向量的最後元素組合向量。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_combine_low (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 從兩個向量的第一個元素組合向量。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_cos (const v_reg< _Tp, n > &a)
 元素的餘弦 \( cos(x) \)。
 
template<int n>
v_reg< float, n *2 > cv::v_cvt_f32 (const v_reg< double, n > &a)
 將下半部分轉換為浮點數。
 
template<int n>
v_reg< float, n *2 > cv::v_cvt_f32 (const v_reg< double, n > &a, const v_reg< double, n > &b)
 轉換為浮點數。
 
template<int n>
v_reg< float, n > cv::v_cvt_f32 (const v_reg< int, n > &a)
 轉換為浮點數。
 
template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64 (const v_reg< float, n > &a)
 將下半部分轉換為雙精度浮點數。
 
template<int n>
v_reg< double, n/2 > cv::v_cvt_f64 (const v_reg< int, n > &a)
 將下半部分轉換為雙精度浮點數。
 
template<int n>
v_reg< double, n > cv::v_cvt_f64 (const v_reg< int64, n > &a)
 轉換為雙精度浮點數。
 
template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64_high (const v_reg< float, n > &a)
 將向量高位部分轉換為雙精度浮點數。
 
template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64_high (const v_reg< int, n > &a)
 將向量高位部分轉換為雙精度浮點數。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_div (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 除法。
 
template<typename _Tp , int n>
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)
 元素的點積。
 
template<typename _Tp , int n>
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)
 元素的點積。
 
template<typename _Tp , int n>
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)
 元素的點積並擴充套件。
 
template<typename _Tp , int n>
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)
 元素的點積。
 
template<int n>
v_reg< double, n/2 > cv::v_dotprod_expand (const v_reg< int, n > &a, const v_reg< int, n > &b)
 
template<int n>
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)
 
template<typename _Tp , int n>
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)
 快速元素的點積並擴充套件。
 
template<typename _Tp , int n>
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)
 快速元素的點積。
 
template<int n>
v_reg< double, n/2 > cv::v_dotprod_expand_fast (const v_reg< int, n > &a, const v_reg< int, n > &b)
 
template<int n>
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)
 
template<typename _Tp , int n>
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)
 快速元素的點積。
 
template<typename _Tp , int n>
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)
 快速元素的點積。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_eq (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 相等比較。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_erf (const v_reg< _Tp, n > &a)
 誤差函式。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_exp (const v_reg< _Tp, n > &a)
 元素的指數 \( e^x \)。
 
template<typename _Tp , int n>
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)
 將值擴充套件到更寬的打包型別。
 
template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_expand_high (const v_reg< _Tp, n > &a)
 將更高值擴充套件到更寬的打包型別。
 
template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_expand_low (const v_reg< _Tp, n > &a)
 將更低值擴充套件到更寬的打包型別。
 
template<int s, typename _Tp , int n>
v_reg< _Tp, n > cv::v_extract (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 向量提取。
 
template<int s, typename _Tp , int n>
_Tp cv::v_extract_n (const v_reg< _Tp, n > &v)
 向量提取。
 
template<int n>
v_reg< int, n *2 > cv::v_floor (const v_reg< double, n > &a)
 
template<int n>
v_reg< int, n > cv::v_floor (const v_reg< float, n > &a)
 向下取整元素。
 
template<typename _Tp , int n>
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)
 乘加運算。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_ge (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 大於或等於比較。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_gt (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 大於比較。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_interleave_pairs (const v_reg< _Tp, n > &vec)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_interleave_quads (const v_reg< _Tp, n > &vec)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_invsqrt (const v_reg< _Tp, n > &a)
 平方根倒數。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_le (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 小於或等於比較。
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load (const _Tp *ptr)
 從記憶體載入暫存器內容。
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_aligned (const _Tp *ptr)
 從記憶體載入暫存器內容(對齊)
 
template<typename _Tp , int n>
void cv::v_load_deinterleave (const _Tp *ptr, v_reg< _Tp, n > &a, v_reg< _Tp, n > &b)
 載入和解交錯(2通道)
 
template<typename _Tp , int n>
void cv::v_load_deinterleave (const _Tp *ptr, v_reg< _Tp, n > &a, v_reg< _Tp, n > &b, v_reg< _Tp, n > &c)
 載入和解交錯(3通道)
 
template<typename _Tp , int n>
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)
 載入和解交錯(4通道)
 
template<typename _Tp >
v_reg< typename V_TypeTraits< _Tp >::w_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v_load_expand (const _Tp *ptr)
 從記憶體載入暫存器內容並雙重擴充套件。
 
v_reg< float, simd128_width/sizeof(float)> cv::v_load_expand (const hfloat *ptr)
 
template<typename _Tp >
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)
 從記憶體載入暫存器內容並四重擴充套件。
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_halves (const _Tp *loptr, const _Tp *hiptr)
 從兩個記憶體塊載入暫存器內容。
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_low (const _Tp *ptr)
 載入64位資料到低位部分(高位部分未定義)。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_log (const v_reg< _Tp, n > &a)
 元素的自然對數 \( \log(x) \)。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_lt (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 小於比較。
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut (const _Tp *tab, const int *idx)
 
template<int n>
v_reg< double, n/2 > cv::v_lut (const double *tab, const v_reg< int, n > &idx)
 
template<int n>
v_reg< float, n > cv::v_lut (const float *tab, const v_reg< int, n > &idx)
 
template<int n>
v_reg< int, n > cv::v_lut (const int *tab, const v_reg< int, n > &idx)
 
template<int n>
v_reg< unsigned, n > cv::v_lut (const unsigned *tab, const v_reg< int, n > &idx)
 
template<int n>
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)
 
template<int n>
void cv::v_lut_deinterleave (const float *tab, const v_reg< int, n > &idx, v_reg< float, n > &x, v_reg< float, n > &y)
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut_pairs (const _Tp *tab, const int *idx)
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut_quads (const _Tp *tab, const int *idx)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_magnitude (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 幅值。
 
template<int n>
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)
 矩陣乘法。
 
template<int n>
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)
 矩陣乘加。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_max (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 為每對選擇最大值。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_min (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 為每對選擇最小值。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_mul (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 乘法。
 
template<typename _Tp , int n>
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)
 乘法並擴充套件。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_mul_hi (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 乘法並提取高位部分。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_mul_wrap (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 無飽和乘法。
 
template<typename _Tp , int n>
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)
 v_fma 的同義詞。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_ne (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 不相等比較。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_not (const v_reg< _Tp, n > &a)
 按位非。
 
template<int n>
v_reg< double, n > cv::v_not_nan (const v_reg< double, n > &a)
 
template<int n>
v_reg< float, n > cv::v_not_nan (const v_reg< float, n > &a)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_or (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 按位或。
 
template<int n>
void cv::v_pack_store (hfloat *ptr, const v_reg< float, n > &v)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_pack_triplets (const v_reg< _Tp, n > &vec)
 
template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_popcount (const v_reg< _Tp, n > &a)
 計算向量通道中的1位數量,並以相應的無符號型別返回結果。
 
template<typename _Tp , int n>
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)
 將兩個向量從另外兩個向量的低部和高部組合起來。
 
template<typename _Tp , int n>
_Tp cv::v_reduce_max (const v_reg< _Tp, n > &a)
 查詢一個最大值。
 
template<typename _Tp , int n>
_Tp cv::v_reduce_min (const v_reg< _Tp, n > &a)
 查詢一個最小值。
 
template<typename _Tp , int n>
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)
 值的絕對差之和。
 
template<typename _Tp , int n>
V_TypeTraits< _Tp >::sum_type cv::v_reduce_sum (const v_reg< _Tp, n > &a)
 對打包值求和。
 
template<int n>
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)
 求和每個輸入向量的所有元素,返回和的向量。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_reverse (const v_reg< _Tp, n > &a)
 向量反序。
 
template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_left (const v_reg< _Tp, n > &a)
 向量內元素左移。
 
template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_left (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 
template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_right (const v_reg< _Tp, n > &a)
 向量內元素右移。
 
template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_right (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 
template<int n>
v_reg< int, n *2 > cv::v_round (const v_reg< double, n > &a)
 
template<int n>
v_reg< int, n *2 > cv::v_round (const v_reg< double, n > &a, const v_reg< double, n > &b)
 
template<int n>
v_reg< int, n > cv::v_round (const v_reg< float, n > &a)
 四捨五入元素。
 
template<typename _Tp , int n>
int cv::v_scan_forward (const v_reg< _Tp, n > &a)
 獲取第一個負通道索引。
 
template<typename _Tp , int n>
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)
 逐元素選擇(混合操作)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_shl (const v_reg< _Tp, n > &a, int imm)
 按位左移。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_shr (const v_reg< _Tp, n > &a, int imm)
 按位右移。
 
template<typename _Tp , int n>
int cv::v_signmask (const v_reg< _Tp, n > &a)
 獲取負值掩碼。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sin (const v_reg< _Tp, n > &a)
 元素的正弦 \( sin(x) \)。
 
template<typename _Tp , int n>
void cv::v_sincos (const v_reg< _Tp, n > &x, v_reg< _Tp, n > &s, v_reg< _Tp, n > &c)
 同時計算元素的正弦 \( sin(x) \) 和餘弦 \( cos(x) \) 。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sqr_magnitude (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 幅值的平方。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sqrt (const v_reg< _Tp, n > &a)
 元素的平方根。
 
template<typename _Tp , int n>
void cv::v_store (_Tp *ptr, const v_reg< _Tp, n > &a)
 將資料儲存到記憶體。
 
template<typename _Tp , int n>
void cv::v_store (_Tp *ptr, const v_reg< _Tp, n > &a, hal::StoreMode)
 
template<typename _Tp , int n>
void cv::v_store_aligned (_Tp *ptr, const v_reg< _Tp, n > &a)
 將資料儲存到記憶體(對齊)
 
template<typename _Tp , int n>
void cv::v_store_aligned (_Tp *ptr, const v_reg< _Tp, n > &a, hal::StoreMode)
 
template<typename _Tp , int n>
void cv::v_store_aligned_nocache (_Tp *ptr, const v_reg< _Tp, n > &a)
 
template<typename _Tp , int n>
void cv::v_store_high (_Tp *ptr, const v_reg< _Tp, n > &a)
 將資料儲存到記憶體(高位半部)
 
template<typename _Tp , int n>
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)
 交錯並存儲(4通道)
 
template<typename _Tp , int n>
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)
 交錯並存儲(3通道)
 
template<typename _Tp , int n>
void cv::v_store_interleave (_Tp *ptr, const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b, hal::StoreMode=hal::STORE_UNALIGNED)
 交錯並存儲(2通道)
 
template<typename _Tp , int n>
void cv::v_store_low (_Tp *ptr, const v_reg< _Tp, n > &a)
 將資料儲存到記憶體(低位半部)
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sub (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 減法。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sub_wrap (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 無飽和減法。
 
template<typename _Tp , int n>
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)
 轉置4x4矩陣。
 
template<int n>
v_reg< int, n *2 > cv::v_trunc (const v_reg< double, n > &a)
 
template<int n>
v_reg< int, n > cv::v_trunc (const v_reg< float, n > &a)
 截斷元素。
 
template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_xor (const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
 按位異或。
 
template<typename _Tp , int n>
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)
 交錯兩個向量。
 

變數

static const unsigned char cv::popCountTable []
 

初始化為零

建立具有零元素的新向量

v_uint8x16 cv::v_setzero_u8 ()
 
template<>
v_uint8x16 cv::v_setzero_ ()
 
v_int8x16 cv::v_setzero_s8 ()
 
v_uint16x8 cv::v_setzero_u16 ()
 
v_int16x8 cv::v_setzero_s16 ()
 
v_uint32x4 cv::v_setzero_u32 ()
 
v_int32x4 cv::v_setzero_s32 ()
 
v_float32x4 cv::v_setzero_f32 ()
 
v_float64x2 cv::v_setzero_f64 ()
 
v_uint64x2 cv::v_setzero_u64 ()
 
v_int64x2 cv::v_setzero_s64 ()
 
v_uint8x32 cv::v256_setzero_u8 ()
 
v_int8x32 cv::v256_setzero_s8 ()
 
v_uint16x16 cv::v256_setzero_u16 ()
 
v_int16x16 cv::v256_setzero_s16 ()
 
v_uint32x8 cv::v256_setzero_u32 ()
 
v_int32x8 cv::v256_setzero_s32 ()
 
v_float32x8 cv::v256_setzero_f32 ()
 
v_float64x4 cv::v256_setzero_f64 ()
 
v_uint64x4 cv::v256_setzero_u64 ()
 
v_int64x4 cv::v256_setzero_s64 ()
 
v_uint8x64 cv::v512_setzero_u8 ()
 
v_int8x64 cv::v512_setzero_s8 ()
 
v_uint16x32 cv::v512_setzero_u16 ()
 
v_int16x32 cv::v512_setzero_s16 ()
 
v_uint32x16 cv::v512_setzero_u32 ()
 
v_int32x16 cv::v512_setzero_s32 ()
 
v_float32x16 cv::v512_setzero_f32 ()
 
v_float64x8 cv::v512_setzero_f64 ()
 
v_uint64x8 cv::v512_setzero_u64 ()
 
v_int64x8 cv::v512_setzero_s64 ()
 

初始化為指定值

建立元素設定為特定值的新向量

v_uint8x16 cv::v_setall_u8 (uchar val)
 
template<>
v_uint8x16 cv::v_setall_ (uchar val)
 
v_int8x16 cv::v_setall_s8 (schar val)
 
template<>
v_int8x16 cv::v_setall_ (schar val)
 
v_uint16x8 cv::v_setall_u16 (ushort val)
 
template<>
v_uint16x8 cv::v_setall_ (ushort val)
 
v_int16x8 cv::v_setall_s16 (short val)
 
template<>
v_int16x8 cv::v_setall_ (short val)
 
v_uint32x4 cv::v_setall_u32 (unsigned val)
 
template<>
v_uint32x4 cv::v_setall_ (unsigned val)
 
v_int32x4 cv::v_setall_s32 (int val)
 
template<>
v_int32x4 cv::v_setall_ (int val)
 
v_float32x4 cv::v_setall_f32 (float val)
 
template<>
v_float32x4 cv::v_setall_ (float val)
 
v_float64x2 cv::v_setall_f64 (double val)
 
template<>
v_float64x2 cv::v_setall_ (double val)
 
v_uint64x2 cv::v_setall_u64 (uint64 val)
 
template<>
v_uint64x2 cv::v_setall_ (uint64 val)
 
v_int64x2 cv::v_setall_s64 (int64 val)
 
template<>
v_int64x2 cv::v_setall_ (int64 val)
 
v_uint8x32 cv::v256_setall_u8 (uchar val)
 
v_int8x32 cv::v256_setall_s8 (schar val)
 
v_uint16x16 cv::v256_setall_u16 (ushort val)
 
v_int16x16 cv::v256_setall_s16 (short val)
 
v_uint32x8 cv::v256_setall_u32 (unsigned val)
 
v_int32x8 cv::v256_setall_s32 (int val)
 
v_float32x8 cv::v256_setall_f32 (float val)
 
v_float64x4 cv::v256_setall_f64 (double val)
 
v_uint64x4 cv::v256_setall_u64 (uint64 val)
 
v_int64x4 cv::v256_setall_s64 (int64 val)
 
v_uint8x64 cv::v512_setall_u8 (uchar val)
 
v_int8x64 cv::v512_setall_s8 (schar val)
 
v_uint16x32 cv::v512_setall_u16 (ushort val)
 
v_int16x32 cv::v512_setall_s16 (short val)
 
v_uint32x16 cv::v512_setall_u32 (unsigned val)
 
v_int32x16 cv::v512_setall_s32 (int val)
 
v_float32x16 cv::v512_setall_f32 (float val)
 
v_float64x8 cv::v512_setall_f64 (double val)
 
v_uint64x8 cv::v512_setall_u64 (uint64 val)
 
v_int64x8 cv::v512_setall_s64 (int64 val)
 

重新解釋

將向量轉換為不同型別而不修改底層資料。

template<typename _Tp0 , int n0>
v_reg< uchar, n0 *sizeof(_Tp0)/sizeof(uchar)> cv::v_reinterpret_as_u8 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< schar, n0 *sizeof(_Tp0)/sizeof(schar)> cv::v_reinterpret_as_s8 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< ushort, n0 *sizeof(_Tp0)/sizeof(ushort)> cv::v_reinterpret_as_u16 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< short, n0 *sizeof(_Tp0)/sizeof(short)> cv::v_reinterpret_as_s16 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< unsigned, n0 *sizeof(_Tp0)/sizeof(unsigned)> cv::v_reinterpret_as_u32 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< int, n0 *sizeof(_Tp0)/sizeof(int)> cv::v_reinterpret_as_s32 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< float, n0 *sizeof(_Tp0)/sizeof(float)> cv::v_reinterpret_as_f32 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< double, n0 *sizeof(_Tp0)/sizeof(double)> cv::v_reinterpret_as_f64 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< uint64, n0 *sizeof(_Tp0)/sizeof(uint64)> cv::v_reinterpret_as_u64 (const v_reg< _Tp0, n0 > &a)
 
template<typename _Tp0 , int n0>
v_reg< int64, n0 *sizeof(_Tp0)/sizeof(int64)> cv::v_reinterpret_as_s64 (const v_reg< _Tp0, n0 > &a)
 

左移

左移

template<int shift, int n>
v_reg< ushort, n > cv::v_shl (const v_reg< ushort, n > &a)
 
template<int shift, int n>
v_reg< short, n > cv::v_shl (const v_reg< short, n > &a)
 
template<int shift, int n>
v_reg< unsigned, n > cv::v_shl (const v_reg< unsigned, n > &a)
 
template<int shift, int n>
v_reg< int, n > cv::v_shl (const v_reg< int, n > &a)
 
template<int shift, int n>
v_reg< uint64, n > cv::v_shl (const v_reg< uint64, n > &a)
 
template<int shift, int n>
v_reg< int64, n > cv::v_shl (const v_reg< int64, n > &a)
 

右移

右移

template<int shift, int n>
v_reg< ushort, n > cv::v_shr (const v_reg< ushort, n > &a)
 
template<int shift, int n>
v_reg< short, n > cv::v_shr (const v_reg< short, n > &a)
 
template<int shift, int n>
v_reg< unsigned, n > cv::v_shr (const v_reg< unsigned, n > &a)
 
template<int shift, int n>
v_reg< int, n > cv::v_shr (const v_reg< int, n > &a)
 
template<int shift, int n>
v_reg< uint64, n > cv::v_shr (const v_reg< uint64, n > &a)
 
template<int shift, int n>
v_reg< int64, n > cv::v_shr (const v_reg< int64, n > &a)
 

舍入移位

舍入右移

template<int shift, int n>
v_reg< ushort, n > cv::v_rshr (const v_reg< ushort, n > &a)
 
template<int shift, int n>
v_reg< short, n > cv::v_rshr (const v_reg< short, n > &a)
 
template<int shift, int n>
v_reg< unsigned, n > cv::v_rshr (const v_reg< unsigned, n > &a)
 
template<int shift, int n>
v_reg< int, n > cv::v_rshr (const v_reg< int, n > &a)
 
template<int shift, int n>
v_reg< uint64, n > cv::v_rshr (const v_reg< uint64, n > &a)
 
template<int shift, int n>
v_reg< int64, n > cv::v_rshr (const v_reg< int64, n > &a)
 

打包

將兩個向量的值打包成一個

返回的向量型別具有兩倍於輸入向量元素的數量。帶有 *u* 字尾的變體也會轉換為相應的無符號型別。

  • pack:適用於 16 位、32 位和 64 位整數輸入型別
  • pack_u:適用於 16 位和 32 位有符號整數輸入型別
注意
除 64 位外的所有變體均使用飽和。
template<int n>
v_reg< uchar, 2 *n > cv::v_pack (const v_reg< ushort, n > &a, const v_reg< ushort, n > &b)
 
template<int n>
v_reg< schar, 2 *n > cv::v_pack (const v_reg< short, n > &a, const v_reg< short, n > &b)
 
template<int n>
v_reg< ushort, 2 *n > cv::v_pack (const v_reg< unsigned, n > &a, const v_reg< unsigned, n > &b)
 
template<int n>
v_reg< short, 2 *n > cv::v_pack (const v_reg< int, n > &a, const v_reg< int, n > &b)
 
template<int n>
v_reg< unsigned, 2 *n > cv::v_pack (const v_reg< uint64, n > &a, const v_reg< uint64, n > &b)
 
template<int n>
v_reg< int, 2 *n > cv::v_pack (const v_reg< int64, n > &a, const v_reg< int64, n > &b)
 
template<int n>
v_reg< uchar, 2 *n > cv::v_pack_u (const v_reg< short, n > &a, const v_reg< short, n > &b)
 
template<int n>
v_reg< ushort, 2 *n > cv::v_pack_u (const v_reg< int, n > &a, const v_reg< int, n > &b)
 

帶舍入移位的打包

將兩個向量的值打包成一個,並帶舍入移位

輸入向量中的值將右移 *n* 位並進行舍入,然後轉換為較窄型別並在結果向量中返回。帶有 *u* 字尾的變體轉換為無符號型別。

  • pack:適用於 16 位、32 位和 64 位整數輸入型別
  • pack_u:適用於 16 位和 32 位有符號整數輸入型別
注意
除 64 位外的所有變體均使用飽和。
template<int shift, int n>
v_reg< uchar, 2 *n > cv::v_rshr_pack (const v_reg< ushort, n > &a, const v_reg< ushort, n > &b)
 
template<int shift, int n>
v_reg< schar, 2 *n > cv::v_rshr_pack (const v_reg< short, n > &a, const v_reg< short, n > &b)
 
template<int shift, int n>
v_reg< ushort, 2 *n > cv::v_rshr_pack (const v_reg< unsigned, n > &a, const v_reg< unsigned, n > &b)
 
template<int shift, int n>
v_reg< short, 2 *n > cv::v_rshr_pack (const v_reg< int, n > &a, const v_reg< int, n > &b)
 
template<int shift, int n>
v_reg< unsigned, 2 *n > cv::v_rshr_pack (const v_reg< uint64, n > &a, const v_reg< uint64, n > &b)
 
template<int shift, int n>
v_reg< int, 2 *n > cv::v_rshr_pack (const v_reg< int64, n > &a, const v_reg< int64, n > &b)
 
template<int shift, int n>
v_reg< uchar, 2 *n > cv::v_rshr_pack_u (const v_reg< short, n > &a, const v_reg< short, n > &b)
 
template<int shift, int n>
v_reg< ushort, 2 *n > cv::v_rshr_pack_u (const v_reg< int, n > &a, const v_reg< int, n > &b)
 

打包並存儲

將輸入向量的值打包並存儲到記憶體中

值將被儲存到記憶體中,並轉換為較窄型別。帶有 *u* 字尾的變體轉換為相應的無符號型別。

  • pack:適用於 16 位、32 位和 64 位整數輸入型別
  • pack_u:適用於 16 位和 32 位有符號整數輸入型別
注意
除 64 位外的所有變體均使用飽和。
template<int n>
void cv::v_pack_store (uchar *ptr, const v_reg< ushort, n > &a)
 
template<int n>
void cv::v_pack_store (schar *ptr, const v_reg< short, n > &a)
 
template<int n>
void cv::v_pack_store (ushort *ptr, const v_reg< unsigned, n > &a)
 
template<int n>
void cv::v_pack_store (short *ptr, const v_reg< int, n > &a)
 
template<int n>
void cv::v_pack_store (unsigned *ptr, const v_reg< uint64, n > &a)
 
template<int n>
void cv::v_pack_store (int *ptr, const v_reg< int64, n > &a)
 
template<int n>
void cv::v_pack_u_store (uchar *ptr, const v_reg< short, n > &a)
 
template<int n>
void cv::v_pack_u_store (ushort *ptr, const v_reg< int, n > &a)
 

帶舍入移位的打包和儲存

將輸入向量的值打包並存儲到記憶體中

值將右移 *n* 位並進行舍入,然後轉換為較窄型別並存儲到記憶體中。帶有 *u* 字尾的變體轉換為無符號型別。

  • pack:適用於 16 位、32 位和 64 位整數輸入型別
  • pack_u:適用於 16 位和 32 位有符號整數輸入型別
注意
除 64 位外的所有變體均使用飽和。
template<int shift, int n>
void cv::v_rshr_pack_store (uchar *ptr, const v_reg< ushort, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_store (schar *ptr, const v_reg< short, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_store (ushort *ptr, const v_reg< unsigned, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_store (short *ptr, const v_reg< int, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_store (unsigned *ptr, const v_reg< uint64, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_store (int *ptr, const v_reg< int64, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_u_store (uchar *ptr, const v_reg< short, n > &a)
 
template<int shift, int n>
void cv::v_rshr_pack_u_store (ushort *ptr, const v_reg< int, n > &a)
 

打包布林值

將來自多個向量的布林值打包到一個無符號8位整數向量中

注意
必須提供有效的布林值以保證所有架構的結果一致。
template<int n>
v_reg< uchar, 2 *n > cv::v_pack_b (const v_reg< ushort, n > &a, const v_reg< ushort, n > &b)
 !適用於 16 位布林值
 
template<int n>
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)
 
template<int n>
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)
 

宏定義文件

◆ OPENCV_HAL_MATH_HAVE_EXP

#define OPENCV_HAL_MATH_HAVE_EXP   1

型別定義文件

◆ v_float32

typedef v_float32x16 simd512::v_float32

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 32位浮點值(單精度)

◆ v_float32x16

typedef v_reg<float, 16> cv::v_float32x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個32位浮點值(單精度)

◆ v_float32x4

typedef v_reg<float, 4> cv::v_float32x4

#include <opencv2/core/hal/intrin_cpp.hpp>

四個32位浮點值(單精度)

◆ v_float32x8

typedef v_reg<float, 8> cv::v_float32x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個32位浮點值(單精度)

◆ v_float64

typedef v_float64x8 simd512::v_float64

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 64位浮點值(雙精度)

◆ v_float64x2

typedef v_reg<double, 2> cv::v_float64x2

#include <opencv2/core/hal/intrin_cpp.hpp>

兩個64位浮點值(雙精度)

◆ v_float64x4

typedef v_reg<double, 4> cv::v_float64x4

#include <opencv2/core/hal/intrin_cpp.hpp>

四個64位浮點值(雙精度)

◆ v_float64x8

typedef v_reg<double, 8> cv::v_float64x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個64位浮點值(雙精度)

◆ v_int16

typedef v_int16x32 simd512::v_int16

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 16位有符號整數值。

◆ v_int16x16

typedef v_reg<short, 16> cv::v_int16x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個16位有符號整數值。

◆ v_int16x32

typedef v_reg<short, 32> cv::v_int16x32

#include <opencv2/core/hal/intrin_cpp.hpp>

三十二個16位有符號整數值。

◆ v_int16x8

typedef v_reg<short, 8> cv::v_int16x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個16位有符號整數值。

◆ v_int32

typedef v_int32x16 simd512::v_int32

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 32位有符號整數值。

◆ v_int32x16

typedef v_reg<int, 16> cv::v_int32x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個32位有符號整數值。

◆ v_int32x4

typedef v_reg<int, 4> cv::v_int32x4

#include <opencv2/core/hal/intrin_cpp.hpp>

四個32位有符號整數值。

◆ v_int32x8

typedef v_reg<int, 8> cv::v_int32x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個32位有符號整數值。

◆ v_int64

typedef v_int64x8 simd512::v_int64

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 64位有符號整數值。

◆ v_int64x2

typedef v_reg<int64, 2> cv::v_int64x2

#include <opencv2/core/hal/intrin_cpp.hpp>

兩個64位有符號整數值。

◆ v_int64x4

typedef v_reg<int64, 4> cv::v_int64x4

#include <opencv2/core/hal/intrin_cpp.hpp>

四個64位有符號整數值。

◆ v_int64x8

typedef v_reg<int64, 8> cv::v_int64x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個64位有符號整數值。

◆ v_int8

typedef v_int8x64 simd512::v_int8

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 8位有符號整數值。

◆ v_int8x16

typedef v_reg<schar, 16> cv::v_int8x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個8位有符號整數值。

◆ v_int8x32

typedef v_reg<schar, 32> cv::v_int8x32

#include <opencv2/core/hal/intrin_cpp.hpp>

三十二個8位有符號整數值。

◆ v_int8x64

typedef v_reg<schar, 64> cv::v_int8x64

#include <opencv2/core/hal/intrin_cpp.hpp>

六十四個8位有符號整數值。

◆ v_uint16

typedef v_uint16x32 simd512::v_uint16

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 16位無符號整數值。

◆ v_uint16x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個16位無符號整數值。

◆ v_uint16x32

#include <opencv2/core/hal/intrin_cpp.hpp>

三十二個16位無符號整數值。

◆ v_uint16x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個16位無符號整數值。

◆ v_uint32

typedef v_uint32x16 simd512::v_uint32

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 32位無符號整數值。

◆ v_uint32x16

typedef v_reg<unsigned, 16> cv::v_uint32x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個32位無符號整數值。

◆ v_uint32x4

typedef v_reg<unsigned, 4> cv::v_uint32x4

#include <opencv2/core/hal/intrin_cpp.hpp>

四個32位無符號整數值。

◆ v_uint32x8

typedef v_reg<unsigned, 8> cv::v_uint32x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個32位無符號整數值。

◆ v_uint64

typedef v_uint64x8 simd512::v_uint64

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 64位無符號整數值。

◆ v_uint64x2

#include <opencv2/core/hal/intrin_cpp.hpp>

兩個64位無符號整數值。

◆ v_uint64x4

#include <opencv2/core/hal/intrin_cpp.hpp>

四個64位無符號整數值。

◆ v_uint64x8

#include <opencv2/core/hal/intrin_cpp.hpp>

八個64位無符號整數值。

◆ v_uint8

typedef v_uint8x64 simd512::v_uint8

#include <opencv2/core/hal/intrin.hpp>

最大可用向量暫存器容量 8位無符號整數值。

◆ v_uint8x16

typedef v_reg<uchar, 16> cv::v_uint8x16

#include <opencv2/core/hal/intrin_cpp.hpp>

十六個8位無符號整數值。

◆ v_uint8x32

typedef v_reg<uchar, 32> cv::v_uint8x32

#include <opencv2/core/hal/intrin_cpp.hpp>

三十二個8位無符號整數值。

◆ v_uint8x64

typedef v_reg<uchar, 64> cv::v_uint8x64

#include <opencv2/core/hal/intrin_cpp.hpp>

六十四個8位無符號整數值。

列舉型別文件

◆ 匿名列舉

匿名列舉

#include <opencv2/core/hal/intrin_cpp.hpp>

列舉器
simd128_width 
simd256_width 
simd512_width 
simdmax_width 

函式文件

◆ v256_cleanup()

void cv::v256_cleanup ( )
inline

◆ v256_load()

template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入256位長度暫存器內容。

引數
ptr指向記憶體塊的指標
返回
暫存器物件
注意
返回型別將根據傳入的指標型別進行檢測,例如 uchar ==> cv::v_uint8x32, int ==> cv::v_int32x8, 等。
在使用前檢查 CV_SIMD256 預處理器定義。使用 vx_load 版本可獲得最大可用暫存器長度結果
對齊要求:如果 CV_STRONG_ALIGNMENT=1,則傳入的指標必須對齊(`sizeof(lane type)` 應該足夠)。不要在沒有執行時檢查指標對齊(例如 `uchar*` => `int*`)的情況下進行指標型別轉換。
此函式的呼叫圖如下

◆ v256_load_aligned()

template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_aligned ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容(對齊)

類似於 cv::v256_load,但源記憶體塊應進行對齊(SIMD256 情況下為 32 位元組對齊,SIMD512 情況下為 64 位元組對齊,依此類推)

注意
在使用前檢查 CV_SIMD256 預處理器定義。使用 vx_load_aligned 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v256_load_expand() [1/2]

template<typename _Tp >
v_reg< typename V_TypeTraits< _Tp >::w_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v256_load_expand ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容並雙重擴充套件。

cv::v256_load 相同,但結果包型別將比記憶體型別寬 2 倍。

short buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // 型別為 int16
v_int32x8 r = v256_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - 型別為 int32
v_reg< int, 8 > v_int32x8
八個32位有符號整數值。
定義 intrin_cpp.hpp:523
v_reg< typename V_TypeTraits< _Tp >::w_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> v256_load_expand(const _Tp *ptr)
從記憶體載入暫存器內容並雙重擴充套件。
定義 intrin_cpp.hpp:1954

適用於 8 位、16 位、32 位整數源型別。

注意
在使用前檢查 CV_SIMD256 預處理器定義。使用 vx_load_expand 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v256_load_expand() [2/2]

v_reg< float, simd256_width/sizeof(float)> cv::v256_load_expand ( const hfloat * ptr)
inline

◆ v256_load_expand_q()

template<typename _Tp >
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)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容並四重擴充套件。

cv::v256_load_expand 相同,但結果型別是源型別的 4 倍寬。

char buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // 型別為 int8
v_int32x8 r = v256_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - 型別為 int32
v_reg< typename V_TypeTraits< _Tp >::q_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::q_type)> v256_load_expand_q(const _Tp *ptr)
從記憶體載入暫存器內容並四重擴充套件。
定義 intrin_cpp.hpp:2042

適用於 8 位整數源型別。

注意
在使用前檢查 CV_SIMD256 預處理器定義。使用 vx_load_expand_q 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v256_load_halves()

template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_halves ( const _Tp * loptr,
const _Tp * hiptr )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從兩個記憶體塊載入暫存器內容。

引數
loptr包含前半部分資料 (0..n/2) 的記憶體塊
hiptr包含後半部分資料 (n/2..n) 的記憶體塊
int lo[4] = { 1, 2, 3, 4 }, hi[4] = { 5, 6, 7, 8 };
v_reg< _Tp, simd256_width/sizeof(_Tp)> v256_load_halves(const _Tp *loptr, const _Tp *hiptr)
從兩個記憶體塊載入暫存器內容。
定義 intrin_cpp.hpp:1863
注意
在使用前檢查 CV_SIMD256 預處理器定義。使用 vx_load_halves 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v256_load_low()

template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_low ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

載入128位資料到低位部分(高位部分未定義)。

引數
ptr包含前半部分資料 (0..n/2) 的記憶體塊
int lo[4] = { 1, 2, 3, 4 };
v_reg< _Tp, simd256_width/sizeof(_Tp)> v256_load_low(const _Tp *ptr)
載入128位資料到低位部分(高位部分未定義)。
定義 intrin_cpp.hpp:1778
注意
在使用前檢查 CV_SIMD256 預處理器定義。使用 vx_load_low 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v256_setall_f32()

v_float32x8 cv::v256_setall_f32 ( float val)
inline

◆ v256_setall_f64()

v_float64x4 cv::v256_setall_f64 ( double val)
inline

◆ v256_setall_s16()

v_int16x16 cv::v256_setall_s16 ( short val)
inline

◆ v256_setall_s32()

v_int32x8 cv::v256_setall_s32 ( int val)
inline

◆ v256_setall_s64()

v_int64x4 cv::v256_setall_s64 ( int64 val)
inline

◆ v256_setall_s8()

v_int8x32 cv::v256_setall_s8 ( schar val)
inline

◆ v256_setall_u16()

v_uint16x16 cv::v256_setall_u16 ( ushort val)
inline

◆ v256_setall_u32()

v_uint32x8 cv::v256_setall_u32 ( unsigned val)
inline

◆ v256_setall_u64()

v_uint64x4 cv::v256_setall_u64 ( uint64 val)
inline

◆ v256_setall_u8()

v_uint8x32 cv::v256_setall_u8 ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); val)
inline

◆ v256_setzero_f32()

v_float32x8 cv::v256_setzero_f32 ( )
inline

◆ v256_setzero_f64()

v_float64x4 cv::v256_setzero_f64 ( )
inline

◆ v256_setzero_s16()

v_int16x16 cv::v256_setzero_s16 ( )
inline

◆ v256_setzero_s32()

v_int32x8 cv::v256_setzero_s32 ( )
inline

◆ v256_setzero_s64()

v_int64x4 cv::v256_setzero_s64 ( )
inline

◆ v256_setzero_s8()

v_int8x32 cv::v256_setzero_s8 ( )
inline

◆ v256_setzero_u16()

v_uint16x16 cv::v256_setzero_u16 ( )
inline

◆ v256_setzero_u32()

v_uint32x8 cv::v256_setzero_u32 ( )
inline

◆ v256_setzero_u64()

v_uint64x4 cv::v256_setzero_u64 ( )
inline

◆ v256_setzero_u8()

v_uint8x32 cv::v256_setzero_u8 ( )
inline

◆ v512_cleanup()

void cv::v512_cleanup ( )
inline

◆ v512_load()

template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入512位長度暫存器內容。

引數
ptr指向記憶體塊的指標
返回
暫存器物件
注意
返回型別將根據傳入的指標型別進行檢測,例如 uchar ==> cv::v_uint8x64, int ==> cv::v_int32x16, 等。
在使用前檢查 CV_SIMD512 預處理器定義。使用 vx_load 版本可獲得最大可用暫存器長度結果
對齊要求:如果 CV_STRONG_ALIGNMENT=1,則傳入的指標必須對齊(`sizeof(lane type)` 應該足夠)。不要在沒有執行時檢查指標對齊(例如 `uchar*` => `int*`)的情況下進行指標型別轉換。
此函式的呼叫圖如下

◆ v512_load_aligned()

template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_aligned ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容(對齊)

類似於 cv::v512_load,但源記憶體塊應進行對齊(SIMD512 情況下為 64 位元組對齊,依此類推)

注意
在使用前檢查 CV_SIMD512 預處理器定義。使用 vx_load_aligned 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v512_load_expand() [1/2]

template<typename _Tp >
v_reg< typename V_TypeTraits< _Tp >::w_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v512_load_expand ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容並雙重擴充套件。

cv::v512_load 相同,但結果包型別將比記憶體型別寬 2 倍。

short buf[8] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // 型別為 int16
v_int32x16 r = v512_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - 型別為 int32
v_reg< typename V_TypeTraits< _Tp >::w_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> v512_load_expand(const _Tp *ptr)
從記憶體載入暫存器內容並雙重擴充套件。
定義 intrin_cpp.hpp:1985
v_reg< int, 16 > v_int32x16
十六個32位有符號整數值。
定義 intrin_cpp.hpp:546

適用於 8 位、16 位、32 位整數源型別。

注意
在使用前檢查 CV_SIMD512 預處理器定義。使用 vx_load_expand 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v512_load_expand() [2/2]

v_reg< float, simd512_width/sizeof(float)> cv::v512_load_expand ( const hfloat * ptr)
inline

◆ v512_load_expand_q()

template<typename _Tp >
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)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容並四重擴充套件。

cv::v512_load_expand 相同,但結果型別是源型別的 4 倍寬。

char buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // 型別為 int8
v_int32x16 r = v512_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - 型別為 int32
v_reg< typename V_TypeTraits< _Tp >::q_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::q_type)> v512_load_expand_q(const _Tp *ptr)
從記憶體載入暫存器內容並四重擴充套件。
定義 intrin_cpp.hpp:2072

適用於 8 位整數源型別。

注意
在使用前檢查 CV_SIMD512 預處理器定義。使用 vx_load_expand_q 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v512_load_halves()

template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_halves ( const _Tp * loptr,
const _Tp * hiptr )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從兩個記憶體塊載入暫存器內容。

引數
loptr包含前半部分資料 (0..n/2) 的記憶體塊
hiptr包含後半部分資料 (n/2..n) 的記憶體塊
int lo[4] = { 1, 2, 3, 4, 5, 6, 7, 8 }, hi[4] = { 9, 10, 11, 12, 13, 14, 15, 16 };
v_reg< _Tp, simd512_width/sizeof(_Tp)> v512_load_halves(const _Tp *loptr, const _Tp *hiptr)
從兩個記憶體塊載入暫存器內容。
定義 intrin_cpp.hpp:1894
注意
在使用前檢查 CV_SIMD512 預處理器定義。使用 vx_load_halves 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v512_load_low()

template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_low ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

載入256位資料到低位部分(高位部分未定義)。

引數
ptr包含前半部分資料 (0..n/2) 的記憶體塊
int lo[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
v_reg< _Tp, simd512_width/sizeof(_Tp)> v512_load_low(const _Tp *ptr)
載入256位資料到低位部分(高位部分未定義)。
定義 intrin_cpp.hpp:1806
注意
在使用前檢查 CV_SIMD512 預處理器定義。使用 vx_load_low 版本可獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v512_setall_f32()

v_float32x16 cv::v512_setall_f32 ( float val)
inline

◆ v512_setall_f64()

v_float64x8 cv::v512_setall_f64 ( double val)
inline

◆ v512_setall_s16()

v_int16x32 cv::v512_setall_s16 ( short val)
inline

◆ v512_setall_s32()

v_int32x16 cv::v512_setall_s32 ( int val)
inline

◆ v512_setall_s64()

v_int64x8 cv::v512_setall_s64 ( int64 val)
inline

◆ v512_setall_s8()

v_int8x64 cv::v512_setall_s8 ( schar val)
inline

◆ v512_setall_u16()

v_uint16x32 cv::v512_setall_u16 ( ushort val)
inline

◆ v512_setall_u32()

v_uint32x16 cv::v512_setall_u32 ( unsigned val)
inline

◆ v512_setall_u64()

v_uint64x8 cv::v512_setall_u64 ( uint64 val)
inline

◆ v512_setall_u8()

v_uint8x64 cv::v512_setall_u8 ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); val)
inline

◆ v512_setzero_f32()

v_float32x16 cv::v512_setzero_f32 ( )
inline

◆ v512_setzero_f64()

v_float64x8 cv::v512_setzero_f64 ( )
inline

◆ v512_setzero_s16()

v_int16x32 cv::v512_setzero_s16 ( )
inline

◆ v512_setzero_s32()

v_int32x16 cv::v512_setzero_s32 ( )
inline

◆ v512_setzero_s64()

v_int64x8 cv::v512_setzero_s64 ( )
inline

◆ v512_setzero_s8()

v_int8x64 cv::v512_setzero_s8 ( )
inline

◆ v512_setzero_u16()

v_uint16x32 cv::v512_setzero_u16 ( )
inline

◆ v512_setzero_u32()

v_uint32x16 cv::v512_setzero_u32 ( )
inline

◆ v512_setzero_u64()

v_uint64x8 cv::v512_setzero_u64 ( )
inline

◆ v512_setzero_u8()

v_uint8x64 cv::v512_setzero_u8 ( )
inline

◆ v_abs()

template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_abs ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的絕對值。

僅適用於浮點型別。

◆ v_absdiff() [1/3]

template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_absdiff ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

絕對差。

返回 \( |a - b| \) 並轉換為相應的無符號型別。示例:

v_int32x4 a, b; // {1, 2, 3, 4} 和 {4, 3, 2, 1}
v_uint32x4 c = v_absdiff(a, b); // 結果為 {3, 1, 1, 3}
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > v_absdiff(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
絕對差。
定義 intrin_cpp.hpp:1005
定義 intrin_cpp.hpp:372

適用於 8 位、16 位、32 位整數源型別。

◆ v_absdiff() [2/3]

template<int n>
v_reg< double, n > cv::v_absdiff ( const v_reg< double, n > & a,
const v_reg< double, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

適用於64位浮點值

◆ v_absdiff() [3/3]

template<int n>
v_reg< float, n > cv::v_absdiff ( const v_reg< float, n > & a,
const v_reg< float, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

適用於32位浮點值

◆ v_absdiffs()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_absdiffs ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

飽和絕對差。

返回 \( saturate(|a - b|) \) 。適用於8位、16位有符號整數源型別。

此函式的呼叫圖如下

◆ v_add()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_add ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

新增值。

適用於所有型別。

◆ v_add_wrap()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_add_wrap ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

無飽和新增值。

適用於8位和16位整數值。

◆ v_and()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_and ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

按位與。

僅適用於整數型別。

◆ v_broadcast_element()

template<int i, typename _Tp , int n>
v_reg< _Tp, n > cv::v_broadcast_element ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

廣播向量的第i個元素。

方案

{ v[0] v[1] v[2] ... v[SZ] } => { v[i], v[i], v[i] ... v[i] }

限制:0 <= i < nlanes 支援的型別:32 位整數和浮點數 (s32/u32/f32)

◆ v_ceil() [1/2]

template<int n>
v_reg< int, n *2 > cv::v_ceil ( const v_reg< double, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

此函式的呼叫圖如下

◆ v_ceil() [2/2]

template<int n>
v_reg< int, n > cv::v_ceil ( const v_reg< float, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向上取整元素。

對每個值進行向上取整。輸入型別為浮點向量 ==> 輸出型別為整數向量。

注意
僅適用於浮點型別。
此函式的呼叫圖如下

◆ v_check_all()

template<typename _Tp , int n>
bool cv::v_check_all ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

檢查所有打包值是否都小於零。

無符號值將被轉換為有符號值:`uchar 254 => char -2`。

◆ v_check_any()

template<typename _Tp , int n>
bool cv::v_check_any ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

檢查是否有任何打包值小於零。

無符號值將被轉換為有符號值:`uchar 254 => char -2`。

◆ v_cleanup()

void cv::v_cleanup ( )
inline

◆ v_combine_high()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_combine_high ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從兩個向量的最後元素組合向量。

方案

{A1 A2 A3 A4}
{B1 B2 B3 B4}
---------------
{A3 A4 B3 B4}

適用於除64位以外的所有型別。

◆ v_combine_low()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_combine_low ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從兩個向量的第一個元素組合向量。

方案

{A1 A2 A3 A4}
{B1 B2 B3 B4}
---------------
{A1 A2 B1 B2}

適用於除64位以外的所有型別。

◆ v_cos()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_cos ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的餘弦 \( cos(x) \)。

僅適用於浮點型別。核心實現與 v_sincos 相同。

◆ v_cvt_f32() [1/3]

template<int n>
v_reg< float, n *2 > cv::v_cvt_f32 ( const v_reg< double, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將下半部分轉換為浮點數。

支援的輸入型別為 cv::v_float64。

◆ v_cvt_f32() [2/3]

template<int n>
v_reg< float, n *2 > cv::v_cvt_f32 ( const v_reg< double, n > & a,
const v_reg< double, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

轉換為浮點數。

支援的輸入型別為 cv::v_float64。

◆ v_cvt_f32() [3/3]

template<int n>
v_reg< float, n > cv::v_cvt_f32 ( const v_reg< int, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

轉換為浮點數。

支援的輸入型別為 cv::v_int32。

◆ v_cvt_f64() [1/3]

template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64 ( const v_reg< float, n > & a)

#include <opencv2/core/hal/intrin_cpp.hpp>

將下半部分轉換為雙精度浮點數。

支援的輸入型別為 cv::v_float32。

◆ v_cvt_f64() [2/3]

template<int n>
v_reg< double, n/2 > cv::v_cvt_f64 ( const v_reg< int, n > & a)

#include <opencv2/core/hal/intrin_cpp.hpp>

將下半部分轉換為雙精度浮點數。

支援的輸入型別為 cv::v_int32。

◆ v_cvt_f64() [3/3]

template<int n>
v_reg< double, n > cv::v_cvt_f64 ( const int64, n > & a)

#include <opencv2/core/hal/intrin_cpp.hpp>

轉換為雙精度浮點數。

支援的輸入型別為 cv::v_int64。

◆ v_cvt_f64_high() [1/2]

template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64_high ( const v_reg< float, n > & a)

#include <opencv2/core/hal/intrin_cpp.hpp>

將向量高位部分轉換為雙精度浮點數。

支援的輸入型別為 cv::v_float32。

◆ v_cvt_f64_high() [2/2]

template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64_high ( const v_reg< int, n > & a)

#include <opencv2/core/hal/intrin_cpp.hpp>

將向量高位部分轉換為雙精度浮點數。

支援的輸入型別為 cv::v_int32。

◆ v_div()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_div ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

除法。

僅適用於浮點型別。

◆ v_dotprod() [1/2]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的點積。

將兩個暫存器中的值相乘並對相鄰結果對求和。

方案

{A1 A2 ...} // 16位
x {B1 B2 ...} // 16位
-------------
{A1B1+A2B2 ...} // 32位

◆ v_dotprod() [2/2]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的點積。

cv::v_dotprod 相同,但將第三個元素新增到相鄰對的和中。方案:

{A1 A2 ...} // 16位
x {B1 B2 ...} // 16位
-------------
{A1B1+A2B2+C1 ...} // 32位

◆ v_dotprod_expand() [1/4]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的點積並擴充套件。

將兩個暫存器中的值相乘並展開相鄰結果對的和。

方案

{A1 A2 A3 A4 ...} // 8位
x {B1 B2 B3 B4 ...} // 8位
-------------
{A1B1+A2B2+A3B3+A4B4 ...} // 32位

◆ v_dotprod_expand() [2/4]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的點積。

cv::v_dotprod_expand 相同,但將第三個元素新增到相鄰對的和中。方案:

{A1 A2 A3 A4 ...} // 8位
x {B1 B2 B3 B4 ...} // 8位
-------------
{A1B1+A2B2+A3B3+A4B4+C1 ...} // 32位

◆ v_dotprod_expand() [3/4]

template<int n>
v_reg< double, n/2 > cv::v_dotprod_expand ( const v_reg< int, n > & a,
const v_reg< int, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_dotprod_expand() [4/4]

template<int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_dotprod_expand_fast() [1/4]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

快速元素的點積並擴充套件。

將兩個暫存器中的值相乘並展開相鄰結果對的和。

cv::v_dotprod_expand 相同,但在某些平臺上它可能會在結果對之間執行無序求和,如果只關心所有通道的總和,並且它在受影響的平臺上能提供更好的效能,則可以使用此內在函式。

此函式的呼叫圖如下

◆ v_dotprod_expand_fast() [2/4]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

快速元素的點積。

cv::v_dotprod_expand_fast 相同,但會在相鄰對的和中新增第三個元素。

此函式的呼叫圖如下

◆ v_dotprod_expand_fast() [3/4]

template<int n>
v_reg< double, n/2 > cv::v_dotprod_expand_fast ( const v_reg< int, n > & a,
const v_reg< int, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_dotprod_expand_fast() [4/4]

template<int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_dotprod_fast() [1/2]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

快速元素的點積。

cv::v_dotprod 相同,但在某些平臺上它可能會在結果對之間執行無序求和,如果只關心所有通道的總和,並且它在受影響的平臺上能提供更好的效能,則可以使用此內在函式。

此函式的呼叫圖如下

◆ v_dotprod_fast() [2/2]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

快速元素的點積。

cv::v_dotprod_fast 相同,但會在相鄰對的和中新增第三個元素。

此函式的呼叫圖如下

◆ v_eq()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_eq ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

相等比較。

◆ v_erf()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_erf ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

誤差函式。

注意
目前支援 FP32 精度。

◆ v_exp()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_exp ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的指數 \( e^x \)。

僅適用於浮點型別。核心實現步驟

  1. 分解輸入:將輸入轉換為 \( 2^{x \cdot \log_2e} \),並將其指數部分拆分為整數部分和分數部分:\( x \cdot \log_2e = n + f \),其中 \( n \) 是整數部分,\( f \) 是分數部分。
  2. 計算 \( 2^n \):透過位移計算得出。
  3. 調整小數部分:計算 \( f \cdot \ln2 \) 將小數部分轉換為以 \( e \) 為底。\( C1 \) 和 \( C2 \) 用於調整小數部分。
  4. \( e^{f \cdot \ln2} \) 的多項式近似:小數部分越接近 0,結果越精確。
    • 對於 float16 和 float32,使用 6 項泰勒級數。
    • 對於 float64,使用 4 項 Padé 多項式近似。
  5. 合併結果:將兩部分相乘得到最終結果:\( e^x = 2^n \cdot e^{f \cdot \ln2} \)。
注意
計算精度取決於實現和輸入向量的資料型別。

◆ v_expand()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將值擴充套件到更寬的打包型別。

將暫存器內容複製到兩個具有 2 倍寬封裝型別的暫存器。方案

int32x4 int64x2 int64x2
{A B C D} ==> {A B} , {C D}

◆ v_expand_high()

template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_expand_high ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將更高值擴充套件到更寬的打包型別。

cv::v_expand_low 相同,但擴充套件向量的更高一半。

方案

int32x4 int64x2
{A B C D} ==> {C D}

◆ v_expand_low()

template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::w_type, n/2 > cv::v_expand_low ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將更低值擴充套件到更寬的打包型別。

cv::v_expand 相同,但返回向量的較低一半。

方案

int32x4 int64x2
{A B C D} ==> {A B}

◆ v_extract()

template<int s, typename _Tp , int n>
v_reg< _Tp, n > cv::v_extract ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向量提取。

方案

{A1 A2 A3 A4}
{B1 B2 B3 B4}
========================
shift = 1 {A2 A3 A4 B1}
shift = 2 {A3 A4 B1 B2}
shift = 3 {A4 B1 B2 B3}

限制:0 <= shift < nlanes

用法

v_int32x4 a, b, c;
c = v_extract<2>(a, b);
v_reg< _Tp, n > v_extract(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
向量提取。
定義 intrin_cpp.hpp:2423

適用於所有型別。

◆ v_extract_n()

template<int s, typename _Tp , int n>
_Tp cv::v_extract_n ( const v_reg< _Tp, n > & v)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向量提取。

方案:返回 v 的第 s 個元素。限制:0 <= s < nlanes

用法

int r;
_Tp v_extract_n(const v_reg< _Tp, n > &v)
向量提取。
定義 intrin_cpp.hpp:2449

適用於所有型別。

◆ v_floor() [1/2]

template<int n>
v_reg< int, n *2 > cv::v_floor ( const v_reg< double, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

此函式的呼叫圖如下

◆ v_floor() [2/2]

template<int n>
v_reg< int, n > cv::v_floor ( const v_reg< float, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向下取整元素。

對每個值進行向下取整。輸入型別為浮點向量 ==> 輸出型別為整數向量。

注意
僅適用於浮點型別。
此函式的呼叫圖如下

◆ v_fma()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

乘加運算。

返回 \( a*b + c \)。僅適用於浮點型別和有符號 32 位整數。

◆ v_ge()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_ge ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

大於或等於比較。

適用於除 64 位整數值之外的所有型別。

◆ v_gt()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_gt ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

大於比較。

適用於除 64 位整數值之外的所有型別。

◆ v_interleave_pairs()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_interleave_pairs ( const v_reg< _Tp, n > & vec)
inline

◆ v_interleave_quads()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_interleave_quads ( const v_reg< _Tp, n > & vec)
inline

◆ v_invsqrt()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_invsqrt ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

平方根倒數。

返回 \( 1/sqrt(a) \)。僅適用於浮點型別。

◆ v_le()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_le ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

小於或等於比較。

適用於除 64 位整數值之外的所有型別。

◆ v_load()

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容。

引數
ptr指向記憶體塊的指標
返回
暫存器物件
注意
返回型別將根據傳入的指標型別檢測,例如 uchar ==> cv::v_uint8x16,int ==> cv::v_int32x4 等。
使用 vx_load 版本以獲得最大可用暫存器長度結果
對齊要求:如果 CV_STRONG_ALIGNMENT=1,則傳入的指標必須對齊(`sizeof(lane type)` 應該足夠)。不要在沒有執行時檢查指標對齊(例如 `uchar*` => `int*`)的情況下進行指標型別轉換。
此函式的呼叫圖如下

◆ v_load_aligned()

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_aligned ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容(對齊)

類似於 cv::v_load,但源記憶體塊應進行對齊(SIMD128 的情況為 16 位元組對齊,SIMD256 為 32 位元組對齊等)

注意
使用 vx_load_aligned 版本以獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v_load_deinterleave() [1/3]

template<typename _Tp , int n>
void cv::v_load_deinterleave ( const _Tp * ptr,
v_reg< _Tp, n > & a,
v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

載入和解交錯(2通道)

從記憶體中載入資料並解交錯儲存到 2 個暫存器。方案

{A1 B1 A2 B2 ...} ==> {A1 A2 ...}, {B1 B2 ...}

適用於除64位以外的所有型別。

此函式的呼叫圖如下

◆ v_load_deinterleave() [2/3]

template<typename _Tp , int n>
void cv::v_load_deinterleave ( const _Tp * ptr,
v_reg< _Tp, n > & a,
v_reg< _Tp, n > & b,
v_reg< _Tp, n > & c )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

載入和解交錯(3通道)

從記憶體中載入資料並解交錯儲存到 3 個暫存器。方案

{A1 B1 C1 A2 B2 C2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}

適用於除64位以外的所有型別。

此函式的呼叫圖如下

◆ v_load_deinterleave() [3/3]

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

載入和解交錯(4通道)

從記憶體中載入資料並解交錯儲存到 4 個暫存器。方案

{A1 B1 C1 D1 A2 B2 C2 D2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...}

適用於除64位以外的所有型別。

此函式的呼叫圖如下

◆ v_load_expand() [1/2]

template<typename _Tp >
v_reg< typename V_TypeTraits< _Tp >::w_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> cv::v_load_expand ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容並雙重擴充套件。

cv::v_load 相同,但結果封裝型別將是記憶體型別的 2 倍寬。

short buf[4] = {1, 2, 3, 4}; // 型別為 int16
v_int32x4 r = v_load_expand(buf); // r = {1, 2, 3, 4} - 型別為 int32
v_reg< typename V_TypeTraits< _Tp >::w_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> v_load_expand(const _Tp *ptr)
從記憶體載入暫存器內容並雙重擴充套件。
定義 intrin_cpp.hpp:1924
v_reg< int, 4 > v_int32x4
四個32位有符號整數值。
定義 intrin_cpp.hpp:501

適用於 8 位、16 位、32 位整數源型別。

注意
使用 vx_load_expand 版本以獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v_load_expand() [2/2]

v_reg< float, simd128_width/sizeof(float)> cv::v_load_expand ( const hfloat * ptr)
inline

◆ v_load_expand_q()

template<typename _Tp >
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)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從記憶體載入暫存器內容並四重擴充套件。

cv::v_load_expand 相同,但結果型別是源型別的 4 倍寬。

char buf[4] = {1, 2, 3, 4}; // 型別為 int8
v_int32x4 r = v_load_expand_q(buf); // r = {1, 2, 3, 4} - 型別為 int32
v_reg< typename V_TypeTraits< _Tp >::q_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::q_type)> v_load_expand_q(const _Tp *ptr)
從記憶體載入暫存器內容並四重擴充套件。
定義 intrin_cpp.hpp:2013

適用於 8 位整數源型別。

注意
使用 vx_load_expand_q 版本以獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v_load_halves()

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_halves ( const _Tp * loptr,
const _Tp * hiptr )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

從兩個記憶體塊載入暫存器內容。

引數
loptr包含前半部分資料 (0..n/2) 的記憶體塊
hiptr包含後半部分資料 (n/2..n) 的記憶體塊
int lo[2] = { 1, 2 }, hi[2] = { 3, 4 };
v_reg< _Tp, simd128_width/sizeof(_Tp)> v_load_halves(const _Tp *loptr, const _Tp *hiptr)
從兩個記憶體塊載入暫存器內容。
定義 intrin_cpp.hpp:1833
注意
使用 vx_load_halves 版本以獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v_load_low()

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_low ( const _Tp * ptr)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

載入64位資料到低位部分(高位部分未定義)。

引數
ptr包含前半部分資料 (0..n/2) 的記憶體塊
int lo[2] = { 1, 2 };
v_reg< _Tp, simd128_width/sizeof(_Tp)> v_load_low(const _Tp *ptr)
載入64位資料到低位部分(高位部分未定義)。
定義 intrin_cpp.hpp:1751
注意
使用 vx_load_low 版本以獲得最大可用暫存器長度結果
此函式的呼叫圖如下

◆ v_log()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_log ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的自然對數 \( \log(x) \)。

僅適用於浮點型別。核心實現步驟

  1. 分解輸入:使用二進位制表示將輸入分解為尾數部分 \( m \) 和指數部分 \( e \)。使得 \( \log(x) = \log(m \cdot 2^e) = \log(m) + e \cdot \ln(2) \)。
  2. 調整尾數和指數部分:如果尾數小於 \( \sqrt{0.5} \),則調整指數和尾數以確保尾數在 \( (\sqrt{0.5}, \sqrt{2}) \) 範圍內,以獲得更好的近似。
  3. \( \log(m) \) 的多項式近似:\( m \) 越接近 1,結果越精確。
    • 對於 float16 和 float32,使用 9 項泰勒級數。
    • 對於 float64,使用 6 項 Padé 多項式近似。
  4. 合併結果:將兩部分相加得到最終結果。
注意
計算精度取決於實現和輸入資料型別。
類似於 std::log() 的行為,\( \ln(0) = -\infty \)。

◆ v_lt()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_lt ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

小於比較。

適用於除 64 位整數值之外的所有型別。

◆ v_lut() [1/5]

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut ( const _Tp * tab,
const int * idx )
inline

◆ v_lut() [2/5]

template<int n>
v_reg< double, n/2 > cv::v_lut ( const double * tab,
const v_reg< int, n > & idx )
inline

◆ v_lut() [3/5]

template<int n>
v_reg< float, n > cv::v_lut ( const float * tab,
const v_reg< int, n > & idx )
inline

◆ v_lut() [4/5]

template<int n>
v_reg< int, n > cv::v_lut ( const int * tab,
const v_reg< int, n > & idx )
inline

◆ v_lut() [5/5]

template<int n>
v_reg< unsigned, n > cv::v_lut ( const unsigned * tab,
const v_reg< int, n > & idx )
inline

◆ v_lut_deinterleave() [1/2]

template<int n>
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 )
inline

◆ v_lut_deinterleave() [2/2]

template<int n>
void cv::v_lut_deinterleave ( const float * tab,
const v_reg< int, n > & idx,
v_reg< float, n > & x,
v_reg< float, n > & y )
inline

◆ v_lut_pairs()

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut_pairs ( const _Tp * tab,
const int * idx )
inline

◆ v_lut_quads()

template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_lut_quads ( const _Tp * tab,
const int * idx )
inline

◆ v_magnitude()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_magnitude ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

幅值。

返回 \( sqrt(a^2 + b^2) \)。僅適用於浮點型別。

◆ v_matmul()

template<int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

矩陣乘法。

方案

{A0 A1 A2 A3} |V0|
{B0 B1 B2 B3} |V1|
{C0 C1 C2 C3} |V2|
{D0 D1 D2 D3} x |V3|
====================
{R0 R1 R2 R3}, where
R0 = A0V0 + B0V1 + C0V2 + D0V3,
R1 = A1V0 + B1V1 + C1V2 + D1V3
...

◆ v_matmuladd()

template<int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

矩陣乘加。

方案

{A0 A1 A2 A3} |V0| |D0|
{B0 B1 B2 B3} |V1| |D1|
{C0 C1 C2 C3} x |V2| + |D2|
==================== |D3|
{R0 R1 R2 R3}, where
R0 = A0V0 + B0V1 + C0V2 + D0,
R1 = A1V0 + B1V1 + C1V2 + D1
...

◆ v_max()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_max ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

為每對選擇最大值。

方案

{A1 A2 ...}
{B1 B2 ...}
--------------
{max(A1,B1) max(A2,B2) ...}
void max(InputArray src1, InputArray src2, OutputArray dst)
計算兩個陣列或一個數組與一個標量的逐元素最大值。

適用於除 64 位整數之外的所有型別。

◆ v_min()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_min ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

為每對選擇最小值。

方案

{A1 A2 ...}
{B1 B2 ...}
--------------
{min(A1,B1) min(A2,B2) ...}
void min(InputArray src1, InputArray src2, OutputArray dst)
計算兩個陣列或一個數組與一個標量的逐元素最小值。

適用於除 64 位整數之外的所有型別。

◆ v_mul()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_mul ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

乘法。

適用於 16 位和 32 位整數型別以及浮點型別。

◆ v_mul_expand()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

乘法並擴充套件。

將兩個暫存器中的值相乘,並將結果儲存到兩個具有更寬封裝型別的暫存器中。方案

{A B C D} // 32-bit
x {E F G H} // 32-bit
---------------
{AE BF} // 64-bit
{CG DH} // 64-bit

示例

v_uint32x4 a, b; // {1,2,3,4} 和 {2,2,2,2}
v_uint64x2 c, d; // 結果
v_mul_expand(a, b, c, d); // c, d = {2,4}, {6, 8}
void 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)
乘法並擴充套件。
定義 intrin_cpp.hpp:1268

僅適用於 16 位和無符號 32 位源型別 (v_int16x8, v_uint16x8, v_uint32x4)。

◆ v_mul_hi()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_mul_hi ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

乘法並提取高位部分。

將兩個暫存器中的值相乘並存儲結果的高位部分。僅適用於 16 位源型別 (v_int16x8, v_uint16x8)。返回 \( a*b >> 16 \)

◆ v_mul_wrap()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_mul_wrap ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

無飽和乘法。

適用於8位和16位整數值。

◆ v_muladd()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

v_fma 的同義詞。

此函式的呼叫圖如下

◆ v_ne()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_ne ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

不相等比較。

◆ v_not()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_not ( const v_reg< _Tp, n > & a)

#include <opencv2/core/hal/intrin_cpp.hpp>

按位非。

僅適用於整數型別。

◆ v_not_nan() [1/2]

template<int n>
v_reg< double, n > cv::v_not_nan ( const v_reg< double, n > & a)
inline

◆ v_not_nan() [2/2]

template<int n>
v_reg< float, n > cv::v_not_nan ( const v_reg< float, n > & a)
inline

◆ v_or()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_or ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

按位或。

僅適用於整數型別。

◆ v_pack() [1/6]

template<int n>
v_reg< short, 2 *n > cv::v_pack ( const v_reg< int, n > & a,
const v_reg< int, n > & b )
inline

◆ v_pack() [2/6]

template<int n>
v_reg< int, 2 *n > cv::v_pack ( const int64, n > & a,
const int64, n > & b )
inline

◆ v_pack() [3/6]

template<int n>
v_reg< schar, 2 *n > cv::v_pack ( const v_reg< short, n > & a,
const v_reg< short, n > & b )
inline

◆ v_pack() [4/6]

template<int n>
v_reg< unsigned, 2 *n > cv::v_pack ( const v_reg< uint64, n > & a,
const v_reg< uint64, n > & b )
inline

◆ v_pack() [5/6]

template<int n>
v_reg< ushort, 2 *n > cv::v_pack ( const v_reg< unsigned, n > & a,
const v_reg< unsigned, n > & b )
inline

◆ v_pack() [6/6]

template<int n>
v_reg< uchar, 2 *n > cv::v_pack ( const v_reg< ushort, n > & a,
const v_reg< ushort, n > & b )
inline

◆ v_pack_b() [1/3]

template<int n>
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 > & ◆ hashtableResize(),
const v_reg< uint64, n > & g,
const v_reg< uint64, n > & h )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是一個過載的成員函式,為方便起見而提供。它與上述函式的區別僅在於其接受的引數。對於 64 位布林值

方案

a {0xFFFF.. 0}
b {0 0xFFFF..}
c {0xFFFF.. 0}
d {0 0xFFFF..}
e {0xFFFF.. 0}
f {0xFFFF.. 0}
g {0 0xFFFF..}
h {0 0xFFFF..}
===============
{
0xFF 0 0 0xFF 0xFF 0 0 0xFF
0xFF 0 0xFF 0 0 0xFF 0 0xFF
}

◆ v_pack_b() [2/3]

template<int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是一個過載的成員函式,為方便起見而提供。它與上述函式的區別僅在於其接受的引數。對於 32 位布林值

方案

a {0xFFFF.. 0 0 0xFFFF..}
b {0 0xFFFF.. 0xFFFF.. 0}
c {0xFFFF.. 0 0xFFFF.. 0}
d {0 0xFFFF.. 0 0xFFFF..}
===============
{
0xFF 0 0 0xFF 0 0xFF 0xFF 0
0xFF 0 0xFF 0 0 0xFF 0 0xFF
}

◆ v_pack_b() [3/3]

template<int n>
v_reg< uchar, 2 *n > cv::v_pack_b ( const v_reg< ushort, n > & a,
const v_reg< ushort, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

!適用於 16 位布林值

方案

a {0xFFFF 0 0 0xFFFF 0 0xFFFF 0xFFFF 0}
b {0xFFFF 0 0xFFFF 0 0 0xFFFF 0 0xFFFF}
===============
{
0xFF 0 0 0xFF 0 0xFF 0xFF 0
0xFF 0 0xFF 0 0 0xFF 0 0xFF
}

◆ v_pack_store() [1/7]

template<int n>
void cv::v_pack_store ( hfloat * ptr,
const v_reg< float, n > & v )
inline

◆ v_pack_store() [2/7]

template<int n>
void cv::v_pack_store ( int * ptr,
const int64, n > & a )
inline

◆ v_pack_store() [3/7]

template<int n>
void cv::v_pack_store ( schar * ptr,
const v_reg< short, n > & a )
inline

◆ v_pack_store() [4/7]

template<int n>
void cv::v_pack_store ( short * ptr,
const v_reg< int, n > & a )
inline

◆ v_pack_store() [5/7]

template<int n>
void cv::v_pack_store ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); * ptr,
const v_reg< ushort, n > & a )
inline

◆ v_pack_store() [6/7]

template<int n>
void cv::v_pack_store ( unsigned * ptr,
const v_reg< uint64, n > & a )
inline

◆ v_pack_store() [7/7]

template<int n>
void cv::v_pack_store ( ushort * ptr,
const v_reg< unsigned, n > & a )
inline

◆ v_pack_triplets()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_pack_triplets ( const v_reg< _Tp, n > & vec)
inline

◆ v_pack_u() [1/2]

template<int n>
v_reg< ushort, 2 *n > cv::v_pack_u ( const v_reg< int, n > & a,
const v_reg< int, n > & b )
inline

◆ v_pack_u() [2/2]

template<int n>
v_reg< uchar, 2 *n > cv::v_pack_u ( const v_reg< short, n > & a,
const v_reg< short, n > & b )
inline

◆ v_pack_u_store() [1/2]

template<int n>
void cv::v_pack_u_store ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); * ptr,
const v_reg< short, n > & a )
inline

◆ v_pack_u_store() [2/2]

template<int n>
void cv::v_pack_u_store ( ushort * ptr,
const v_reg< int, n > & a )
inline

◆ v_popcount()

template<typename _Tp , int n>
v_reg< typename V_TypeTraits< _Tp >::abs_type, n > cv::v_popcount ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

計算向量通道中的1位數量,並以相應的無符號型別返回結果。

方案

{A1 A2 A3 ...} => {popcount(A1), popcount(A2), popcount(A3), ...}

適用於所有整數型別。

此函式的呼叫圖如下

◆ v_recombine()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將兩個向量從另外兩個向量的低部和高部組合起來。

low = cv::v_combine_low(a, b);
high = cv::v_combine_high(a, b);
v_reg< _Tp, n > v_combine_high(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
從兩個向量的最後元素組合向量。
定義 intrin_cpp.hpp:2356
v_reg< _Tp, n > v_combine_low(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
從兩個向量的第一個元素組合向量。
定義 intrin_cpp.hpp:2334

◆ v_reduce_max()

template<typename _Tp , int n>
_Tp cv::v_reduce_max ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

查詢一個最大值。

方案

{A1 A2 A3 ...} => max(A1,A2,A3,...)

適用於除 64 位整數和 64 位浮點型別之外的所有型別。

◆ v_reduce_min()

template<typename _Tp , int n>
_Tp cv::v_reduce_min ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

查詢一個最小值。

方案

{A1 A2 A3 ...} => min(A1,A2,A3,...)

適用於除 64 位整數和 64 位浮點型別之外的所有型別。

◆ v_reduce_sad()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

值的絕對差之和。

方案

{A1 A2 A3 ...} {B1 B2 B3 ...} => sum{ABS(A1-B1),abs(A2-B2),abs(A3-B3),...}
Scalar sum(InputArray src)
計算陣列元素的和。
static uchar abs(uchar a)
定義 cvstd.hpp:66

適用於除 64 位型別之外的所有型別。

◆ v_reduce_sum()

template<typename _Tp , int n>
V_TypeTraits< _Tp >::sum_type cv::v_reduce_sum ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

對打包值求和。

方案

{A1 A2 A3 ...} => sum{A1,A2,A3,...}

◆ v_reduce_sum4()

template<int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

求和每個輸入向量的所有元素,返回和的向量。

方案

result[0] = a[0] + a[1] + a[2] + a[3]
result[1] = b[0] + b[1] + b[2] + b[3]
result[2] = c[0] + c[1] + c[2] + c[3]
result[3] = d[0] + d[1] + d[2] + d[3]

◆ v_reinterpret_as_f32()

template<typename _Tp0 , int n0>
v_reg< float, n0 *sizeof(_Tp0)/sizeof(float)> cv::v_reinterpret_as_f32 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_f64()

template<typename _Tp0 , int n0>
v_reg< double, n0 *sizeof(_Tp0)/sizeof(double)> cv::v_reinterpret_as_f64 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_s16()

template<typename _Tp0 , int n0>
v_reg< short, n0 *sizeof(_Tp0)/sizeof(short)> cv::v_reinterpret_as_s16 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_s32()

template<typename _Tp0 , int n0>
v_reg< int, n0 *sizeof(_Tp0)/sizeof(int)> cv::v_reinterpret_as_s32 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_s64()

template<typename _Tp0 , int n0>
v_reg< int64, n0 *sizeof(_Tp0)/sizeof(int64)> cv::v_reinterpret_as_s64 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_s8()

template<typename _Tp0 , int n0>
v_reg< schar, n0 *sizeof(_Tp0)/sizeof(schar)> cv::v_reinterpret_as_s8 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_u16()

template<typename _Tp0 , int n0>
v_reg< ushort, n0 *sizeof(_Tp0)/sizeof(ushort)> cv::v_reinterpret_as_u16 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_u32()

template<typename _Tp0 , int n0>
v_reg< unsigned, n0 *sizeof(_Tp0)/sizeof(unsigned)> cv::v_reinterpret_as_u32 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_u64()

template<typename _Tp0 , int n0>
v_reg< uint64, n0 *sizeof(_Tp0)/sizeof(uint64)> cv::v_reinterpret_as_u64 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reinterpret_as_u8()

template<typename _Tp0 , int n0>
v_reg< uchar, n0 *sizeof(_Tp0)/sizeof(uchar)> cv::v_reinterpret_as_u8 ( const v_reg< _Tp0, n0 > & a)
inline

◆ v_reverse()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_reverse ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向量反序。

反轉向量的順序。方案

REG {A1 ... An} ==> REG {An ... A1}

適用於所有型別。

◆ v_rotate_left() [1/2]

template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_left ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向量內元素左移。

適用於所有型別

◆ v_rotate_left() [2/2]

template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_left ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

◆ v_rotate_right() [1/2]

template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_right ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

向量內元素右移。

適用於所有型別

◆ v_rotate_right() [2/2]

template<int imm, typename _Tp , int n>
v_reg< _Tp, n > cv::v_rotate_right ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

◆ v_round() [1/3]

template<int n>
v_reg< int, n *2 > cv::v_round ( const v_reg< double, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

此函式的呼叫圖如下

◆ v_round() [2/3]

template<int n>
v_reg< int, n *2 > cv::v_round ( const v_reg< double, n > & a,
const v_reg< double, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

此函式的呼叫圖如下

◆ v_round() [3/3]

template<int n>
v_reg< int, n > cv::v_round ( const v_reg< float, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

四捨五入元素。

對每個值進行四捨五入。輸入型別為浮點向量 ==> 輸出型別為整數向量。

注意
僅適用於浮點型別。
此函式的呼叫圖如下

◆ v_rshr() [1/6]

template<int shift, int n>
v_reg< int, n > cv::v_rshr ( const v_reg< int, n > & a)
inline

◆ v_rshr() [2/6]

template<int shift, int n>
v_reg< int64, n > cv::v_rshr ( const int64, n > & a)
inline

◆ v_rshr() [3/6]

template<int shift, int n>
v_reg< short, n > cv::v_rshr ( const v_reg< short, n > & a)
inline

◆ v_rshr() [4/6]

template<int shift, int n>
v_reg< uint64, n > cv::v_rshr ( const v_reg< uint64, n > & a)
inline

◆ v_rshr() [5/6]

template<int shift, int n>
v_reg< unsigned, n > cv::v_rshr ( const v_reg< unsigned, n > & a)
inline

◆ v_rshr() [6/6]

template<int shift, int n>
v_reg< ushort, n > cv::v_rshr ( const v_reg< ushort, n > & a)
inline

◆ v_rshr_pack() [1/6]

template<int shift, int n>
v_reg< short, 2 *n > cv::v_rshr_pack ( const v_reg< int, n > & a,
const v_reg< int, n > & b )
inline

◆ v_rshr_pack() [2/6]

template<int shift, int n>
v_reg< int, 2 *n > cv::v_rshr_pack ( const int64, n > & a,
const int64, n > & b )
inline

◆ v_rshr_pack() [3/6]

template<int shift, int n>
v_reg< schar, 2 *n > cv::v_rshr_pack ( const v_reg< short, n > & a,
const v_reg< short, n > & b )
inline

◆ v_rshr_pack() [4/6]

template<int shift, int n>
v_reg< unsigned, 2 *n > cv::v_rshr_pack ( const v_reg< uint64, n > & a,
const v_reg< uint64, n > & b )
inline

◆ v_rshr_pack() [5/6]

template<int shift, int n>
v_reg< ushort, 2 *n > cv::v_rshr_pack ( const v_reg< unsigned, n > & a,
const v_reg< unsigned, n > & b )
inline

◆ v_rshr_pack() [6/6]

template<int shift, int n>
v_reg< uchar, 2 *n > cv::v_rshr_pack ( const v_reg< ushort, n > & a,
const v_reg< ushort, n > & b )
inline

◆ v_rshr_pack_store() [1/6]

template<int shift, int n>
void cv::v_rshr_pack_store ( int * ptr,
const int64, n > & a )
inline

◆ v_rshr_pack_store() [2/6]

template<int shift, int n>
void cv::v_rshr_pack_store ( schar * ptr,
const v_reg< short, n > & a )
inline

◆ v_rshr_pack_store() [3/6]

template<int shift, int n>
void cv::v_rshr_pack_store ( short * ptr,
const v_reg< int, n > & a )
inline

◆ v_rshr_pack_store() [4/6]

template<int shift, int n>
void cv::v_rshr_pack_store ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); * ptr,
const v_reg< ushort, n > & a )
inline

◆ v_rshr_pack_store() [5/6]

template<int shift, int n>
void cv::v_rshr_pack_store ( unsigned * ptr,
const v_reg< uint64, n > & a )
inline

◆ v_rshr_pack_store() [6/6]

template<int shift, int n>
void cv::v_rshr_pack_store ( ushort * ptr,
const v_reg< unsigned, n > & a )
inline

◆ v_rshr_pack_u() [1/2]

template<int shift, int n>
v_reg< ushort, 2 *n > cv::v_rshr_pack_u ( const v_reg< int, n > & a,
const v_reg< int, n > & b )
inline

◆ v_rshr_pack_u() [2/2]

template<int shift, int n>
v_reg< uchar, 2 *n > cv::v_rshr_pack_u ( const v_reg< short, n > & a,
const v_reg< short, n > & b )
inline

◆ v_rshr_pack_u_store() [1/2]

template<int shift, int n>
void cv::v_rshr_pack_u_store ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); * ptr,
const v_reg< short, n > & a )
inline

◆ v_rshr_pack_u_store() [2/2]

template<int shift, int n>
void cv::v_rshr_pack_u_store ( ushort * ptr,
const v_reg< int, n > & a )
inline

◆ v_scan_forward()

template<typename _Tp , int n>
int cv::v_scan_forward ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

獲取第一個負通道索引。

返回值為第一個負通道的索引(對於所有正數值的輸入則未定義)。示例

v_int32x4 r; // 設定為 {0, 0, -1, -1}
int idx = v_heading_zeros(r); // idx = 2

◆ v_select()

template<typename _Tp , int n>
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

逐元素選擇(混合操作)

返回值將透過以下方案組合值 ab 構建:result[i] = mask[i] ? a[i] : b[i];

注意
: mask 元素值僅限於這些值
  • 0:從 b 中選擇元素
  • 0xff/0xffff/etc:從 a 中選擇元素(與基於位運算的運算子完全相容)

◆ v_setall_() [1/10]

template<>
v_float64x2 cv::v_setall_ ( double val)
inline

◆ v_setall_() [2/10]

template<>
v_float32x4 cv::v_setall_ ( float val)
inline

◆ v_setall_() [3/10]

template<>
v_int32x4 cv::v_setall_ ( int val)
inline

◆ v_setall_() [4/10]

template<>
v_int64x2 cv::v_setall_ ( int64 val)
inline

◆ v_setall_() [5/10]

template<>
v_int8x16 cv::v_setall_ ( schar val)
inline

◆ v_setall_() [6/10]

template<>
v_int16x8 cv::v_setall_ ( short val)
inline

◆ v_setall_() [7/10]

template<>
v_uint8x16 cv::v_setall_ ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); val)
inline

◆ v_setall_() [8/10]

template<>
v_uint64x2 cv::v_setall_ ( uint64 val)
inline

◆ v_setall_() [9/10]

template<>
v_uint32x4 cv::v_setall_ ( unsigned val)
inline

◆ v_setall_() [10/10]

template<>
v_uint16x8 cv::v_setall_ ( ushort val)
inline

◆ v_setall_f32()

v_float32x4 cv::v_setall_f32 ( float val)
inline

◆ v_setall_f64()

v_float64x2 cv::v_setall_f64 ( double val)
inline

◆ v_setall_s16()

v_int16x8 cv::v_setall_s16 ( short val)
inline

◆ v_setall_s32()

v_int32x4 cv::v_setall_s32 ( int val)
inline

◆ v_setall_s64()

v_int64x2 cv::v_setall_s64 ( int64 val)
inline

◆ v_setall_s8()

v_int8x16 cv::v_setall_s8 ( schar val)
inline

◆ v_setall_u16()

v_uint16x8 cv::v_setall_u16 ( ushort val)
inline

◆ v_setall_u32()

v_uint32x4 cv::v_setall_u32 ( unsigned val)
inline

◆ v_setall_u64()

v_uint64x2 cv::v_setall_u64 ( uint64 val)
inline

◆ v_setall_u8()

v_uint8x16 cv::v_setall_u8 ( I.at<uchar>(y, x) = saturate_cast<uchar>(r); val)
inline

◆ v_setzero_()

template<>
v_uint8x16 cv::v_setzero_ ( )
inline

◆ v_setzero_f32()

v_float32x4 cv::v_setzero_f32 ( )
inline

◆ v_setzero_f64()

v_float64x2 cv::v_setzero_f64 ( )
inline

◆ v_setzero_s16()

v_int16x8 cv::v_setzero_s16 ( )
inline

◆ v_setzero_s32()

v_int32x4 cv::v_setzero_s32 ( )
inline

◆ v_setzero_s64()

v_int64x2 cv::v_setzero_s64 ( )
inline

◆ v_setzero_s8()

v_int8x16 cv::v_setzero_s8 ( )
inline

◆ v_setzero_u16()

v_uint16x8 cv::v_setzero_u16 ( )
inline

◆ v_setzero_u32()

v_uint32x4 cv::v_setzero_u32 ( )
inline

◆ v_setzero_u64()

v_uint64x2 cv::v_setzero_u64 ( )
inline

◆ v_setzero_u8()

v_uint8x16 cv::v_setzero_u8 ( )
inline

◆ v_shl() [1/7]

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_shl ( const v_reg< _Tp, n > & a,
int imm )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

按位左移。

適用於 16 位、32 位和 64 位整數值。

◆ v_shl() [2/7]

template<int shift, int n>
v_reg< int, n > cv::v_shl ( const v_reg< int, n > & a)
inline

◆ v_shl() [3/7]

template<int shift, int n>
v_reg< int64, n > cv::v_shl ( const int64, n > & a)
inline

◆ v_shl() [4/7]

template<int shift, int n>
v_reg< short, n > cv::v_shl ( const v_reg< short, n > & a)
inline

◆ v_shl() [5/7]

template<int shift, int n>
v_reg< uint64, n > cv::v_shl ( const v_reg< uint64, n > & a)
inline

◆ v_shl() [6/7]

template<int shift, int n>
v_reg< unsigned, n > cv::v_shl ( const v_reg< unsigned, n > & a)
inline

◆ v_shl() [7/7]

template<int shift, int n>
v_reg< ushort, n > cv::v_shl ( const v_reg< ushort, n > & a)
inline

◆ v_shr() [1/7]

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_shr ( const v_reg< _Tp, n > & a,
int imm )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

按位右移。

適用於 16 位、32 位和 64 位整數值。

◆ v_shr() [2/7]

template<int shift, int n>
v_reg< int, n > cv::v_shr ( const v_reg< int, n > & a)
inline

◆ v_shr() [3/7]

template<int shift, int n>
v_reg< int64, n > cv::v_shr ( const int64, n > & a)
inline

◆ v_shr() [4/7]

template<int shift, int n>
v_reg< short, n > cv::v_shr ( const v_reg< short, n > & a)
inline

◆ v_shr() [5/7]

template<int shift, int n>
v_reg< uint64, n > cv::v_shr ( const v_reg< uint64, n > & a)
inline

◆ v_shr() [6/7]

template<int shift, int n>
v_reg< unsigned, n > cv::v_shr ( const v_reg< unsigned, n > & a)
inline

◆ v_shr() [7/7]

template<int shift, int n>
v_reg< ushort, n > cv::v_shr ( const v_reg< ushort, n > & a)
inline

◆ v_signmask()

template<typename _Tp , int n>
int cv::v_signmask ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

獲取負值掩碼。

已棄用
v_signmask 嚴重依賴於通道計數,因此不夠通用

返回值為一個位掩碼,其位在對應負打包值索引的位置設定為 1。示例

v_int32x4 r; // 設定為 {-1, -1, 1, 1}
int mask = v_signmask(r); // mask = 3 <== 00000000 00000000 00000000 00000011
int v_signmask(const v_reg< _Tp, n > &a)
獲取負值掩碼。
定義 intrin_cpp.hpp:1444

◆ v_sin()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sin ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的正弦 \( sin(x) \)。

僅適用於浮點型別。核心實現與 v_sincos 相同。

◆ v_sincos()

template<typename _Tp , int n>
void cv::v_sincos ( const v_reg< _Tp, n > & x,
v_reg< _Tp, n > & s,
v_reg< _Tp, n > & c )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

同時計算元素的正弦 \( sin(x) \) 和餘弦 \( cos(x) \) 。

僅適用於浮點型別。核心實現步驟

  1. 輸入歸一化:將週期性從 2π 縮放到 4,並利用週期性和三角恆等式將角度減小到 \( [0, \frac{\pi}{4}] \) 範圍。
  2. \( sin(x) \) 和 \( cos(x) \) 的多項式近似
    • 對於 float16 和 float32,正弦使用 4 項泰勒級數,餘弦使用 5 項泰勒級數。
    • 對於 float64,正弦使用 7 項泰勒級數,餘弦使用 8 項泰勒級數。
  3. 選擇結果:選擇並轉換原始輸入角度的最終正弦和餘弦值。
注意
計算精度取決於實現和輸入向量的資料型別。

◆ v_sqr_magnitude()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sqr_magnitude ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

幅值的平方。

返回 \( a^2 + b^2 \)。僅適用於浮點型別。

◆ v_sqrt()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sqrt ( const v_reg< _Tp, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

元素的平方根。

僅適用於浮點型別。

◆ v_store() [1/2]

template<typename _Tp , int n>
void cv::v_store ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將資料儲存到記憶體。

將暫存器內容儲存到記憶體。方案

REG {A B C D} ==> MEM {A B C D}

指標可以不對齊。

此函式的呼叫圖如下

◆ v_store() [2/2]

template<typename _Tp , int n>
void cv::v_store ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a,
hal::StoreMode  )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_store_aligned() [1/2]

template<typename _Tp , int n>
void cv::v_store_aligned ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將資料儲存到記憶體(對齊)

將暫存器內容儲存到記憶體。方案

REG {A B C D} ==> MEM {A B C D}

指標按 16 位元組邊界對齊。

此函式的呼叫圖如下

◆ v_store_aligned() [2/2]

template<typename _Tp , int n>
void cv::v_store_aligned ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a,
hal::StoreMode  )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_store_aligned_nocache()

template<typename _Tp , int n>
void cv::v_store_aligned_nocache ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

此函式的呼叫圖如下

◆ v_store_high()

template<typename _Tp , int n>
void cv::v_store_high ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將資料儲存到記憶體(高位半部)

將暫存器內容的高半部分儲存到記憶體。方案

REG {A B C D} ==> MEM {C D}
此函式的呼叫圖如下

◆ v_store_interleave() [1/3]

template<typename _Tp , int n>
void cv::v_store_interleave ( 包裝自定義型別的輔助函式。 * 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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

交錯並存儲(4通道)

交錯並存儲來自 4 個暫存器的資料到記憶體。方案

{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} ==> {A1 B1 C1 D1 A2 B2 C2 D2 ...}

適用於除64位以外的所有型別。

此函式的呼叫圖如下

◆ v_store_interleave() [2/3]

template<typename _Tp , int n>
void cv::v_store_interleave ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b,
const v_reg< _Tp, n > & c,
hal::StoreMode = hal::STORE_UNALIGNED )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

交錯並存儲(3通道)

交錯並存儲來自 3 個暫存器的資料到記憶體。方案

{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...} ==> {A1 B1 C1 A2 B2 C2 ...}

適用於除64位以外的所有型別。

此函式的呼叫圖如下

◆ v_store_interleave() [3/3]

template<typename _Tp , int n>
void cv::v_store_interleave ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b,
hal::StoreMode = hal::STORE_UNALIGNED )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

交錯並存儲(2通道)

交錯並存儲來自 2 個暫存器的資料到記憶體。方案

{A1 A2 ...}, {B1 B2 ...} ==> {A1 B1 A2 B2 ...}

適用於除64位以外的所有型別。

此函式的呼叫圖如下

◆ v_store_low()

template<typename _Tp , int n>
void cv::v_store_low ( 包裝自定義型別的輔助函式。 * ptr,
const v_reg< _Tp, n > & a )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

將資料儲存到記憶體(低位半部)

將暫存器內容的低半部分儲存到記憶體。方案

REG {A B C D} ==> MEM {A B}
此函式的呼叫圖如下

◆ v_sub()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sub ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

減法。

適用於所有型別。

◆ v_sub_wrap()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_sub_wrap ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

無飽和減法。

適用於8位和16位整數值。

◆ v_transpose4x4()

template<typename _Tp , int n>
void cv::v_transpose4x4 ( v_reg< _Tp, n > & a0,
const v_reg< _Tp, n > & ◆ noArray(),
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 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

轉置4x4矩陣。

方案

a0 {A1 A2 A3 A4}
a1 {B1 B2 B3 B4}
a2 {C1 C2 C3 C4}
a3 {D1 D2 D3 D4}
===============
b0 {A1 B1 C1 D1}
b1 {A2 B2 C2 D2}
b2 {A3 B3 C3 D3}
b3 {A4 B4 C4 D4}

◆ v_trunc() [1/2]

template<int n>
v_reg< int, n *2 > cv::v_trunc ( const v_reg< double, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

這是為方便而提供的過載成員函式。它與上述函式的唯一區別在於其接受的引數。

◆ v_trunc() [2/2]

template<int n>
v_reg< int, n > cv::v_trunc ( const v_reg< float, n > & a)
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

截斷元素。

截斷每個值。輸入型別為浮點向量 ==> 輸出型別為整數向量。

注意
僅適用於浮點型別。

◆ v_xor()

template<typename _Tp , int n>
v_reg< _Tp, n > cv::v_xor ( const v_reg< _Tp, n > & a,
const v_reg< _Tp, n > & b )

#include <opencv2/core/hal/intrin_cpp.hpp>

按位異或。

僅適用於整數型別。

◆ v_zip()

template<typename _Tp , int n>
void cv::v_zip ( const v_reg< _Tp, n > & a0,
const v_reg< _Tp, n > & ◆ noArray(),
v_reg< _Tp, n > & b0,
v_reg< _Tp, n > & b1 )
inline

#include <opencv2/core/hal/intrin_cpp.hpp>

交錯兩個向量。

方案

{A1 A2 A3 A4}
{B1 B2 B3 B4}
---------------
{A1 B1 A2 B2} and {A3 B3 A4 B4}

適用於除64位以外的所有型別。

變數文件

◆ popCountTable

const unsigned char cv::popCountTable[]
static

#include <opencv2/core/hal/intrin_cpp.hpp>

初始值
=
{
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,
}