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

D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR

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

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

フィールド

フィールドサイズx64x86説明
ReconstructedPictureResourceIndexDWORD4+0+0再構成ピクチャを保持するリソースのインデックス。
TemporalLayerIndexPlus1DWORD4+4+4時間レイヤーインデックスに1を加えた値。0は未指定を表す。
SpatialLayerIndexPlus1DWORD4+8+8空間レイヤーインデックスに1を加えた値。0は未指定を表す。
FrameTypeD3D12_VIDEO_ENCODER_AV1_FRAME_TYPE4+12+12この参照ピクチャのフレーム種別を示すD3D12_VIDEO_ENCODER_AV1_FRAME_TYPE。
WarpedMotionInfoD3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO40+16+16この参照のワープ動き情報を示すD3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO。
OrderHintDWORD4+56+56この参照ピクチャの順序ヒント値。
PictureIndexDWORD4+60+60この参照ピクチャの識別インデックス。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO  (x64 40 / x86 40 バイト)
typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO {
    D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION TransformationType;
    INT TransformationMatrix[8];
    BOOL InvalidAffineSet;
} D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO;

// D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR  (x64 64 / x86 64 バイト)
typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR {
    DWORD ReconstructedPictureResourceIndex;
    DWORD TemporalLayerIndexPlus1;
    DWORD SpatialLayerIndexPlus1;
    D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType;
    D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo;
    DWORD OrderHint;
    DWORD PictureIndex;
} D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
{
    public int TransformationType;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public int[] TransformationMatrix;
    [MarshalAs(UnmanagedType.Bool)] public bool InvalidAffineSet;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR
{
    public uint ReconstructedPictureResourceIndex;
    public uint TemporalLayerIndexPlus1;
    public uint SpatialLayerIndexPlus1;
    public int FrameType;
    public D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo;
    public uint OrderHint;
    public uint PictureIndex;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
    Public TransformationType As Integer
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public TransformationMatrix() As Integer
    <MarshalAs(UnmanagedType.Bool)> Public InvalidAffineSet As Boolean
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR
    Public ReconstructedPictureResourceIndex As UInteger
    Public TemporalLayerIndexPlus1 As UInteger
    Public SpatialLayerIndexPlus1 As UInteger
    Public FrameType As Integer
    Public WarpedMotionInfo As D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
    Public OrderHint As UInteger
    Public PictureIndex As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO(ctypes.Structure):
    _fields_ = [
        ("TransformationType", ctypes.c_int),
        ("TransformationMatrix", ctypes.c_int * 8),
        ("InvalidAffineSet", wintypes.BOOL),
    ]

class D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR(ctypes.Structure):
    _fields_ = [
        ("ReconstructedPictureResourceIndex", wintypes.DWORD),
        ("TemporalLayerIndexPlus1", wintypes.DWORD),
        ("SpatialLayerIndexPlus1", wintypes.DWORD),
        ("FrameType", ctypes.c_int),
        ("WarpedMotionInfo", D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO),
        ("OrderHint", wintypes.DWORD),
        ("PictureIndex", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO {
    pub TransformationType: i32,
    pub TransformationMatrix: [i32; 8],
    pub InvalidAffineSet: i32,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR {
    pub ReconstructedPictureResourceIndex: u32,
    pub TemporalLayerIndexPlus1: u32,
    pub SpatialLayerIndexPlus1: u32,
    pub FrameType: i32,
    pub WarpedMotionInfo: D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO,
    pub OrderHint: u32,
    pub PictureIndex: u32,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO struct {
	TransformationType int32
	TransformationMatrix [8]int32
	InvalidAffineSet int32
}

type D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR struct {
	ReconstructedPictureResourceIndex uint32
	TemporalLayerIndexPlus1 uint32
	SpatialLayerIndexPlus1 uint32
	FrameType int32
	WarpedMotionInfo D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
	OrderHint uint32
	PictureIndex uint32
}
type
  D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO = record
    TransformationType: Integer;
    TransformationMatrix: array[0..7] of Integer;
    InvalidAffineSet: BOOL;
  end;

  D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR = record
    ReconstructedPictureResourceIndex: DWORD;
    TemporalLayerIndexPlus1: DWORD;
    SpatialLayerIndexPlus1: DWORD;
    FrameType: Integer;
    WarpedMotionInfo: D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO;
    OrderHint: DWORD;
    PictureIndex: DWORD;
  end;
const D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO = extern struct {
    TransformationType: i32,
    TransformationMatrix: [8]i32,
    InvalidAffineSet: i32,
};

const D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR = extern struct {
    ReconstructedPictureResourceIndex: u32,
    TemporalLayerIndexPlus1: u32,
    SpatialLayerIndexPlus1: u32,
    FrameType: i32,
    WarpedMotionInfo: D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO,
    OrderHint: u32,
    PictureIndex: u32,
};
type
  D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO {.bycopy.} = object
    TransformationType: int32
    TransformationMatrix: array[8, int32]
    InvalidAffineSet: int32

  D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR {.bycopy.} = object
    ReconstructedPictureResourceIndex: uint32
    TemporalLayerIndexPlus1: uint32
    SpatialLayerIndexPlus1: uint32
    FrameType: int32
    WarpedMotionInfo: D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
    OrderHint: uint32
    PictureIndex: uint32
struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
{
    int TransformationType;
    int[8] TransformationMatrix;
    int InvalidAffineSet;
}

struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR
{
    uint ReconstructedPictureResourceIndex;
    uint TemporalLayerIndexPlus1;
    uint SpatialLayerIndexPlus1;
    int FrameType;
    D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo;
    uint OrderHint;
    uint PictureIndex;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ReconstructedPictureResourceIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; TemporalLayerIndexPlus1 : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; SpatialLayerIndexPlus1 : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; FrameType : D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; WarpedMotionInfo : D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO (+16, 40byte)  varptr(st)+16 を基点に操作(40byte:入れ子/配列)
; OrderHint : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; PictureIndex : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
    #field int TransformationType
    #field int TransformationMatrix 8
    #field bool InvalidAffineSet
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR
    #field int ReconstructedPictureResourceIndex
    #field int TemporalLayerIndexPlus1
    #field int SpatialLayerIndexPlus1
    #field int FrameType
    #field D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo
    #field int OrderHint
    #field int PictureIndex
#endstruct

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