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

D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS

構造体
サイズx64: 160 バイト / x86: 104 バイト

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

フィールド

フィールドサイズx64x86説明
SequenceControlDescD3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC96/64+0+0シーケンスレベルの制御記述子を指定する入力引数である。
PictureControlDescD3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC48/28+96+64ピクチャレベルの制御記述子を指定する入力引数である。
pInputFrameID3D12Resource*8/4+144+92符号化対象の入力フレームを保持するID3D12Resourceへのポインタである。
InputFrameSubresourceDWORD4+152+96入力フレームリソース内で使用するサブリソースインデックスを指定する。
CurrentFrameBitstreamMetadataSizeDWORD4+156+100現フレームのビットストリームに先行付加するメタデータのバイトサイズである。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_ENCODER_INTRA_REFRESH  (x64 8 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_INTRA_REFRESH {
    D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE Mode;
    DWORD IntraRefreshDuration;
} D3D12_VIDEO_ENCODER_INTRA_REFRESH;

// D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS;

// DXGI_RATIONAL  (x64 8 / x86 8 バイト)
typedef struct DXGI_RATIONAL {
    DWORD Numerator;
    DWORD Denominator;
} DXGI_RATIONAL;

// D3D12_VIDEO_ENCODER_RATE_CONTROL  (x64 32 / x86 24 バイト)
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL {
    D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE Mode;
    D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS Flags;
    D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
    DXGI_RATIONAL TargetFrameRate;
} D3D12_VIDEO_ENCODER_RATE_CONTROL;

// D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC  (x64 8 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC {
    DWORD Width;
    DWORD Height;
} D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC;

// D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA;

// D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE;

// D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC  (x64 96 / x86 64 バイト)
typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC {
    D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags;
    D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig;
    D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
    D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution;
    D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SelectedLayoutMode;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData;
    D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
} D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC;

// D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA;

// D3D12_VIDEO_ENCODE_REFERENCE_FRAMES  (x64 24 / x86 12 バイト)
typedef struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES {
    DWORD NumTexture2Ds;
    ID3D12Resource** ppTexture2Ds;
    DWORD* pSubresources;
} D3D12_VIDEO_ENCODE_REFERENCE_FRAMES;

// D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC  (x64 48 / x86 28 バイト)
typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC {
    DWORD IntraRefreshFrameIndex;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS Flags;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData;
    D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames;
} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC;

// D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS  (x64 160 / x86 104 バイト)
typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS {
    D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc;
    ID3D12Resource* pInputFrame;
    DWORD InputFrameSubresource;
    DWORD CurrentFrameBitstreamMetadataSize;
} D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_INTRA_REFRESH
{
    public int Mode;
    public uint IntraRefreshDuration;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_RATIONAL
{
    public uint Numerator;
    public uint Denominator;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_RATE_CONTROL
{
    public int Mode;
    public int Flags;
    public D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
    public DXGI_RATIONAL TargetFrameRate;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
{
    public uint Width;
    public uint Height;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
{
    public int Flags;
    public D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig;
    public D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
    public D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution;
    public int SelectedLayoutMode;
    public D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData;
    public D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
{
    public uint NumTexture2Ds;
    public IntPtr ppTexture2Ds;
    public IntPtr pSubresources;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
{
    public uint IntraRefreshFrameIndex;
    public int Flags;
    public D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData;
    public D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS
{
    public D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc;
    public D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc;
    public IntPtr pInputFrame;
    public uint InputFrameSubresource;
    public uint CurrentFrameBitstreamMetadataSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_INTRA_REFRESH
    Public Mode As Integer
    Public IntraRefreshDuration As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_RATIONAL
    Public Numerator As UInteger
    Public Denominator As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_RATE_CONTROL
    Public Mode As Integer
    Public Flags As Integer
    Public ConfigParams As D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    Public TargetFrameRate As DXGI_RATIONAL
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
    Public Width As UInteger
    Public Height As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
    Public Flags As Integer
    Public IntraRefreshConfig As D3D12_VIDEO_ENCODER_INTRA_REFRESH
    Public RateControl As D3D12_VIDEO_ENCODER_RATE_CONTROL
    Public PictureTargetResolution As D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
    Public SelectedLayoutMode As Integer
    Public FrameSubregionsLayoutData As D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
    Public CodecGopSequence As D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
    Public NumTexture2Ds As UInteger
    Public ppTexture2Ds As IntPtr
    Public pSubresources As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
    Public IntraRefreshFrameIndex As UInteger
    Public Flags As Integer
    Public PictureControlCodecData As D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
    Public ReferenceFrames As D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS
    Public SequenceControlDesc As D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
    Public PictureControlDesc As D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
    Public pInputFrame As IntPtr
    Public InputFrameSubresource As UInteger
    Public CurrentFrameBitstreamMetadataSize As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_ENCODER_INTRA_REFRESH(ctypes.Structure):
    _fields_ = [
        ("Mode", ctypes.c_int),
        ("IntraRefreshDuration", wintypes.DWORD),
    ]

class D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class DXGI_RATIONAL(ctypes.Structure):
    _fields_ = [
        ("Numerator", wintypes.DWORD),
        ("Denominator", wintypes.DWORD),
    ]

class D3D12_VIDEO_ENCODER_RATE_CONTROL(ctypes.Structure):
    _fields_ = [
        ("Mode", ctypes.c_int),
        ("Flags", ctypes.c_int),
        ("ConfigParams", D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS),
        ("TargetFrameRate", DXGI_RATIONAL),
    ]

class D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC(ctypes.Structure):
    _fields_ = [
        ("Width", wintypes.DWORD),
        ("Height", wintypes.DWORD),
    ]

class D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC(ctypes.Structure):
    _fields_ = [
        ("Flags", ctypes.c_int),
        ("IntraRefreshConfig", D3D12_VIDEO_ENCODER_INTRA_REFRESH),
        ("RateControl", D3D12_VIDEO_ENCODER_RATE_CONTROL),
        ("PictureTargetResolution", D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC),
        ("SelectedLayoutMode", ctypes.c_int),
        ("FrameSubregionsLayoutData", D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA),
        ("CodecGopSequence", D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE),
    ]

class D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_VIDEO_ENCODE_REFERENCE_FRAMES(ctypes.Structure):
    _fields_ = [
        ("NumTexture2Ds", wintypes.DWORD),
        ("ppTexture2Ds", ctypes.c_void_p),
        ("pSubresources", ctypes.c_void_p),
    ]

class D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC(ctypes.Structure):
    _fields_ = [
        ("IntraRefreshFrameIndex", wintypes.DWORD),
        ("Flags", ctypes.c_int),
        ("PictureControlCodecData", D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA),
        ("ReferenceFrames", D3D12_VIDEO_ENCODE_REFERENCE_FRAMES),
    ]

class D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS(ctypes.Structure):
    _fields_ = [
        ("SequenceControlDesc", D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC),
        ("PictureControlDesc", D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC),
        ("pInputFrame", ctypes.c_void_p),
        ("InputFrameSubresource", wintypes.DWORD),
        ("CurrentFrameBitstreamMetadataSize", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_INTRA_REFRESH {
    pub Mode: i32,
    pub IntraRefreshDuration: u32,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct DXGI_RATIONAL {
    pub Numerator: u32,
    pub Denominator: u32,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_RATE_CONTROL {
    pub Mode: i32,
    pub Flags: i32,
    pub ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS,
    pub TargetFrameRate: DXGI_RATIONAL,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC {
    pub Width: u32,
    pub Height: u32,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC {
    pub Flags: i32,
    pub IntraRefreshConfig: D3D12_VIDEO_ENCODER_INTRA_REFRESH,
    pub RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL,
    pub PictureTargetResolution: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC,
    pub SelectedLayoutMode: i32,
    pub FrameSubregionsLayoutData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA,
    pub CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES {
    pub NumTexture2Ds: u32,
    pub ppTexture2Ds: *mut core::ffi::c_void,
    pub pSubresources: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC {
    pub IntraRefreshFrameIndex: u32,
    pub Flags: i32,
    pub PictureControlCodecData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA,
    pub ReferenceFrames: D3D12_VIDEO_ENCODE_REFERENCE_FRAMES,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS {
    pub SequenceControlDesc: D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC,
    pub PictureControlDesc: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC,
    pub pInputFrame: *mut core::ffi::c_void,
    pub InputFrameSubresource: u32,
    pub CurrentFrameBitstreamMetadataSize: u32,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_INTRA_REFRESH struct {
	Mode int32
	IntraRefreshDuration uint32
}

type D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type DXGI_RATIONAL struct {
	Numerator uint32
	Denominator uint32
}

type D3D12_VIDEO_ENCODER_RATE_CONTROL struct {
	Mode int32
	Flags int32
	ConfigParams D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
	TargetFrameRate DXGI_RATIONAL
}

type D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC struct {
	Width uint32
	Height uint32
}

type D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC struct {
	Flags int32
	IntraRefreshConfig D3D12_VIDEO_ENCODER_INTRA_REFRESH
	RateControl D3D12_VIDEO_ENCODER_RATE_CONTROL
	PictureTargetResolution D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
	SelectedLayoutMode int32
	FrameSubregionsLayoutData D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
	CodecGopSequence D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
}

type D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODE_REFERENCE_FRAMES struct {
	NumTexture2Ds uint32
	ppTexture2Ds uintptr
	pSubresources uintptr
}

type D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC struct {
	IntraRefreshFrameIndex uint32
	Flags int32
	PictureControlCodecData D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
	ReferenceFrames D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
}

type D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS struct {
	SequenceControlDesc D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
	PictureControlDesc D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
	pInputFrame uintptr
	InputFrameSubresource uint32
	CurrentFrameBitstreamMetadataSize uint32
}
type
  D3D12_VIDEO_ENCODER_INTRA_REFRESH = record
    Mode: Integer;
    IntraRefreshDuration: DWORD;
  end;

  D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  DXGI_RATIONAL = record
    Numerator: DWORD;
    Denominator: DWORD;
  end;

  D3D12_VIDEO_ENCODER_RATE_CONTROL = record
    Mode: Integer;
    Flags: Integer;
    ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS;
    TargetFrameRate: DXGI_RATIONAL;
  end;

  D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC = record
    Width: DWORD;
    Height: DWORD;
  end;

  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC = record
    Flags: Integer;
    IntraRefreshConfig: D3D12_VIDEO_ENCODER_INTRA_REFRESH;
    RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL;
    PictureTargetResolution: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC;
    SelectedLayoutMode: Integer;
    FrameSubregionsLayoutData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA;
    CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE;
  end;

  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_VIDEO_ENCODE_REFERENCE_FRAMES = record
    NumTexture2Ds: DWORD;
    ppTexture2Ds: Pointer;
    pSubresources: Pointer;
  end;

  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC = record
    IntraRefreshFrameIndex: DWORD;
    Flags: Integer;
    PictureControlCodecData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA;
    ReferenceFrames: D3D12_VIDEO_ENCODE_REFERENCE_FRAMES;
  end;

  D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS = record
    SequenceControlDesc: D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC;
    PictureControlDesc: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC;
    pInputFrame: Pointer;
    InputFrameSubresource: DWORD;
    CurrentFrameBitstreamMetadataSize: DWORD;
  end;
const D3D12_VIDEO_ENCODER_INTRA_REFRESH = extern struct {
    Mode: i32,
    IntraRefreshDuration: u32,
};

const D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const DXGI_RATIONAL = extern struct {
    Numerator: u32,
    Denominator: u32,
};

const D3D12_VIDEO_ENCODER_RATE_CONTROL = extern struct {
    Mode: i32,
    Flags: i32,
    ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS,
    TargetFrameRate: DXGI_RATIONAL,
};

const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC = extern struct {
    Width: u32,
    Height: u32,
};

const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC = extern struct {
    Flags: i32,
    IntraRefreshConfig: D3D12_VIDEO_ENCODER_INTRA_REFRESH,
    RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL,
    PictureTargetResolution: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC,
    SelectedLayoutMode: i32,
    FrameSubregionsLayoutData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA,
    CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE,
};

const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_VIDEO_ENCODE_REFERENCE_FRAMES = extern struct {
    NumTexture2Ds: u32,
    ppTexture2Ds: ?*anyopaque,
    pSubresources: ?*anyopaque,
};

const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC = extern struct {
    IntraRefreshFrameIndex: u32,
    Flags: i32,
    PictureControlCodecData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA,
    ReferenceFrames: D3D12_VIDEO_ENCODE_REFERENCE_FRAMES,
};

const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS = extern struct {
    SequenceControlDesc: D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC,
    PictureControlDesc: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC,
    pInputFrame: ?*anyopaque,
    InputFrameSubresource: u32,
    CurrentFrameBitstreamMetadataSize: u32,
};
type
  D3D12_VIDEO_ENCODER_INTRA_REFRESH {.bycopy.} = object
    Mode: int32
    IntraRefreshDuration: uint32

  D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  DXGI_RATIONAL {.bycopy.} = object
    Numerator: uint32
    Denominator: uint32

  D3D12_VIDEO_ENCODER_RATE_CONTROL {.bycopy.} = object
    Mode: int32
    Flags: int32
    ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    TargetFrameRate: DXGI_RATIONAL

  D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC {.bycopy.} = object
    Width: uint32
    Height: uint32

  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC {.bycopy.} = object
    Flags: int32
    IntraRefreshConfig: D3D12_VIDEO_ENCODER_INTRA_REFRESH
    RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL
    PictureTargetResolution: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
    SelectedLayoutMode: int32
    FrameSubregionsLayoutData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
    CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE

  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_VIDEO_ENCODE_REFERENCE_FRAMES {.bycopy.} = object
    NumTexture2Ds: uint32
    ppTexture2Ds: pointer
    pSubresources: pointer

  D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC {.bycopy.} = object
    IntraRefreshFrameIndex: uint32
    Flags: int32
    PictureControlCodecData: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
    ReferenceFrames: D3D12_VIDEO_ENCODE_REFERENCE_FRAMES

  D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS {.bycopy.} = object
    SequenceControlDesc: D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
    PictureControlDesc: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
    pInputFrame: pointer
    InputFrameSubresource: uint32
    CurrentFrameBitstreamMetadataSize: uint32
struct D3D12_VIDEO_ENCODER_INTRA_REFRESH
{
    int Mode;
    uint IntraRefreshDuration;
}

struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct DXGI_RATIONAL
{
    uint Numerator;
    uint Denominator;
}

struct D3D12_VIDEO_ENCODER_RATE_CONTROL
{
    int Mode;
    int Flags;
    D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
    DXGI_RATIONAL TargetFrameRate;
}

struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
{
    uint Width;
    uint Height;
}

struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
{
    int Flags;
    D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig;
    D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
    D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution;
    int SelectedLayoutMode;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData;
    D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
}

struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
{
    uint NumTexture2Ds;
    void* ppTexture2Ds;
    void* pSubresources;
}

struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
{
    uint IntraRefreshFrameIndex;
    int Flags;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData;
    D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames;
}

struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS
{
    D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc;
    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc;
    void* pInputFrame;
    uint InputFrameSubresource;
    uint CurrentFrameBitstreamMetadataSize;
}

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_ENCODEFRAME_INPUT_ARGUMENTS サイズ: 104 バイト(x86)
dim st, 26    ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; SequenceControlDesc : D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC (+0, 64byte)  varptr(st)+0 を基点に操作(64byte:入れ子/配列)
; PictureControlDesc : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC (+64, 28byte)  varptr(st)+64 を基点に操作(28byte:入れ子/配列)
; pInputFrame : ID3D12Resource* (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; InputFrameSubresource : DWORD (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; CurrentFrameBitstreamMetadataSize : DWORD (+100, 4byte)  st.25 = 値  /  値 = st.25   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS サイズ: 160 バイト(x64)
dim st, 40    ; 4byte整数×40(構造体サイズ 160 / 4 切り上げ)
; SequenceControlDesc : D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC (+0, 96byte)  varptr(st)+0 を基点に操作(96byte:入れ子/配列)
; PictureControlDesc : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC (+96, 48byte)  varptr(st)+96 を基点に操作(48byte:入れ子/配列)
; pInputFrame : ID3D12Resource* (+144, 8byte)  qpoke st,144,値 / qpeek(st,144)  ※IronHSPのみ。3.7/3.8は lpoke st,144,下位 : lpoke st,148,上位
; InputFrameSubresource : DWORD (+152, 4byte)  st.38 = 値  /  値 = st.38   (lpoke/lpeek も可)
; CurrentFrameBitstreamMetadataSize : DWORD (+156, 4byte)  st.39 = 値  /  値 = st.39   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_VIDEO_ENCODER_INTRA_REFRESH
    #field int Mode
    #field int IntraRefreshDuration
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global DXGI_RATIONAL
    #field int Numerator
    #field int Denominator
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_RATE_CONTROL
    #field int Mode
    #field int Flags
    #field D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams
    #field DXGI_RATIONAL TargetFrameRate
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
    #field int Width
    #field int Height
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
    #field int Flags
    #field D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig
    #field D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl
    #field D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution
    #field int SelectedLayoutMode
    #field D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData
    #field D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
    #field int NumTexture2Ds
    #field intptr ppTexture2Ds
    #field intptr pSubresources
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
    #field int IntraRefreshFrameIndex
    #field int Flags
    #field D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData
    #field D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS
    #field D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc
    #field D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc
    #field intptr pInputFrame
    #field int InputFrameSubresource
    #field int CurrentFrameBitstreamMetadataSize
#endstruct

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