Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264

D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264

構造体
サイズx64: 136 バイト / x86: 88 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
FlagsD3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS4+0+0エンコードされるフレームの構成フラグを指定する、D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS 列挙型の値のビット単位のOR の組み合わせです。
FrameTypeD3D12_VIDEO_ENCODER_FRAME_TYPE_H2644+4+4ピクチャータイプを指定する D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 列挙型の値です。コーデック固有のフラグが、指定したタイプをサポートしていることを確認してください。この選択は、ホストが設定した GOP 構造の構成と常に同期を保つ必要があります。GOP は表示順で定義されますが、このピクチャータイプの選択は GOP に従いつつエンコード順である必要があることに注意してください。
pic_parameter_set_idDWORD4+8+8PPS を参照するために現在のフレームのスライスヘッダーで使用される値を指定する UINT です。
idr_pic_idDWORD4+12+12FrameTypeD3D12_VIDEO_ENCODER_FRAME_TYPE_H264_IDR_FRAME の場合に、そのフレーム内に存在するすべてのスライスヘッダーで使用される IDR フレームの識別子を示す UINT です。
PictureOrderCountNumberDWORD4+16+16現在のフレームの表示順を指定する UINT です。
FrameDecodingOrderNumberDWORD4+20+20参照ピクチャーごとにインクリメントされるスライスヘッダーの frame_num シンタックス要素が示すセマンティクスで、フレームのデコード順を指定する UINT です。
TemporalLayerIndexDWORD4+24+24時間階層におけるピクチャーのレイヤー番号を指定する UINT です。レイヤーの最大数は D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 で確認してください。
List0ReferenceFramesCountDWORD4+28+28このフレームで使用する過去のフレーム参照の数を指定する UINT です。この値は、D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 で公開された内容と整合している必要があります。
pList0ReferenceFramesDWORD*8/4+32+32このフレームで使用する過去の参照フレームのリストを指定する UINT 配列へのポインターです。この配列の各整数値は、DPB に保持されている参照ピクチャーを指す pReferenceFramesReconPictureDescriptors へのインデックスです。
List1ReferenceFramesCountDWORD4+40+36このフレームで使用する将来のフレーム参照の数を指定する UINT です。この値は、D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 で公開された内容と整合している必要があります。
pList1ReferenceFramesDWORD*8/4+48+40このフレームで使用する将来の参照フレームのリストを指定する UINT 配列へのポインターです。この配列の各整数値は、DPB に保持されている参照ピクチャーを指す pReferenceFramesReconPictureDescriptors へのインデックスです。
ReferenceFramesReconPictureDescriptorsCountDWORD4+56+44pReferenceFramesReconPictureDescriptors 内のエントリ数を指定する UINT です。
pReferenceFramesReconPictureDescriptorsD3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264*8/4+64+48

D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC.ReferenceFrames に保持されている DPB バッファーの現在の状態を記述する UINT 配列へのポインターです。pList0ReferenceFrames および pList1ReferenceFrames のリストのインデックスは、過去/将来の参照からこの記述子配列へマッピングされます。

さらにこの記述子の配列は、このフレームの参照ピクチャーを、再構築ピクチャー配列 D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC.ReferenceFrames 内のリソースインデックスへマッピングします。加えて、各参照ピクチャーについて、エンコード順および表示順の番号と、長期参照であるかどうかを示します。

この配列のサイズは、関連する EncodeFrame コマンドの D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC.ReferenceFrames.NumTextures と常に一致します。

adaptive_ref_pic_marking_mode_flagBYTE1+72+52

フレームの参照処理のセマンティックモードを定義する UCHAR です。

adaptive_ref_pic_marking_mode_flag の値 指定される参照ピクチャーマーキングモード
0 1
スライディングウィンドウ参照ピクチャーマーキングモード: 短期参照ピクチャーに対して先入れ先出しの仕組みを提供するマーキングモードです。 適応的参照ピクチャーマーキングモード: 参照ピクチャーを「参照に使用しない」としてマークし、長期フレームインデックスを割り当てるためのシンタックス要素を提供する参照ピクチャーマーキングモードです。
RefPicMarkingOperationsCommandsCountDWORD4+76+56現在のフレームに関連付けられた参照ピクチャーマーキング操作の数を指定する UINT です。adaptive_ref_pic_marking_mode_flag が 1 に設定されている必要があります。
pRefPicMarkingOperationsCommandsD3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION*8/4+80+60現在のフレームに関連付けられた参照ピクチャーマーキング操作のリストを表す D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION 構造体の配列へのポインターです。このリストで記述される操作は、エンコードセッション中に DPB 記述子へ適切に反映される必要があります。
List0RefPicModificationsCountDWORD4+88+64pList0RefPicModifications 内の項目数を指定する UINT です。
pList0RefPicModificationsD3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION*8/4+96+68pList0ReferenceFrames リストに対する参照ピクチャーリスト変更操作のリストを表す D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION 構造体の配列へのポインターです。
List1RefPicModificationsCountDWORD4+104+72pList1RefPicModifications 内の項目数を指定する UINT です。
pList1RefPicModificationsD3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION*8/4+112+76pList1ReferenceFrames リストに対する参照ピクチャーリスト変更操作のリストを表す D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION 構造体の配列へのポインターです。
QPMapValuesCountDWORD4+120+80pRateControlQPMap に存在する要素の数を指定する UINT です。この値は、フレーム解像度を最も近いアライメント値へ切り上げた場合の、フレーム内のコーディングブロック数と一致する必要があります。
pRateControlQPMapCHAR*8/4+128+84このフレームの各正方形領域に使用する QP マップ値を、行/列のスキャン順で格納した Int8 の配列へのポインターです。QP マップの寸法は、現在の解像度と、正方形領域のサイズを示す D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS.QPMapRegionPixelsSize を使用して計算できます。

公式ドキュメント

H.264 エンコードにおいて、関連する EncodeFrame コマンドのピクチャーレベルの制御要素を表します。

解説(Remarks)

現在のフレームが参照ピクチャーとしてマークされている場合、ホストが後続のコマンドの再構築ピクチャー参照リストに配置できるよう、出力にはビットストリームとともに再構築ピクチャーが含まれている必要があることに注意してください。また、フレームタイプによっては参照としてマークすることに制限がある場合があるため、これらの値を設定する前に機能サポートを確認してください。

次の表に、H264 エンコードで想定される SPS および PPS の値を示します。

H264 の Level_idc のマッピング

D3D12 レベル 想定される level_idc 備考
D3D12_VIDEO_ENCODER_LEVELS_H264_1 10 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_1b 11 SPS.constraint_set3 は 1 でなければなりません
D3D12_VIDEO_ENCODER_LEVELS_H264_11 11 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_12 12 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_13 13 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_2 20 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_21 21 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_22 22 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_3 30 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_31 31 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_32 32 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_4 40 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_41 41 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_42 42 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_5 50 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_51 51 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_52 52 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_6 60 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_61 61 なし
D3D12_VIDEO_ENCODER_LEVELS_H264_62 62 なし

H264 シーケンスパラメーターセットで想定される値

シンタックス要素 想定される既定値 備考
profile_idc H264_PROFILE_MAIN/H264_PROFILE_HIGH/H264_PROFILE_HIGH10 の列挙値 なし
constraint_set0_flag 0 なし
constraint_set1_flag 0 なし
constraint_set2_flag 0 なし
constraint_set3_flag 0 D3D12_VIDEO_ENCODER_LEVELS_H264_1b を使用する場合は 1
constraint_set4_flag 0 なし
constraint_set5_flag 0 なし
reserved_zero_2bits 0 なし
level_idc H264 のレベルについては上の表を参照してください なし
seq_parameter_set_id ユーザー指定 なし
chroma_format_idc 1 P010 または NV12 YUV 4.2.0 形式で使用する場合のみ
bit_depth_luma_minus8 NV12 の場合は 0、P010 の場合は 2 なし
qpprime_y_zero_transform_bypass_flag 0 なし
seq_scaling_matrix_present_flag 0 なし
log2_max_frame_num_minus4 D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 と同じ なし
pic_order_cnt_type D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 と同じ この API ではモード 0 と 2 のみサポートされます
log2_max_pic_order_cnt_lsb_minus4 D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 と同じ pic_order_cnt_type == 0 の場合のみ
max_num_ref_frames エンコードセッションで使用される参照ピクチャーの最大数 なし
gaps_in_frame_num_value_allowed_flag 0 なし
pic_width_in_mbs_minus1 std::ceil(sequenceTargetResolution.Width / 16.0)) - 1; なし
pic_height_in_map_units_minus1 std::ceil(sequenceTargetResolution.Height / 16.0)) - 1; なし
frame_mbs_only_flag 0 インターレースはサポートされません
direct_8x8_inference_flag D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_ADAPTIVE_8x8_TRANSFORM に基づきます なし
frame_cropping_flag エンコード解像度が 16 にアライメントされているかどうかに応じて 0 または 1 なし
frame_cropping_rect_left_offset 0 frame_cropping_flag = 1 の場合のみ
frame_cropping_rect_right_offset ((pic_width_in_mbs_minus1+1) * 16 - sequenceTargetResolution.Width) / 2 frame_cropping_flag = 1 の場合のみ
frame_cropping_rect_top_offset ((pic_height_in_map_units_minus1+1) * 16 - sequenceTargetResolution.Height) / 2 frame_cropping_flag = 1 の場合のみ
frame_cropping_rect_bottom_offset 0 frame_cropping_flag = 1 の場合のみ
vui_paramenters_present_flag 0 なし

H264 ピクチャーパラメーターセットで想定される値

シンタックス要素 想定される既定値 備考
pic_parameter_set_id ユーザー指定 なし
seq_parameter_set_id ユーザー指定 なし
entropy_coding_mode_flag D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ENABLE_CABAC_ENCODING に基づきます なし
pic_order_present_flag 0 pic_cnt_type = 0, 2 のみサポートされます
num_slice_groups_minus1 0 なし
num_ref_idx_l1_active_minus1 std::max(static_cast<INT>(pictureControl.List0ReferenceFramesCount) - 1, 0) なし
num_ref_idx_l0_active_minus1 std::max(static_cast<INT>(pictureControl.List1ReferenceFramesCount) - 1, 0) なし
weighted_pred_flag 0 なし
weighted_bipred_idc 0 なし
pic_init_qp_minus26 0 なし
pic_init_qs_minus26 0 なし
chroma_qp_index_offset 0 なし
deblocking_filter_control_present_flag 1 なし
constrained_intra_pred_flag D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_CONSTRAINED_INTRAPREDICTION に基づきます なし
redundant_pic_cnt_present_flag 0 なし
transform_8x8_mode_flag D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_ADAPTIVE_8x8_TRANSFORM に基づきます High プロファイルを使用する場合のみ
pic_scaling_matrix_present_flag 0 なし
second_chroma_qp_index_offset 0 なし
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264  (x64 136 / x86 88 バイト)
typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 {
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS Flags;
    D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 FrameType;
    DWORD pic_parameter_set_id;
    DWORD idr_pic_id;
    DWORD PictureOrderCountNumber;
    DWORD FrameDecodingOrderNumber;
    DWORD TemporalLayerIndex;
    DWORD List0ReferenceFramesCount;
    DWORD* pList0ReferenceFrames;
    DWORD List1ReferenceFramesCount;
    DWORD* pList1ReferenceFrames;
    DWORD ReferenceFramesReconPictureDescriptorsCount;
    D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264* pReferenceFramesReconPictureDescriptors;
    BYTE adaptive_ref_pic_marking_mode_flag;
    DWORD RefPicMarkingOperationsCommandsCount;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION* pRefPicMarkingOperationsCommands;
    DWORD List0RefPicModificationsCount;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* pList0RefPicModifications;
    DWORD List1RefPicModificationsCount;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* pList1RefPicModifications;
    DWORD QPMapValuesCount;
    CHAR* pRateControlQPMap;
} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264
{
    public int Flags;
    public int FrameType;
    public uint pic_parameter_set_id;
    public uint idr_pic_id;
    public uint PictureOrderCountNumber;
    public uint FrameDecodingOrderNumber;
    public uint TemporalLayerIndex;
    public uint List0ReferenceFramesCount;
    public IntPtr pList0ReferenceFrames;
    public uint List1ReferenceFramesCount;
    public IntPtr pList1ReferenceFrames;
    public uint ReferenceFramesReconPictureDescriptorsCount;
    public IntPtr pReferenceFramesReconPictureDescriptors;
    public byte adaptive_ref_pic_marking_mode_flag;
    public uint RefPicMarkingOperationsCommandsCount;
    public IntPtr pRefPicMarkingOperationsCommands;
    public uint List0RefPicModificationsCount;
    public IntPtr pList0RefPicModifications;
    public uint List1RefPicModificationsCount;
    public IntPtr pList1RefPicModifications;
    public uint QPMapValuesCount;
    public IntPtr pRateControlQPMap;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264
    Public Flags As Integer
    Public FrameType As Integer
    Public pic_parameter_set_id As UInteger
    Public idr_pic_id As UInteger
    Public PictureOrderCountNumber As UInteger
    Public FrameDecodingOrderNumber As UInteger
    Public TemporalLayerIndex As UInteger
    Public List0ReferenceFramesCount As UInteger
    Public pList0ReferenceFrames As IntPtr
    Public List1ReferenceFramesCount As UInteger
    Public pList1ReferenceFrames As IntPtr
    Public ReferenceFramesReconPictureDescriptorsCount As UInteger
    Public pReferenceFramesReconPictureDescriptors As IntPtr
    Public adaptive_ref_pic_marking_mode_flag As Byte
    Public RefPicMarkingOperationsCommandsCount As UInteger
    Public pRefPicMarkingOperationsCommands As IntPtr
    Public List0RefPicModificationsCount As UInteger
    Public pList0RefPicModifications As IntPtr
    Public List1RefPicModificationsCount As UInteger
    Public pList1RefPicModifications As IntPtr
    Public QPMapValuesCount As UInteger
    Public pRateControlQPMap As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264(ctypes.Structure):
    _fields_ = [
        ("Flags", ctypes.c_int),
        ("FrameType", ctypes.c_int),
        ("pic_parameter_set_id", wintypes.DWORD),
        ("idr_pic_id", wintypes.DWORD),
        ("PictureOrderCountNumber", wintypes.DWORD),
        ("FrameDecodingOrderNumber", wintypes.DWORD),
        ("TemporalLayerIndex", wintypes.DWORD),
        ("List0ReferenceFramesCount", wintypes.DWORD),
        ("pList0ReferenceFrames", ctypes.c_void_p),
        ("List1ReferenceFramesCount", wintypes.DWORD),
        ("pList1ReferenceFrames", ctypes.c_void_p),
        ("ReferenceFramesReconPictureDescriptorsCount", wintypes.DWORD),
        ("pReferenceFramesReconPictureDescriptors", ctypes.c_void_p),
        ("adaptive_ref_pic_marking_mode_flag", ctypes.c_ubyte),
        ("RefPicMarkingOperationsCommandsCount", wintypes.DWORD),
        ("pRefPicMarkingOperationsCommands", ctypes.c_void_p),
        ("List0RefPicModificationsCount", wintypes.DWORD),
        ("pList0RefPicModifications", ctypes.c_void_p),
        ("List1RefPicModificationsCount", wintypes.DWORD),
        ("pList1RefPicModifications", ctypes.c_void_p),
        ("QPMapValuesCount", wintypes.DWORD),
        ("pRateControlQPMap", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 {
    pub Flags: i32,
    pub FrameType: i32,
    pub pic_parameter_set_id: u32,
    pub idr_pic_id: u32,
    pub PictureOrderCountNumber: u32,
    pub FrameDecodingOrderNumber: u32,
    pub TemporalLayerIndex: u32,
    pub List0ReferenceFramesCount: u32,
    pub pList0ReferenceFrames: *mut core::ffi::c_void,
    pub List1ReferenceFramesCount: u32,
    pub pList1ReferenceFrames: *mut core::ffi::c_void,
    pub ReferenceFramesReconPictureDescriptorsCount: u32,
    pub pReferenceFramesReconPictureDescriptors: *mut core::ffi::c_void,
    pub adaptive_ref_pic_marking_mode_flag: u8,
    pub RefPicMarkingOperationsCommandsCount: u32,
    pub pRefPicMarkingOperationsCommands: *mut core::ffi::c_void,
    pub List0RefPicModificationsCount: u32,
    pub pList0RefPicModifications: *mut core::ffi::c_void,
    pub List1RefPicModificationsCount: u32,
    pub pList1RefPicModifications: *mut core::ffi::c_void,
    pub QPMapValuesCount: u32,
    pub pRateControlQPMap: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 struct {
	Flags int32
	FrameType int32
	pic_parameter_set_id uint32
	idr_pic_id uint32
	PictureOrderCountNumber uint32
	FrameDecodingOrderNumber uint32
	TemporalLayerIndex uint32
	List0ReferenceFramesCount uint32
	pList0ReferenceFrames uintptr
	List1ReferenceFramesCount uint32
	pList1ReferenceFrames uintptr
	ReferenceFramesReconPictureDescriptorsCount uint32
	pReferenceFramesReconPictureDescriptors uintptr
	adaptive_ref_pic_marking_mode_flag byte
	RefPicMarkingOperationsCommandsCount uint32
	pRefPicMarkingOperationsCommands uintptr
	List0RefPicModificationsCount uint32
	pList0RefPicModifications uintptr
	List1RefPicModificationsCount uint32
	pList1RefPicModifications uintptr
	QPMapValuesCount uint32
	pRateControlQPMap uintptr
}
type
  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 = record
    Flags: Integer;
    FrameType: Integer;
    pic_parameter_set_id: DWORD;
    idr_pic_id: DWORD;
    PictureOrderCountNumber: DWORD;
    FrameDecodingOrderNumber: DWORD;
    TemporalLayerIndex: DWORD;
    List0ReferenceFramesCount: DWORD;
    pList0ReferenceFrames: Pointer;
    List1ReferenceFramesCount: DWORD;
    pList1ReferenceFrames: Pointer;
    ReferenceFramesReconPictureDescriptorsCount: DWORD;
    pReferenceFramesReconPictureDescriptors: Pointer;
    adaptive_ref_pic_marking_mode_flag: Byte;
    RefPicMarkingOperationsCommandsCount: DWORD;
    pRefPicMarkingOperationsCommands: Pointer;
    List0RefPicModificationsCount: DWORD;
    pList0RefPicModifications: Pointer;
    List1RefPicModificationsCount: DWORD;
    pList1RefPicModifications: Pointer;
    QPMapValuesCount: DWORD;
    pRateControlQPMap: Pointer;
  end;
const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 = extern struct {
    Flags: i32,
    FrameType: i32,
    pic_parameter_set_id: u32,
    idr_pic_id: u32,
    PictureOrderCountNumber: u32,
    FrameDecodingOrderNumber: u32,
    TemporalLayerIndex: u32,
    List0ReferenceFramesCount: u32,
    pList0ReferenceFrames: ?*anyopaque,
    List1ReferenceFramesCount: u32,
    pList1ReferenceFrames: ?*anyopaque,
    ReferenceFramesReconPictureDescriptorsCount: u32,
    pReferenceFramesReconPictureDescriptors: ?*anyopaque,
    adaptive_ref_pic_marking_mode_flag: u8,
    RefPicMarkingOperationsCommandsCount: u32,
    pRefPicMarkingOperationsCommands: ?*anyopaque,
    List0RefPicModificationsCount: u32,
    pList0RefPicModifications: ?*anyopaque,
    List1RefPicModificationsCount: u32,
    pList1RefPicModifications: ?*anyopaque,
    QPMapValuesCount: u32,
    pRateControlQPMap: ?*anyopaque,
};
type
  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 {.bycopy.} = object
    Flags: int32
    FrameType: int32
    pic_parameter_set_id: uint32
    idr_pic_id: uint32
    PictureOrderCountNumber: uint32
    FrameDecodingOrderNumber: uint32
    TemporalLayerIndex: uint32
    List0ReferenceFramesCount: uint32
    pList0ReferenceFrames: pointer
    List1ReferenceFramesCount: uint32
    pList1ReferenceFrames: pointer
    ReferenceFramesReconPictureDescriptorsCount: uint32
    pReferenceFramesReconPictureDescriptors: pointer
    adaptive_ref_pic_marking_mode_flag: uint8
    RefPicMarkingOperationsCommandsCount: uint32
    pRefPicMarkingOperationsCommands: pointer
    List0RefPicModificationsCount: uint32
    pList0RefPicModifications: pointer
    List1RefPicModificationsCount: uint32
    pList1RefPicModifications: pointer
    QPMapValuesCount: uint32
    pRateControlQPMap: pointer
struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264
{
    int Flags;
    int FrameType;
    uint pic_parameter_set_id;
    uint idr_pic_id;
    uint PictureOrderCountNumber;
    uint FrameDecodingOrderNumber;
    uint TemporalLayerIndex;
    uint List0ReferenceFramesCount;
    void* pList0ReferenceFrames;
    uint List1ReferenceFramesCount;
    void* pList1ReferenceFrames;
    uint ReferenceFramesReconPictureDescriptorsCount;
    void* pReferenceFramesReconPictureDescriptors;
    ubyte adaptive_ref_pic_marking_mode_flag;
    uint RefPicMarkingOperationsCommandsCount;
    void* pRefPicMarkingOperationsCommands;
    uint List0RefPicModificationsCount;
    void* pList0RefPicModifications;
    uint List1RefPicModificationsCount;
    void* pList1RefPicModifications;
    uint QPMapValuesCount;
    void* pRateControlQPMap;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 サイズ: 88 バイト(x86)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; Flags : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; FrameType : D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pic_parameter_set_id : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; idr_pic_id : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; PictureOrderCountNumber : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; FrameDecodingOrderNumber : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; TemporalLayerIndex : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; List0ReferenceFramesCount : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pList0ReferenceFrames : DWORD* (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; List1ReferenceFramesCount : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pList1ReferenceFrames : DWORD* (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ReferenceFramesReconPictureDescriptorsCount : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; pReferenceFramesReconPictureDescriptors : D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264* (+48, 4byte)  varptr(st)+48 を基点に操作(4byte:入れ子/配列)
; adaptive_ref_pic_marking_mode_flag : BYTE (+52, 1byte)  poke st,52,値  /  値 = peek(st,52)
; RefPicMarkingOperationsCommandsCount : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; pRefPicMarkingOperationsCommands : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION* (+60, 4byte)  varptr(st)+60 を基点に操作(4byte:入れ子/配列)
; List0RefPicModificationsCount : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; pList0RefPicModifications : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* (+68, 4byte)  varptr(st)+68 を基点に操作(4byte:入れ子/配列)
; List1RefPicModificationsCount : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; pList1RefPicModifications : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* (+76, 4byte)  varptr(st)+76 を基点に操作(4byte:入れ子/配列)
; QPMapValuesCount : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; pRateControlQPMap : CHAR* (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 サイズ: 136 バイト(x64)
dim st, 34    ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; Flags : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; FrameType : D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pic_parameter_set_id : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; idr_pic_id : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; PictureOrderCountNumber : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; FrameDecodingOrderNumber : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; TemporalLayerIndex : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; List0ReferenceFramesCount : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pList0ReferenceFrames : DWORD* (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; List1ReferenceFramesCount : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; pList1ReferenceFrames : DWORD* (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ReferenceFramesReconPictureDescriptorsCount : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; pReferenceFramesReconPictureDescriptors : D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264* (+64, 8byte)  varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; adaptive_ref_pic_marking_mode_flag : BYTE (+72, 1byte)  poke st,72,値  /  値 = peek(st,72)
; RefPicMarkingOperationsCommandsCount : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; pRefPicMarkingOperationsCommands : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION* (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; List0RefPicModificationsCount : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; pList0RefPicModifications : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; List1RefPicModificationsCount : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; pList1RefPicModifications : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* (+112, 8byte)  varptr(st)+112 を基点に操作(8byte:入れ子/配列)
; QPMapValuesCount : DWORD (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; pRateControlQPMap : CHAR* (+128, 8byte)  qpoke st,128,値 / qpeek(st,128)  ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264
    #field int Flags
    #field int FrameType
    #field int pic_parameter_set_id
    #field int idr_pic_id
    #field int PictureOrderCountNumber
    #field int FrameDecodingOrderNumber
    #field int TemporalLayerIndex
    #field int List0ReferenceFramesCount
    #field intptr pList0ReferenceFrames
    #field int List1ReferenceFramesCount
    #field intptr pList1ReferenceFrames
    #field int ReferenceFramesReconPictureDescriptorsCount
    #field intptr pReferenceFramesReconPictureDescriptors
    #field byte adaptive_ref_pic_marking_mode_flag
    #field int RefPicMarkingOperationsCommandsCount
    #field intptr pRefPicMarkingOperationsCommands
    #field int List0RefPicModificationsCount
    #field intptr pList0RefPicModifications
    #field int List1RefPicModificationsCount
    #field intptr pList1RefPicModifications
    #field int QPMapValuesCount
    #field intptr pRateControlQPMap
#endstruct

stdim st, D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264        ; NSTRUCT 変数を確保
st->Flags = 100
mes "Flags=" + st->Flags