ホーム › Media.MediaFoundation › DXVA_DeinterlaceBltEx
DXVA_DeinterlaceBltEx
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | 本構造体のバイトサイズを示す。バージョン判定に用いる。 |
| BackgroundColor | DXVA_AYUVsample2 | 4 | +4 | +4 | 出力背景に塗りつぶす色(AYUV)を示す。 |
| rcTarget | RECT | 16 | +8 | +8 | 出力ターゲット全体の矩形領域である。 |
| rtTarget | LONGLONG | 8 | +24 | +24 | 出力対象フレームの時刻(100ナノ秒単位)を示す。 |
| NumSourceSurfaces | DWORD | 4 | +32 | +32 | 入力ソースサーフェスの数を示す。 |
| Alpha | FLOAT | 4 | +36 | +36 | 出力に適用する全体の不透明度(0.0〜1.0)を示す。 |
| Source | DXVA_VideoSample2 | 4352 | +40 | +40 | デインターレース対象の入力ビデオサンプル(拡張版)である。 |
| DestinationFormat | DWORD | 4 | +4392 | +4392 | 出力先のフォーマット情報(色空間等)を示す。 |
| DestinationFlags | DWORD | 4 | +4396 | +4396 | 出力に関する付加属性を示すフラグである。 |
各言語での定義
#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_VideoSample2 (x64 136 / x86 136 バイト)
typedef struct DXVA_VideoSample2 {
DWORD Size;
DWORD Reserved;
LONGLONG rtStart;
LONGLONG rtEnd;
DWORD SampleFormat;
DWORD SampleFlags;
void* lpDDSSrcSurface;
RECT rcSrc;
RECT rcDst;
DXVA_AYUVsample2 Palette[16];
} DXVA_VideoSample2;
// DXVA_DeinterlaceBltEx (x64 4400 / x86 4400 バイト)
typedef struct DXVA_DeinterlaceBltEx {
DWORD Size;
DXVA_AYUVsample2 BackgroundColor;
RECT rcTarget;
LONGLONG rtTarget;
DWORD NumSourceSurfaces;
FLOAT Alpha;
DXVA_VideoSample2 Source[32];
DWORD DestinationFormat;
DWORD DestinationFlags;
} DXVA_DeinterlaceBltEx;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_VideoSample2
{
public uint Size;
public uint Reserved;
public long rtStart;
public long rtEnd;
public uint SampleFormat;
public uint SampleFlags;
public IntPtr 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_DeinterlaceBltEx
{
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_VideoSample2[] 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_VideoSample2
Public Size As UInteger
Public Reserved As UInteger
Public rtStart As Long
Public rtEnd As Long
Public SampleFormat As UInteger
Public SampleFlags As UInteger
Public lpDDSSrcSurface As IntPtr
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_DeinterlaceBltEx
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_VideoSample2
Public DestinationFormat As UInteger
Public DestinationFlags As UInteger
End Structureimport 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_VideoSample2(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Reserved", wintypes.DWORD),
("rtStart", ctypes.c_longlong),
("rtEnd", ctypes.c_longlong),
("SampleFormat", wintypes.DWORD),
("SampleFlags", wintypes.DWORD),
("lpDDSSrcSurface", ctypes.c_void_p),
("rcSrc", RECT),
("rcDst", RECT),
("Palette", DXVA_AYUVsample2 * 16),
]
class DXVA_DeinterlaceBltEx(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("BackgroundColor", DXVA_AYUVsample2),
("rcTarget", RECT),
("rtTarget", ctypes.c_longlong),
("NumSourceSurfaces", wintypes.DWORD),
("Alpha", ctypes.c_float),
("Source", DXVA_VideoSample2 * 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_VideoSample2 {
pub Size: u32,
pub Reserved: u32,
pub rtStart: i64,
pub rtEnd: i64,
pub SampleFormat: u32,
pub SampleFlags: u32,
pub lpDDSSrcSurface: *mut core::ffi::c_void,
pub rcSrc: RECT,
pub rcDst: RECT,
pub Palette: [DXVA_AYUVsample2; 16],
}
#[repr(C)]
pub struct DXVA_DeinterlaceBltEx {
pub Size: u32,
pub BackgroundColor: DXVA_AYUVsample2,
pub rcTarget: RECT,
pub rtTarget: i64,
pub NumSourceSurfaces: u32,
pub Alpha: f32,
pub Source: [DXVA_VideoSample2; 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_VideoSample2 struct {
Size uint32
Reserved uint32
rtStart int64
rtEnd int64
SampleFormat uint32
SampleFlags uint32
lpDDSSrcSurface uintptr
rcSrc RECT
rcDst RECT
Palette [16]DXVA_AYUVsample2
}
type DXVA_DeinterlaceBltEx struct {
Size uint32
BackgroundColor DXVA_AYUVsample2
rcTarget RECT
rtTarget int64
NumSourceSurfaces uint32
Alpha float32
Source [32]DXVA_VideoSample2
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_VideoSample2 = record
Size: DWORD;
Reserved: DWORD;
rtStart: Int64;
rtEnd: Int64;
SampleFormat: DWORD;
SampleFlags: DWORD;
lpDDSSrcSurface: Pointer;
rcSrc: RECT;
rcDst: RECT;
Palette: array[0..15] of DXVA_AYUVsample2;
end;
DXVA_DeinterlaceBltEx = record
Size: DWORD;
BackgroundColor: DXVA_AYUVsample2;
rcTarget: RECT;
rtTarget: Int64;
NumSourceSurfaces: DWORD;
Alpha: Single;
Source: array[0..31] of DXVA_VideoSample2;
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_VideoSample2 = extern struct {
Size: u32,
Reserved: u32,
rtStart: i64,
rtEnd: i64,
SampleFormat: u32,
SampleFlags: u32,
lpDDSSrcSurface: ?*anyopaque,
rcSrc: RECT,
rcDst: RECT,
Palette: [16]DXVA_AYUVsample2,
};
const DXVA_DeinterlaceBltEx = extern struct {
Size: u32,
BackgroundColor: DXVA_AYUVsample2,
rcTarget: RECT,
rtTarget: i64,
NumSourceSurfaces: u32,
Alpha: f32,
Source: [32]DXVA_VideoSample2,
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_VideoSample2 {.bycopy.} = object
Size: uint32
Reserved: uint32
rtStart: int64
rtEnd: int64
SampleFormat: uint32
SampleFlags: uint32
lpDDSSrcSurface: pointer
rcSrc: RECT
rcDst: RECT
Palette: array[16, DXVA_AYUVsample2]
DXVA_DeinterlaceBltEx {.bycopy.} = object
Size: uint32
BackgroundColor: DXVA_AYUVsample2
rcTarget: RECT
rtTarget: int64
NumSourceSurfaces: uint32
Alpha: float32
Source: array[32, DXVA_VideoSample2]
DestinationFormat: uint32
DestinationFlags: uint32struct DXVA_AYUVsample2
{
ubyte bCrValue;
ubyte bCbValue;
ubyte bY_Value;
ubyte bSampleAlpha8;
}
struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct DXVA_VideoSample2
{
uint Size;
uint Reserved;
long rtStart;
long rtEnd;
uint SampleFormat;
uint SampleFlags;
void* lpDDSSrcSurface;
RECT rcSrc;
RECT rcDst;
DXVA_AYUVsample2[16] Palette;
}
struct DXVA_DeinterlaceBltEx
{
uint Size;
DXVA_AYUVsample2 BackgroundColor;
RECT rcTarget;
long rtTarget;
uint NumSourceSurfaces;
float Alpha;
DXVA_VideoSample2[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_DeinterlaceBltEx サイズ: 4400 バイト(x64)
dim st, 1100 ; 4byte整数×1100(構造体サイズ 4400 / 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_VideoSample2 (+40, 4352byte) varptr(st)+40 を基点に操作(4352byte:入れ子/配列)
; DestinationFormat : DWORD (+4392, 4byte) st.1098 = 値 / 値 = st.1098 (lpoke/lpeek も可)
; DestinationFlags : DWORD (+4396, 4byte) st.1099 = 値 / 値 = st.1099 (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_VideoSample2
#field int Size
#field int Reserved
#field int64 rtStart
#field int64 rtEnd
#field int SampleFormat
#field int SampleFlags
#field intptr lpDDSSrcSurface
#field RECT rcSrc
#field RECT rcDst
#field DXVA_AYUVsample2 Palette 16
#endstruct
#defstruct global DXVA_DeinterlaceBltEx
#field int Size
#field DXVA_AYUVsample2 BackgroundColor
#field RECT rcTarget
#field int64 rtTarget
#field int NumSourceSurfaces
#field float Alpha
#field DXVA_VideoSample2 Source 32
#field int DestinationFormat
#field int DestinationFlags
#endstruct
stdim st, DXVA_DeinterlaceBltEx ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size