LoginSignup
39
28

More than 5 years have passed since last update.

ポインタのポインタのポインタのポインタのポインタのポインタのポインタ型(7重ポインタ)

Posted at

(ネタを除く)C言語ソースコードで見かけた、これまでで最もアスタリスク(*)の多い1ポインタ型。

ITU T-Rec. H.264.2 Reference Software2 の動画エンコード処理より。動的メモリ確保した6次元配列をポインタ引数で返すため、構造体への7重ポインタ(MotionVector *******)型となっている。

lcommon/src/memalloc.c
int get_mem6Dmv(MotionVector *******array6D, int dim0, int dim1, int dim2, int dim3, int dim4, int dim5)
lencod/src/slice.c
static int get_mem_bipred_mv(Slice *currSlice, MotionVector ******* bipred_mv)
{
  get_mem6Dmv(bipred_mv, 2, 2, currSlice->max_num_references, 9, 4, 4);
  return 576 * currSlice->max_num_references * sizeof(MotionVector);
}

なお現バージョンでは利用されないが、もう1個*が多い7次元配列確保関数も残存している。

lcommon/src/memalloc.c
int get_mem7Dmv(MotionVector ********array7D, int dim0, int dim1, int dim2, int dim3, int dim4, int dim5, int dim6)

  1. オレオレ調査による。世の中にはもっと長いヤツがあるかも?無いに越したことはない。 

  2. 動画像コーデックH.264/MPEG-4 AVCの研究開発フェーズで利用されてきた参照ソフトウェア。あくまでコーデック自体のアルゴリズム開発・評価が主目的のため、非常にナイーブな実装がなされることが多い。処理速度も超が付くほど遅いため、普通の利用者は x264 などのソフトウェアを使うことになる。 

39
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
39
28