ホーム › Media.MediaFoundation › D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| GOPLength | DWORD | 4 | +0 | +0 | シーケンス内の I フレーム間の距離、つまり 1 つの GOP に含まれるピクチャー数です。0 に設定した場合、最初のフレームだけが I フレームになります (無限 GOP)。 |
| PPicturePeriod | DWORD | 4 | +4 | +4 | GOP 内に P フレームを挿入する周期です。無限 GOP にするために GOPLength を 0 に設定した場合、この値は 0 より大きくなければならないことに注意してください。 使用例。A=GOPLength、B=PPictureInterval とします。
|
| pic_order_cnt_type | BYTE | 1 | +8 | +8 | H264 標準のシーケンスパラメーターセットにおける pic_order_cnt_type で定義されている、ピクチャーオーダーカウントタイプのフィルターモードを指定します。pic_order_cnt_type の値は 0 から 2 までの範囲 (両端を含む) でなければなりません。 |
| log2_max_frame_num_minus4 | BYTE | 1 | +9 | +9 | frame_num に関連する導出で使用される変数 MaxFrameNum の値を、次のように指定します。 MaxFrameNum = 2^(log2_max_frame_num_minus4 + 4) log2_max_frame_num_minus4 の値は 0 から 12 までの範囲 (両端を含む) でなければなりません。 |
| log2_max_pic_order_cnt_lsb_minus4 | BYTE | 1 | +10 | +10 | 8.2.1 項で規定されているピクチャーオーダーカウントのデコード処理で使用される変数 MaxPicOrderCntLsb の値を、次のように指定します。 MaxPicOrderCntLsb = 2^ (log2_max_pic_order_cnt_lsb_minus4 + 4) log2_max_pic_order_cnt_lsb_minus4 の値は 0 から 12 までの範囲 (両端を含む) でなければなりません。 |
公式ドキュメント
H.264 ビデオエンコードの GOP 構造を表します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 (x64 12 / x86 12 バイト)
typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 {
DWORD GOPLength;
DWORD PPicturePeriod;
BYTE pic_order_cnt_type;
BYTE log2_max_frame_num_minus4;
BYTE log2_max_pic_order_cnt_lsb_minus4;
} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
{
public uint GOPLength;
public uint PPicturePeriod;
public byte pic_order_cnt_type;
public byte log2_max_frame_num_minus4;
public byte log2_max_pic_order_cnt_lsb_minus4;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
Public GOPLength As UInteger
Public PPicturePeriod As UInteger
Public pic_order_cnt_type As Byte
Public log2_max_frame_num_minus4 As Byte
Public log2_max_pic_order_cnt_lsb_minus4 As Byte
End Structureimport ctypes
from ctypes import wintypes
class D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264(ctypes.Structure):
_fields_ = [
("GOPLength", wintypes.DWORD),
("PPicturePeriod", wintypes.DWORD),
("pic_order_cnt_type", ctypes.c_ubyte),
("log2_max_frame_num_minus4", ctypes.c_ubyte),
("log2_max_pic_order_cnt_lsb_minus4", ctypes.c_ubyte),
]#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 {
pub GOPLength: u32,
pub PPicturePeriod: u32,
pub pic_order_cnt_type: u8,
pub log2_max_frame_num_minus4: u8,
pub log2_max_pic_order_cnt_lsb_minus4: u8,
}import "golang.org/x/sys/windows"
type D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 struct {
GOPLength uint32
PPicturePeriod uint32
pic_order_cnt_type byte
log2_max_frame_num_minus4 byte
log2_max_pic_order_cnt_lsb_minus4 byte
}type
D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 = record
GOPLength: DWORD;
PPicturePeriod: DWORD;
pic_order_cnt_type: Byte;
log2_max_frame_num_minus4: Byte;
log2_max_pic_order_cnt_lsb_minus4: Byte;
end;const D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 = extern struct {
GOPLength: u32,
PPicturePeriod: u32,
pic_order_cnt_type: u8,
log2_max_frame_num_minus4: u8,
log2_max_pic_order_cnt_lsb_minus4: u8,
};type
D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 {.bycopy.} = object
GOPLength: uint32
PPicturePeriod: uint32
pic_order_cnt_type: uint8
log2_max_frame_num_minus4: uint8
log2_max_pic_order_cnt_lsb_minus4: uint8struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
{
uint GOPLength;
uint PPicturePeriod;
ubyte pic_order_cnt_type;
ubyte log2_max_frame_num_minus4;
ubyte log2_max_pic_order_cnt_lsb_minus4;
}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_SEQUENCE_GOP_STRUCTURE_H264 サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; GOPLength : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; PPicturePeriod : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pic_order_cnt_type : BYTE (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; log2_max_frame_num_minus4 : BYTE (+9, 1byte) poke st,9,値 / 値 = peek(st,9)
; log2_max_pic_order_cnt_lsb_minus4 : BYTE (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
#field int GOPLength
#field int PPicturePeriod
#field byte pic_order_cnt_type
#field byte log2_max_frame_num_minus4
#field byte log2_max_pic_order_cnt_lsb_minus4
#endstruct
stdim st, D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 ; NSTRUCT 変数を確保
st->GOPLength = 100
mes "GOPLength=" + st->GOPLength