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

DXVA_DeinterlaceBltEx32

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズ(バイト単位)。
BackgroundColorDXVA_AYUVsample24+4+4デインターレース出力の背景色を示すDXVA_AYUVsample2。
rcTargetRECT16+8+8出力先ターゲット矩形を示すRECT。
rtTargetLONGLONG8+24+24出力対象フレームの基準時刻(100ナノ秒単位)。
NumSourceSurfacesDWORD4+32+32Source配列に含まれるソースサーフェス数。
AlphaFLOAT4+36+36出力全体に適用するアルファ値(0.0〜1.0)。
SourceDXVA_VideoSample324096+40+40入力ソースサンプル群を示すDXVA_VideoSample32(可変長配列の先頭)。
DestinationFormatDWORD4+4136+4136出力先のフォーマットを示す値。
DestinationFlagsDWORD4+4140+4140出力処理を制御するフラグ群。

各言語での定義

#include <windows.h>

// DXVA_AYUVsample2  (x64 4 / x86 4 バイト)
typedef struct DXVA_AYUVsample2 {
    BYTE bCrValue;
    BYTE bCbValue;
    BYTE bY_Value;
    BYTE bSampleAlpha8;
} DXVA_AYUVsample2;

// RECT  (x64 16 / x86 16 バイト)
typedef struct RECT {
    INT left;
    INT top;
    INT right;
    INT bottom;
} RECT;

// DXVA_VideoSample32  (x64 128 / x86 128 バイト)
typedef struct DXVA_VideoSample32 {
    LONGLONG rtStart;
    LONGLONG rtEnd;
    DWORD SampleFormat;
    DWORD SampleFlags;
    DWORD lpDDSSrcSurface;
    RECT rcSrc;
    RECT rcDst;
    DXVA_AYUVsample2 Palette[16];
} DXVA_VideoSample32;

// DXVA_DeinterlaceBltEx32  (x64 4144 / x86 4144 バイト)
typedef struct DXVA_DeinterlaceBltEx32 {
    DWORD Size;
    DXVA_AYUVsample2 BackgroundColor;
    RECT rcTarget;
    LONGLONG rtTarget;
    DWORD NumSourceSurfaces;
    FLOAT Alpha;
    DXVA_VideoSample32 Source[32];
    DWORD DestinationFormat;
    DWORD DestinationFlags;
} DXVA_DeinterlaceBltEx32;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_AYUVsample2
{
    public byte bCrValue;
    public byte bCbValue;
    public byte bY_Value;
    public byte bSampleAlpha8;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
    public int left;
    public int top;
    public int right;
    public int bottom;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_VideoSample32
{
    public long rtStart;
    public long rtEnd;
    public uint SampleFormat;
    public uint SampleFlags;
    public uint lpDDSSrcSurface;
    public RECT rcSrc;
    public RECT rcDst;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public DXVA_AYUVsample2[] Palette;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_DeinterlaceBltEx32
{
    public uint Size;
    public DXVA_AYUVsample2 BackgroundColor;
    public RECT rcTarget;
    public long rtTarget;
    public uint NumSourceSurfaces;
    public float Alpha;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public DXVA_VideoSample32[] Source;
    public uint DestinationFormat;
    public uint DestinationFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_AYUVsample2
    Public bCrValue As Byte
    Public bCbValue As Byte
    Public bY_Value As Byte
    Public bSampleAlpha8 As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
    Public left As Integer
    Public top As Integer
    Public right As Integer
    Public bottom As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_VideoSample32
    Public rtStart As Long
    Public rtEnd As Long
    Public SampleFormat As UInteger
    Public SampleFlags As UInteger
    Public lpDDSSrcSurface As UInteger
    Public rcSrc As RECT
    Public rcDst As RECT
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public Palette() As DXVA_AYUVsample2
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_DeinterlaceBltEx32
    Public Size As UInteger
    Public BackgroundColor As DXVA_AYUVsample2
    Public rcTarget As RECT
    Public rtTarget As Long
    Public NumSourceSurfaces As UInteger
    Public Alpha As Single
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public Source() As DXVA_VideoSample32
    Public DestinationFormat As UInteger
    Public DestinationFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DXVA_AYUVsample2(ctypes.Structure):
    _fields_ = [
        ("bCrValue", ctypes.c_ubyte),
        ("bCbValue", ctypes.c_ubyte),
        ("bY_Value", ctypes.c_ubyte),
        ("bSampleAlpha8", ctypes.c_ubyte),
    ]

class RECT(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_int),
        ("top", ctypes.c_int),
        ("right", ctypes.c_int),
        ("bottom", ctypes.c_int),
    ]

class DXVA_VideoSample32(ctypes.Structure):
    _fields_ = [
        ("rtStart", ctypes.c_longlong),
        ("rtEnd", ctypes.c_longlong),
        ("SampleFormat", wintypes.DWORD),
        ("SampleFlags", wintypes.DWORD),
        ("lpDDSSrcSurface", wintypes.DWORD),
        ("rcSrc", RECT),
        ("rcDst", RECT),
        ("Palette", DXVA_AYUVsample2 * 16),
    ]

class DXVA_DeinterlaceBltEx32(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("BackgroundColor", DXVA_AYUVsample2),
        ("rcTarget", RECT),
        ("rtTarget", ctypes.c_longlong),
        ("NumSourceSurfaces", wintypes.DWORD),
        ("Alpha", ctypes.c_float),
        ("Source", DXVA_VideoSample32 * 32),
        ("DestinationFormat", wintypes.DWORD),
        ("DestinationFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DXVA_AYUVsample2 {
    pub bCrValue: u8,
    pub bCbValue: u8,
    pub bY_Value: u8,
    pub bSampleAlpha8: u8,
}

#[repr(C)]
pub struct RECT {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[repr(C)]
pub struct DXVA_VideoSample32 {
    pub rtStart: i64,
    pub rtEnd: i64,
    pub SampleFormat: u32,
    pub SampleFlags: u32,
    pub lpDDSSrcSurface: u32,
    pub rcSrc: RECT,
    pub rcDst: RECT,
    pub Palette: [DXVA_AYUVsample2; 16],
}

#[repr(C)]
pub struct DXVA_DeinterlaceBltEx32 {
    pub Size: u32,
    pub BackgroundColor: DXVA_AYUVsample2,
    pub rcTarget: RECT,
    pub rtTarget: i64,
    pub NumSourceSurfaces: u32,
    pub Alpha: f32,
    pub Source: [DXVA_VideoSample32; 32],
    pub DestinationFormat: u32,
    pub DestinationFlags: u32,
}
import "golang.org/x/sys/windows"

type DXVA_AYUVsample2 struct {
	bCrValue byte
	bCbValue byte
	bY_Value byte
	bSampleAlpha8 byte
}

type RECT struct {
	left int32
	top int32
	right int32
	bottom int32
}

type DXVA_VideoSample32 struct {
	rtStart int64
	rtEnd int64
	SampleFormat uint32
	SampleFlags uint32
	lpDDSSrcSurface uint32
	rcSrc RECT
	rcDst RECT
	Palette [16]DXVA_AYUVsample2
}

type DXVA_DeinterlaceBltEx32 struct {
	Size uint32
	BackgroundColor DXVA_AYUVsample2
	rcTarget RECT
	rtTarget int64
	NumSourceSurfaces uint32
	Alpha float32
	Source [32]DXVA_VideoSample32
	DestinationFormat uint32
	DestinationFlags uint32
}
type
  DXVA_AYUVsample2 = record
    bCrValue: Byte;
    bCbValue: Byte;
    bY_Value: Byte;
    bSampleAlpha8: Byte;
  end;

  RECT = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  DXVA_VideoSample32 = record
    rtStart: Int64;
    rtEnd: Int64;
    SampleFormat: DWORD;
    SampleFlags: DWORD;
    lpDDSSrcSurface: DWORD;
    rcSrc: RECT;
    rcDst: RECT;
    Palette: array[0..15] of DXVA_AYUVsample2;
  end;

  DXVA_DeinterlaceBltEx32 = record
    Size: DWORD;
    BackgroundColor: DXVA_AYUVsample2;
    rcTarget: RECT;
    rtTarget: Int64;
    NumSourceSurfaces: DWORD;
    Alpha: Single;
    Source: array[0..31] of DXVA_VideoSample32;
    DestinationFormat: DWORD;
    DestinationFlags: DWORD;
  end;
const DXVA_AYUVsample2 = extern struct {
    bCrValue: u8,
    bCbValue: u8,
    bY_Value: u8,
    bSampleAlpha8: u8,
};

const RECT = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

const DXVA_VideoSample32 = extern struct {
    rtStart: i64,
    rtEnd: i64,
    SampleFormat: u32,
    SampleFlags: u32,
    lpDDSSrcSurface: u32,
    rcSrc: RECT,
    rcDst: RECT,
    Palette: [16]DXVA_AYUVsample2,
};

const DXVA_DeinterlaceBltEx32 = extern struct {
    Size: u32,
    BackgroundColor: DXVA_AYUVsample2,
    rcTarget: RECT,
    rtTarget: i64,
    NumSourceSurfaces: u32,
    Alpha: f32,
    Source: [32]DXVA_VideoSample32,
    DestinationFormat: u32,
    DestinationFlags: u32,
};
type
  DXVA_AYUVsample2 {.bycopy.} = object
    bCrValue: uint8
    bCbValue: uint8
    bY_Value: uint8
    bSampleAlpha8: uint8

  RECT {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  DXVA_VideoSample32 {.bycopy.} = object
    rtStart: int64
    rtEnd: int64
    SampleFormat: uint32
    SampleFlags: uint32
    lpDDSSrcSurface: uint32
    rcSrc: RECT
    rcDst: RECT
    Palette: array[16, DXVA_AYUVsample2]

  DXVA_DeinterlaceBltEx32 {.bycopy.} = object
    Size: uint32
    BackgroundColor: DXVA_AYUVsample2
    rcTarget: RECT
    rtTarget: int64
    NumSourceSurfaces: uint32
    Alpha: float32
    Source: array[32, DXVA_VideoSample32]
    DestinationFormat: uint32
    DestinationFlags: uint32
struct DXVA_AYUVsample2
{
    ubyte bCrValue;
    ubyte bCbValue;
    ubyte bY_Value;
    ubyte bSampleAlpha8;
}

struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct DXVA_VideoSample32
{
    long rtStart;
    long rtEnd;
    uint SampleFormat;
    uint SampleFlags;
    uint lpDDSSrcSurface;
    RECT rcSrc;
    RECT rcDst;
    DXVA_AYUVsample2[16] Palette;
}

struct DXVA_DeinterlaceBltEx32
{
    uint Size;
    DXVA_AYUVsample2 BackgroundColor;
    RECT rcTarget;
    long rtTarget;
    uint NumSourceSurfaces;
    float Alpha;
    DXVA_VideoSample32[32] Source;
    uint DestinationFormat;
    uint DestinationFlags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA_DeinterlaceBltEx32 サイズ: 4144 バイト(x64)
dim st, 1036    ; 4byte整数×1036(構造体サイズ 4144 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; BackgroundColor : DXVA_AYUVsample2 (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; rcTarget : RECT (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; rtTarget : LONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; NumSourceSurfaces : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Alpha : FLOAT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; Source : DXVA_VideoSample32 (+40, 4096byte)  varptr(st)+40 を基点に操作(4096byte:入れ子/配列)
; DestinationFormat : DWORD (+4136, 4byte)  st.1034 = 値  /  値 = st.1034   (lpoke/lpeek も可)
; DestinationFlags : DWORD (+4140, 4byte)  st.1035 = 値  /  値 = st.1035   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DXVA_AYUVsample2
    #field byte bCrValue
    #field byte bCbValue
    #field byte bY_Value
    #field byte bSampleAlpha8
#endstruct

#defstruct global RECT
    #field int left
    #field int top
    #field int right
    #field int bottom
#endstruct

#defstruct global DXVA_VideoSample32
    #field int64 rtStart
    #field int64 rtEnd
    #field int SampleFormat
    #field int SampleFlags
    #field int lpDDSSrcSurface
    #field RECT rcSrc
    #field RECT rcDst
    #field DXVA_AYUVsample2 Palette 16
#endstruct

#defstruct global DXVA_DeinterlaceBltEx32
    #field int Size
    #field DXVA_AYUVsample2 BackgroundColor
    #field RECT rcTarget
    #field int64 rtTarget
    #field int NumSourceSurfaces
    #field float Alpha
    #field DXVA_VideoSample32 Source 32
    #field int DestinationFormat
    #field int DestinationFlags
#endstruct

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