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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
use crate::ffi::GUID;

// from https://github.com/crab2313/nvenc-sys
macro_rules! make_guid {
    ($d1:expr, $d2:expr, $d3:expr, $d4:expr) => {
        GUID {
            Data1: $d1,
            Data2: $d2,
            Data3: $d3,
            Data4: $d4,
        }
    };
}

// Codec GUIDs
pub const NV_ENC_CODEC_H264_GUID: GUID = make_guid!(
    0x6bc82762,
    0x4e63,
    0x4ca4,
    [0xaa, 0x85, 0x1e, 0x50, 0xf3, 0x21, 0xf6, 0xbf]
);
pub const NV_ENC_CODEC_HEVC_GUID: GUID = make_guid!(
    0x790cdc88,
    0x4522,
    0x4d7b,
    [0x94, 0x25, 0xbd, 0xa9, 0x97, 0x5f, 0x76, 0x3]
);

// Preset GUIDs
pub const NV_ENC_PRESET_DEFAULT_GUID: GUID = make_guid!(
    0xb2dfb705,
    0x4ebd,
    0x4c49,
    [0x9b, 0x5f, 0x24, 0xa7, 0x77, 0xd3, 0xe5, 0x87]
);
pub const NV_ENC_PRESET_HP_GUID: GUID = make_guid!(
    0x60e4c59f,
    0xe846,
    0x4484,
    [0xa5, 0x6d, 0xcd, 0x45, 0xbe, 0x9f, 0xdd, 0xf6]
);
pub const NV_ENC_PRESET_HQ_GUID: GUID = make_guid!(
    0x34dba71d,
    0xa77b,
    0x4b8f,
    [0x9c, 0x3e, 0xb6, 0xd5, 0xda, 0x24, 0xc0, 0x12]
);
pub const NV_ENC_PRESET_BD_GUID: GUID = make_guid!(
    0x82e3e450,
    0xbdbb,
    0x4e40,
    [0x98, 0x9c, 0x82, 0xa9, 0xd, 0xf9, 0xef, 0x32]
);
pub const NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID: GUID = make_guid!(
    0x49df21c5,
    0x6dfa,
    0x4feb,
    [0x97, 0x87, 0x6a, 0xcc, 0x9e, 0xff, 0xb7, 0x26]
);
pub const NV_ENC_PRESET_LOW_LATENCY_HQ_GUID: GUID = make_guid!(
    0xc5f733b9,
    0xea97,
    0x4cf9,
    [0xbe, 0xc2, 0xbf, 0x78, 0xa7, 0x4f, 0xd1, 0x5]
);
pub const NV_ENC_PRESET_LOW_LATENCY_HP_GUID: GUID = make_guid!(
    0x67082a44,
    0x4bad,
    0x48fa,
    [0x98, 0xea, 0x93, 0x5, 0x6d, 0x15, 0xa, 0x58]
);
pub const NV_ENC_PRESET_LOSSLESS_DEFAULT_GUID: GUID = make_guid!(
    0xd5bfb716,
    0xc604,
    0x44e7,
    [0x9b, 0xb8, 0xde, 0xa5, 0x51, 0xf, 0xc3, 0xac]
);
pub const NV_ENC_PRESET_LOSSLESS_HP_GUID: GUID = make_guid!(
    0x149998e7,
    0x2364,
    0x411d,
    [0x82, 0xef, 0x17, 0x98, 0x88, 0x9, 0x34, 0x9]
);

// Profile GUIDs
pub const NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID: GUID = make_guid!(
    0xbfd6f8e7,
    0x233c,
    0x4341,
    [0x8b, 0x3e, 0x48, 0x18, 0x52, 0x38, 0x3, 0xf4]
);
pub const NV_ENC_H264_PROFILE_BASELINE_GUID: GUID = make_guid!(
    0x727bcaa,
    0x78c4,
    0x4c83,
    [0x8c, 0x2f, 0xef, 0x3d, 0xff, 0x26, 0x7c, 0x6a]
);
pub const NV_ENC_H264_PROFILE_MAIN_GUID: GUID = make_guid!(
    0x60b5c1d4,
    0x67fe,
    0x4790,
    [0x94, 0xd5, 0xc4, 0x72, 0x6d, 0x7b, 0x6e, 0x6d]
);
pub const NV_ENC_H264_PROFILE_HIGH_GUID: GUID = make_guid!(
    0xe7cbc309,
    0x4f7a,
    0x4b89,
    [0xaf, 0x2a, 0xd5, 0x37, 0xc9, 0x2b, 0xe3, 0x10]
);
pub const NV_ENC_H264_PROFILE_HIGH_444_GUID: GUID = make_guid!(
    0x7ac663cb,
    0xa598,
    0x4960,
    [0xb8, 0x44, 0x33, 0x9b, 0x26, 0x1a, 0x7d, 0x52]
);
pub const NV_ENC_H264_PROFILE_STEREO_GUID: GUID = make_guid!(
    0x40847bf5,
    0x33f7,
    0x4601,
    [0x90, 0x84, 0xe8, 0xfe, 0x3c, 0x1d, 0xb8, 0xb7]
);
pub const NV_ENC_H264_PROFILE_SVC_TEMPORAL_SCALABILTY: GUID = make_guid!(
    0xce788d20,
    0xaaa9,
    0x4318,
    [0x92, 0xbb, 0xac, 0x7e, 0x85, 0x8c, 0x8d, 0x36]
);
pub const NV_ENC_H264_PROFILE_PROGRESSIVE_HIGH_GUID: GUID = make_guid!(
    0xb405afac,
    0xf32b,
    0x417b,
    [0x89, 0xc4, 0x9a, 0xbe, 0xed, 0x3e, 0x59, 0x78]
);
pub const NV_ENC_H264_PROFILE_CONSTRAINED_HIGH_GUID: GUID = make_guid!(
    0xaec1bd87,
    0xe85b,
    0x48f2,
    [0x84, 0xc3, 0x98, 0xbc, 0xa6, 0x28, 0x50, 0x72]
);
pub const NV_ENC_HEVC_PROFILE_MAIN_GUID: GUID = make_guid!(
    0xb514c39a,
    0xb55b,
    0x40fa,
    [0x87, 0x8f, 0xf1, 0x25, 0x3b, 0x4d, 0xfd, 0xec]
);
pub const NV_ENC_HEVC_PROFILE_MAIN10_GUID: GUID = make_guid!(
    0xfa4d2b6c,
    0x3a5b,
    0x411a,
    [0x80, 0x18, 0x0a, 0x3f, 0x5e, 0x3c, 0x9b, 0xe5]
);
pub const NV_ENC_HEVC_PROFILE_FREXT_GUID: GUID = make_guid!(
    0x51ec32b5,
    0x1b4c,
    0x453c,
    [0x9c, 0xbd, 0xb6, 0x16, 0xbd, 0x62, 0x13, 0x41]
);

// Performance degrades and quality improves as we move from P1 to P7. Presets P3 to P7 for H264 and Presets P2 to P7 for HEVC have B frames enabled by default
// for HIGH_QUALITY and LOSSLESS tuning info, and will not work with Weighted Prediction enabled. In case Weighted Prediction is required, disable B frames by
// setting frameIntervalP = 1
// {FC0A8D3E-45F8-4CF8-80C7-298871590EBF}
pub const NV_ENC_PRESET_P1_GUID: GUID = make_guid!(
    0xfc0a8d3e,
    0x45f8,
    0x4cf8,
    [0x80, 0xc7, 0x29, 0x88, 0x71, 0x59, 0xe, 0xbf]
);

// {F581CFB8-88D6-4381-93F0-DF13F9C27DAB}
pub const NV_ENC_PRESET_P2_GUID: GUID = make_guid!(
    0xf581cfb8,
    0x88d6,
    0x4381,
    [0x93, 0xf0, 0xdf, 0x13, 0xf9, 0xc2, 0x7d, 0xab]
);

// {36850110-3A07-441F-94D5-3670631F91F6}
pub const NV_ENC_PRESET_P3_GUID: GUID = make_guid!(
    0x36850110,
    0x3a07,
    0x441f,
    [0x94, 0xd5, 0x36, 0x70, 0x63, 0x1f, 0x91, 0xf6]
);

// {90A7B826-DF06-4862-B9D2-CD6D73A08681}
pub const NV_ENC_PRESET_P4_GUID: GUID = make_guid!(
    0x90a7b826,
    0xdf06,
    0x4862,
    [0xb9, 0xd2, 0xcd, 0x6d, 0x73, 0xa0, 0x86, 0x81]
);

// {21C6E6B4-297A-4CBA-998F-B6CBDE72ADE3}
pub const NV_ENC_PRESET_P5_GUID: GUID = make_guid!(
    0x21c6e6b4,
    0x297a,
    0x4cba,
    [0x99, 0x8f, 0xb6, 0xcb, 0xde, 0x72, 0xad, 0xe3]
);

// {8E75C279-6299-4AB6-8302-0B215A335CF5}
pub const NV_ENC_PRESET_P6_GUID: GUID = make_guid!(
    0x8e75c279,
    0x6299,
    0x4ab6,
    [0x83, 0x2, 0xb, 0x21, 0x5a, 0x33, 0x5c, 0xf5]
);

// {84848C12-6F71-4C13-931B-53E283F57974}
pub const NV_ENC_PRESET_P7_GUID: GUID = make_guid!(
    0x84848c12,
    0x6f71,
    0x4c13,
    [0x93, 0x1b, 0x53, 0xe2, 0x83, 0xf5, 0x79, 0x74]
);

// {BFD6F8E7-233C-4341-8B3E-4818523803F4}
pub const NV_ENV_CODEC_PROFILE_AUTOSELECT_GUID: GUID = make_guid!(
    0xbfd6f8e7,
    0x233c,
    0x4341,
    [0x8b, 0x3e, 0x48, 0x18, 0x52, 0x38, 0x3, 0xf4]
);

// {0727BCAA-78C4-4c83-8C2F-EF3DFF267C6A}
pub const NV_ENV_H264_PROFILE_BASELINE_GUID: GUID = make_guid!(
    0x727bcaa,
    0x78c4,
    0x4c83,
    [0x8c, 0x2f, 0xef, 0x3d, 0xff, 0x26, 0x7c, 0x6a]
);

// {60B5C1D4-67FE-4790-94D5-C4726D7B6E6D}
pub const NV_ENV_H264_PROFILE_MAIN_GUID: GUID = make_guid!(
    0x60b5c1d4,
    0x67fe,
    0x4790,
    [0x94, 0xd5, 0xc4, 0x72, 0x6d, 0x7b, 0x6e, 0x6d]
);

// {E7CBC309-4F7A-4b89-AF2A-D537C92BE310}
pub const NV_ENV_H264_PROFILE_HIGH_GUID: GUID = make_guid!(
    0xe7cbc309,
    0x4f7a,
    0x4b89,
    [0xaf, 0x2a, 0xd5, 0x37, 0xc9, 0x2b, 0xe3, 0x10]
);