1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! Sizes, offsets, versions and enum values from the Video Codec SDK 12.0
//! `nvEncodeAPI.h`, printed by the C compiler on x86_64 Linux (`sizeof`,
//! `offsetof`, the `*_VER` macros) rather than transcribed by hand. The
//! structs are handled as zeroed blocks of the C size with these fields
//! written in place: several are kilobytes of unions and bitfields, and only
//! a handful of fields are needed.
pub const FUNCTION_LIST_SIZE: usize = 2552;
pub const FUNCTION_LIST_VER: u32 = 0x7002000c;
pub const FN_OPEN_ENCODE_SESSION_EX: usize = 240;
pub const FN_GET_ENCODE_PRESET_CONFIG_EX: usize = 320;
pub const FN_INITIALIZE_ENCODER: usize = 96;
pub const FN_CREATE_INPUT_BUFFER: usize = 104;
pub const FN_DESTROY_INPUT_BUFFER: usize = 112;
pub const FN_CREATE_BITSTREAM_BUFFER: usize = 120;
pub const FN_DESTROY_BITSTREAM_BUFFER: usize = 128;
pub const FN_ENCODE_PICTURE: usize = 136;
pub const FN_LOCK_BITSTREAM: usize = 144;
pub const FN_UNLOCK_BITSTREAM: usize = 152;
pub const FN_LOCK_INPUT_BUFFER: usize = 160;
pub const FN_UNLOCK_INPUT_BUFFER: usize = 168;
pub const FN_DESTROY_ENCODER: usize = 224;
pub const FN_GET_LAST_ERROR_STRING: usize = 304;
pub const API_VERSION: u32 = 0x0000000c;
pub const OPEN_SIZE: usize = 1552;
pub const OPEN_VER: u32 = 0x7001000c;
pub const OPEN_DEVICE_TYPE: usize = 4;
pub const OPEN_DEVICE: usize = 8;
pub const OPEN_API_VERSION: usize = 24;
pub const PRESET_SIZE: usize = 5128;
pub const PRESET_VER: u32 = 0xf004000c;
pub const PRESET_CFG: usize = 8;
pub const CONFIG_SIZE: usize = 3584;
pub const CONFIG_VER: u32 = 0xf008000c;
pub const CONFIG_GOP_LENGTH: usize = 20;
pub const CONFIG_FRAME_INTERVAL_P: usize = 24;
pub const CONFIG_RC_MODE: usize = 44;
pub const CONFIG_RC_CONST_QP: usize = 48;
pub const CONFIG_RC_AVG_BITRATE: usize = 60;
pub const CONFIG_RC_MAX_BITRATE: usize = 64;
pub const CONFIG_RC_TARGET_QUALITY: usize = 128;
pub const CONFIG_HEVC_IDR_PERIOD: usize = 188;
pub const INIT_SIZE: usize = 1808;
pub const INIT_VER: u32 = 0xf005000c;
pub const INIT_ENCODE_GUID: usize = 4;
pub const INIT_PRESET_GUID: usize = 20;
pub const INIT_WIDTH: usize = 36;
pub const INIT_HEIGHT: usize = 40;
pub const INIT_DAR_WIDTH: usize = 44;
pub const INIT_DAR_HEIGHT: usize = 48;
pub const INIT_FRAME_RATE_NUM: usize = 52;
pub const INIT_FRAME_RATE_DEN: usize = 56;
pub const INIT_ENABLE_PTD: usize = 64;
pub const INIT_ENCODE_CONFIG: usize = 88;
pub const INIT_MAX_WIDTH: usize = 96;
pub const INIT_MAX_HEIGHT: usize = 100;
pub const INIT_TUNING_INFO: usize = 136;
pub const INPUT_SIZE: usize = 776;
pub const INPUT_VER: u32 = 0x7001000c;
pub const INPUT_WIDTH: usize = 4;
pub const INPUT_HEIGHT: usize = 8;
pub const INPUT_FORMAT: usize = 16;
pub const INPUT_BUFFER: usize = 24;
pub const BITSTREAM_SIZE: usize = 776;
pub const BITSTREAM_VER: u32 = 0x7001000c;
pub const BITSTREAM_BUFFER: usize = 16;
pub const LOCK_INPUT_SIZE: usize = 1544;
pub const LOCK_INPUT_VER: u32 = 0x7001000c;
pub const LOCK_INPUT_BUFFER: usize = 8;
pub const LOCK_INPUT_DATA: usize = 16;
pub const LOCK_INPUT_PITCH: usize = 24;
pub const PIC_SIZE: usize = 3360;
pub const PIC_VER: u32 = 0xf006000c;
pub const PIC_INPUT_WIDTH: usize = 4;
pub const PIC_INPUT_HEIGHT: usize = 8;
pub const PIC_INPUT_PITCH: usize = 12;
pub const PIC_FLAGS: usize = 16;
pub const PIC_FRAME_IDX: usize = 20;
pub const PIC_TIMESTAMP: usize = 24;
pub const PIC_INPUT_BUFFER: usize = 40;
pub const PIC_OUTPUT: usize = 48;
pub const PIC_BUFFER_FORMAT: usize = 64;
pub const PIC_STRUCT: usize = 68;
pub const LOCK_BS_SIZE: usize = 1544;
pub const LOCK_BS_VER: u32 = 0x7002000c;
pub const LOCK_BS_OUTPUT: usize = 8;
pub const LOCK_BS_SIZE_BYTES: usize = 36;
pub const LOCK_BS_PTR: usize = 56;
pub const LOCK_BS_PICTURE_TYPE: usize = 64;
pub const DEVICE_TYPE_CUDA: u32 = 0x00000001;
pub const BUFFER_FORMAT_ABGR: u32 = 0x10000000;
pub const PIC_STRUCT_FRAME: u32 = 0x00000001;
pub const PIC_FLAG_EOS: u32 = 0x00000008;
pub const RC_CONSTQP: u32 = 0x00000000;
pub const RC_VBR: u32 = 0x00000001;
pub const TUNING_HIGH_QUALITY: u32 = 0x00000001;
pub const TUNING_LOW_LATENCY: u32 = 0x00000002;
pub const ERR_NEED_MORE_INPUT: u32 = 0x00000011;
pub const PIC_TYPE_IDR: u32 = 0x00000003;