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

DXVA_DeinterlaceBlt

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0本構造体のバイトサイズを示す。バージョン判定に用いる。
ReservedDWORD4+4+4予約フィールド。0を設定する。
rtTargetLONGLONG8+8+8出力対象フレームの時刻(100ナノ秒単位)を示す。
DstRectRECT16+16+16出力先の矩形領域である。
SrcRectRECT16+32+32ソースの処理対象矩形領域である。
NumSourceSurfacesDWORD4+48+48入力ソースサーフェスの数を示す。
AlphaFLOAT4+52+52出力に適用する全体の不透明度(0.0〜1.0)を示す。
SourceDXVA_VideoSample1024/768+56+56デインターレース対象の入力ビデオサンプルである。

各言語での定義

#include <windows.h>

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

// DXVA_VideoSample  (x64 32 / x86 24 バイト)
typedef struct DXVA_VideoSample {
    LONGLONG rtStart;
    LONGLONG rtEnd;
    DXVA_SampleFormat SampleFormat;
    void* lpDDSSrcSurface;
} DXVA_VideoSample;

// DXVA_DeinterlaceBlt  (x64 1080 / x86 824 バイト)
typedef struct DXVA_DeinterlaceBlt {
    DWORD Size;
    DWORD Reserved;
    LONGLONG rtTarget;
    RECT DstRect;
    RECT SrcRect;
    DWORD NumSourceSurfaces;
    FLOAT Alpha;
    DXVA_VideoSample Source[32];
} DXVA_DeinterlaceBlt;
using System;
using System.Runtime.InteropServices;

[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_VideoSample
{
    public long rtStart;
    public long rtEnd;
    public int SampleFormat;
    public IntPtr lpDDSSrcSurface;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_DeinterlaceBlt
{
    public uint Size;
    public uint Reserved;
    public long rtTarget;
    public RECT DstRect;
    public RECT SrcRect;
    public uint NumSourceSurfaces;
    public float Alpha;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public DXVA_VideoSample[] Source;
}
Imports System.Runtime.InteropServices

<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_VideoSample
    Public rtStart As Long
    Public rtEnd As Long
    Public SampleFormat As Integer
    Public lpDDSSrcSurface As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_DeinterlaceBlt
    Public Size As UInteger
    Public Reserved As UInteger
    Public rtTarget As Long
    Public DstRect As RECT
    Public SrcRect As RECT
    Public NumSourceSurfaces As UInteger
    Public Alpha As Single
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public Source() As DXVA_VideoSample
End Structure
import ctypes
from ctypes import wintypes

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

class DXVA_VideoSample(ctypes.Structure):
    _fields_ = [
        ("rtStart", ctypes.c_longlong),
        ("rtEnd", ctypes.c_longlong),
        ("SampleFormat", ctypes.c_int),
        ("lpDDSSrcSurface", ctypes.c_void_p),
    ]

class DXVA_DeinterlaceBlt(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
        ("rtTarget", ctypes.c_longlong),
        ("DstRect", RECT),
        ("SrcRect", RECT),
        ("NumSourceSurfaces", wintypes.DWORD),
        ("Alpha", ctypes.c_float),
        ("Source", DXVA_VideoSample * 32),
    ]
#[repr(C)]
pub struct RECT {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[repr(C)]
pub struct DXVA_VideoSample {
    pub rtStart: i64,
    pub rtEnd: i64,
    pub SampleFormat: i32,
    pub lpDDSSrcSurface: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct DXVA_DeinterlaceBlt {
    pub Size: u32,
    pub Reserved: u32,
    pub rtTarget: i64,
    pub DstRect: RECT,
    pub SrcRect: RECT,
    pub NumSourceSurfaces: u32,
    pub Alpha: f32,
    pub Source: [DXVA_VideoSample; 32],
}
import "golang.org/x/sys/windows"

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

type DXVA_VideoSample struct {
	rtStart int64
	rtEnd int64
	SampleFormat int32
	lpDDSSrcSurface uintptr
}

type DXVA_DeinterlaceBlt struct {
	Size uint32
	Reserved uint32
	rtTarget int64
	DstRect RECT
	SrcRect RECT
	NumSourceSurfaces uint32
	Alpha float32
	Source [32]DXVA_VideoSample
}
type
  RECT = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  DXVA_VideoSample = record
    rtStart: Int64;
    rtEnd: Int64;
    SampleFormat: Integer;
    lpDDSSrcSurface: Pointer;
  end;

  DXVA_DeinterlaceBlt = record
    Size: DWORD;
    Reserved: DWORD;
    rtTarget: Int64;
    DstRect: RECT;
    SrcRect: RECT;
    NumSourceSurfaces: DWORD;
    Alpha: Single;
    Source: array[0..31] of DXVA_VideoSample;
  end;
const RECT = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

const DXVA_VideoSample = extern struct {
    rtStart: i64,
    rtEnd: i64,
    SampleFormat: i32,
    lpDDSSrcSurface: ?*anyopaque,
};

const DXVA_DeinterlaceBlt = extern struct {
    Size: u32,
    Reserved: u32,
    rtTarget: i64,
    DstRect: RECT,
    SrcRect: RECT,
    NumSourceSurfaces: u32,
    Alpha: f32,
    Source: [32]DXVA_VideoSample,
};
type
  RECT {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  DXVA_VideoSample {.bycopy.} = object
    rtStart: int64
    rtEnd: int64
    SampleFormat: int32
    lpDDSSrcSurface: pointer

  DXVA_DeinterlaceBlt {.bycopy.} = object
    Size: uint32
    Reserved: uint32
    rtTarget: int64
    DstRect: RECT
    SrcRect: RECT
    NumSourceSurfaces: uint32
    Alpha: float32
    Source: array[32, DXVA_VideoSample]
struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct DXVA_VideoSample
{
    long rtStart;
    long rtEnd;
    int SampleFormat;
    void* lpDDSSrcSurface;
}

struct DXVA_DeinterlaceBlt
{
    uint Size;
    uint Reserved;
    long rtTarget;
    RECT DstRect;
    RECT SrcRect;
    uint NumSourceSurfaces;
    float Alpha;
    DXVA_VideoSample[32] Source;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXVA_DeinterlaceBlt サイズ: 824 バイト(x86)
dim st, 206    ; 4byte整数×206(構造体サイズ 824 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Reserved : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; rtTarget : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; DstRect : RECT (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; SrcRect : RECT (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; NumSourceSurfaces : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; Alpha : FLOAT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; Source : DXVA_VideoSample (+56, 768byte)  varptr(st)+56 を基点に操作(768byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA_DeinterlaceBlt サイズ: 1080 バイト(x64)
dim st, 270    ; 4byte整数×270(構造体サイズ 1080 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Reserved : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; rtTarget : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; DstRect : RECT (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; SrcRect : RECT (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; NumSourceSurfaces : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; Alpha : FLOAT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; Source : DXVA_VideoSample (+56, 1024byte)  varptr(st)+56 を基点に操作(1024byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
    #field int left
    #field int top
    #field int right
    #field int bottom
#endstruct

#defstruct global DXVA_VideoSample
    #field int64 rtStart
    #field int64 rtEnd
    #field int SampleFormat
    #field intptr lpDDSSrcSurface
#endstruct

#defstruct global DXVA_DeinterlaceBlt
    #field int Size
    #field int Reserved
    #field int64 rtTarget
    #field RECT DstRect
    #field RECT SrcRect
    #field int NumSourceSurfaces
    #field float Alpha
    #field DXVA_VideoSample Source 32
#endstruct

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