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

D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS

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

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

フィールド

フィールドサイズx64x86説明
AverageQPULONGLONG8+0+0当該フレームで使用された量子化パラメータ(QP)の平均値を示す。
IntraCodingUnitsCountULONGLONG8+8+8イントラ符号化されたコーディングユニットの数を示す。
InterCodingUnitsCountULONGLONG8+16+16インター符号化されたコーディングユニットの数を示す。
SkipCodingUnitsCountULONGLONG8+24+24スキップ符号化されたコーディングユニットの数を示す。
AverageMotionEstimationXDirectionULONGLONG8+32+32X方向の動きベクトル推定の平均値を示す。
AverageMotionEstimationYDirectionULONGLONG8+40+40Y方向の動きベクトル推定の平均値を示す。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS  (x64 48 / x86 48 バイト)
typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS {
    ULONGLONG AverageQP;
    ULONGLONG IntraCodingUnitsCount;
    ULONGLONG InterCodingUnitsCount;
    ULONGLONG SkipCodingUnitsCount;
    ULONGLONG AverageMotionEstimationXDirection;
    ULONGLONG AverageMotionEstimationYDirection;
} D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS
{
    public ulong AverageQP;
    public ulong IntraCodingUnitsCount;
    public ulong InterCodingUnitsCount;
    public ulong SkipCodingUnitsCount;
    public ulong AverageMotionEstimationXDirection;
    public ulong AverageMotionEstimationYDirection;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS
    Public AverageQP As ULong
    Public IntraCodingUnitsCount As ULong
    Public InterCodingUnitsCount As ULong
    Public SkipCodingUnitsCount As ULong
    Public AverageMotionEstimationXDirection As ULong
    Public AverageMotionEstimationYDirection As ULong
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS(ctypes.Structure):
    _fields_ = [
        ("AverageQP", ctypes.c_ulonglong),
        ("IntraCodingUnitsCount", ctypes.c_ulonglong),
        ("InterCodingUnitsCount", ctypes.c_ulonglong),
        ("SkipCodingUnitsCount", ctypes.c_ulonglong),
        ("AverageMotionEstimationXDirection", ctypes.c_ulonglong),
        ("AverageMotionEstimationYDirection", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS {
    pub AverageQP: u64,
    pub IntraCodingUnitsCount: u64,
    pub InterCodingUnitsCount: u64,
    pub SkipCodingUnitsCount: u64,
    pub AverageMotionEstimationXDirection: u64,
    pub AverageMotionEstimationYDirection: u64,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS struct {
	AverageQP uint64
	IntraCodingUnitsCount uint64
	InterCodingUnitsCount uint64
	SkipCodingUnitsCount uint64
	AverageMotionEstimationXDirection uint64
	AverageMotionEstimationYDirection uint64
}
type
  D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS = record
    AverageQP: UInt64;
    IntraCodingUnitsCount: UInt64;
    InterCodingUnitsCount: UInt64;
    SkipCodingUnitsCount: UInt64;
    AverageMotionEstimationXDirection: UInt64;
    AverageMotionEstimationYDirection: UInt64;
  end;
const D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS = extern struct {
    AverageQP: u64,
    IntraCodingUnitsCount: u64,
    InterCodingUnitsCount: u64,
    SkipCodingUnitsCount: u64,
    AverageMotionEstimationXDirection: u64,
    AverageMotionEstimationYDirection: u64,
};
type
  D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS {.bycopy.} = object
    AverageQP: uint64
    IntraCodingUnitsCount: uint64
    InterCodingUnitsCount: uint64
    SkipCodingUnitsCount: uint64
    AverageMotionEstimationXDirection: uint64
    AverageMotionEstimationYDirection: uint64
struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS
{
    ulong AverageQP;
    ulong IntraCodingUnitsCount;
    ulong InterCodingUnitsCount;
    ulong SkipCodingUnitsCount;
    ulong AverageMotionEstimationXDirection;
    ulong AverageMotionEstimationYDirection;
}

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_OUTPUT_METADATA_STATISTICS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; AverageQP : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; IntraCodingUnitsCount : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; InterCodingUnitsCount : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SkipCodingUnitsCount : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; AverageMotionEstimationXDirection : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AverageMotionEstimationYDirection : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS
    #field int64 AverageQP
    #field int64 IntraCodingUnitsCount
    #field int64 InterCodingUnitsCount
    #field int64 SkipCodingUnitsCount
    #field int64 AverageMotionEstimationXDirection
    #field int64 AverageMotionEstimationYDirection
#endstruct

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