codekingpro/portable-devtools
114k
1/*
2 * This copyright notice applies to this header file only:
3 *
4 * Copyright (c) 2010-2024 NVIDIA Corporation
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the software, and to permit persons to whom the
12 * software is furnished to do so, subject to the following
13 * conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28/**
29 * \file nvEncodeAPI.h
30 * NVIDIA GPUs - beginning with the Kepler generation - contain a hardware-based encoder
31 * (referred to as NVENC) which provides fully-accelerated hardware-based video encoding.
32 * NvEncodeAPI provides the interface for NVIDIA video encoder (NVENC).
33 * \date 2011-2024
34 * This file contains the interface constants, structure definitions and function prototypes.
35 */
36
37#ifndef _NV_ENCODEAPI_H_
38#define _NV_ENCODEAPI_H_
39
40#include <stdlib.h>
41
42#ifdef _WIN32
43#include <windows.h>
44#endif
45
46#ifdef _MSC_VER
47#ifndef _STDINT
48typedef __int32 int32_t;
49typedef unsigned __int32 uint32_t;
50typedef __int64 int64_t;
51typedef unsigned __int64 uint64_t;
52typedef signed char int8_t;
53typedef unsigned char uint8_t;
54typedef short int16_t;
55typedef unsigned short uint16_t;
56#endif
57#else
58#include <stdint.h>
59#endif
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65/**
66 * \addtogroup ENCODER_STRUCTURE NvEncodeAPI Data structures
67 * @{
68 */
69
70#ifdef _WIN32
71#define NVENCAPI __stdcall
72typedef RECT NVENC_RECT;
73#else
74#define NVENCAPI
75// =========================================================================================
76#ifndef GUID_DEFINED
77#define GUID_DEFINED
78/*!
79 * \struct GUID
80 * Abstracts the GUID structure for non-windows platforms.
81 */
82// =========================================================================================
83typedef struct _GUID
84{
85 uint32_t Data1; /**< [in]: Specifies the first 8 hexadecimal digits of the GUID. */
86 uint16_t Data2; /**< [in]: Specifies the first group of 4 hexadecimal digits. */
87 uint16_t Data3; /**< [in]: Specifies the second group of 4 hexadecimal digits. */
88 uint8_t Data4[8]; /**< [in]: Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits.
89 The remaining 6 bytes contain the final 12 hexadecimal digits. */
90} GUID, *LPGUID;
91#endif // GUID
92
93/**
94 * \struct _NVENC_RECT
95 * Defines a Rectangle. Used in ::NV_ENC_PREPROCESS_FRAME.
96 */
97typedef struct _NVENC_RECT
98{
99 uint32_t left; /**< [in]: X coordinate of the upper left corner of rectangular area to be specified. */
100 uint32_t top; /**< [in]: Y coordinate of the upper left corner of the rectangular area to be specified. */
101 uint32_t right; /**< [in]: X coordinate of the bottom right corner of the rectangular area to be specified. */
102 uint32_t bottom; /**< [in]: Y coordinate of the bottom right corner of the rectangular area to be specified. */
103} NVENC_RECT;
104
105#endif // _WIN32
106
107/** @} */ /* End of GUID and NVENC_RECT structure grouping*/
108
109typedef void* NV_ENC_INPUT_PTR; /**< NVENCODE API input buffer */
110typedef void* NV_ENC_OUTPUT_PTR; /**< NVENCODE API output buffer*/
111typedef void* NV_ENC_REGISTERED_PTR; /**< A Resource that has been registered with NVENCODE API*/
112typedef void* NV_ENC_CUSTREAM_PTR; /**< Pointer to CUstream*/
113
114#define NVENCAPI_MAJOR_VERSION 13
115#define NVENCAPI_MINOR_VERSION 0
116
117#define NVENCAPI_VERSION (NVENCAPI_MAJOR_VERSION | (NVENCAPI_MINOR_VERSION << 24))
118
119/**
120 * Macro to generate per-structure version for use with API.
121 */
122#define NVENCAPI_STRUCT_VERSION(ver) ((uint32_t)NVENCAPI_VERSION | ((ver)<<16) | (0x7 << 28))
123
124
125#define NVENC_INFINITE_GOPLENGTH 0xffffffff
126
127#define NV_MAX_SEQ_HDR_LEN (512)
128
129#ifdef __GNUC__
130#define NV_ENC_DEPRECATED __attribute__ ((deprecated("WILL BE REMOVED IN A FUTURE VIDEO CODEC SDK VERSION")))
131#elif defined(_MSC_VER)
132#define NV_ENC_DEPRECATED __declspec(deprecated("WILL BE REMOVED IN A FUTURE VIDEO CODEC SDK VERSION"))
133#endif
134
135// =========================================================================================
136// Encode Codec GUIDS supported by the NvEncodeAPI interface.
137// =========================================================================================
138
139// {6BC82762-4E63-4ca4-AA85-1E50F321F6BF}
140static const GUID NV_ENC_CODEC_H264_GUID =
141{ 0x6bc82762, 0x4e63, 0x4ca4, { 0xaa, 0x85, 0x1e, 0x50, 0xf3, 0x21, 0xf6, 0xbf } };
142
143// {790CDC88-4522-4d7b-9425-BDA9975F7603}
144static const GUID NV_ENC_CODEC_HEVC_GUID =
145{ 0x790cdc88, 0x4522, 0x4d7b, { 0x94, 0x25, 0xbd, 0xa9, 0x97, 0x5f, 0x76, 0x3 } };
146
147// {0A352289-0AA7-4759-862D-5D15CD16D254}
148static const GUID NV_ENC_CODEC_AV1_GUID =
149{ 0x0a352289, 0x0aa7, 0x4759, { 0x86, 0x2d, 0x5d, 0x15, 0xcd, 0x16, 0xd2, 0x54 } };
150
151
152
153// =========================================================================================
154// * Encode Profile GUIDS supported by the NvEncodeAPI interface.
155// =========================================================================================
156
157// {BFD6F8E7-233C-4341-8B3E-4818523803F4}
158static const GUID NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID =
159{ 0xbfd6f8e7, 0x233c, 0x4341, { 0x8b, 0x3e, 0x48, 0x18, 0x52, 0x38, 0x3, 0xf4 } };
160
161// {0727BCAA-78C4-4c83-8C2F-EF3DFF267C6A}
162static const GUID NV_ENC_H264_PROFILE_BASELINE_GUID =
163{ 0x727bcaa, 0x78c4, 0x4c83, { 0x8c, 0x2f, 0xef, 0x3d, 0xff, 0x26, 0x7c, 0x6a } };
164
165// {60B5C1D4-67FE-4790-94D5-C4726D7B6E6D}
166static const GUID NV_ENC_H264_PROFILE_MAIN_GUID =
167{ 0x60b5c1d4, 0x67fe, 0x4790, { 0x94, 0xd5, 0xc4, 0x72, 0x6d, 0x7b, 0x6e, 0x6d } };
168
169// {E7CBC309-4F7A-4b89-AF2A-D537C92BE310}
170static const GUID NV_ENC_H264_PROFILE_HIGH_GUID =
171{ 0xe7cbc309, 0x4f7a, 0x4b89, { 0xaf, 0x2a, 0xd5, 0x37, 0xc9, 0x2b, 0xe3, 0x10 } };
172
173// {8F0C337E-186C-48E9-A69D-7A8334089758}
174static const GUID NV_ENC_H264_PROFILE_HIGH_10_GUID =
175{ 0x8f0c337e, 0x186c, 0x48e9, { 0xa6, 0x9d, 0x7a, 0x83, 0x34, 0x08, 0x97, 0x58} };
176
177// {FF3242E9-613C-4295-A1E8-2A7FE94D8133}
178static const GUID NV_ENC_H264_PROFILE_HIGH_422_GUID =
179{ 0xff3242e9, 0x613c, 0x4295, { 0xa1, 0xe8, 0x2a, 0x7f, 0xe9, 0x4d, 0x81, 0x33 } };
180
181// {7AC663CB-A598-4960-B844-339B261A7D52}
182static const GUID NV_ENC_H264_PROFILE_HIGH_444_GUID =
183{ 0x7ac663cb, 0xa598, 0x4960, { 0xb8, 0x44, 0x33, 0x9b, 0x26, 0x1a, 0x7d, 0x52 } };
184
185// {40847BF5-33F7-4601-9084-E8FE3C1DB8B7}
186static const GUID NV_ENC_H264_PROFILE_STEREO_GUID =
187{ 0x40847bf5, 0x33f7, 0x4601, { 0x90, 0x84, 0xe8, 0xfe, 0x3c, 0x1d, 0xb8, 0xb7 } };
188
189// {B405AFAC-F32B-417B-89C4-9ABEED3E5978}
190static const GUID NV_ENC_H264_PROFILE_PROGRESSIVE_HIGH_GUID =
191{ 0xb405afac, 0xf32b, 0x417b, { 0x89, 0xc4, 0x9a, 0xbe, 0xed, 0x3e, 0x59, 0x78 } };
192
193// {AEC1BD87-E85B-48f2-84C3-98BCA6285072}
194static const GUID NV_ENC_H264_PROFILE_CONSTRAINED_HIGH_GUID =
195{ 0xaec1bd87, 0xe85b, 0x48f2, { 0x84, 0xc3, 0x98, 0xbc, 0xa6, 0x28, 0x50, 0x72 } };
196
197// {B514C39A-B55B-40fa-878F-F1253B4DFDEC}
198static const GUID NV_ENC_HEVC_PROFILE_MAIN_GUID =
199{ 0xb514c39a, 0xb55b, 0x40fa, { 0x87, 0x8f, 0xf1, 0x25, 0x3b, 0x4d, 0xfd, 0xec } };
200
201// {fa4d2b6c-3a5b-411a-8018-0a3f5e3c9be5}
202static const GUID NV_ENC_HEVC_PROFILE_MAIN10_GUID =
203{ 0xfa4d2b6c, 0x3a5b, 0x411a, { 0x80, 0x18, 0x0a, 0x3f, 0x5e, 0x3c, 0x9b, 0xe5 } };
204
205// For HEVC Main 422/444 8 bit and HEVC Main 422/444 10 bit profiles only
206// {51ec32b5-1b4c-453c-9cbd-b616bd621341}
207static const GUID NV_ENC_HEVC_PROFILE_FREXT_GUID =
208{ 0x51ec32b5, 0x1b4c, 0x453c, { 0x9c, 0xbd, 0xb6, 0x16, 0xbd, 0x62, 0x13, 0x41 } };
209
210// {5f2a39f5-f14e-4f95-9a9e-b76d568fcf97}
211static const GUID NV_ENC_AV1_PROFILE_MAIN_GUID =
212{ 0x5f2a39f5, 0xf14e, 0x4f95, { 0x9a, 0x9e, 0xb7, 0x6d, 0x56, 0x8f, 0xcf, 0x97 } };
213
214// =========================================================================================
215// * Preset GUIDS supported by the NvEncodeAPI interface.
216// =========================================================================================
217
218// 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
219// 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
220// setting frameIntervalP = 1
221// {FC0A8D3E-45F8-4CF8-80C7-298871590EBF}
222static const GUID NV_ENC_PRESET_P1_GUID =
223{ 0xfc0a8d3e, 0x45f8, 0x4cf8, { 0x80, 0xc7, 0x29, 0x88, 0x71, 0x59, 0xe, 0xbf } };
224
225// {F581CFB8-88D6-4381-93F0-DF13F9C27DAB}
226static const GUID NV_ENC_PRESET_P2_GUID =
227{ 0xf581cfb8, 0x88d6, 0x4381, { 0x93, 0xf0, 0xdf, 0x13, 0xf9, 0xc2, 0x7d, 0xab } };
228
229// {36850110-3A07-441F-94D5-3670631F91F6}
230static const GUID NV_ENC_PRESET_P3_GUID =
231{ 0x36850110, 0x3a07, 0x441f, { 0x94, 0xd5, 0x36, 0x70, 0x63, 0x1f, 0x91, 0xf6 } };
232
233// {90A7B826-DF06-4862-B9D2-CD6D73A08681}
234static const GUID NV_ENC_PRESET_P4_GUID =
235{ 0x90a7b826, 0xdf06, 0x4862, { 0xb9, 0xd2, 0xcd, 0x6d, 0x73, 0xa0, 0x86, 0x81 } };
236
237// {21C6E6B4-297A-4CBA-998F-B6CBDE72ADE3}
238static const GUID NV_ENC_PRESET_P5_GUID =
239{ 0x21c6e6b4, 0x297a, 0x4cba, { 0x99, 0x8f, 0xb6, 0xcb, 0xde, 0x72, 0xad, 0xe3 } };
240
241// {8E75C279-6299-4AB6-8302-0B215A335CF5}
242static const GUID NV_ENC_PRESET_P6_GUID =
243{ 0x8e75c279, 0x6299, 0x4ab6, { 0x83, 0x2, 0xb, 0x21, 0x5a, 0x33, 0x5c, 0xf5 } };
244
245// {84848C12-6F71-4C13-931B-53E283F57974}
246static const GUID NV_ENC_PRESET_P7_GUID =
247{ 0x84848c12, 0x6f71, 0x4c13, { 0x93, 0x1b, 0x53, 0xe2, 0x83, 0xf5, 0x79, 0x74 } };
248
249/**
250 * \addtogroup ENCODER_STRUCTURE NvEncodeAPI Data structures
251 * @{
252 */
253
254/**
255 * Input frame encode modes
256 */
257typedef enum _NV_ENC_PARAMS_FRAME_FIELD_MODE
258{
259 NV_ENC_PARAMS_FRAME_FIELD_MODE_FRAME = 0x01, /**< Frame mode */
260 NV_ENC_PARAMS_FRAME_FIELD_MODE_FIELD = 0x02, /**< Field mode */
261 NV_ENC_PARAMS_FRAME_FIELD_MODE_MBAFF = 0x03 /**< MB adaptive frame/field */
262} NV_ENC_PARAMS_FRAME_FIELD_MODE;
263
264/**
265 * Rate Control Modes
266 */
267typedef enum _NV_ENC_PARAMS_RC_MODE
268{
269 NV_ENC_PARAMS_RC_CONSTQP = 0x0, /**< Constant QP mode */
270 NV_ENC_PARAMS_RC_VBR = 0x1, /**< Variable bitrate mode */
271 NV_ENC_PARAMS_RC_CBR = 0x2, /**< Constant bitrate mode */
272} NV_ENC_PARAMS_RC_MODE;
273
274/**
275 * Multi Pass encoding
276 */
277typedef enum _NV_ENC_MULTI_PASS
278{
279 NV_ENC_MULTI_PASS_DISABLED = 0x0, /**< Single Pass */
280 NV_ENC_TWO_PASS_QUARTER_RESOLUTION = 0x1, /**< Two Pass encoding is enabled where first Pass is quarter resolution */
281 NV_ENC_TWO_PASS_FULL_RESOLUTION = 0x2, /**< Two Pass encoding is enabled where first Pass is full resolution */
282} NV_ENC_MULTI_PASS;
283
284typedef enum _NV_ENC_STATE_RESTORE_TYPE
285{
286 NV_ENC_STATE_RESTORE_FULL = 0x01, /**< Restore full encoder state */
287 NV_ENC_STATE_RESTORE_RATE_CONTROL = 0x02, /**< Restore only rate control state */
288 NV_ENC_STATE_RESTORE_ENCODE = 0x03, /**< Restore full encoder state except for rate control state */
289} NV_ENC_STATE_RESTORE_TYPE;
290
291typedef enum _NV_ENC_OUTPUT_STATS_LEVEL
292{
293 NV_ENC_OUTPUT_STATS_NONE = 0, /** No output stats */
294 NV_ENC_OUTPUT_STATS_BLOCK_LEVEL = 1, /** Output stats for every block.
295 Block represents a CTB for HEVC, macroblock for H.264, super block for AV1 */
296 NV_ENC_OUTPUT_STATS_ROW_LEVEL = 2, /** Output stats for every row.
297 Row represents a CTB row for HEVC, macroblock row for H.264, super block row for AV1 */
298} NV_ENC_OUTPUT_STATS_LEVEL;
299
300/**
301 * Emphasis Levels
302 */
303typedef enum _NV_ENC_EMPHASIS_MAP_LEVEL
304{
305 NV_ENC_EMPHASIS_MAP_LEVEL_0 = 0x0, /**< Emphasis Map Level 0, for zero Delta QP value */
306 NV_ENC_EMPHASIS_MAP_LEVEL_1 = 0x1, /**< Emphasis Map Level 1, for very low Delta QP value */
307 NV_ENC_EMPHASIS_MAP_LEVEL_2 = 0x2, /**< Emphasis Map Level 2, for low Delta QP value */
308 NV_ENC_EMPHASIS_MAP_LEVEL_3 = 0x3, /**< Emphasis Map Level 3, for medium Delta QP value */
309 NV_ENC_EMPHASIS_MAP_LEVEL_4 = 0x4, /**< Emphasis Map Level 4, for high Delta QP value */
310 NV_ENC_EMPHASIS_MAP_LEVEL_5 = 0x5 /**< Emphasis Map Level 5, for very high Delta QP value */
311} NV_ENC_EMPHASIS_MAP_LEVEL;
312
313/**
314 * QP MAP MODE
315 */
316typedef enum _NV_ENC_QP_MAP_MODE
317{
318 NV_ENC_QP_MAP_DISABLED = 0x0, /**< Value in NV_ENC_PIC_PARAMS::qpDeltaMap have no effect. */
319 NV_ENC_QP_MAP_EMPHASIS = 0x1, /**< Value in NV_ENC_PIC_PARAMS::qpDeltaMap will be treated as Emphasis level. Currently this is only supported for H264 */
320 NV_ENC_QP_MAP_DELTA = 0x2, /**< Value in NV_ENC_PIC_PARAMS::qpDeltaMap will be treated as QP delta map. */
321 NV_ENC_QP_MAP = 0x3, /**< Currently This is not supported. Value in NV_ENC_PIC_PARAMS::qpDeltaMap will be treated as QP value. */
322} NV_ENC_QP_MAP_MODE;
323
324
325/**
326 * Input picture structure
327 */
328typedef enum _NV_ENC_PIC_STRUCT
329{
330 NV_ENC_PIC_STRUCT_FRAME = 0x01, /**< Progressive frame */
331 NV_ENC_PIC_STRUCT_FIELD_TOP_BOTTOM = 0x02, /**< Field encoding top field first */
332 NV_ENC_PIC_STRUCT_FIELD_BOTTOM_TOP = 0x03 /**< Field encoding bottom field first */
333} NV_ENC_PIC_STRUCT;
334
335/**
336 * Display picture structure
337 * Currently, this enum is only used for deciding the number of clock timestamp sets in Picture Timing SEI / Time Code SEI
338 * Otherwise, this has no impact on encoder behavior
339 */
340typedef enum _NV_ENC_DISPLAY_PIC_STRUCT
341{
342 NV_ENC_PIC_STRUCT_DISPLAY_FRAME = 0x00, /**< Field encoding top field first */
343 NV_ENC_PIC_STRUCT_DISPLAY_FIELD_TOP_BOTTOM = 0x01, /**< Field encoding top field first */
344 NV_ENC_PIC_STRUCT_DISPLAY_FIELD_BOTTOM_TOP = 0x02, /**< Field encoding bottom field first */
345 NV_ENC_PIC_STRUCT_DISPLAY_FRAME_DOUBLING = 0x03, /**< Frame doubling */
346 NV_ENC_PIC_STRUCT_DISPLAY_FRAME_TRIPLING = 0x04 /**< Field tripling */
347} NV_ENC_DISPLAY_PIC_STRUCT;
348
349/**
350 * Input picture type
351 */
352typedef enum _NV_ENC_PIC_TYPE
353{
354 NV_ENC_PIC_TYPE_P = 0x0, /**< Forward predicted */
355 NV_ENC_PIC_TYPE_B = 0x01, /**< Bi-directionally predicted picture */
356 NV_ENC_PIC_TYPE_I = 0x02, /**< Intra predicted picture */
357 NV_ENC_PIC_TYPE_IDR = 0x03, /**< IDR picture */
358 NV_ENC_PIC_TYPE_BI = 0x04, /**< Bi-directionally predicted with only Intra MBs */
359 NV_ENC_PIC_TYPE_SKIPPED = 0x05, /**< Picture is skipped */
360 NV_ENC_PIC_TYPE_INTRA_REFRESH = 0x06, /**< First picture in intra refresh cycle */
361 NV_ENC_PIC_TYPE_NONREF_P = 0x07, /**< Non reference P picture */
362 NV_ENC_PIC_TYPE_SWITCH = 0x08, /**< Switch frame (AV1 only) */
363 NV_ENC_PIC_TYPE_UNKNOWN = 0xFF /**< Picture type unknown */
364} NV_ENC_PIC_TYPE;
365
366/**
367 * Motion vector precisions
368 */
369typedef enum _NV_ENC_MV_PRECISION
370{
371 NV_ENC_MV_PRECISION_DEFAULT = 0x0, /**< Driver selects Quarter-Pel motion vector precision by default */
372 NV_ENC_MV_PRECISION_FULL_PEL = 0x01, /**< Full-Pel motion vector precision */
373 NV_ENC_MV_PRECISION_HALF_PEL = 0x02, /**< Half-Pel motion vector precision */
374 NV_ENC_MV_PRECISION_QUARTER_PEL = 0x03 /**< Quarter-Pel motion vector precision */
375} NV_ENC_MV_PRECISION;
376
377
378/**
379 * Input buffer formats
380 */
381typedef enum _NV_ENC_BUFFER_FORMAT
382{
383 NV_ENC_BUFFER_FORMAT_UNDEFINED = 0x00000000, /**< Undefined buffer format */
384
385 NV_ENC_BUFFER_FORMAT_NV12 = 0x00000001, /**< Semi-Planar YUV [Y plane followed by interleaved UV plane] */
386 NV_ENC_BUFFER_FORMAT_YV12 = 0x00000010, /**< Planar YUV [Y plane followed by V and U planes] */
387 NV_ENC_BUFFER_FORMAT_IYUV = 0x00000100, /**< Planar YUV [Y plane followed by U and V planes] */
388 NV_ENC_BUFFER_FORMAT_YUV444 = 0x00001000, /**< Planar YUV [Y plane followed by U and V planes] */
389 NV_ENC_BUFFER_FORMAT_YUV420_10BIT = 0x00010000, /**< 10 bit Semi-Planar YUV [Y plane followed by interleaved UV plane]. Each pixel of size 2 bytes. Most Significant 10 bits contain pixel data. */
390 NV_ENC_BUFFER_FORMAT_YUV444_10BIT = 0x00100000, /**< 10 bit Planar YUV444 [Y plane followed by U and V planes]. Each pixel of size 2 bytes. Most Significant 10 bits contain pixel data. */
391 NV_ENC_BUFFER_FORMAT_ARGB = 0x01000000, /**< 8 bit Packed A8R8G8B8. This is a word-ordered format
392 where a pixel is represented by a 32-bit word with B
393 in the lowest 8 bits, G in the next 8 bits, R in the
394 8 bits after that and A in the highest 8 bits. */
395 NV_ENC_BUFFER_FORMAT_ARGB10 = 0x02000000, /**< 10 bit Packed A2R10G10B10. This is a word-ordered format
396 where a pixel is represented by a 32-bit word with B
397 in the lowest 10 bits, G in the next 10 bits, R in the
398 10 bits after that and A in the highest 2 bits. */
399 NV_ENC_BUFFER_FORMAT_AYUV = 0x04000000, /**< 8 bit Packed A8Y8U8V8. This is a word-ordered format
400 where a pixel is represented by a 32-bit word with V
401 in the lowest 8 bits, U in the next 8 bits, Y in the
402 8 bits after that and A in the highest 8 bits. */
403 NV_ENC_BUFFER_FORMAT_ABGR = 0x10000000, /**< 8 bit Packed A8B8G8R8. This is a word-ordered format
404 where a pixel is represented by a 32-bit word with R
405 in the lowest 8 bits, G in the next 8 bits, B in the
406 8 bits after that and A in the highest 8 bits. */
407 NV_ENC_BUFFER_FORMAT_ABGR10 = 0x20000000, /**< 10 bit Packed A2B10G10R10. This is a word-ordered format
408 where a pixel is represented by a 32-bit word with R
409 in the lowest 10 bits, G in the next 10 bits, B in the
410 10 bits after that and A in the highest 2 bits. */
411 NV_ENC_BUFFER_FORMAT_U8 = 0x40000000, /**< Buffer format representing one-dimensional buffer.
412 This format should be used only when registering the
413 resource as output buffer, which will be used to write
414 the encoded bit stream or H.264 ME only mode output. */
415 NV_ENC_BUFFER_FORMAT_NV16 = 0x40000001, /**< Semi-Planar YUV 422 [Y plane followed by interleaved UV plane] */
416 NV_ENC_BUFFER_FORMAT_P210 = 0x40000002, /**< Semi-Planar 10-bit YUV 422 [Y plane followed by interleaved UV plane] */
417} NV_ENC_BUFFER_FORMAT;
418
419/**
420 * Encoding levels
421 */
422typedef enum _NV_ENC_LEVEL
423{
424 NV_ENC_LEVEL_AUTOSELECT = 0,
425
426 NV_ENC_LEVEL_H264_1 = 10,
427 NV_ENC_LEVEL_H264_1b = 9,
428 NV_ENC_LEVEL_H264_11 = 11,
429 NV_ENC_LEVEL_H264_12 = 12,
430 NV_ENC_LEVEL_H264_13 = 13,
431 NV_ENC_LEVEL_H264_2 = 20,
432 NV_ENC_LEVEL_H264_21 = 21,
433 NV_ENC_LEVEL_H264_22 = 22,
434 NV_ENC_LEVEL_H264_3 = 30,
435 NV_ENC_LEVEL_H264_31 = 31,
436 NV_ENC_LEVEL_H264_32 = 32,
437 NV_ENC_LEVEL_H264_4 = 40,
438 NV_ENC_LEVEL_H264_41 = 41,
439 NV_ENC_LEVEL_H264_42 = 42,
440 NV_ENC_LEVEL_H264_5 = 50,
441 NV_ENC_LEVEL_H264_51 = 51,
442 NV_ENC_LEVEL_H264_52 = 52,
443 NV_ENC_LEVEL_H264_60 = 60,
444 NV_ENC_LEVEL_H264_61 = 61,
445 NV_ENC_LEVEL_H264_62 = 62,
446
447 NV_ENC_LEVEL_HEVC_1 = 30,
448 NV_ENC_LEVEL_HEVC_2 = 60,
449 NV_ENC_LEVEL_HEVC_21 = 63,
450 NV_ENC_LEVEL_HEVC_3 = 90,
451 NV_ENC_LEVEL_HEVC_31 = 93,
452 NV_ENC_LEVEL_HEVC_4 = 120,
453 NV_ENC_LEVEL_HEVC_41 = 123,
454 NV_ENC_LEVEL_HEVC_5 = 150,
455 NV_ENC_LEVEL_HEVC_51 = 153,
456 NV_ENC_LEVEL_HEVC_52 = 156,
457 NV_ENC_LEVEL_HEVC_6 = 180,
458 NV_ENC_LEVEL_HEVC_61 = 183,
459 NV_ENC_LEVEL_HEVC_62 = 186,
460
461 NV_ENC_TIER_HEVC_MAIN = 0,
462 NV_ENC_TIER_HEVC_HIGH = 1,
463
464 NV_ENC_LEVEL_AV1_2 = 0,
465 NV_ENC_LEVEL_AV1_21 = 1,
466 NV_ENC_LEVEL_AV1_22 = 2,
467 NV_ENC_LEVEL_AV1_23 = 3,
468 NV_ENC_LEVEL_AV1_3 = 4,
469 NV_ENC_LEVEL_AV1_31 = 5,
470 NV_ENC_LEVEL_AV1_32 = 6,
471 NV_ENC_LEVEL_AV1_33 = 7,
472 NV_ENC_LEVEL_AV1_4 = 8,
473 NV_ENC_LEVEL_AV1_41 = 9,
474 NV_ENC_LEVEL_AV1_42 = 10,
475 NV_ENC_LEVEL_AV1_43 = 11,
476 NV_ENC_LEVEL_AV1_5 = 12,
477 NV_ENC_LEVEL_AV1_51 = 13,
478 NV_ENC_LEVEL_AV1_52 = 14,
479 NV_ENC_LEVEL_AV1_53 = 15,
480 NV_ENC_LEVEL_AV1_6 = 16,
481 NV_ENC_LEVEL_AV1_61 = 17,
482 NV_ENC_LEVEL_AV1_62 = 18,
483 NV_ENC_LEVEL_AV1_63 = 19,
484 NV_ENC_LEVEL_AV1_7 = 20,
485 NV_ENC_LEVEL_AV1_71 = 21,
486 NV_ENC_LEVEL_AV1_72 = 22,
487 NV_ENC_LEVEL_AV1_73 = 23,
488 NV_ENC_LEVEL_AV1_AUTOSELECT ,
489
490 NV_ENC_TIER_AV1_0 = 0,
491 NV_ENC_TIER_AV1_1 = 1
492} NV_ENC_LEVEL;
493
494/**
495 * Error Codes
496 */
497typedef enum _NVENCSTATUS
498{
499 /**
500 * This indicates that API call returned with no errors.
501 */
502 NV_ENC_SUCCESS,
503
504 /**
505 * This indicates that no encode capable devices were detected.
506 */
507 NV_ENC_ERR_NO_ENCODE_DEVICE,
508
509 /**
510 * This indicates that devices pass by the client is not supported.
511 */
512 NV_ENC_ERR_UNSUPPORTED_DEVICE,
513
514 /**
515 * This indicates that the encoder device supplied by the client is not
516 * valid.
517 */
518 NV_ENC_ERR_INVALID_ENCODERDEVICE,
519
520 /**
521 * This indicates that device passed to the API call is invalid.
522 */
523 NV_ENC_ERR_INVALID_DEVICE,
524
525 /**
526 * This indicates that device passed to the API call is no longer available and
527 * needs to be reinitialized. The clients need to destroy the current encoder
528 * session by freeing the allocated input output buffers and destroying the device
529 * and create a new encoding session.
530 */
531 NV_ENC_ERR_DEVICE_NOT_EXIST,
532
533 /**
534 * This indicates that one or more of the pointers passed to the API call
535 * is invalid.
536 */
537 NV_ENC_ERR_INVALID_PTR,
538
539 /**
540 * This indicates that completion event passed in ::NvEncEncodePicture() call
541 * is invalid.
542 */
543 NV_ENC_ERR_INVALID_EVENT,
544
545 /**
546 * This indicates that one or more of the parameter passed to the API call
547 * is invalid.
548 */
549 NV_ENC_ERR_INVALID_PARAM,
550
551 /**
552 * This indicates that an API call was made in wrong sequence/order.
553 */
554 NV_ENC_ERR_INVALID_CALL,
555
556 /**
557 * This indicates that the API call failed because it was unable to allocate
558 * enough memory to perform the requested operation.
559 */
560 NV_ENC_ERR_OUT_OF_MEMORY,
561
562 /**
563 * This indicates that the encoder has not been initialized with
564 * ::NvEncInitializeEncoder() or that initialization has failed.
565 * The client cannot allocate input or output buffers or do any encoding
566 * related operation before successfully initializing the encoder.
567 */
568 NV_ENC_ERR_ENCODER_NOT_INITIALIZED,
569
570 /**
571 * This indicates that an unsupported parameter was passed by the client.
572 */
573 NV_ENC_ERR_UNSUPPORTED_PARAM,
574
575 /**
576 * This indicates that the ::NvEncLockBitstream() failed to lock the output
577 * buffer. This happens when the client makes a non blocking lock call to
578 * access the output bitstream by passing NV_ENC_LOCK_BITSTREAM::doNotWait flag.
579 * This is not a fatal error and client should retry the same operation after
580 * few milliseconds.
581 */
582 NV_ENC_ERR_LOCK_BUSY,
583
584 /**
585 * This indicates that the size of the user buffer passed by the client is
586 * insufficient for the requested operation.
587 */
588 NV_ENC_ERR_NOT_ENOUGH_BUFFER,
589
590 /**
591 * This indicates that an invalid struct version was used by the client.
592 */
593 NV_ENC_ERR_INVALID_VERSION,
594
595 /**
596 * This indicates that ::NvEncMapInputResource() API failed to map the client
597 * provided input resource.
598 */
599 NV_ENC_ERR_MAP_FAILED,
600
601 /**
602 * This indicates encode driver requires more input buffers to produce an output
603 * bitstream. If this error is returned from ::NvEncEncodePicture() API, this
604 * is not a fatal error. If the client is encoding with B frames then,
605 * ::NvEncEncodePicture() API might be buffering the input frame for re-ordering.
606 *
607 * A client operating in synchronous mode cannot call ::NvEncLockBitstream()
608 * API on the output bitstream buffer if ::NvEncEncodePicture() returned the
609 * ::NV_ENC_ERR_NEED_MORE_INPUT error code.
610 * The client must continue providing input frames until encode driver returns
611 * ::NV_ENC_SUCCESS. After receiving ::NV_ENC_SUCCESS status the client can call
612 * ::NvEncLockBitstream() API on the output buffers in the same order in which
613 * it has called ::NvEncEncodePicture().
614 */
615 NV_ENC_ERR_NEED_MORE_INPUT,
616
617 /**
618 * This indicates that the HW encoder is busy encoding and is unable to encode
619 * the input. The client should call ::NvEncEncodePicture() again after few
620 * milliseconds.
621 */
622 NV_ENC_ERR_ENCODER_BUSY,
623
624 /**
625 * This indicates that the completion event passed in ::NvEncEncodePicture()
626 * API has not been registered with encoder driver using ::NvEncRegisterAsyncEvent().
627 */
628 NV_ENC_ERR_EVENT_NOT_REGISTERD,
629
630 /**
631 * This indicates that an unknown internal error has occurred.
632 */
633 NV_ENC_ERR_GENERIC,
634
635 /**
636 * This indicates that the client is attempting to use a feature
637 * that is not available for the license type for the current system.
638 */
639 NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY,
640
641 /**
642 * This indicates that the client is attempting to use a feature
643 * that is not implemented for the current version.
644 */
645 NV_ENC_ERR_UNIMPLEMENTED,
646
647 /**
648 * This indicates that the ::NvEncRegisterResource API failed to register the resource.
649 */
650 NV_ENC_ERR_RESOURCE_REGISTER_FAILED,
651
652 /**
653 * This indicates that the client is attempting to unregister a resource
654 * that has not been successfully registered.
655 */
656 NV_ENC_ERR_RESOURCE_NOT_REGISTERED,
657
658 /**
659 * This indicates that the client is attempting to unmap a resource
660 * that has not been successfully mapped.
661 */
662 NV_ENC_ERR_RESOURCE_NOT_MAPPED,
663
664 /**
665 * This indicates encode driver requires more output buffers to write an output
666 * bitstream. If this error is returned from ::NvEncRestoreEncoderState() API, this
667 * is not a fatal error. If the client is encoding with B frames then,
668 * ::NvEncRestoreEncoderState() API might be requiring the extra output buffer for accomodating overlay frame output in a separate buffer, for AV1 codec.
669 * In this case, client must call NvEncRestoreEncoderState() API again with NV_ENC_RESTORE_ENCODER_STATE_PARAMS::outputBitstream as input along with
670 * the parameters in the previous call. When operating in asynchronous mode of encoding, client must also specify NV_ENC_RESTORE_ENCODER_STATE_PARAMS::completionEvent.
671 */
672 NV_ENC_ERR_NEED_MORE_OUTPUT,
673
674} NVENCSTATUS;
675
676/**
677 * Encode Picture encode flags.
678 */
679typedef enum _NV_ENC_PIC_FLAGS
680{
681 NV_ENC_PIC_FLAG_FORCEINTRA = 0x1, /**< Encode the current picture as an Intra picture */
682 NV_ENC_PIC_FLAG_FORCEIDR = 0x2, /**< Encode the current picture as an IDR picture.
683 This flag is only valid when Picture type decision is taken by the Encoder
684 [_NV_ENC_INITIALIZE_PARAMS::enablePTD == 1]. */
685 NV_ENC_PIC_FLAG_OUTPUT_SPSPPS = 0x4, /**< Write the sequence and picture header in encoded bitstream of the current picture */
686 NV_ENC_PIC_FLAG_EOS = 0x8, /**< Indicates end of the input stream */
687 NV_ENC_PIC_FLAG_DISABLE_ENC_STATE_ADVANCE = 0x10, /**< Do not advance encoder state during encode */
688 NV_ENC_PIC_FLAG_OUTPUT_RECON_FRAME = 0x20, /**< Write reconstructed frame */
689} NV_ENC_PIC_FLAGS;
690
691/**
692 * Memory heap to allocate input and output buffers.
693 */
694typedef enum _NV_ENC_MEMORY_HEAP
695{
696 NV_ENC_MEMORY_HEAP_AUTOSELECT = 0, /**< Memory heap to be decided by the encoder driver based on the usage */
697 NV_ENC_MEMORY_HEAP_VID = 1, /**< Memory heap is in local video memory */
698 NV_ENC_MEMORY_HEAP_SYSMEM_CACHED = 2, /**< Memory heap is in cached system memory */
699 NV_ENC_MEMORY_HEAP_SYSMEM_UNCACHED = 3 /**< Memory heap is in uncached system memory */
700} NV_ENC_MEMORY_HEAP;
701
702/**
703 * B-frame used as reference modes
704 */
705typedef enum _NV_ENC_BFRAME_REF_MODE
706{
707 NV_ENC_BFRAME_REF_MODE_DISABLED = 0x0, /**< B frame is not used for reference */
708 NV_ENC_BFRAME_REF_MODE_EACH = 0x1, /**< Each B-frame will be used for reference */
709 NV_ENC_BFRAME_REF_MODE_MIDDLE = 0x2, /**< Only(Number of B-frame)/2 th B-frame will be used for reference */
710} NV_ENC_BFRAME_REF_MODE;
711
712/**
713 * H.264 entropy coding modes.
714 */
715typedef enum _NV_ENC_H264_ENTROPY_CODING_MODE
716{
717 NV_ENC_H264_ENTROPY_CODING_MODE_AUTOSELECT = 0x0, /**< Entropy coding mode is auto selected by the encoder driver */
718 NV_ENC_H264_ENTROPY_CODING_MODE_CABAC = 0x1, /**< Entropy coding mode is CABAC */
719 NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC = 0x2 /**< Entropy coding mode is CAVLC */
720} NV_ENC_H264_ENTROPY_CODING_MODE;
721
722/**
723 * H.264 specific BDirect modes
724 */
725typedef enum _NV_ENC_H264_BDIRECT_MODE
726{
727 NV_ENC_H264_BDIRECT_MODE_AUTOSELECT = 0x0, /**< BDirect mode is auto selected by the encoder driver */
728 NV_ENC_H264_BDIRECT_MODE_DISABLE = 0x1, /**< Disable BDirect mode */
729 NV_ENC_H264_BDIRECT_MODE_TEMPORAL = 0x2, /**< Temporal BDirect mode */
730 NV_ENC_H264_BDIRECT_MODE_SPATIAL = 0x3 /**< Spatial BDirect mode */
731} NV_ENC_H264_BDIRECT_MODE;
732
733/**
734 * H.264 specific FMO usage
735 */
736typedef enum _NV_ENC_H264_FMO_MODE
737{
738 NV_ENC_H264_FMO_AUTOSELECT = 0x0, /**< FMO usage is auto selected by the encoder driver */
739 NV_ENC_H264_FMO_ENABLE = 0x1, /**< Enable FMO */
740 NV_ENC_H264_FMO_DISABLE = 0x2, /**< Disable FMO */
741} NV_ENC_H264_FMO_MODE;
742
743/**
744 * H.264 specific Adaptive Transform modes
745 */
746typedef enum _NV_ENC_H264_ADAPTIVE_TRANSFORM_MODE
747{
748 NV_ENC_H264_ADAPTIVE_TRANSFORM_AUTOSELECT = 0x0, /**< Adaptive Transform 8x8 mode is auto selected by the encoder driver*/
749 NV_ENC_H264_ADAPTIVE_TRANSFORM_DISABLE = 0x1, /**< Adaptive Transform 8x8 mode disabled */
750 NV_ENC_H264_ADAPTIVE_TRANSFORM_ENABLE = 0x2, /**< Adaptive Transform 8x8 mode should be used */
751} NV_ENC_H264_ADAPTIVE_TRANSFORM_MODE;
752
753/**
754 * Stereo frame packing modes.
755 */
756typedef enum _NV_ENC_STEREO_PACKING_MODE
757{
758 NV_ENC_STEREO_PACKING_MODE_NONE = 0x0, /**< No Stereo packing required */
759 NV_ENC_STEREO_PACKING_MODE_CHECKERBOARD = 0x1, /**< Checkerboard mode for packing stereo frames */
760 NV_ENC_STEREO_PACKING_MODE_COLINTERLEAVE = 0x2, /**< Column Interleave mode for packing stereo frames */
761 NV_ENC_STEREO_PACKING_MODE_ROWINTERLEAVE = 0x3, /**< Row Interleave mode for packing stereo frames */
762 NV_ENC_STEREO_PACKING_MODE_SIDEBYSIDE = 0x4, /**< Side-by-side mode for packing stereo frames */
763 NV_ENC_STEREO_PACKING_MODE_TOPBOTTOM = 0x5, /**< Top-Bottom mode for packing stereo frames */
764 NV_ENC_STEREO_PACKING_MODE_FRAMESEQ = 0x6 /**< Frame Sequential mode for packing stereo frames */
765} NV_ENC_STEREO_PACKING_MODE;
766
767/**
768 * Input Resource type
769 */
770typedef enum _NV_ENC_INPUT_RESOURCE_TYPE
771{
772 NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX = 0x0, /**< input resource type is a directx9 surface*/
773 NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR = 0x1, /**< input resource type is a cuda device pointer surface*/
774 NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY = 0x2, /**< input resource type is a cuda array surface.
775 This array must be a 2D array and the CUDA_ARRAY3D_SURFACE_LDST
776 flag must have been specified when creating it. */
777 NV_ENC_INPUT_RESOURCE_TYPE_OPENGL_TEX = 0x3 /**< input resource type is an OpenGL texture */
778} NV_ENC_INPUT_RESOURCE_TYPE;
779
780/**
781 * Buffer usage
782 */
783typedef enum _NV_ENC_BUFFER_USAGE
784{
785 NV_ENC_INPUT_IMAGE = 0x0, /**< Registered surface will be used for input image */
786 NV_ENC_OUTPUT_MOTION_VECTOR = 0x1, /**< Registered surface will be used for output of H.264 ME only mode.
787 This buffer usage type is not supported for HEVC ME only mode. */
788 NV_ENC_OUTPUT_BITSTREAM = 0x2, /**< Registered surface will be used for output bitstream in encoding */
789 NV_ENC_OUTPUT_RECON = 0x4, /**< Registered surface will be used for output reconstructed frame in encoding */
790} NV_ENC_BUFFER_USAGE;
791
792/**
793 * Encoder Device type
794 */
795typedef enum _NV_ENC_DEVICE_TYPE
796{
797 NV_ENC_DEVICE_TYPE_DIRECTX = 0x0, /**< encode device type is a directx9 device */
798 NV_ENC_DEVICE_TYPE_CUDA = 0x1, /**< encode device type is a cuda device */
799 NV_ENC_DEVICE_TYPE_OPENGL = 0x2 /**< encode device type is an OpenGL device.
800 Use of this device type is supported only on Linux */
801} NV_ENC_DEVICE_TYPE;
802
803/**
804 * Number of reference frames
805 */
806typedef enum _NV_ENC_NUM_REF_FRAMES
807{
808 NV_ENC_NUM_REF_FRAMES_AUTOSELECT = 0x0, /**< Number of reference frames is auto selected by the encoder driver */
809 NV_ENC_NUM_REF_FRAMES_1 = 0x1, /**< Number of reference frames equal to 1 */
810 NV_ENC_NUM_REF_FRAMES_2 = 0x2, /**< Number of reference frames equal to 2 */
811 NV_ENC_NUM_REF_FRAMES_3 = 0x3, /**< Number of reference frames equal to 3 */
812 NV_ENC_NUM_REF_FRAMES_4 = 0x4, /**< Number of reference frames equal to 4 */
813 NV_ENC_NUM_REF_FRAMES_5 = 0x5, /**< Number of reference frames equal to 5 */
814 NV_ENC_NUM_REF_FRAMES_6 = 0x6, /**< Number of reference frames equal to 6 */
815 NV_ENC_NUM_REF_FRAMES_7 = 0x7 /**< Number of reference frames equal to 7 */
816} NV_ENC_NUM_REF_FRAMES;
817
818/**
819* Enum for Temporal filtering level.
820*/
821typedef enum _NV_ENC_TEMPORAL_FILTER_LEVEL
822{
823 NV_ENC_TEMPORAL_FILTER_LEVEL_0 = 0,
824 NV_ENC_TEMPORAL_FILTER_LEVEL_4 = 4,
825}NV_ENC_TEMPORAL_FILTER_LEVEL;
826/**
827 * Encoder capabilities enumeration.
828 */
829typedef enum _NV_ENC_CAPS
830{
831 /**
832 * Maximum number of B-Frames supported.
833 */
834 NV_ENC_CAPS_NUM_MAX_BFRAMES,
835
836 /**
837 * Rate control modes supported.
838 * \n The API return value is a bitmask of the values in NV_ENC_PARAMS_RC_MODE.
839 */
840 NV_ENC_CAPS_SUPPORTED_RATECONTROL_MODES,
841
842 /**
843 * Indicates HW support for field mode encoding.
844 * \n 0 : Interlaced mode encoding is not supported.
845 * \n 1 : Interlaced field mode encoding is supported.
846 * \n 2 : Interlaced frame encoding and field mode encoding are both supported.
847 */
848 NV_ENC_CAPS_SUPPORT_FIELD_ENCODING,
849
850 /**
851 * Indicates HW support for monochrome mode encoding.
852 * \n 0 : Monochrome mode not supported.
853 * \n 1 : Monochrome mode supported.
854 */
855 NV_ENC_CAPS_SUPPORT_MONOCHROME,
856
857 /**
858 * Indicates HW support for FMO.
859 * \n 0 : FMO not supported.
860 * \n 1 : FMO supported.
861 */
862 NV_ENC_CAPS_SUPPORT_FMO,
863
864 /**
865 * Indicates HW capability for Quarter pel motion estimation.
866 * \n 0 : Quarter-Pel Motion Estimation not supported.
867 * \n 1 : Quarter-Pel Motion Estimation supported.
868 */
869 NV_ENC_CAPS_SUPPORT_QPELMV,
870
871 /**
872 * H.264 specific. Indicates HW support for BDirect modes.
873 * \n 0 : BDirect mode encoding not supported.
874 * \n 1 : BDirect mode encoding supported.
875 */
876 NV_ENC_CAPS_SUPPORT_BDIRECT_MODE,
877
878 /**
879 * H264 specific. Indicates HW support for CABAC entropy coding mode.
880 * \n 0 : CABAC entropy coding not supported.
881 * \n 1 : CABAC entropy coding supported.
882 */
883 NV_ENC_CAPS_SUPPORT_CABAC,
884
885 /**
886 * Indicates HW support for Adaptive Transform.
887 * \n 0 : Adaptive Transform not supported.
888 * \n 1 : Adaptive Transform supported.
889 */
890 NV_ENC_CAPS_SUPPORT_ADAPTIVE_TRANSFORM,
891
892 /**
893 * Indicates HW support for Multi View Coding.
894 * \n 0 : Multi View Coding not supported.
895 * \n 1 : Multi View Coding supported.
896 */
897 NV_ENC_CAPS_SUPPORT_STEREO_MVC,
898
899 /**
900 * Indicates HW support for encoding Temporal layers.
901 * \n 0 : Encoding Temporal layers not supported.
902 * \n 1 : Encoding Temporal layers supported.
903 */
904 NV_ENC_CAPS_NUM_MAX_TEMPORAL_LAYERS,
905
906 /**
907 * Indicates HW support for Hierarchical P frames.
908 * \n 0 : Hierarchical P frames not supported.
909 * \n 1 : Hierarchical P frames supported.
910 */
911 NV_ENC_CAPS_SUPPORT_HIERARCHICAL_PFRAMES,
912
913 /**
914 * Indicates HW support for Hierarchical B frames.
915 * \n 0 : Hierarchical B frames not supported.
916 * \n 1 : Hierarchical B frames supported.
917 */
918 NV_ENC_CAPS_SUPPORT_HIERARCHICAL_BFRAMES,
919
920 /**
921 * Maximum Encoding level supported (See ::NV_ENC_LEVEL for details).
922 */
923 NV_ENC_CAPS_LEVEL_MAX,
924
925 /**
926 * Minimum Encoding level supported (See ::NV_ENC_LEVEL for details).
927 */
928 NV_ENC_CAPS_LEVEL_MIN,
929
930 /**
931 * Indicates HW support for separate colour plane encoding.
932 * \n 0 : Separate colour plane encoding not supported.
933 * \n 1 : Separate colour plane encoding supported.
934 */
935 NV_ENC_CAPS_SEPARATE_COLOUR_PLANE,
936
937 /**
938 * Maximum output width supported.
939 */
940 NV_ENC_CAPS_WIDTH_MAX,
941
942 /**
943 * Maximum output height supported.
944 */
945 NV_ENC_CAPS_HEIGHT_MAX,
946
947 /**
948 * Indicates Temporal Scalability Support.
949 * \n 0 : Temporal SVC encoding not supported.
950 * \n 1 : Temporal SVC encoding supported.
951 */
952 NV_ENC_CAPS_SUPPORT_TEMPORAL_SVC,
953
954 /**
955 * Indicates Dynamic Encode Resolution Change Support.
956 * Support added from NvEncodeAPI version 2.0.
957 * \n 0 : Dynamic Encode Resolution Change not supported.
958 * \n 1 : Dynamic Encode Resolution Change supported.
959 */
960 NV_ENC_CAPS_SUPPORT_DYN_RES_CHANGE,
961
962 /**
963 * Indicates Dynamic Encode Bitrate Change Support.
964 * Support added from NvEncodeAPI version 2.0.
965 * \n 0 : Dynamic Encode bitrate change not supported.
966 * \n 1 : Dynamic Encode bitrate change supported.
967 */
968 NV_ENC_CAPS_SUPPORT_DYN_BITRATE_CHANGE,
969
970 /**
971 * Indicates Forcing Constant QP On The Fly Support.
972 * Support added from NvEncodeAPI version 2.0.
973 * \n 0 : Forcing constant QP on the fly not supported.
974 * \n 1 : Forcing constant QP on the fly supported.
975 */
976 NV_ENC_CAPS_SUPPORT_DYN_FORCE_CONSTQP,
977
978 /**
979 * Indicates Dynamic rate control mode Change Support.
980 * \n 0 : Dynamic rate control mode change not supported.
981 * \n 1 : Dynamic rate control mode change supported.
982 */
983 NV_ENC_CAPS_SUPPORT_DYN_RCMODE_CHANGE,
984
985 /**
986 * Indicates Subframe readback support for slice-based encoding. If this feature is supported, it can be enabled by setting enableSubFrameWrite = 1.
987 * \n 0 : Subframe readback not supported.
988 * \n 1 : Subframe readback supported.
989 */
990 NV_ENC_CAPS_SUPPORT_SUBFRAME_READBACK,
991
992 /**
993 * Indicates Constrained Encoding mode support.
994 * Support added from NvEncodeAPI version 2.0.
995 * \n 0 : Constrained encoding mode not supported.
996 * \n 1 : Constrained encoding mode supported.
997 * If this mode is supported client can enable this during initialization.
998 * Client can then force a picture to be coded as constrained picture where
999 * in-loop filtering is disabled across slice boundaries and prediction vectors for inter
1000 * macroblocks in each slice will be restricted to the slice region.
1001 */
1002 NV_ENC_CAPS_SUPPORT_CONSTRAINED_ENCODING,
1003
1004 /**
1005 * Indicates Intra Refresh Mode Support.
1006 * Support added from NvEncodeAPI version 2.0.
1007 * \n 0 : Intra Refresh Mode not supported.
1008 * \n 1 : Intra Refresh Mode supported.
1009 */
1010 NV_ENC_CAPS_SUPPORT_INTRA_REFRESH,
1011
1012 /**
1013 * Indicates Custom VBV Buffer Size support. It can be used for capping frame size.
1014 * Support added from NvEncodeAPI version 2.0.
1015 * \n 0 : Custom VBV buffer size specification from client, not supported.
1016 * \n 1 : Custom VBV buffer size specification from client, supported.
1017 */
1018 NV_ENC_CAPS_SUPPORT_CUSTOM_VBV_BUF_SIZE,
1019
1020 /**
1021 * Indicates Dynamic Slice Mode Support.
1022 * Support added from NvEncodeAPI version 2.0.
1023 * \n 0 : Dynamic Slice Mode not supported.
1024 * \n 1 : Dynamic Slice Mode supported.
1025 */
1026 NV_ENC_CAPS_SUPPORT_DYNAMIC_SLICE_MODE,
1027
1028 /**
1029 * Indicates Reference Picture Invalidation Support.
1030 * Support added from NvEncodeAPI version 2.0.
1031 * \n 0 : Reference Picture Invalidation not supported.
1032 * \n 1 : Reference Picture Invalidation supported.
1033 */
1034 NV_ENC_CAPS_SUPPORT_REF_PIC_INVALIDATION,
1035
1036 /**
1037 * Indicates support for Pre-Processing.
1038 * The API return value is a bitmask of the values defined in ::NV_ENC_PREPROC_FLAGS
1039 */
1040 NV_ENC_CAPS_PREPROC_SUPPORT,
1041
1042 /**
1043 * Indicates support Async mode.
1044 * \n 0 : Async Encode mode not supported.
1045 * \n 1 : Async Encode mode supported.
1046 */
1047 NV_ENC_CAPS_ASYNC_ENCODE_SUPPORT,
1048
1049 /**
1050 * Maximum MBs per frame supported.
1051 */
1052 NV_ENC_CAPS_MB_NUM_MAX,
1053
1054 /**
1055 * Maximum aggregate throughput in MBs per sec.
1056 */
1057 NV_ENC_CAPS_MB_PER_SEC_MAX,
1058
1059 /**
1060 * Indicates HW support for YUV444 mode encoding.
1061 * \n 0 : YUV444 mode encoding not supported.
1062 * \n 1 : YUV444 mode encoding supported.
1063 */
1064 NV_ENC_CAPS_SUPPORT_YUV444_ENCODE,
1065
1066 /**
1067 * Indicates HW support for lossless encoding.
1068 * \n 0 : lossless encoding not supported.
1069 * \n 1 : lossless encoding supported.
1070 */
1071 NV_ENC_CAPS_SUPPORT_LOSSLESS_ENCODE,
1072
1073 /**
1074 * Indicates HW support for Sample Adaptive Offset.
1075 * \n 0 : SAO not supported.
1076 * \n 1 : SAO encoding supported.
1077 */
1078 NV_ENC_CAPS_SUPPORT_SAO,
1079
1080 /**
1081 * Indicates HW support for Motion Estimation Only Mode.
1082 * \n 0 : MEOnly Mode not supported.
1083 * \n 1 : MEOnly Mode supported for I and P frames.
1084 * \n 2 : MEOnly Mode supported for I, P and B frames.
1085 */
1086 NV_ENC_CAPS_SUPPORT_MEONLY_MODE,
1087
1088 /**
1089 * Indicates HW support for lookahead encoding (enableLookahead=1).
1090 * \n 0 : Lookahead not supported.
1091 * \n 1 : Lookahead supported.
1092 */
1093 NV_ENC_CAPS_SUPPORT_LOOKAHEAD,
1094
1095 /**
1096 * Indicates HW support for temporal AQ encoding (enableTemporalAQ=1).
1097 * \n 0 : Temporal AQ not supported.
1098 * \n 1 : Temporal AQ supported.
1099 */
1100 NV_ENC_CAPS_SUPPORT_TEMPORAL_AQ,
1101 /**
1102 * Indicates HW support for 10 bit encoding.
1103 * \n 0 : 10 bit encoding not supported.
1104 * \n 1 : 10 bit encoding supported.
1105 */
1106 NV_ENC_CAPS_SUPPORT_10BIT_ENCODE,
1107 /**
1108 * Maximum number of Long Term Reference frames supported
1109 */
1110 NV_ENC_CAPS_NUM_MAX_LTR_FRAMES,
1111
1112 /**
1113 * Indicates HW support for Weighted Prediction.
1114 * \n 0 : Weighted Prediction not supported.
1115 * \n 1 : Weighted Prediction supported.
1116 */
1117 NV_ENC_CAPS_SUPPORT_WEIGHTED_PREDICTION,
1118
1119
1120 /**
1121 * On managed (vGPU) platforms (Windows only), this API, in conjunction with other GRID Management APIs, can be used
1122 * to estimate the residual capacity of the hardware encoder on the GPU as a percentage of the total available encoder capacity.
1123 * This API can be called at any time; i.e. during the encode session or before opening the encode session.
1124 * If the available encoder capacity is returned as zero, applications may choose to switch to software encoding
1125 * and continue to call this API (e.g. polling once per second) until capacity becomes available.
1126 *
1127 * On bare metal (non-virtualized GPU) and linux platforms, this API always returns 100.
1128 */
1129 NV_ENC_CAPS_DYNAMIC_QUERY_ENCODER_CAPACITY,
1130
1131 /**
1132 * Indicates B as reference support.
1133 * \n 0 : B as reference is not supported.
1134 * \n 1 : each B-Frame as reference is supported.
1135 * \n 2 : only Middle B-frame as reference is supported.
1136 */
1137 NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE,
1138
1139 /**
1140 * Indicates HW support for Emphasis Level Map based delta QP computation.
1141 * \n 0 : Emphasis Level Map based delta QP not supported.
1142 * \n 1 : Emphasis Level Map based delta QP is supported.
1143 */
1144 NV_ENC_CAPS_SUPPORT_EMPHASIS_LEVEL_MAP,
1145
1146 /**
1147 * Minimum input width supported.
1148 */
1149 NV_ENC_CAPS_WIDTH_MIN,
1150
1151 /**
1152 * Minimum input height supported.
1153 */
1154 NV_ENC_CAPS_HEIGHT_MIN,
1155
1156 /**
1157 * Indicates HW support for multiple reference frames.
1158 */
1159 NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES,
1160
1161 /**
1162 * Indicates HW support for HEVC with alpha encoding.
1163 * \n 0 : HEVC with alpha encoding not supported.
1164 * \n 1 : HEVC with alpha encoding is supported.
1165 */
1166 NV_ENC_CAPS_SUPPORT_ALPHA_LAYER_ENCODING,
1167
1168 /**
1169 * Indicates number of Encoding engines present on GPU.
1170 */
1171 NV_ENC_CAPS_NUM_ENCODER_ENGINES,
1172
1173 /**
1174 * Indicates single slice intra refresh support.
1175 */
1176 NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH,
1177
1178 /**
1179 * Indicates encoding without advancing the state support.
1180 */
1181 NV_ENC_CAPS_DISABLE_ENC_STATE_ADVANCE,
1182
1183 /**
1184 * Indicates reconstructed output support.
1185 */
1186 NV_ENC_CAPS_OUTPUT_RECON_SURFACE,
1187
1188 /**
1189 * Indicates encoded frame output stats support for every block. Block represents a CTB for HEVC, macroblock for H.264 and super block for AV1.
1190 */
1191 NV_ENC_CAPS_OUTPUT_BLOCK_STATS,
1192
1193 /**
1194 * Indicates encoded frame output stats support for every row. Row represents a CTB row for HEVC, macroblock row for H.264 and super block row for AV1.
1195 */
1196 NV_ENC_CAPS_OUTPUT_ROW_STATS,
1197
1198
1199 /**
1200 * Indicates temporal filtering support.
