OpenCV 5.0.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

トピック

 プライベート実装ヘルパー
 

詳細説明

「Universal intrinsics」は、異なるプラットフォーム上でのコードのベクトル化を簡素化することを目的とした型と関数のセットである。現在、異なるアーキテクチャ上のいくつかの異なるSIMD拡張がサポートされている。

OpenCV Universal Intrinsicsは以下の命令セットをサポートしている:

コンパイル時に利用可能なSIMD拡張がない場合は、intrinsicsのフォールバックC++実装が選択され、より遅くなる可能性はあるものの、コードは期待通りに動作する。

パックされた値のベクトルレジスタを表すいくつかの型があり、各型は1つの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

値の並べ替え

これらの操作により、1つまたは複数のベクトル内の要素を並べ替えたり、再結合したりできる。

算術、ビット演算、比較演算

要素ごとの二項演算および単項演算。

リダクションとマスク

これらの操作のほとんどは値を1つだけ返す。

その他の数学演算

変換

さまざまな型変換とキャスト:

行列演算

これらの操作では、ベクトルは行列の行/列を表す: v_dotprod, v_dotprod_fast, v_dotprod_expand, v_dotprod_expand_fast, v_matmul, v_transpose4x4

使い勝手

ほとんどの操作は利用可能な型の一部に対してのみ実装されている。以下の表に、さまざまな操作の各型への適用可否を示す。

通常の整数:

Operations\Types uint 8 int 8 uint 16 int 16 uint 32 int 32
load, store x x x x x x
interleave x x x x x x
expand x x x x x x
expand_low x x x x x x
expand_high x x x x x x
expand_q x x
add, sub x x x x x x
add_wrap, sub_wrap x x x x
mul_wrap x x x x
mul x x x x x x
mul_expand x x x x x
compare x x x x x x
shift x x x x
dotprod x x
dotprod_fast x x
dotprod_expand x x x x x
dotprod_expand_fast x x x x x
logical x x x x x x
min, max x x x x x x
absdiff x x x x x x
absdiffs x x
reduce x x x x x x
mask x x x x x x
pack x x x x x x
pack_u x x
pack_b x
unpack x x x x x x
extract x x x x x x
rotate (lanes) x x x x x x
cvt_flt32 x
cvt_flt64 x
transpose4x4 x x
reverse x x x x x x
extract_n x x x x x x
broadcast_element x x

大きな整数:

Operations\Types uint 64 int 64
load, store x x
add, sub x x
shift x x
logical x x
reverse x x
extract x x
rotate (lanes) x x
cvt_flt64 x
extract_n x x

浮動小数点:

Operations\Types float 32 float 64
load, store x x
interleave x
add, sub x x
mul x x
div x x
compare x x
min, max x x
absdiff x x
reduce x
mask x x
unpack x x
cvt_flt32 x
cvt_flt64 x
sqrt, abs x x
float math x x
transpose4x4 x
extract x x
rotate (lanes) x x
reverse x x
extract_n x x
broadcast_element x
exp x x
log x x
sin, cos x x

クラス

struct  cv::v_reg< _Tp, n >
 

マクロ定義

#define OPENCV_HAL_HAVE_PACK_STORE_BFLOAT16   1
 
#define OPENCV_HAL_MATH_HAVE_EXP   1
 

型定義

typedef v_float32x16 simd512::v_float32
 32ビット浮動小数点値(単精度)の利用可能な最大ベクトルレジスタ容量
 
typedef v_reg< float, 16 > cv::v_float32x16
 16個の32ビット浮動小数点値(単精度)
 
typedef v_reg< float, 4 > cv::v_float32x4
 4個の32ビット浮動小数点値(単精度)
 
typedef v_reg< float, 8 > cv::v_float32x8
 8個の32ビット浮動小数点値(単精度)
 
typedef v_float64x8 simd512::v_float64
 64ビット浮動小数点値(倍精度)の利用可能な最大ベクトルレジスタ容量
 
typedef v_reg< double, 2 > cv::v_float64x2
 2個の64ビット浮動小数点値(倍精度)
 
typedef v_reg< double, 4 > cv::v_float64x4
 4個の64ビット浮動小数点値(倍精度)
 
typedef v_reg< double, 8 > cv::v_float64x8
 8個の64ビット浮動小数点値(倍精度)
 
typedef v_int16x32 simd512::v_int16
 16ビット符号付き整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< short, 16 > cv::v_int16x16
 16個の16ビット符号付き整数値。
 
typedef v_reg< short, 32 > cv::v_int16x32
 32個の16ビット符号付き整数値。
 
typedef v_reg< short, 8 > cv::v_int16x8
 8個の16ビット符号付き整数値。
 
typedef v_int32x16 simd512::v_int32
 32ビット符号付き整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< int, 16 > cv::v_int32x16
 16個の32ビット符号付き整数値。
 
typedef v_reg< int, 4 > cv::v_int32x4
 4個の32ビット符号付き整数値。
 
typedef v_reg< int, 8 > cv::v_int32x8
 8個の32ビット符号付き整数値。
 
typedef v_int64x8 simd512::v_int64
 64ビット符号付き整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< int64, 2 > cv::v_int64x2
 2個の64ビット符号付き整数値。
 
typedef v_reg< int64, 4 > cv::v_int64x4
 4個の64ビット符号付き整数値。
 
typedef v_reg< int64, 8 > cv::v_int64x8
 8個の64ビット符号付き整数値。
 
typedef v_int8x64 simd512::v_int8
 8ビット符号付き整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< schar, 16 > cv::v_int8x16
 16個の8ビット符号付き整数値。
 
typedef v_reg< schar, 32 > cv::v_int8x32
 32個の8ビット符号付き整数値。
 
typedef v_reg< schar, 64 > cv::v_int8x64
 64個の8ビット符号付き整数値。
 
typedef v_uint16x32 simd512::v_uint16
 16ビット符号なし整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< ushort, 16 > cv::v_uint16x16
 16個の16ビット符号なし整数値。
 
typedef v_reg< ushort, 32 > cv::v_uint16x32
 32個の16ビット符号なし整数値。
 
typedef v_reg< ushort, 8 > cv::v_uint16x8
 8個の16ビット符号なし整数値。
 
typedef v_uint32x16 simd512::v_uint32
 32ビット符号なし整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< unsigned, 16 > cv::v_uint32x16
 16個の32ビット符号なし整数値。
 
typedef v_reg< unsigned, 4 > cv::v_uint32x4
 4個の32ビット符号なし整数値。
 
typedef v_reg< unsigned, 8 > cv::v_uint32x8
 8個の32ビット符号なし整数値。
 
typedef v_uint64x8 simd512::v_uint64
 64ビット符号なし整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< uint64, 2 > cv::v_uint64x2
 2個の64ビット符号なし整数値。
 
typedef v_reg< uint64, 4 > cv::v_uint64x4
 4個の64ビット符号なし整数値。
 
typedef v_reg< uint64, 8 > cv::v_uint64x8
 8個の64ビット符号なし整数値。
 
typedef v_uint8x64 simd512::v_uint8
 8ビット符号なし整数値の利用可能な最大ベクトルレジスタ容量。
 
typedef v_reg< uchar, 16 > cv::v_uint8x16
 16個の8ビット符号なし整数値。
 
typedef v_reg< uchar, 32 > cv::v_uint8x32
 32個の8ビット符号なし整数値。
 
typedef v_reg< uchar, 64 > cv::v_uint8x64
 64個の8ビット符号なし整数値。
 

列挙型

enum  {
  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)
 メモリからレジスタ内容を4倍展開してロードする。
 
template<typename _Tp >
v_reg< _Tp, simd256_width/sizeof(_Tp)> cv::v256_load_halves (const _Tp *loptr, const _Tp *hiptr)
 2つのメモリブロックからレジスタ内容をロードする。
 
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)
 メモリからレジスタ内容を4倍展開してロードする。
 
template<typename _Tp >
v_reg< _Tp, simd512_width/sizeof(_Tp)> cv::v512_load_halves (const _Tp *loptr, const _Tp *hiptr)
 2つのメモリブロックからレジスタ内容をロードする。
 
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)
 ビットごとのAND。
 
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)
 パックされた全ての値が0未満かどうかを判定する。
 
template<typename _Tp , int n>
bool cv::v_check_any (const v_reg< _Tp, n > &a)
 パックされた値のいずれかが0未満かどうかを判定する。
 
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)
 2つのベクトルの末尾要素からベクトルを合成する。
 
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)
 2つのベクトルの先頭要素からベクトルを合成する。
 
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)
 下位半分をfloatに変換する。
 
template<int n>
v_reg< float, n *2 > cv::v_cvt_f32 (const v_reg< double, n > &a, const v_reg< double, n > &b)
 floatに変換する。
 
template<int n>
v_reg< float, n > cv::v_cvt_f32 (const v_reg< int, n > &a)
 floatに変換する。
 
template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64 (const v_reg< float, n > &a)
 下位半分をdoubleに変換する。
 
template<int n>
v_reg< double, n/2 > cv::v_cvt_f64 (const v_reg< int, n > &a)
 下位半分をdoubleに変換する。
 
template<int n>
v_reg< double, n > cv::v_cvt_f64 (const v_reg< int64, n > &a)
 doubleに変換する。
 
template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64_high (const v_reg< float, n > &a)
 ベクトルの上位部分をdoubleに変換する。
 
template<int n>
v_reg< double,(n/2)> cv::v_cvt_f64_high (const v_reg< int, n > &a)
 ベクトルの上位部分をdoubleに変換する。
 
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)
 Error 関数。
 
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)
 メモリからレジスタ内容を4倍展開してロードする。
 
template<typename _Tp >
v_reg< _Tp, simd128_width/sizeof(_Tp)> cv::v_load_halves (const _Tp *loptr, const _Tp *hiptr)
 2つのメモリブロックからレジスタ内容をロードする。
 
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)
 ビットごとのNOT。
 
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)
 ビットごとのOR。
 
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)
 2つの別のベクトルの下位部分と上位部分から2つのベクトルを結合する。
 
template<typename _Tp , int n>
_Tp cv::v_reduce_max (const v_reg< _Tp, n > &a)
 1つの最大値を求める。
 
template<typename _Tp , int n>
_Tp cv::v_reduce_min (const v_reg< _Tp, n > &a)
 1つの最小値を求める。
 
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)
 大きさの2乗。
 
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)
 ビットごとのXOR。
 
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)
 2つのベクトルをインターリーブする。
 

変数

static const unsigned char cv::popCountTable []
 

Init with zero

ゼロ要素を持つ新しいベクトルを作成する

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 ()
 

Init with value

特定の値に設定された要素を持つ新しいベクトルを作成する

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)
 

Reinterpret

基となるデータを変更せずにベクトルを別の型に変換する。

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)
 

Left shift

左シフト

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)
 

Right shift

右シフト

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)
 

Rounding shift

丸めを伴う右シフト

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)
 

Pack

2つのベクトルの値を1つにパックする

入力ベクトル型の2倍の要素数を持つベクトル型を返す。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)
 

Pack with rounding shift

2つのベクトルの値を、丸めを伴う右シフトで1つにパックする

入力ベクトルの値は丸めを伴って 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)
 

Pack and store

入力ベクトルの値をパックしてメモリに格納する

値はより狭い型に変換されてメモリに格納される。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)
 

Pack and store with rounding shift

入力ベクトルの値をパックしてメモリに格納する

値は丸めを伴って 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)
 

Pack boolean values

複数のベクトルのブール値を1つの符号なし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_HAVE_PACK_STORE_BFLOAT16

#define OPENCV_HAL_HAVE_PACK_STORE_BFLOAT16   1

◆ 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>

16個の32ビット浮動小数点値 (単精度)

◆ v_float32x4

typedef v_reg<float, 4> cv::v_float32x4

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

4個の32ビット浮動小数点値 (単精度)

◆ v_float32x8

typedef v_reg<float, 8> cv::v_float32x8

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

8個の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>

2個の64ビット浮動小数点値(倍精度)

◆ v_float64x4

typedef v_reg<double, 4> cv::v_float64x4

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

4個の64ビット浮動小数点値(倍精度)

◆ v_float64x8

typedef v_reg<double, 8> cv::v_float64x8

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

8個の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個の16ビット符号付き整数値。

◆ v_int16x32

typedef v_reg<short, 32> cv::v_int16x32

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

32個の16ビット符号付き整数値。

◆ v_int16x8

typedef v_reg<short, 8> cv::v_int16x8

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

8個の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>

16個の32ビット符号付き整数値。

◆ v_int32x4

typedef v_reg<int, 4> cv::v_int32x4

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

4個の32ビット符号付き整数値。

◆ v_int32x8

typedef v_reg<int, 8> cv::v_int32x8

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

8個の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>

2個の64ビット符号付き整数値。

◆ v_int64x4

typedef v_reg<int64, 4> cv::v_int64x4

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

4個の64ビット符号付き整数値。

◆ v_int64x8

typedef v_reg<int64, 8> cv::v_int64x8

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

8個の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>

16個の8ビット符号付き整数値。

◆ v_int8x32

typedef v_reg<schar, 32> cv::v_int8x32

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

32個の8ビット符号付き整数値。

◆ v_int8x64

typedef v_reg<schar, 64> cv::v_int8x64

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

64個の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個の16ビット符号なし整数値。

◆ v_uint16x32

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

32個の16ビット符号なし整数値。

◆ v_uint16x8

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

8個の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>

16個の32ビット符号なし整数値。

◆ v_uint32x4

typedef v_reg<unsigned, 4> cv::v_uint32x4

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

4個の32ビット符号なし整数値。

◆ v_uint32x8

typedef v_reg<unsigned, 8> cv::v_uint32x8

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

8個の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>

2個の64ビット符号なし整数値。

◆ v_uint64x4

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

4個の64ビット符号なし整数値。

◆ v_uint64x8

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

8個の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>

16個の8ビット符号なし整数値。

◆ v_uint8x32

typedef v_reg<uchar, 32> cv::v_uint8x32

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

32個の8ビット符号なし整数値。

◆ v_uint8x64

typedef v_reg<uchar, 64> cv::v_uint8x64

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

64個の8ビット符号なし整数値。

列挙型詳解

◆ anonymous enum

anonymous enum

#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>

メモリからレジスタ内容を2倍に拡張してロードする。

cv::v256_load と同じだが、結果のパック型はメモリの型より2倍幅広くなる。

short buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // type is int16
v_int32x8 r = v256_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - type is int32
v_reg< int, 8 > v_int32x8
Eight 32-bit signed integer values.
Definition intrin_cpp.hpp:540
v_reg< typename V_TypeTraits< _Tp >::w_type, simd256_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> v256_load_expand(const _Tp *ptr)
Load register contents from memory with double expand.
Definition intrin_cpp.hpp:1971

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>

メモリからレジスタ内容を4倍に拡張してロードする。

cv::v256_load_expand と同じだが、結果の型はソースより4倍幅広くなる。

char buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // type is int8
v_int32x8 r = v256_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - type is 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)
Load register contents from memory with quad expand.
Definition intrin_cpp.hpp:2059

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>

2つのメモリブロックからレジスタ内容をロードする。

引数
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)
Load register contents from two memory blocks.
Definition intrin_cpp.hpp:1880
覚え書き
使用前に 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)
Load 128-bits of data to lower part (high part is undefined).
Definition intrin_cpp.hpp:1795
覚え書き
使用前に 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 ( uchar 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>

メモリからレジスタ内容を2倍に拡張してロードする。

cv::v512_load と同じだが、結果のパック型はメモリの型より2倍幅広くなる。

short buf[8] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // type is 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} - type is int32
v_reg< typename V_TypeTraits< _Tp >::w_type, simd512_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> v512_load_expand(const _Tp *ptr)
Load register contents from memory with double expand.
Definition intrin_cpp.hpp:2002
v_reg< int, 16 > v_int32x16
Sixteen 32-bit signed integer values.
Definition intrin_cpp.hpp:563

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>

メモリからレジスタ内容を4倍に拡張してロードする。

cv::v512_load_expand と同じだが、結果の型はソースより4倍幅広くなる。

char buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // type is 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} - type is 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)
Load register contents from memory with quad expand.
Definition intrin_cpp.hpp:2089

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>

2つのメモリブロックからレジスタ内容をロードする。

引数
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)
Load register contents from two memory blocks.
Definition intrin_cpp.hpp:1911
覚え書き
使用前に 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)
Load 256-bits of data to lower part (high part is undefined).
Definition intrin_cpp.hpp:1823
覚え書き
使用前に 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 ( uchar 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} and {4, 3, 2, 1}
v_uint32x4 c = v_absdiff(a, b); // result is {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)
Absolute difference.
Definition intrin_cpp.hpp:1022
Definition intrin_cpp.hpp:389

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>

ビット単位のAND演算。

整数型のみ。

◆ 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>

要素を切り上げる。

各値を切り上げる。入力型は float ベクトル ==> 出力型は int ベクトル。

覚え書き
浮動小数点型のみ対応。
この関数の呼び出しグラフ:

◆ 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>

パックされた全ての値が0未満かどうかを判定する。

符号なし値は符号付きにキャストされる: 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>

パックされた値のいずれかが0未満かどうかを判定する。

符号なし値は符号付きにキャストされる: 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>

2つのベクトルの末尾要素からベクトルを合成する。

模式図:

{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>

2つのベクトルの先頭要素からベクトルを合成する。

模式図:

{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>

下位半分を float に変換する。

サポートされる入力型は 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>

float に変換する。

サポートされる入力型は 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>

float に変換する。

サポートされる入力型は 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>

下位半分を double に変換する。

サポートされる入力型は 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>

下位半分を double に変換する。

サポートされる入力型は cv::v_int32。

◆ v_cvt_f64() [3/3]

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

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

double に変換する。

サポートされる入力型は 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>

ベクトルの上位部分を double に変換する。

サポートされる入力型は 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>

ベクトルの上位部分を double に変換する。

サポートされる入力型は 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>

要素のドット積。

2つのレジスタの値を乗算し、隣接する結果のペアを加算する。

模式図:

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

◆ 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 と同じだが、隣接ペアの和に第3の要素を加える。模式図:

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

◆ 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>

要素のドット積と拡張。

2つのレジスタの値を乗算し、隣接する結果のペアの和を拡張する。

模式図:

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

◆ 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 と同じだが、隣接ペアの和に第3の要素を加える。模式図:

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

◆ 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>

要素の高速ドット積と拡張。

2つのレジスタの値を乗算し、隣接する結果のペアの和を拡張する。

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 と同じだが、隣接ペアの和に第3の要素を加える。

この関数の呼び出しグラフ:

◆ 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 と同じだが、隣接ペアの和に第3の要素を加える。

この関数の呼び出しグラフ:

◆ 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. Polynomial Approximation for \( e^{f \cdot \ln2} \): The closer the fractional part is to 0, the more accurate the result.
    • float16 および float32 では、6項のテイラー級数を用いる。
    • float64 では、4項のパデ多項式近似を用いる。
  5. 結果の合成: 2つの部分を掛け合わせて最終結果を得る: \( 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倍幅のパック型を持つ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)
Vector extract.
Definition intrin_cpp.hpp:2440

すべての型向け。

◆ 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)
Vector extract.
Definition intrin_cpp.hpp:2466

すべての型向け。

◆ 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>

要素を切り捨てる。

各値を切り捨てる。入力型は float ベクトル ==> 出力型は int ベクトル。

覚え書き
浮動小数点型のみ対応。
この関数の呼び出しグラフ:

◆ 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>

メモリからレジスタ内容を2倍に拡張してロードする。

cv::v_load と同じだが、結果のパック型はメモリ型の2倍幅になる。

short buf[4] = {1, 2, 3, 4}; // type is int16
v_int32x4 r = v_load_expand(buf); // r = {1, 2, 3, 4} - type is int32
v_reg< typename V_TypeTraits< _Tp >::w_type, simd128_width/sizeof(typename V_TypeTraits< _Tp >::w_type)> v_load_expand(const _Tp *ptr)
Load register contents from memory with double expand.
Definition intrin_cpp.hpp:1941
v_reg< int, 4 > v_int32x4
Four 32-bit signed integer values.
Definition intrin_cpp.hpp:518

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>

メモリからレジスタ内容を4倍に拡張してロードする。

cv::v_load_expand と同様だが、結果の型はソースの4倍の幅になる。

char buf[4] = {1, 2, 3, 4}; // type is int8
v_int32x4 r = v_load_expand_q(buf); // r = {1, 2, 3, 4} - type is 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)
Load register contents from memory with quad expand.
Definition intrin_cpp.hpp:2030

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>

2つのメモリブロックからレジスタ内容をロードする。

引数
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)
Load register contents from two memory blocks.
Definition intrin_cpp.hpp:1850
覚え書き
最大限利用可能なレジスタ長の結果を得るには 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)
Load 64-bits of data to lower part (high part is undefined).
Definition intrin_cpp.hpp:1768
覚え書き
最大限利用可能なレジスタ長の結果を得るには 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. 入力の分解: 2進表現を用いて入力を仮数部 \( 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. Polynomial Approximation for \( \log(m) \): The closer the \( m \) is to 1, the more accurate the result.
    • float16 および float32 では、9項のテイラー級数を使用する。
    • float64 では、6項のパデ多項式近似を使用する。
  4. 結果の合成: 2つの部分を加算して最終結果を得る。
覚え書き
計算の精度は、実装および入力のデータ型に依存する。
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>

大きさ(magnitude)。

\( 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)
Calculates per-element maximum of two arrays or an array and a scalar.

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)
Calculates per-element minimum of two arrays or an array and a scalar.

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>

乗算して拡張する。

2つのレジスタの値を乗算し、より幅の広いパック型を持つ2つのレジスタに結果を格納する。模式図:

{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} and {2,2,2,2}
v_uint64x2 c, d; // results
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)
Multiply and expand.
Definition intrin_cpp.hpp:1285

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>

乗算して上位部分を取り出す。

2つのレジスタの値を乗算し、結果の上位部分を格納する。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>

ビット単位のNOT。

整数型のみ。

◆ 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>

ビット単位のOR。

整数型のみ。

◆ 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 v_reg< int64, n > & a,
const v_reg< 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 > & f,
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 v_reg< 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 ( uchar * 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 ( uchar * 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>

他の2つのベクトルの下位部分と上位部分から2つのベクトルを合成する。

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)
Combine vector from last elements of two vectors.
Definition intrin_cpp.hpp:2373
v_reg< _Tp, n > v_combine_low(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Combine vector from first elements of two vectors.
Definition intrin_cpp.hpp:2351

◆ 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>

1つの最大値を求める。

模式図:

{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>

1つの最小値を求める。

模式図:

{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)
Calculates the sum of array elements.
static uchar abs(uchar a)
Definition 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>

要素を丸める。

各値を丸める。入力型は float ベクトル ==> 出力型は int ベクトル。

覚え書き
浮動小数点型のみ対応。
この関数の呼び出しグラフ:

◆ 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 v_reg< 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 v_reg< int64, n > & a,
const v_reg< 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 v_reg< 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 ( uchar * 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 ( uchar * 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; // set to {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 element values are restricted to these values:
  • 0: b から要素を選択する
  • 0xff/0xffff/等: 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_ ( uchar 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 ( uchar 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 v_reg< 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 v_reg< 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>

負の値のマスクを取得する。

非推奨Deprecated
v_signmask はレーン数に大きく依存するため、汎用性が十分ではない

戻り値は、負のパック値のインデックスに対応する位置のビットが1にセットされたビットマスクである。例:

v_int32x4 r; // set to {-1, -1, 1, 1}
int mask = v_signmask(r); // mask = 3 <== 00000000 00000000 00000000 00000011
int v_signmask(const v_reg< _Tp, n > &a)
Get negative values mask.
Definition intrin_cpp.hpp:1461

◆ 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. Polynomial Approximation for \( sin(x) \) and \( 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>

大きさの2乗。

\( 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 ( _Tp * 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 ( _Tp * 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 ( _Tp * 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 ( _Tp * 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 ( _Tp * 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 ( _Tp * 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 ( _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 )
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 ( _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 )
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 ( _Tp * 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 ( _Tp * 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 > & 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 )
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>

要素を切り捨てる。

各値を切り捨てる。入力型はfloatベクトル ==> 出力型はintベクトル。

覚え書き
浮動小数点型のみ対応。

◆ 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>

ビット単位XOR。

整数型のみ。

◆ v_zip()

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 )
inline

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

2つのベクトルをインターリーブする。

模式図:

{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,
}