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

D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM

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

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

フィールド

フィールドサイズx64x86説明
NodeIndexDWORD4+0+0対象とする物理アダプタノードのインデックス。
DecodeProfileGUID16+4+4デコードプロファイルを識別するGUID。
WidthDWORD4+20+20対象映像の幅(ピクセル単位)。
HeightDWORD4+24+24対象映像の高さ(ピクセル単位)。
DecodeFormatDXGI_FORMAT4+28+28デコード出力のピクセル形式を示すDXGI_FORMAT。
ComponentsD3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS4+32+32ヒストグラム対象の色成分を示すD3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS。
BinCountDWORD4+36+36ヒストグラムのビン数(出力)。
CounterBitDepthDWORD4+40+40各ビンのカウンタのビット深度(出力)。

各言語での定義

#include <windows.h>

// D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM  (x64 44 / x86 44 バイト)
typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM {
    DWORD NodeIndex;
    GUID DecodeProfile;
    DWORD Width;
    DWORD Height;
    DXGI_FORMAT DecodeFormat;
    D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS Components;
    DWORD BinCount;
    DWORD CounterBitDepth;
} D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM
{
    public uint NodeIndex;
    public Guid DecodeProfile;
    public uint Width;
    public uint Height;
    public int DecodeFormat;
    public int Components;
    public uint BinCount;
    public uint CounterBitDepth;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM
    Public NodeIndex As UInteger
    Public DecodeProfile As Guid
    Public Width As UInteger
    Public Height As UInteger
    Public DecodeFormat As Integer
    Public Components As Integer
    Public BinCount As UInteger
    Public CounterBitDepth As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM(ctypes.Structure):
    _fields_ = [
        ("NodeIndex", wintypes.DWORD),
        ("DecodeProfile", GUID),
        ("Width", wintypes.DWORD),
        ("Height", wintypes.DWORD),
        ("DecodeFormat", ctypes.c_int),
        ("Components", ctypes.c_int),
        ("BinCount", wintypes.DWORD),
        ("CounterBitDepth", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM {
    pub NodeIndex: u32,
    pub DecodeProfile: GUID,
    pub Width: u32,
    pub Height: u32,
    pub DecodeFormat: i32,
    pub Components: i32,
    pub BinCount: u32,
    pub CounterBitDepth: u32,
}
import "golang.org/x/sys/windows"

type D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM struct {
	NodeIndex uint32
	DecodeProfile windows.GUID
	Width uint32
	Height uint32
	DecodeFormat int32
	Components int32
	BinCount uint32
	CounterBitDepth uint32
}
type
  D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM = record
    NodeIndex: DWORD;
    DecodeProfile: TGUID;
    Width: DWORD;
    Height: DWORD;
    DecodeFormat: Integer;
    Components: Integer;
    BinCount: DWORD;
    CounterBitDepth: DWORD;
  end;
const D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM = extern struct {
    NodeIndex: u32,
    DecodeProfile: GUID,
    Width: u32,
    Height: u32,
    DecodeFormat: i32,
    Components: i32,
    BinCount: u32,
    CounterBitDepth: u32,
};
type
  D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM {.bycopy.} = object
    NodeIndex: uint32
    DecodeProfile: GUID
    Width: uint32
    Height: uint32
    DecodeFormat: int32
    Components: int32
    BinCount: uint32
    CounterBitDepth: uint32
struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM
{
    uint NodeIndex;
    GUID DecodeProfile;
    uint Width;
    uint Height;
    int DecodeFormat;
    int Components;
    uint BinCount;
    uint CounterBitDepth;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM サイズ: 44 バイト(x64)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; DecodeProfile : GUID (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; Width : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Height : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; DecodeFormat : DXGI_FORMAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Components : D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; BinCount : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; CounterBitDepth : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM
    #field int NodeIndex
    #field GUID DecodeProfile
    #field int Width
    #field int Height
    #field int DecodeFormat
    #field int Components
    #field int BinCount
    #field int CounterBitDepth
#endstruct

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