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

D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC

構造体
サイズx64: 48 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
IntraRefreshFrameIndexDWORD4+0+0現在のイントラリフレッシュ周期内でのフレームインデックスを指定する。
FlagsD3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS4+4+4ピクチャ制御の動作オプションを示すフラグである。
PictureControlCodecDataD3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA16/8+8+8コーデック別のピクチャ制御データを指定する。
ReferenceFramesD3D12_VIDEO_ENCODE_REFERENCE_FRAMES24/12+24+16当該ピクチャの符号化に使用する参照フレーム群を指定する。

各言語での定義

#include <windows.h>

// 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;
using System;
using System.Runtime.InteropServices;

[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;
}
Imports System.Runtime.InteropServices

<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
import ctypes
from ctypes import wintypes

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),
    ]
#[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,
}
import "golang.org/x/sys/windows"

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_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;
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,
};
type
  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
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;
}

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_DESC サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; IntraRefreshFrameIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Flags : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; PictureControlCodecData : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ReferenceFrames : D3D12_VIDEO_ENCODE_REFERENCE_FRAMES (+16, 12byte)  varptr(st)+16 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; IntraRefreshFrameIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Flags : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; PictureControlCodecData : D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ReferenceFrames : D3D12_VIDEO_ENCODE_REFERENCE_FRAMES (+24, 24byte)  varptr(st)+24 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#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

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