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 方向の動きベクトルのシフト量の平均を受け取る出力フィールドです。

公式ドキュメント

ID3D12VideoEncodeCommandList2::EncodeFrame 操作に関するエンコードの統計情報を表します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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