libxcoder  5.2.0
ni_device_api.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * Copyright (C) 2022 NETINT Technologies
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18  * SOFTWARE.
19  *
20  ******************************************************************************/
21 
22 /*!*****************************************************************************
23  * \file ni_device_api.h
24  *
25  * \brief Public definitions for operating NETINT video processing devices for
26  * video processing
27  ******************************************************************************/
28 
29 #pragma once
30 
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 #include "ni_defs.h"
38 #include "ni_rsrc_api.h"
39 
40 // resource allocation strategy names
41 #define NI_BEST_MODEL_LOAD_STR "bestmodelload"
42 #define NI_BEST_REAL_LOAD_STR "bestload"
43 
44 #define NI_DATA_FORMAT_VIDEO_PACKET 0
45 #define NI_DATA_FORMAT_YUV_FRAME 1
46 #define NI_DATA_FORMAT_Y_FRAME 2
47 #define NI_DATA_FORMAT_CB_FRAME 3
48 #define NI_DATA_FORMAT_CR_FRAME 4
49 
50 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
51 // If you change this,you should also change NI_QUADRA_NOPTS_VALUE in ni_quadra_filter_api.h
52 #define NI_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
53 
54 // the following are the default values from FFmpeg
55 #define AV_CODEC_DEFAULT_BITRATE 200 * 1000
56 
57 #define NI_MAX_GOP_NUM 8
58 
59 #define NI_MAX_REF_PIC 4
60 
62 #define NI_MAX_VUI_SIZE NI_DEPRECATED_MACRO 32
63 
64 #define NI_MAX_TX_RETRIES 1000
65 
66 #define NI_MAX_ENCODER_QUERY_RETRIES 5000
67 
68 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
69 // If you change this,you should also change NI_QUADRA_MAX_SUPPORT_DRAWBOX_NUM, NI_MAX_SUPPORT_WATERMARK_NUM
70 // in ni_quadra_filter_api.h
71 #define NI_MAX_SUPPORT_DRAWBOX_NUM 5
72 #define NI_MAX_SUPPORT_WATERMARK_NUM 6
73 
74 // Number of pixels for main stream resolutions
75 #define NI_NUM_OF_PIXELS_360P (640*360)
76 #define NI_NUM_OF_PIXELS_720P (1280*720)
77 #define NI_NUM_OF_PIXELS_1080P (1920*1080)
78 #define NI_NUM_OF_PIXELS_1440P (2560*1440)
79 #define NI_NUM_OF_PIXELS_4K (3840*2160)
80 #define NI_NUM_OF_PIXELS_4K_2 (4096*2160)
81 #define NI_NUM_OF_PIXELS_8K (7680*4320)
82 
83 #define NI_MIN_RESOLUTION_WIDTH_JPEG 48
84 #define NI_MIN_RESOLUTION_HEIGHT_JPEG 48
85 
86 #define NI_MIN_RESOLUTION_WIDTH 144
87 #define NI_MIN_RESOLUTION_HEIGHT 144
88 #define NI_ENC_MIN_RESOLUTION_WIDTH 144
89 #define NI_ENC_MIN_RESOLUTION_HEIGHT 128
90 
91 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
92 // If you change this,you should also change NI_MIN_RESOLUTION_WIDTH_SCALER,
93 // NI_MIN_RESOLUTION_HEIGHT_SCALER in ni_quadra_filter_api.h
94 #define NI_MIN_RESOLUTION_WIDTH_SCALER 16
95 #define NI_MIN_RESOLUTION_HEIGHT_SCALER 16
96 
97 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
98 // If you change this,you should also change NI_QUADRA_MAX_RESOLUTION_WIDTH,
99 // NI_QUADRA_MAX_RESOLUTION_HEIGHT in ni_quadra_filter_api.h
100 #define NI_MAX_RESOLUTION_WIDTH 8192
101 #define NI_MAX_RESOLUTION_HEIGHT 8192
102 #define NI_MAX_RESOLUTION_AREA 8192*8192
103 #define NI_MAX_RESOLUTION_RGBA_WIDTH 7040
104 #define NI_MAX_RESOLUTION_RGBA_HEIGHT 7040
105 
106 #define NI_MAX_RESOLUTION_LINESIZE (NI_MAX_RESOLUTION_WIDTH*2)
107 
108 #define NI_FRAME_LITTLE_ENDIAN 0
109 #define NI_FRAME_BIG_ENDIAN 1
110 
111 #define NI_INVALID_SESSION_ID 0xFFFF
112 
113 #define NI_MAX_BITRATE 1000000000
114 #define NI_MIN_BITRATE 10000
115 
116 #define NI_MAX_FRAMERATE 65535
117 #define NI_MAX_ASPECTRATIO 65535
118 
119 /*Values below used for VPU resolution range checking*/
120 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
121 // If you change this,you should also change NI_QUADRA_MAX_WIDTH, NI_QUADRA_MIN_WIDTH,
122 // NI_QUADRA_MAX_HEIGHT, NI_QUADRA_MIN_HEIGHT in ni_quadra_filter_api.h
123 #define NI_MAX_WIDTH 8192
124 #define NI_MIN_WIDTH 144
125 #define NI_MAX_HEIGHT 8192
126 #define NI_MIN_HEIGHT 128
127 
128 #define NI_2PASS_ENCODE_MIN_WIDTH ((272 + 31) / 32 * 32)
129 #define NI_2PASS_ENCODE_MIN_HEIGHT 256
130 
131 #define NI_MULTICORE_ENCODE_MIN_WIDTH 256
132 #define NI_MULTICORE_ENCODE_MIN_HEIGHT 256
133 
134 /*Values below used for parameter resolution range checking*/
135 #define NI_PARAM_MAX_WIDTH 8192
136 #define NI_PARAM_MIN_WIDTH 32
137 #define NI_PARAM_MAX_HEIGHT 8192
138 #define NI_PARAM_MIN_HEIGHT 32
139 
140 #define NI_PARAM_JPEG_MIN_WIDTH 48
141 #define NI_PARAM_JPEG_MIN_HEIGHT 48
142 
143 #define NI_PARAM_AV1_MIN_WIDTH 144
144 #define NI_PARAM_AV1_MIN_HEIGHT 128
145 #define NI_PARAM_AV1_MAX_WIDTH 4096
146 #define NI_PARAM_AV1_MAX_HEIGHT 4352
147 #define NI_PARAM_AV1_MAX_AREA (4096 * 2304)
148 #define NI_PARAM_AV1_ALIGN_WIDTH_HEIGHT 8
149 
150 #define NI_MAX_GOP_SIZE 8
151 #define NI_MIN_GOP_SIZE 1
152 #define NI_MAX_GOP_PRESET_IDX 15
153 #define NI_MIN_GOP_PRESET_IDX -1
154 #define NI_MAX_DECODING_REFRESH_TYPE 2
155 #define NI_MIN_DECODING_REFRESH_TYPE 0
156 #define NI_MAX_CU_SIZE_MODE 2
157 #define NI_MIN_CU_SIZE_MODE 0
158 #define NI_DEFAULT_CU_SIZE_MODE 7
159 #define NI_MAX_DYNAMIC_MERGE 1
160 #define NI_MIN_DYNAMIC_MERGE 0
161 #define NI_MAX_USE_RECOMMENDED_ENC_PARAMS 3
162 #define NI_MIN_USE_RECOMMENDED_ENC_PARAMS 0
163 #define NI_MAX_MAX_NUM_MERGE 3
164 #define NI_MIN_MAX_NUM_MERGE 0
165 #define NI_MAX_INTRA_QP 51
166 #define NI_MIN_INTRA_QP -1
167 #define NI_MAX_INTRA_QP_DELTA 51
168 #define NI_MIN_INTRA_QP_DELTA -51
169 #define NI_DEFAULT_INTRA_QP 22
170 #define NI_INTRA_QP_RANGE 25
171 #define NI_MIN_QP_DELTA (-25)
172 #define NI_MAX_QP_DELTA 25
173 #define NI_MAX_QP_INFO 63
174 #define NI_MAX_BIN 1
175 #define NI_MIN_BIN 0
176 #define NI_MAX_NUM_SESSIONS 32
177 #define NI_MIN_FRAME_SIZE 0
178 #define NI_MAX_FRAME_SIZE (7680*4320*3)
179 #define NI_AV1_INVALID_BUFFER_INDEX (-1)
180 
181 #define RC_SUCCESS true
182 #define RC_ERROR false
183 
184 #define MAX_CHAR_IN_DEVICE_NAME 32
185 
186 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
187 // If you change this,you should also change MAX_QUADRA_NUM_FRAMEPOOL_HWAVFRAME in ni_quadra_filter_api.h
188 #define MAX_NUM_FRAMEPOOL_HWAVFRAME 128
189 
190 /* These constants are the values used by the GC620 2D engine */
191 #define GC620_NV12 0x104
192 #define GC620_NV21 0x105
193 #define GC620_I420 0x103
194 #define GC620_P010_MSB 0x108
195 #define GC620_I010 0x10A
196 #define GC620_YUYV 0x100
197 #define GC620_UYVY 0x101
198 #define GC620_NV16 0x106
199 #define GC620_RGBA8888 0
200 #define GC620_BGRA8888 4
201 #define GC620_BGRX8888 5
202 #define GC620_ABGR8888 12
203 #define GC620_ARGB8888 15
204 #define GC620_RGB565 3
205 #define GC620_BGR565 11
206 #define GC620_B5G5R5X1 8
207 #define GC620_RGB888_PLANAR 0x10C
208 
209 #define NI_ENABLE_AUD_FOR_GLOBAL_HEADER 2
210 
211 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
212 // If you change this,you should also change NI_QUADRA_MAX_FIFO_CAPACITY in ni_quadra_filter_api.h
213 #define NI_MAX_FIFO_CAPACITY 120
214 
215 /* These are Namespace and QOS configuration related */
216 #define NI_NAMESPACE_MAX_NUM 128
217 
218 /* These are sliceArg configuration related */
219 #define NI_MAX_SLICE_SIZE 127
220 
221 /*!*
222 * Operation modes for QOS
223 */
224 typedef enum ni_qos_modes
225 {
230 
231 /*!*
232 * Operation codes for ni_device_config_ns_qos
233 */
234 typedef enum ni_qos_codes
235 {
240 
241 // XCODER STATE
242 typedef enum
243 {
244  NI_XCODER_IDLE_STATE = 0x00, // Xcoder idle state
245  NI_XCODER_OPEN_STATE = 0x01 << 1, // Xcoder open state
246  NI_XCODER_WRITE_STATE = 0x01 << 2, // Xcoder write state
247  NI_XCODER_READ_STATE = 0x01 << 3, // Xcoder read state
248  NI_XCODER_CLOSE_STATE = 0x01 << 4, // Xcoder close state
249  // Xcoder flush state, flush at the end of stream
251  // Xcoder inter flush state, flush during transcoding stream
253  NI_XCODER_READ_DESC_STATE = 0x01 << 7, // Xcoder Read Desc state
254  NI_XCODER_HWUP_STATE = 0x01 << 8, // Xcoder HW upload state
255  NI_XCODER_HWDL_STATE = 0x01 << 9, // Xcoder HW download state
256  // Other states, like init, alloc, etc.
259 
260 typedef enum
261 {
262  NI_PIX_FMT_YUV420P = 0, /* 8-bit YUV420 planar */
263  NI_PIX_FMT_YUV420P10LE = 1, /* 10-bit YUV420 planar */
264  NI_PIX_FMT_NV12 = 2, /* 8-bit YUV420 semi-planar */
265  NI_PIX_FMT_P010LE = 3, /* 10-bit YUV420 semi-planar */
266  NI_PIX_FMT_RGBA = 4, /* 32-bit RGBA packed */
267  NI_PIX_FMT_BGRA = 5, /* 32-bit BGRA packed */
268  NI_PIX_FMT_ARGB = 6, /* 32-bit ARGB packed */
269  NI_PIX_FMT_ABGR = 7, /* 32-bit ABGR packed */
270  NI_PIX_FMT_BGR0 = 8, /* 32-bit BGRX packed */
271  NI_PIX_FMT_BGRP = 9, /* 24-bit BGR planar */
272  NI_PIX_FMT_NV16 = 10, /* 8-bit YUV422 semi-planar */
273  NI_PIX_FMT_YUYV422 = 11, /* 8-bit YUV422 packed */
274  NI_PIX_FMT_UYVY422 = 12, /* 8-bit YUV422 packed */
275  NI_PIX_FMT_8_TILED4X4 = 13, /* 8 bit tiled4x4 */
276  NI_PIX_FMT_10_TILED4X4 = 14,/* 10 bit tiled4x4 */
277  NI_PIX_FMT_NONE = 15, /* invalid format */
278 } ni_pix_fmt_t;
279 
280 typedef enum
281 {
288 
289 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
290 // If you change this,you should also change NI_QUADRA_SCALER_FLAG_* in ni_quadra_filter_api.h
291 #define NI_SCALER_FLAG_IO 0x0001 /* 0 = source frame, 1 = destination frame */
292 #define NI_SCALER_FLAG_PC 0x0002 /* 0 = single allocation, 1 = create pool */
293 #define NI_SCALER_FLAG_PA 0x0004 /* 0 = straight alpha, 1 = premultiplied alpha */
294 #define NI_SCALER_FLAG_P2 0x0008 /* 0 = normal allocation, 1 = P2P allocation */
295 #define NI_SCALER_FLAG_FCE 0x0010 /* 0 = no fill color, 1 = fill color enabled */
296 #define NI_SCALER_FLAG_CS 0x0020 /* 0 = BT.709, 1 = BT.2020 */
297 #define NI_SCALER_FLAG_LM 0x0040 /* 0 == no memory acquisition limit, 1 == limit memory acquisition */
298 #define NI_SCALER_FLAG_CMP 0x0800 /* 0 = no compress, 1 = compress*/
299 
300 #define NI_AI_FLAG_IO 0x0001 /* 0 = source frame, 1 = destination frame */
301 #define NI_AI_FLAG_PC 0x0002 /* 0 = single allocation, 1 = create pool */
302 #define NI_AI_FLAG_LM 0x0004 /* 0 == no memory acquisition limit; 1 == limit memory acquisition */
303 
304 #define NI_UPLOADER_FLAG_LM 0x0010 /* 0 == no memory acquisition limit, 1 == limit memory acquisition */
305 
306 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
307 // If you change this,you should also change NI_QUADRA_MAX_KEEP_ALIVE_TIMEOUT,
308 // NI_QUADRA_MIN_KEEP_ALIVE_TIMEOUT,NI_QUADRA_DEFAULT_KEEP_ALIVE_TIMEOUT in ni_quadra_filter_api.h
309 #define NI_MAX_KEEP_ALIVE_TIMEOUT 100
310 #define NI_MIN_KEEP_ALIVE_TIMEOUT 1
311 #define NI_DEFAULT_KEEP_ALIVE_TIMEOUT 3
312 
313 #define NI_MIN_CUSTOM_SEI_PASSTHRU -1
314 #define NI_MAX_CUSTOM_SEI_PASSTHRU 254
315 #define NI_DISABLE_USR_DATA_SEI_PASSTHRU 0
316 #define NI_ENABLE_USR_DATA_SEI_PASSTHRU 1
317 #define NI_INVALID_SVCT_DECODING_LAYER -1
318 #define NI_EC_POLICY_TOLERANT 1
319 #define NI_EC_POLICY_IGNORE 2
320 #define NI_EC_POLICY_SKIP 3
321 #define NI_EC_POLICY_BEST_EFFORT 4
322 #define NI_EC_POLICY_LIMITED_ERROR 5
323 #define NI_EC_POLICY_BEST_EFFORT_OUT_DC 6
324 #define NI_EC_POLICY_DEFAULT NI_EC_POLICY_BEST_EFFORT
325 #define NI_EC_ERR_THRESHOLD_DEFAULT 10
326 
327 // Picked from the xcoder firmware, commit e3b882e7
328 #define NI_VPU_CEIL(_data, _align) (((_data)+((_align)-1))&~((_align)-1))
329 #define NI_VPU_ALIGN4(_x) (((_x)+0x03)&~0x03)
330 #define NI_VPU_ALIGN8(_x) (((_x)+0x07)&~0x07)
331 #define NI_VPU_ALIGN16(_x) (((_x)+0x0f)&~0x0f)
332 #define NI_VPU_ALIGN32(_x) (((_x)+0x1f)&~0x1f)
333 #define NI_VPU_ALIGN64(_x) (((_x)+0x3f)&~0x3f)
334 #define NI_VPU_ALIGN128(_x) (((_x)+0x7f)&~0x7f)
335 #define NI_VPU_ALIGN256(_x) (((_x)+0xff)&~0xff)
336 #define NI_VPU_ALIGN512(_x) (((_x)+0x1ff)&~0x1ff)
337 #define NI_VPU_ALIGN2048(_x) (((_x)+0x7ff)&~0x7ff)
338 #define NI_VPU_ALIGN4096(_x) (((_x)+0xfff)&~0xfff)
339 #define NI_VPU_ALIGN16384(_x) (((_x)+0x3fff)&~0x3fff)
340 
341 #if 1 // QUADRA_SEI_FMT
342 #pragma pack(1)
343 typedef struct _ni_sei_header {
344  uint8_t status;
345  uint16_t size;
346  uint8_t type;
348 #pragma pack()
349 #else // QUADRA_SEI_FMT
350 typedef struct _ni_sei_user_data_entry
351 {
352  uint32_t offset;
353  uint32_t size;
354 } ni_sei_user_data_entry_t;
355 #endif // QUADRA_SEI_FMT
356 
357 typedef enum
358 {
364  NI_H265_USERDATA_FLAG_ITU_T_T35_PRE = 5, /* SEI Prefix: user_data_registered_itu_t_t35 */
365  NI_H265_USERDATA_FLAG_UNREGISTERED_PRE = 6, /* SEI Prefix: user_data_unregistered */
366  NI_H265_USERDATA_FLAG_ITU_T_T35_SUF = 7, /* SEI Suffix: user_data_registered_itu_t_t35 */
367  NI_H265_USERDATA_FLAG_UNREGISTERED_SUF = 8, /* SEI Suffix: user_data_unregistered */
368  NI_H265_USERDATA_FLAG_RESERVED_9 = 9, /* SEI RESERVED */
369  NI_H265_USERDATA_FLAG_MASTERING_COLOR_VOL = 10, /* SEI Prefix: mastering_display_color_volume */
370  NI_H265_USERDATA_FLAG_CHROMA_RESAMPLING_FILTER_HINT = 11, /* SEI Prefix: chroma_resampling_filter_hint */
371  NI_H265_USERDATA_FLAG_KNEE_FUNCTION_INFO = 12, /* SEI Prefix: knee_function_info */
372  NI_H265_USERDATA_FLAG_TONE_MAPPING_INFO = 13, /* SEI Prefix: tone_mapping_info */
373  NI_H265_USER_DATA_FLAG_FILM_GRAIN_CHARACTERISTICS_INFO = 14, /* SEI Prefix: film_grain_characteristics_info */
374  NI_H265_USER_DATA_FLAG_CONTENT_LIGHT_LEVEL_INFO = 15, /* SEI Prefix: content_light_level_info */
375  NI_H265_USER_DATA_FLAG_COLOUR_REMAPPING_INFO = 16, /* SEI Prefix: content_light_level_info */
376  NI_H265_USERDATA_FLAG_ITU_T_T35_PRE_1 = 28, /* SEI Prefix: additional user_data_registered_itu_t_t35 */
377  NI_H265_USERDATA_FLAG_ITU_T_T35_PRE_2 = 29, /* SEI Prefix: additional user_data_registered_itu_t_t35 */
378  NI_H265_USERDATA_FLAG_ITU_T_T35_SUF_1 = 30, /* SEI Suffix: additional user_data_registered_itu_t_t35 */
379  NI_H265_USERDATA_FLAG_ITU_T_T35_SUF_2 = 31, /* SEI Suffix: additional user_data_registered_itu_t_t35 */
381 
382 typedef enum
383 {
384  PIC_TYPE_I = 0, /*!*< I picture */
385  PIC_TYPE_P = 1, /*!*< P picture */
386  PIC_TYPE_B = 2, /*!*< B picture (except VC1) */
387 
389  PIC_TYPE_IDR = 3, /*!*< Encoder IDR pic type */
390  DECODER_PIC_TYPE_IDR = 5, /*!*< Decoder-returned IDR pic type */
391  PIC_TYPE_NIDR = 5, /*!*< H.264/H.265 IDR picture */
392  PIC_TYPE_MAX /*!*< No Meaning */
393 } ni_pic_type_t;
394 
395 #if 1 // QUADRA_SEI_FMT
396 // user data unreg and custom SEIs have variable length;
397 // non-custom SEIs will be dropped if buffer overflow;
398 // custom SEIs passthru is via SW and host memory constrained
399 #define NI_ENC_MAX_SEI_BUF_SIZE NI_VPU_ALIGN64(1024) // sync with encoder
400 
401 // PIC_TIMING and BUFFERING_PERIOD apply to encoder only, not needed from decoder
402 // For now, only the following will be returned from decoder:
403 // - T35 has 3 possible data types: CLOSE_CAPTION, HDR10PLUS, AFD
404 // - MASTERING_DISPLAY_COLOUR
405 // - CONTENT_LIGHT_LEVEL
406 // - USER_DATA_UNREGISTERED
407 // - CUSTOM_SEI
408 // Note: USER_DATA_UNREGISTERED may have arbitrary size but SEI buffer
409 // size is limited. The SEI buffer on decoder has the following format:
410 // [byte0: #entries][entry1]..[entryN]
411 // up to (1 + sizeof(ni_sei_header_t) + NI_MAX_SEI_DATA) bytes maximum;
412 // where [entryX] := [ni_sei_header][payload]
413 // [payload] of ni_sei_header.size: present only if ni_sei_header.status == 1
414 // X in [1..N] with N <= #entries
415 // N == #entries only if NI_MAX_SEI_DATA is large enough to store all #entries
416 // ex:
417 // entryX header fits in the buffer during SEI extration, but payload can't fit in;
418 // so only entryX header is stored but payload is drop with status set 0.
419 // entryX header can't fit in the buffer (SEI buffer full); so extryX is not stored
420 // in the SEI buffer (neither will any further SEIs)
421 //
422 // To maintain alignment, current implementation retrieves SEI data buffer from
423 // entry 1's payload onwards (skipping byte0, and entry 1's header),
424 // while #entries (same value as SEI buffer byte0) and entry 1's header are notified
425 // separately via metadata.
426 #define NI_MAX_SEI_DATA (NI_ENC_MAX_SEI_BUF_SIZE) // sync with decoder_manager
427 // Custom SEI only applies to software delivery
428 #define NI_MAX_CUSTOM_SEI_DATA (8192)
429 
430 #else // QUADRA_SEI_FMT
431 #define NI_MAX_SEI_ENTRIES 32
432 // 32 user_data_entry_t records + various SEI messages sizes
433 #define NI_MAX_SEI_DATA \
434  NI_MAX_SEI_ENTRIES * sizeof(ni_sei_user_data_entry_t) + \
435  NI_MAX_T35_CLOSE_CAPTION_SIZE + \
436  NI_MASTERING_DISPLAY_COLOUR_VOLUME_SIZE + \
437  NI_CONTENT_LIGHT_LEVEL_INFO_SIZE + NI_MAX_T35_HDR10PLUS_SIZE + \
438  NI_MAX_T35_AFD_SIZE
439 #endif // QUADRA_SEI_FMT
440 
441 #define NI_DEC_MAX_CC_BUF_SIZE 93 // max 31 CC entries of 3 bytes each
442 
443 #define NI_CC_SEI_BYTE0 0xB5 // itu_t_t35_country_code =181 (North America)
444 #define NI_CC_SEI_BYTE1 0x00
445 #define NI_CC_SEI_BYTE2 0x31 // itu_t_t35_provider_code = 49
446 #define NI_CC_SEI_BYTE3 0x47 // ATSC_user_identifier = "GA94"
447 #define NI_CC_SEI_BYTE4 0x41
448 #define NI_CC_SEI_BYTE5 0x39
449 #define NI_CC_SEI_BYTE6 0x34
450 #define NI_CC_SEI_BYTE7 0x03 // cc_data = 0x03
451 
452 #define NI_HDR10P_SEI_BYTE0 0xB5 // itu_t_t35_country_code =181 (North America
453 #define NI_HDR10P_SEI_BYTE1 0x00
454 #define NI_HDR10P_SEI_BYTE2 0x3c // itu_t_t35_provider_code = 0x003c
455 #define NI_HDR10P_SEI_BYTE3 0x00
456 #define NI_HDR10P_SEI_BYTE4 0x01 // u16 itu_t_t35_provider_oriented_code = 0x0001
457 #define NI_HDR10P_SEI_BYTE5 0x04 // u8 application_identifier = 0x04
458 // no longer checking the application version as it was originally 0 but was recently specified as one by AOM.
459 #define NI_HDR10P_SEI_BYTE6 0x00 // u8 application version = 0x00
460 
461 #define NI_CC_SEI_HDR_HEVC_LEN 18
462 #define NI_HDR10P_SEI_HDR_HEVC_LEN 9
463 #define NI_HDR10P_SEI_HDR_H264_LEN 8
464 #define NI_CC_SEI_HDR_H264_LEN 17
465 #define NI_CC_SEI_TRAILER_LEN 2
466 #define NI_RBSP_TRAILING_BITS_LEN 1
467 
468 // The macro definition in ni_quadra_filter_api.h need to be synchronized with libxcoder
469 // If you change this,you should also change NI_QUADRA_MAX_NUM_AUX_DATA_PER_FRAME in ni_quadra_filter_api.h
470 #define NI_MAX_NUM_AUX_DATA_PER_FRAME 16
471 
473 #define NI_BITRATE_RECONFIG_FILE_MAX_LINES 50000
474 #define NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE 10
477 
479 #define NI_CUSTOMIZE_ROI_QPOFFSET_LEVEL 10
480 #define NI_CUSTOMIZE_ROI_QP_NUM 64
482 
483 #define MOTION_CONSTRAINED_PERFORMANCE_MODE 1
484 #define MOTION_CONSTRAINED_QUALITY_MODE 2
485 
486 /*!*
487 * \brief Frame pool type.
488 */
490 {
491  NI_POOL_TYPE_NONE = -1, /* frame pool not inited or allocated */
495 
496 // frame auxiliary data; mostly used for SEI data associated with frame
498 {
500 
501  // ATSC A53 Part 4 Closed Captions
503 
504  // HDR10 mastering display metadata associated with a video frame
506 
507  // HDR10 content light level (based on CTA-861.3). This payload contains
508  // data in the form of ni_content_light_level_t struct.
510 
511  // HDR10+ dynamic metadata associated with a video frame. The payload is
512  // a ni_dynamic_hdr_plus_t struct that contains information for color volume
513  // transform - application 4 of SMPTE 2094-40:2016 standard.
515 
516  // Regions of Interest, the payload is an array of ni_region_of_interest_t,
517  // the number of array element is implied by:
518  // ni_frame_aux_data.size / sizeof(ni_region_of_interest_t)
520 
521  // NETINT: user data unregistered SEI data, which takes SEI payload type
522  // USER_DATA_UNREGISTERED.
523  // There will be no byte reordering.
524  // Usually this payload would be: 16B UUID + other payload Bytes.
526 
527  // NETINT: custom SEI data, which takes SEI payload custom types.
528  // There will be no byte reordering.
529  // Usually this payload would be: 1B Custom SEI type + 16B UUID + other
530  // payload Bytes.
532 
533  // NETINT: bitrate adjustment, which takes int32_t type data as
534  // payload that indicates the new target bitrate value.
536 
537  // NETINT: custom INTRAPRD adjustment, which takes int32_t type data
538  // as payload that specifies the new intra period
540 
541  // NETINT: custom VUI adjustment, which is a struct of
542  // ni_vui_hrd_t that specifies a frame's support of vui
544 
545  // NETINT: long term reference frame support, which is a struct of
546  // ni_long_term_ref_t that specifies a frame's support of long term
547  // reference frame.
549 
550  // NETINT: long term reference interval adjustment, which takes int32_t
551  // type data as payload that indicates the new long term reference interval
552  // value.
554 
555  // NETINT: frame reference invalidation, which takes int32_t type data
556  // as payload that indicates the frame number after which all references
557  // shall be invalidated.
559 
560  // NETINT: framerate adjustment, which takes int32_t type data as
561  // payload that indicates the new target framerate numerator and denominator values.
563 
564  // NETINT: maxFrameSize adjustment, which takes int16_t type data as
565  // payload that indicates the new maxFrameSize value
567 
568  // NETINT: max&min QP adjustment, which is a struct of
569  // payload that indicate the new max&min QP values
571 
572  // NETINT: crf adjustment, which takes int32_t type data
573  // as payload that indicates the new crf value.
575 
576  // NETINT: crf adjustment, which takes float type data
577  // as payload that indicates the new crf value.
579 
580  // NETINT: VbvMaxRate adjust, which takes int32_t type
581  // as payload that indicates the VbvMaxRate value.
583 
584  // NETINT: VbvBufferSize adjust, which takes int32_t type
585  // as payload that indicates the vbvBufferSize value.
587 
588  // NETINT: sliceArg adjust, which takes int16_t type
589  // as payload that indicates the sliceArg value.
591 
592  // NETINT: sliceArg adjust, which takes ni_category_classify_t
593  // type as payload that indicates the class and prob.
596 
597 // rational number (pair of numerator and denominator)
598 typedef struct _ni_rational
599 {
600  int num; // numerator
601  int den; // denominator
602 } ni_rational_t;
603 
604 // create an ni_rational_t
605 static inline ni_rational_t ni_make_q(int num, int den)
606 {
607  ni_rational_t ret = {num, den};
608  return ret;
609 }
610 
611 // convert an ni_rational_t to a double
612 static inline double ni_q2d(ni_rational_t a)
613 {
614  return a.num / (double)a.den;
615 }
616 
617 // struct to hold auxiliary data for ni_frame_t
618 typedef struct _ni_aux_data
619 {
621  void *data;
622  int size;
623 } ni_aux_data_t;
624 
625 // struct describing a Region Of Interest (ROI)
627 {
628  // self size: must be set to: sizeof(ni_region_of_interest_t)
629  uint32_t self_size;
630 
631  // ROI rectangle: pixels from the frame's top edge to the top and bottom
632  // edges of the rectangle, from the frame's left edge to the left and right
633  // edges of the rectangle.
634  int top;
635  int bottom;
636  int left;
637  int right;
638 
639  // quantisation offset: [-1, +1], 0 means no quality change; < 0 value asks
640  // for better quality (less quantisation), > 0 value asks for worse quality
641  // (greater quantisation).
644 
645 // struct describing category class and prob
646 typedef struct _ni_category_classify
647 {
649  int category;
650  float prob;
652 
653 // struct describing VUI HRD support.
654 typedef struct _ni_vui_hrd
655 {
656  // Indicates the presence of color info such as primaries, trc etc.
658 
659  // Indicates the chromaticity of RGB and white components of the
660  // displayed image (See Table E.3 of H.265 spec)
661  int32_t colorPrimaries;
662 
663  // The opto-electronic transfer characteristic of the source picture
664  // (See Table E.4 of H.265 spec)
665  int32_t colorTrc;
666 
667  // Method to represent brightness, luminance or luma and colour (e.g. RGB)
668  int32_t colorSpace;
669 
670  // Luma sample aspect ratio width. With aspectRatioHeight, translates
671  // into specific display ratios such as 16:9, 4:3, etc.
673 
674  // Luma sample aspect ratio height
676 
677  // Input video signal sample range [0,1].
678  // 0 = Y range in [16..235] Cb,Cr in [16..240]. 1 = Y,Cb,Cr in [0..255]
679  int32_t videoFullRange;
680 } ni_vui_hrd_t;
681 
682 // struct describing long term reference frame support.
683 typedef struct _ni_long_term_ref
684 {
685  // A flag for the current picture to be used as a long term reference
686  // picture later at other pictures' encoding
688 
689  // A flag to use a long term reference picture in DPB when encoding the
690  // current picture
693 
694 // struct describing framerate.
695 typedef struct _ni_framerate
696 {
697  // framerate numerator
698  int32_t framerate_num;
699 
700  // framerate denominator
703 
704 typedef struct _ni_rc_min_max_qp
705 {
706  int32_t minQpI;
707  int32_t maxQpI;
708  int32_t maxDeltaQp;
709  int32_t minQpPB;
710  int32_t maxQpPB;
712 
713 typedef struct _ni_dec_win
714 {
715  int16_t left;
716  int16_t right;
717  int16_t top;
718  int16_t bottom;
719 } ni_dec_win_t;
720 
722 {
724  uint32_t time_scale;
726  uint8_t color_trc;
727  uint8_t color_space;
729  // 48 bytes reserved for receiving more header info
730  uint64_t rsvd0;
731  uint64_t rsvd1;
732  uint64_t rsvd2;
733  uint64_t rsvd3;
734  uint64_t rsvd4;
735  uint64_t rsvd5;
737 
738 /*!*
739 * \brief decoded payload format of H.265 VUI
740 *
741 */
743 {
748 
750  int8_t video_format;
751 
754 
755  uint16_t sar_width;
756  uint16_t sar_height;
757 
761 
765 
767 
768  uint8_t field_seq_flag;
769 
774 
776  uint32_t vui_time_scale;
777 
780 
787 
791 
793 
795 
796 /*!*
797 * \brief decoded payload format of H.264 VUI
798 *
799 */
801 {
806 
808  int8_t video_format;
811 
812  uint16_t sar_width;
813  uint16_t sar_height;
814 
819 
822 
825 
827  uint32_t vui_time_scale;
828 
833 
838 
844 
845 /*!*
846 * \brief encoder HEVC ROI custom map (1 CTU = 64bits)
847 */
849 {
850  struct
851  {
852  uint32_t ctu_force_mode : 2; //[ 1: 0]
853  uint32_t ctu_coeff_drop : 1; //[ 2]
854  uint32_t reserved : 5; //[ 7: 3]
855  uint32_t sub_ctu_qp_0 : 6; //[13: 8]
856  uint32_t sub_ctu_qp_1 : 6; //[19:14]
857  uint32_t sub_ctu_qp_2 : 6; //[25:20]
858  uint32_t sub_ctu_qp_3 : 6; //[31:26]
859 
860  uint32_t lambda_sad_0 : 8; //[39:32]
861  uint32_t lambda_sad_1 : 8; //[47:40]
862  uint32_t lambda_sad_2 : 8; //[55:48]
863  uint32_t lambda_sad_3 : 8; //[63:56]
864  } field;
866 
867 /*!*
868 * \brief encoder AVC ROI custom map (1 MB = 8bits)
869 */
871 {
872  struct
873  {
874  uint8_t mb_force_mode : 2; // [ 1: 0]
875  uint8_t mb_qp : 6; // [ 7: 2]
876  } field;
878 
879 /*!*
880 * \brief encoder AVC ROI custom map (1 MB = 8bits)
881 */
882 // QP/CU Control Information Format 1
884 {
885  struct
886  {
887  uint8_t roiAbsQp_flag : 1; // [ 0] (0: QP_delta, 1: abs_QP)
888  uint8_t
889  qp_info : 6; // [ 6: 1] (QP_delta: -32 <= qp_info <= 31, QP_info =- QP_delta, abs_QP: 0 <= Qp_info <= 51, Qp_info = abs_QP)
890  uint8_t
891  ipcm_flag : 1; // [ 7] (0: do not force IPCM mode, 1: force IPCM mode)
892  } field;
894 // QP/CU Control Information Format 2
895 /*
896 typedef union _ni_enc_quad_roi_custom_map
897 {
898  struct
899  {
900  uint8_t qp_info : 6; // [ 5: 0] (QP_delta: -32 <= qp_info <= 31, QP_info =- QP_delta, abs_QP: 0 <= Qp_info <= 51, Qp_info = abs_QP)
901  uint8_t roiAbsQp_flag : 1; // [ 6] (0: QP_delta, 1: abs_QP)
902  uint8_t skip_flag : 1; // [ 7] (0: do not force skip mode, 1: force skip)
903  } field;
904 } ni_enc_quad_roi_custom_map;
905 */
906 /*!*
907 * \brief This is an enumeration for supported codec formats.
908 */
909 typedef enum _ni_codec_format
910 {
917 
919 {
925 
926 typedef enum _ni_dec_crop_mode
927 {
932 
933 
934 /*!*
935 * \brief This is an enumeration for hw actions
936 */
938 {
940  NI_CODEC_HW_ENABLE = (1 << 0),
942  NI_CODEC_HW_UPLOAD = (1 << 2),
943  NI_CODEC_HW_RSVD = (1 << 3),
946 
947 /*!*
948 * \brief This is an enumeration for encoder parameter change.
949 */
951 {
952  // COMMON parameters which can be changed frame by frame.
954  //NI_SET_CHANGE_PARAM_INTRA_PARAM = (1 << 1), // not required by customers
956  //NI_SET_CHANGE_PARAM_RC = (1 << 9), // not required by customers
975  NI_SET_CHANGE_PARAM_INTRA_PERIOD = ((unsigned int)1 << 31),
976  //bit [2,7] and [13,15] is still unused
978 
983 {
984  uint32_t enable_option;
985 
986  // NI_SET_CHANGE_PARAM_RC_TARGET_RATE
987  int32_t bitRate;
990  // NI_SET_CHANGE_PARAM_RC
991 // (rcEnable, cuLevelRc, bitAllocMode, RoiEnable, RcInitQp can't be changed while encoding)
992  int32_t hvsQPEnable;
993  int32_t hvsQpScale;
994  int32_t vbvBufferSize;
995  int32_t mbLevelRcEnable;
997  // NI_SET_CHANGE_PARAM_RC_MIN_MAX_QP
998  int32_t minQpI;
999  int32_t maxQpI;
1001  int32_t maxDeltaQp;
1002 #ifdef QUADRA
1003  int32_t minQpPB;
1004  int32_t maxQpPB;
1005 #else
1006  int32_t minQpP;
1007  int32_t minQpB;
1008  int32_t maxQpP;
1009  int32_t maxQpB;
1010 #endif
1011 
1012  // NI_SET_CHANGE_PARAM_INTRA_PARAM
1013  int32_t intraQP;
1014  int32_t intraPeriod;
1015  int32_t repeatHeaders;
1017 #ifdef QUADRA
1018  // NI_SET_CHANGE_PARAM_VUI_HRD_PARAM
1020  uint8_t colorPrimaries;
1021  uint8_t colorTrc;
1022  uint8_t colorSpace;
1023  uint16_t aspectRatioWidth;
1025  uint8_t videoFullRange;
1027  // RESERVED FOR FUTURE USE
1028  uint8_t reserved[5];
1029 
1030  // NI_SET_CHANGE_PARAM_SLICE_ARG
1031  int16_t sliceArg;
1032  //NI_SET_CHANGE_PARAM_VBV also reconfig for ni_vbvBufferSize
1033  int32_t vbvMaxRate;
1034 
1035  // NI_SET_CHANGE_PARAM_CRF
1036  // crf reconfig (range in [0.00 .. 51.00])
1037  uint8_t crfDecimal; // crf decimal fraction * 100 (range in [0 .. 99])
1038  uint8_t crf; // crf integer (range in [0 .. 51])
1039 
1040  // NI_SET_CHANGE_PARAM_MAX_FRAME_SIZE
1041  uint16_t maxFrameSize; // maxFrameSize reconfig (in unit of 2000 bytes)
1042 
1043  // NI_SET_CHANGE_PARAM_INVALID_REF_FRAME
1045 
1046  // NI_SET_CHANGE_PARAM_LTR_INTERVAL
1047  int32_t ltrInterval;
1048 
1049  // NI_SET_CHANGE_PARAM_RC_FRAMERATE
1050  int32_t frameRateNum;
1052 #else
1053  int32_t reserved[8];
1054 #endif
1056 
1057 /*!*
1058 * \brief decoded payload format of HDR SEI mastering display colour volume
1059 *
1060 */
1062 {
1063  uint16_t display_primaries[3][2];
1064  uint16_t white_point_x;
1065  uint16_t white_point_y;
1069 
1070 /*!*
1071 * \brief payload format of HDR SEI content light level info
1072 *
1073 */
1075 {
1079 
1080 /*!*
1081 * \brief encoded payload format of HDR SEI mastering display colour volume
1082 *
1083 */
1085 {
1086  uint16_t display_primaries[3][2];
1087  uint16_t white_point_x;
1088  uint16_t white_point_y;
1092 
1093 typedef struct _ni_pkt_info
1094 {
1095  double psnr_y;
1096  double psnr_u;
1097  double psnr_v;
1099  double ssim_y;
1100  double ssim_u;
1101  double ssim_v;
1102  double reserved[1];
1103 } ni_pkt_info;
1104 
1105 /*!*
1106  * \brief This is an enumeration for illustrating the custom SEI locations.
1107  */
1109 {
1113 
1114 /*!*
1115  * \brief custom sei payload passthrough
1116  */
1117 typedef struct _ni_custom_sei
1118 {
1119  uint8_t type;
1121  uint32_t size;
1123 } ni_custom_sei_t;
1124 
1125 typedef struct _ni_custom_sei_set
1126 {
1128  int count;
1130 
1131 /*!*
1132 * \brief hardware capability type
1133 */
1134 typedef struct _ni_hw_capability
1135 {
1136  uint8_t hw_id;
1138  uint8_t max_4k_fps;
1139  uint8_t codec_format;
1140  uint8_t codec_type;
1145  uint8_t video_profile;
1146  uint8_t video_level;
1147  uint8_t reserved; // 16B alignment. Unnecessary?
1149 
1150 /*!*
1151 * \brief device capability type
1152 */
1154 {
1160 
1161  uint8_t serial_number[20];
1162  uint8_t model_number[40];
1163 
1164  uint8_t fw_rev[8]; // space right filled ASCII array, not a string
1165  uint8_t fw_branch_name[256];
1166  uint8_t fw_commit_time[26];
1167  uint8_t fw_commit_hash[41];
1168  uint8_t fw_build_time[26];
1169  uint8_t fw_build_id[256];
1171 
1172 /*!*
1173 * \brief Session running state type.
1174 */
1176 {
1183 
1184 typedef struct _ni_context_query
1185 {
1186  uint32_t context_id : 8; //07:00 SW Instance ID (0 to Max number of instances)
1187  uint32_t context_status : 8; //15:08 Instance Status (0-Idle, 1-Active)
1188  uint32_t
1189  codec_format : 8; //23:16 Codec Format (0-H264, 1-H265, 2-VP9, 3-JPEG, 4-AV1)
1190  uint32_t video_width : 16; //39:24 Video Width (0 to Max Width)
1191  uint32_t video_height : 16; //55:40 Video Height (0 to Max Height)
1192  uint32_t fps : 8; //63:56 FPS (0 to 255)
1193  uint32_t reserved : 8; //Alignment
1195 
1196 typedef struct _ni_load_query
1197 {
1198  uint32_t current_load;
1199  uint32_t fw_model_load;
1200  uint32_t fw_load;
1201  uint32_t total_contexts;
1202  union{
1204  uint32_t pcie_throughput; //PCIe throughput - ni_query_nvme_status
1205  };
1206  union {
1208  uint32_t pcie_load; //PCIe load - ni_query_nvme_status
1209  };
1212  union {
1214  uint32_t tp_fw_load; //TP FW load - ni_query_nvme_status
1215  };
1216 
1218 
1220 } ni_load_query_t;
1221 
1223 {
1227  uint32_t admin_queried;
1229 
1231 {
1232  uint8_t ui8AvgCost;
1233  uint8_t ui8MaxCost;
1234  uint16_t ui16FrameRate;
1235  uint32_t ui32BitRate;
1236  uint32_t ui32AvgBitRate;
1237  uint32_t ui32NumIDR;
1238  uint32_t ui32NumInFrame;
1241 
1243  uint32_t ui32Width;
1244  uint32_t ui32Height;
1245  uint32_t ui32UserIDR;
1246  uint8_t u8PixelFormat; // only support for enc
1247  uint8_t u8rsvd[3];
1248  uint32_t u32InstanceId;
1249  uint32_t reserved[6];
1251 
1256 
1258 {
1259  int hw_id; // Codec ID
1260  uint32_t session_id; // session id
1261  uint64_t session_timestamp; // Session Start Timestamp
1262  bool close_thread; // a flag that the keep alive thread is closed or need to be closed
1263  uint32_t device_type; // Device Type, Either NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER
1264  ni_device_handle_t device_handle; // block device handler
1265  ni_event_handle_t thread_event_handle; // only for Windows asynchronous read and write
1266  void *p_buffer; // only be used when regular-io.
1267  ni_pthread_mutex_t *p_mutex; // referring to mutex of session context.
1268  uint32_t keep_alive_timeout; // keep alive timeout setting
1269  volatile uint64_t *plast_access_time; // shared variable for main thread to verify timeout. Keep alive thread will update last_access_time
1271 
1272 typedef struct _ni_buf_t
1273 {
1274  void* buf;
1280 } ni_buf_t;
1281 
1282 typedef struct _ni_buf_pool_t
1283 {
1284  ni_pthread_mutex_t mutex;
1286  uint32_t buf_size;
1291 } ni_buf_pool_t;
1292 
1293 typedef struct _ni_queue_node_t
1294 {
1295  uint64_t timestamp;
1296  uint64_t frame_info;
1302 } ni_queue_node_t;
1303 
1305 {
1306  uint32_t number_of_buffers; // total number of buffers
1312 
1313 typedef struct _ni_queue_t
1314 {
1315  char name[32];
1316  uint32_t count;
1319 } ni_queue_t;
1320 
1322 {
1325 
1327 {
1328  uint32_t num_of_dims; /* The number of dimensions specified in *sizes */
1329  uint32_t sizes[6]; /* The pointer to an array of dimension */
1330  int32_t
1331  data_format; /* Data format for the tensor, see ni_ai_buffer_format_e */
1332  int32_t
1333  quant_format; /* Quantized format see ni_ai_buffer_quantize_format_e */
1334  union
1335  {
1336  struct
1337  {
1338  int32_t
1339  fixed_point_pos; /* Specifies the fixed point position when the input element type is int16, if 0 calculations are performed in integer math */
1340  } dfp;
1341 
1342  struct
1343  {
1344  float scale; /* Scale value for the quantized value */
1345  int32_t zeroPoint; /* A 32 bit integer, in range [0, 255] */
1346  } affine;
1347  } quant_data; /* The union of quantization information */
1348  /* The type of this buffer memory. */
1349  uint32_t memory_type;
1351 
1353 {
1357 
1359 {
1360  int32_t offset;
1362 
1363 typedef struct _ni_network_data
1364 {
1365  uint32_t input_num;
1366  uint32_t output_num;
1369  *inset; /* point to each input layer start offset from p_frame */
1371  *outset; /* point to each output layer start offset from p_packet */
1373 
1374 // if change this structure, you need to change ni_quadra_filter_api.h ni_quadra_frameclone_desc_t
1375 typedef struct _ni_frameclone_desc
1376 {
1377  uint16_t ui16SrcIdx;
1378  uint16_t ui16DstIdx;
1379  uint32_t ui32Offset;
1380  uint32_t ui32Size;
1381  uint32_t reserved;
1383 
1385 {
1386  uint32_t total_cycles;
1388  uint64_t read_bw;
1389  uint64_t write_bw;
1390  uint64_t ocb_read_bw;
1391  uint64_t ocb_write_bw;
1392  uint64_t ddr_read_bw;
1393  uint64_t ddr_write_bw;
1395 
1396 typedef struct _ni_input_frame
1397 {
1398  uint8_t *p_input_buffer;
1399 
1400  uint32_t video_width;
1401  uint32_t video_height;
1402 
1403  int64_t pts;
1404 
1405  int8_t usable;
1407 
1408 typedef struct _ni_session_context
1409 {
1411  /* frame_time_q is pointer to ni_lat_meas_q_t but reserved as void pointer
1412  here as ni_lat_meas_q_t is part of private API */
1415 
1421 
1423 
1434 
1437  int64_t last_pts;
1438  int64_t last_dts;
1440  int64_t enc_pts_r_idx;
1441  int64_t enc_pts_w_idx;
1447 
1448  /* store pts values to create an accurate pts offset */
1453  uint64_t pkt_pos[NI_FIFO_SZ];
1454  uint64_t last_pkt_pos;
1457 
1460 
1462  ni_device_handle_t device_handle;
1463 
1465  ni_device_handle_t blk_io_handle;
1466 
1468  ni_device_handle_t sender_handle;
1469  ni_device_handle_t auto_dl_handle;
1470  uint8_t is_auto_dl;
1471 
1474 
1478  int hw_id;
1480  uint32_t session_id;
1484  uint32_t device_type;
1486  uint32_t codec_format;
1491 
1492  int src_bit_depth; // 8 or 10 bits/pixel formats, default 8
1493  int src_endian; // encoding 0: little endian (default) 1: big
1494  int bit_depth_factor; // for YUV buffer allocation
1495  // for encoder roi metadata
1496  uint32_t roi_len;
1497  uint32_t roi_avg_qp;
1498 
1501 
1502  /* Overall resource use among namespaces */
1504 
1506  uint8_t *p_leftover;
1508  uint32_t sent_size;
1509 
1511  uint8_t *p_hdr_buf;
1512  uint8_t hdr_buf_size;
1513 
1516 
1519 
1522 
1524  int status;
1526 
1527  void *p_dump[2];
1528  char param_err_msg[512];
1529 
1530  int keyframe_factor; // Unused
1531  uint64_t frame_num;
1532  uint64_t pkt_num;
1533  int rc_error_count; // Unused
1534 
1535  uint32_t hwd_Frame_Idx;
1536  uint32_t hwd_src_cpu;
1539  uint32_t hwd_Inst_ID;
1540 
1541  // frame forcing: for encoding
1543 
1544  uint32_t ready_to_close; //flag to indicate we are ready to close session
1545 
1546  // session running state
1548  //Current video width. this is used to do sequence change
1550  //Current video height ,this is used to do sequence change
1552  //Actual video width (without stride + cropped)
1554  // Used to track sequence changes that require bigger bitstream buffers
1556  ni_pthread_t keep_alive_thread;
1560 
1561  // original resolution this stream started with, this is used by encoder sequence change
1563 
1564  // a mutex for Xcoder API, to keep the thread-safety.
1565  ni_pthread_mutex_t mutex;
1566 
1567  // Xcoder running state
1568  uint32_t xcoder_state;
1569 
1570  // only be used when regular-io
1571  void *p_all_zero_buf; //This is for sos, eos, flush and keep alive request
1572 
1573  // these two event handle are only for Windows asynchronous read and write now
1574  ni_event_handle_t event_handle;
1575  ni_event_handle_t thread_event_handle;
1576 
1577  // ROI data
1579  // last passed in ni_region_of_interest_t
1581  int nb_rois;
1582  ni_enc_quad_roi_custom_map *roi_map; // actual AVC/HEVC QP map
1583 
1584  // only for H.264 test roi buffer for up to 8k resolution H.264 - 32 x 32 sub CTUs
1586  // only for H.265 custom map buffer for up to 8k resolution - 64x64 CTU Regions
1588  // only for hevc actual ROI map is stored in individual session context !
1590 
1591  // encoder reconfig parameters
1593  // decoder lowDelay mode for All I packets or IPPP packets
1596 
1597  // wrapper API request data, to be sent out once with the next input frame
1598  // to encoder
1599  int32_t target_bitrate; // A target bitrate to reconfig, -1 if inactive
1600  int force_idr_frame; // force IDR frame type
1601  ni_long_term_ref_t ltr_to_set; // LTR to be set
1602  int32_t ltr_interval; // LTR interval to set
1603  int32_t ltr_frame_ref_invalid; // frame after which all ref to be invalid
1604  ni_framerate_t framerate; // framerate to reconfig, 0 if inactive
1605  ni_vui_hrd_t vui; // vui to reconfig
1606 
1607  // path of decoder input pkt saving folder
1608  char stream_dir_name[256];
1611 
1612  // some parameters for decoder session
1613  // int hw_frame_extra_buffer; e.g. 3
1617  int32_t isP2P;
1619  unsigned short domain;
1620  unsigned short bus;
1621  unsigned short dev;
1622  unsigned short fn;
1623 
1624  // the FW API version of device that opened
1625  uint8_t fw_rev[8];
1626  uint8_t ddr_config;
1627 
1629 
1631  uint32_t prev_fps;
1633  uint64_t prev_pts;
1637 
1638  uint32_t meta_size;
1642 
1643  // flags_array to save packet flags
1645 
1646  // for decoder: store currently returned decoded frame's pkt offset
1649 
1651 
1652  uint32_t count_frame_num_in_sec; //used in the vfr mode, indicate the frame count in seconds
1653  uint32_t passed_time_in_timebase_unit; //used in the vfr mode, indicate how long it has passed
1654 
1655  int32_t max_frame_size; // maxFrameSize (in bytes) to reconfig, 0 if inactive
1656 
1657  // block device name requested by caller to open: when specified this block
1658  // device has priority over hw_id which is device specified by index.
1660 
1661  // decoder low delay send/recv sync; async_mode = 0 by default, i.e.
1662  // codec send-to/recv-from FW is in synchrounous mode by default.
1665  ni_pthread_mutex_t low_delay_sync_mutex;
1666  ni_pthread_cond_t low_delay_sync_cond;
1667 
1668  // muxtex default from source session
1669  // required pointer to external if used by hwdl
1670  ni_pthread_mutex_t* pext_mutex;
1672 
1673  // required parameters for slow sequence change
1674  int32_t last_bitrate;
1676 
1677  // AI embedded network parameters data
1679 
1682  //shared variable for main thread to read and keepalive thread to update
1683  volatile uint64_t last_access_time;
1684 
1685  int reconfig_crf; // crf value to reconfig (range in [0..51]), -1 if inactive
1686  int reconfig_crf_decimal; // crf decimal fration value to reconfig
1687  // (range in [0..99]), -1 if inactive
1688  int reconfig_vbv_buffer_size; // vbv buffer size value to reconfig
1689  int reconfig_vbv_max_rate; // vbv max rate value to reconfig
1690 
1695  uint64_t av1_pkt_num;
1696 
1702  uint32_t pkt_delay_cnt;
1703  char E2EID[128];
1705  int pixel_format_changed; // only for decoder now
1707 
1710  double psnr_y;
1711  double psnr_u;
1712  double psnr_v;
1716 
1718 
1719  // write packet/frame required buf size
1721 
1722  // record the drop num
1725 
1726 typedef struct _ni_split_context_t
1727 {
1728  int enabled;
1729  int w[3];
1730  int h[3];
1731  int f[3]; //planar format
1732  int f8b[3]; //forced 8bit
1733  //int crop_meta_data_rltb[3][4]; //crop rectangle
1735 
1736 /*!*
1737 * \brief This is an enumeration for encoder reconfiguration test settings
1738 */
1739 typedef enum _ni_reconfig
1740 {
1746 //XCODER_TEST_RECONF_RC = 5, // not required by customers
1747  XCODER_TEST_RECONF_RC_MIN_MAX_QP = 6, // reconfig min&max QP
1748 #ifdef QUADRA
1753  XCODER_TEST_RECONF_RC_MIN_MAX_QP_REDUNDANT = 11, // reconfig min&max QP through libxcoder API (redundant demo mode index)
1759  XCODER_TEST_FORCE_IDR_FRAME = 100, // force IDR through libxcoder API
1760  XCODER_TEST_RECONF_BR_API = 101, // reconfig BR through libxcoder API
1761  XCODER_TEST_RECONF_INTRAPRD_API = 102, // reconfig intraperiod through libxcoder API
1762  XCODER_TEST_RECONF_VUI_HRD_API = 103, // reconfig VUI through libxcoder API
1763  XCODER_TEST_RECONF_LTR_API = 104, // reconfig LTR through libxcoder API
1764  XCODER_TEST_RECONF_RC_MIN_MAX_QP_API_REDUNDANT = 106, // reconfig min&max QP through libxcoder API (redundant demo mode index)
1765  XCODER_TEST_RECONF_LTR_INTERVAL_API = 107, // reconf LTR interval thru API
1766  XCODER_TEST_INVALID_REF_FRAME_API = 108, // invalidate ref frame thru API
1767  XCODER_TEST_RECONF_FRAMERATE_API = 109, // reconfig framerate through libxcoder API
1768  XCODER_TEST_RECONF_MAX_FRAME_SIZE_API = 110, // reconfig maxFrameSize through libxcoder API
1769  XCODER_TEST_RECONF_RC_MIN_MAX_QP_API = 111, // reconfig min&max QP through libxcoder API
1770  XCODER_TEST_CRF_API = 114, // reconfig crf through libxcoder API
1771  XCODER_TEST_CRF_FLOAT_API = 115, // reconfig crf float type through libxcoder API
1772  XCODER_TEST_RECONF_VBV_API = 116, // reconfig vbv buffer size and vbv max rate through libxcoder API
1773  XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO_API = 117, // reconfig maxFrameSize ratio through libxcoder API
1774  XCODER_TEST_RECONF_SLICE_ARG_API = 118, // reconfig sliceArg through libxcoder API
1776 #endif
1777 } ni_reconfig_t;
1778 
1780 {
1781  /* A float type of buffer data */
1783  /* A half float type of buffer data */
1785  /* A 8 bit unsigned integer type of buffer data */
1787  /* A 8 bit signed integer type of buffer data */
1789  /* A 16 bit unsigned integer type of buffer data */
1791  /* A 16 signed integer type of buffer data */
1793  /* A char type of data */
1795  /* A bfloat 16 type of data */
1797  /* A 32 bit integer type of data */
1799  /* A 32 bit unsigned signed integer type of buffer */
1801  /* A 64 bit signed integer type of data */
1803  /* A 64 bit unsigned integer type of data */
1805  /* A 64 bit float type of buffer data */
1808 
1810 {
1811  /* Not quantized format */
1813  /* A quantization data type which specifies the fixed point position for whole tensor. */
1815  /* A quantization data type which has scale value and zero point to match with TF and
1816  Android NN API for whole tensor. */
1818  /* A max vaule support quantize format */
1821 
1823 {
1824  NI_DDR_PRIORITY_NONE = -1, // Do not change DDR priorities
1825  NI_DDR_PRIORITY_RESET, // Reset DDR priorities to default
1826  NI_DDR_PRIORITY_DECENC, // DDR prioritize decoder and encoder
1827  NI_DDR_PRIORITY_FILT, // DDR prioritize filter
1828  NI_DDR_PRIORITY_AI, // DDR prioritize AI
1831 
1832 #ifdef QUADRA
1833 #define NI_ENC_GOP_PARAMS_G0_POC_OFFSET "g0pocOffset"
1834 #define NI_ENC_GOP_PARAMS_G0_QP_OFFSET "g0QpOffset"
1835 //#define NI_ENC_GOP_PARAMS_G0_QP_FACTOR "g0QpFactor"
1836 #define NI_ENC_GOP_PARAMS_G0_TEMPORAL_ID "g0temporalId"
1837 #define NI_ENC_GOP_PARAMS_G0_PIC_TYPE "g0picType"
1838 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PICS "g0numRefPics"
1839 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC0 "g0refPic0"
1840 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC0_USED "g0refPic0Used"
1841 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC1 "g0refPic1"
1842 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC1_USED "g0refPic1Used"
1843 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC2 "g0refPic2"
1844 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC2_USED "g0refPic2Used"
1845 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC3 "g0refPic3"
1846 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC3_USED "g0refPic3Used"
1847 
1848 #define NI_ENC_GOP_PARAMS_G1_POC_OFFSET "g1pocOffset"
1849 #define NI_ENC_GOP_PARAMS_G1_QP_OFFSET "g1QpOffset"
1850 //#define NI_ENC_GOP_PARAMS_G1_QP_FACTOR "g1QpFactor"
1851 #define NI_ENC_GOP_PARAMS_G1_TEMPORAL_ID "g1temporalId"
1852 #define NI_ENC_GOP_PARAMS_G1_PIC_TYPE "g1picType"
1853 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PICS "g1numRefPics"
1854 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC0 "g1refPic0"
1855 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC0_USED "g1refPic0Used"
1856 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC1 "g1refPic1"
1857 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC1_USED "g1refPic1Used"
1858 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC2 "g1refPic2"
1859 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC2_USED "g1refPic2Used"
1860 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC3 "g1refPic3"
1861 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC3_USED "g1refPic3Used"
1862 
1863 #define NI_ENC_GOP_PARAMS_G2_POC_OFFSET "g2pocOffset"
1864 #define NI_ENC_GOP_PARAMS_G2_QP_OFFSET "g2QpOffset"
1865 //#define NI_ENC_GOP_PARAMS_G2_QP_FACTOR "g2QpFactor"
1866 #define NI_ENC_GOP_PARAMS_G2_TEMPORAL_ID "g2temporalId"
1867 #define NI_ENC_GOP_PARAMS_G2_PIC_TYPE "g2picType"
1868 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PICS "g2numRefPics"
1869 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC0 "g2refPic0"
1870 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC0_USED "g2refPic0Used"
1871 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC1 "g2refPic1"
1872 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC1_USED "g2refPic1Used"
1873 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC2 "g2refPic2"
1874 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC2_USED "g2refPic2Used"
1875 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC3 "g2refPic3"
1876 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC3_USED "g2refPic3Used"
1877 
1878 #define NI_ENC_GOP_PARAMS_G3_POC_OFFSET "g3pocOffset"
1879 #define NI_ENC_GOP_PARAMS_G3_QP_OFFSET "g3QpOffset"
1880 //#define NI_ENC_GOP_PARAMS_G3_QP_FACTOR "g3QpFactor"
1881 #define NI_ENC_GOP_PARAMS_G3_TEMPORAL_ID "g3temporalId"
1882 #define NI_ENC_GOP_PARAMS_G3_PIC_TYPE "g3picType"
1883 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PICS "g3numRefPics"
1884 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC0 "g3refPic0"
1885 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC0_USED "g3refPic0Used"
1886 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC1 "g3refPic1"
1887 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC1_USED "g3refPic1Used"
1888 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC2 "g3refPic2"
1889 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC2_USED "g3refPic2Used"
1890 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC3 "g3refPic3"
1891 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC3_USED "g3refPic3Used"
1892 
1893 #define NI_ENC_GOP_PARAMS_G4_POC_OFFSET "g4pocOffset"
1894 #define NI_ENC_GOP_PARAMS_G4_QP_OFFSET "g4QpOffset"
1895 //#define NI_ENC_GOP_PARAMS_G4_QP_FACTOR "g4QpFactor"
1896 #define NI_ENC_GOP_PARAMS_G4_TEMPORAL_ID "g4temporalId"
1897 #define NI_ENC_GOP_PARAMS_G4_PIC_TYPE "g4picType"
1898 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PICS "g4numRefPics"
1899 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC0 "g4refPic0"
1900 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC0_USED "g4refPic0Used"
1901 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC1 "g4refPic1"
1902 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC1_USED "g4refPic1Used"
1903 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC2 "g4refPic2"
1904 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC2_USED "g4refPic2Used"
1905 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC3 "g4refPic3"
1906 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC3_USED "g4refPic3Used"
1907 
1908 #define NI_ENC_GOP_PARAMS_G5_POC_OFFSET "g5pocOffset"
1909 #define NI_ENC_GOP_PARAMS_G5_QP_OFFSET "g5QpOffset"
1910 //#define NI_ENC_GOP_PARAMS_G5_QP_FACTOR "g5QpFactor"
1911 #define NI_ENC_GOP_PARAMS_G5_TEMPORAL_ID "g5temporalId"
1912 #define NI_ENC_GOP_PARAMS_G5_PIC_TYPE "g5picType"
1913 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PICS "g5numRefPics"
1914 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC0 "g5refPic0"
1915 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC0_USED "g5refPic0Used"
1916 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC1 "g5refPic1"
1917 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC1_USED "g5refPic1Used"
1918 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC2 "g5refPic2"
1919 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC2_USED "g5refPic2Used"
1920 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC3 "g5refPic3"
1921 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC3_USED "g5refPic3Used"
1922 
1923 #define NI_ENC_GOP_PARAMS_G6_POC_OFFSET "g6pocOffset"
1924 #define NI_ENC_GOP_PARAMS_G6_QP_OFFSET "g6QpOffset"
1925 //#define NI_ENC_GOP_PARAMS_G6_QP_FACTOR "g6QpFactor"
1926 #define NI_ENC_GOP_PARAMS_G6_TEMPORAL_ID "g6temporalId"
1927 #define NI_ENC_GOP_PARAMS_G6_PIC_TYPE "g6picType"
1928 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PICS "g6numRefPics"
1929 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC0 "g6refPic0"
1930 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC0_USED "g6refPic0Used"
1931 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC1 "g6refPic1"
1932 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC1_USED "g6refPic1Used"
1933 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC2 "g6refPic2"
1934 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC2_USED "g6refPic2Used"
1935 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC3 "g6refPic3"
1936 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC3_USED "g6refPic3Used"
1937 
1938 #define NI_ENC_GOP_PARAMS_G7_POC_OFFSET "g7pocOffset"
1939 #define NI_ENC_GOP_PARAMS_G7_QP_OFFSET "g7QpOffset"
1940 //#define NI_ENC_GOP_PARAMS_G7_QP_FACTOR "g7QpFactor"
1941 #define NI_ENC_GOP_PARAMS_G7_TEMPORAL_ID "g7temporalId"
1942 #define NI_ENC_GOP_PARAMS_G7_PIC_TYPE "g7picType"
1943 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PICS "g7numRefPics"
1944 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC0 "g7refPic0"
1945 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC0_USED "g7refPic0Used"
1946 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC1 "g7refPic1"
1947 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC1_USED "g7refPic1Used"
1948 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC2 "g7refPic2"
1949 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC2_USED "g7refPic2Used"
1950 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC3 "g7refPic3"
1951 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC3_USED "g7refPic3Used"
1952 
1953 typedef struct _ni_gop_rps
1954 {
1955  int ref_pic; /*!*< delta_poc of this short reference picture relative to the poc of current picture or index of LTR */
1956  int ref_pic_used; /*!*< whether this reference picture used by current picture */
1957 } ni_gop_rps_t;
1958 
1959 typedef struct _ni_gop_params
1960 {
1961  int poc_offset; /*!*< A POC of Nth picture in the custom GOP */
1962  int qp_offset; /*!*< QP offset of Nth picture in the custom GOP */
1963  float qp_factor; /*!*< QP factor of Nth picture in the custom GOP */
1964  int temporal_id; /*!*< A temporal ID of Nth picture in the custom GOP */
1965  int pic_type; /*!*< A picture type of Nth picture in the custom GOP */
1966  int num_ref_pics; /*!*< the number of reference pictures kept for this picture, the value should be within [0, 4] */
1968 } ni_gop_params_t;
1969 #else
1970 #define NI_ENC_GOP_PARAMS_G0_PIC_TYPE "g0picType"
1971 #define NI_ENC_GOP_PARAMS_G0_POC_OFFSET "g0pocOffset"
1972 #define NI_ENC_GOP_PARAMS_G0_PIC_QP "g0picQp"
1973 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC_L0 "g0numRefPicL0"
1974 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_POC_L0 "g0refPocL0"
1975 #define NI_ENC_GOP_PARAMS_G0_NUM_REF_POC_L1 "g0refPocL1"
1976 #define NI_ENC_GOP_PARAMS_G0_TEMPORAL_ID "g0temporalId"
1977 
1978 #define NI_ENC_GOP_PARAMS_G1_PIC_TYPE "g1picType"
1979 #define NI_ENC_GOP_PARAMS_G1_POC_OFFSET "g1pocOffset"
1980 #define NI_ENC_GOP_PARAMS_G1_PIC_QP "g1picQp"
1981 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC_L0 "g1numRefPicL0"
1982 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_POC_L0 "g1refPocL0"
1983 #define NI_ENC_GOP_PARAMS_G1_NUM_REF_POC_L1 "g1refPocL1"
1984 #define NI_ENC_GOP_PARAMS_G1_TEMPORAL_ID "g1temporalId"
1985 
1986 #define NI_ENC_GOP_PARAMS_G2_PIC_TYPE "g2picType"
1987 #define NI_ENC_GOP_PARAMS_G2_POC_OFFSET "g2pocOffset"
1988 #define NI_ENC_GOP_PARAMS_G2_PIC_QP "g2picQp"
1989 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC_L0 "g2numRefPicL0"
1990 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_POC_L0 "g2refPocL0"
1991 #define NI_ENC_GOP_PARAMS_G2_NUM_REF_POC_L1 "g2refPocL1"
1992 #define NI_ENC_GOP_PARAMS_G2_TEMPORAL_ID "g2temporalId"
1993 
1994 #define NI_ENC_GOP_PARAMS_G3_PIC_TYPE "g3picType"
1995 #define NI_ENC_GOP_PARAMS_G3_POC_OFFSET "g3pocOffset"
1996 #define NI_ENC_GOP_PARAMS_G3_PIC_QP "g3picQp"
1997 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC_L0 "g3numRefPicL0"
1998 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_POC_L0 "g3refPocL0"
1999 #define NI_ENC_GOP_PARAMS_G3_NUM_REF_POC_L1 "g3refPocL1"
2000 #define NI_ENC_GOP_PARAMS_G3_TEMPORAL_ID "g3temporalId"
2001 
2002 #define NI_ENC_GOP_PARAMS_G4_PIC_TYPE "g4picType"
2003 #define NI_ENC_GOP_PARAMS_G4_POC_OFFSET "g4pocOffset"
2004 #define NI_ENC_GOP_PARAMS_G4_PIC_QP "g4picQp"
2005 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC_L0 "g4numRefPicL0"
2006 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_POC_L0 "g4refPocL0"
2007 #define NI_ENC_GOP_PARAMS_G4_NUM_REF_POC_L1 "g4refPocL1"
2008 #define NI_ENC_GOP_PARAMS_G4_TEMPORAL_ID "g4temporalId"
2009 
2010 #define NI_ENC_GOP_PARAMS_G5_PIC_TYPE "g5picType"
2011 #define NI_ENC_GOP_PARAMS_G5_POC_OFFSET "g5pocOffset"
2012 #define NI_ENC_GOP_PARAMS_G5_PIC_QP "g5picQp"
2013 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC_L0 "g5numRefPicL0"
2014 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_POC_L0 "g5refPocL0"
2015 #define NI_ENC_GOP_PARAMS_G5_NUM_REF_POC_L1 "g5refPocL1"
2016 #define NI_ENC_GOP_PARAMS_G5_TEMPORAL_ID "g5temporalId"
2017 
2018 #define NI_ENC_GOP_PARAMS_G6_PIC_TYPE "g6picType"
2019 #define NI_ENC_GOP_PARAMS_G6_POC_OFFSET "g6pocOffset"
2020 #define NI_ENC_GOP_PARAMS_G6_PIC_QP "g6picQp"
2021 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC_L0 "g6numRefPicL0"
2022 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_POC_L0 "g6refPocL0"
2023 #define NI_ENC_GOP_PARAMS_G6_NUM_REF_POC_L1 "g6refPocL1"
2024 #define NI_ENC_GOP_PARAMS_G6_TEMPORAL_ID "g6temporalId"
2025 
2026 #define NI_ENC_GOP_PARAMS_G7_PIC_TYPE "g7picType"
2027 #define NI_ENC_GOP_PARAMS_G7_POC_OFFSET "g7pocOffset"
2028 #define NI_ENC_GOP_PARAMS_G7_PIC_QP "g7picQp"
2029 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC_L0 "g7numRefPicL0"
2030 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_POC_L0 "g7refPocL0"
2031 #define NI_ENC_GOP_PARAMS_G7_NUM_REF_POC_L1 "g7refPocL1"
2032 #define NI_ENC_GOP_PARAMS_G7_TEMPORAL_ID "g7temporalId"
2033 
2034 typedef struct _ni_gop_params
2035 {
2036  int pic_type; /*!*< A picture type of Nth picture in the custom GOP */
2037  int poc_offset; /*!*< A POC of Nth picture in the custom GOP */
2038  int pic_qp; /*!*< A quantization parameter of Nth picture in the custom GOP */
2039  int num_ref_pic_L0; /*!*< The number of reference L0 of Nth picture in the custom GOP */
2040  int ref_poc_L0; /*!*< A POC of reference L0 of Nth picture in the custom GOP */
2041  int ref_poc_L1; /*!*< A POC of reference L1 of Nth picture in the custom GOP */
2042  int temporal_id; /*!*< A temporal ID of Nth picture in the custom GOP */
2043 } ni_gop_params_t;
2044 #endif
2045 
2046 
2047 
2048 #define NI_ENC_GOP_PARAMS_CUSTOM_GOP_SIZE "customGopSize"
2049 
2051 {
2052  int custom_gop_size; /*!*< The size of custom GOP (0~8) */
2053  ni_gop_params_t pic_param[NI_MAX_GOP_NUM]; /*!*< Picture parameters of Nth picture in custom GOP */
2055 
2056 #define NI_ENC_REPEAT_HEADERS_FIRST_IDR 0
2057 #define NI_ENC_REPEAT_HEADERS_ALL_I_FRAMES 1
2058 #define NI_KEEP_ALIVE_TIMEOUT "keepAliveTimeout"
2059 
2061 {
2062 #define NI_ENC_PARAM_BITRATE "bitrate"
2063 #define NI_ENC_PARAM_RECONF_DEMO_MODE "ReconfDemoMode"
2064 #define NI_ENC_PARAM_RECONF_FILE "ReconfFile"
2065 #define NI_ENC_PARAM_ROI_DEMO_MODE "RoiDemoMode"
2066 #define NI_ENC_PARAM_CACHE_ROI "cacheRoi"
2067 #define NI_ENC_PARAM_FORCE_PIC_QP_DEMO_MODE "ForcePicQpDemoMode"
2068 #define NI_ENC_PARAM_GEN_HDRS "GenHdrs"
2069 #define NI_ENC_PARAM_PADDING "padding"
2070 #define NI_ENC_PARAM_FORCE_FRAME_TYPE "forceFrameType"
2071 #define NI_ENC_PARAM_PROFILE "profile"
2072 #define NI_ENC_PARAM_LEVEL "level"
2073 #define NI_ENC_PARAM_HIGH_TIER "high-tier"
2074 #define NI_ENC_PARAM_LOG_LEVEL "log-level"
2075 #define NI_ENC_PARAM_LOG "log"
2076 #define NI_ENC_PARAM_GOP_PRESET_IDX "gopPresetIdx"
2077 #define NI_ENC_PARAM_LOW_DELAY "lowDelay"
2078 #define NI_ENC_PARAM_MIN_FRAMES_DELAY "minFramesDelay"
2079 #define NI_ENC_PARAM_USE_RECOMMENDED_ENC_PARAMS "useRecommendEncParam"
2080 #define NI_ENC_PARAM_USE_LOW_DELAY_POC_TYPE "useLowDelayPocType"
2081 #define NI_ENC_PARAM_CU_SIZE_MODE "cuSizeMode"
2082 #define NI_ENC_PARAM_MAX_NUM_MERGE "maxNumMerge"
2083 #define NI_ENC_PARAM_ENABLE_DYNAMIC_8X8_MERGE "dynamicMerge8x8Enable"
2084 #define NI_ENC_PARAM_ENABLE_DYNAMIC_16X16_MERGE "dynamicMerge16x16Enable"
2085 #define NI_ENC_PARAM_ENABLE_DYNAMIC_32X32_MERGE "dynamicMerge32x32Enable"
2086 #define NI_ENC_PARAM_ENABLE_RATE_CONTROL "RcEnable"
2087 #define NI_ENC_PARAM_ENABLE_CU_LEVEL_RATE_CONTROL "cuLevelRCEnable"
2088 #define NI_ENC_PARAM_ENABLE_HVS_QP "hvsQPEnable"
2089 #define NI_ENC_PARAM_ENABLE_HVS_QP_SCALE "hvsQpScaleEnable"
2090 #define NI_ENC_PARAM_HVS_QP_SCALE "hvsQpScale"
2091 #define NI_ENC_PARAM_MIN_QP "minQp"
2092 #define NI_ENC_PARAM_MAX_QP "maxQp"
2093 #define NI_ENC_PARAM_MAX_DELTA_QP "maxDeltaQp"
2094 #define NI_ENC_PARAM_FORCED_HEADER_ENABLE "repeatHeaders"
2095 #define NI_ENC_PARAM_ROI_ENABLE "roiEnable"
2096 #define NI_ENC_PARAM_CONF_WIN_TOP "confWinTop"
2097 #define NI_ENC_PARAM_CONF_WIN_BOTTOM "confWinBot"
2098 #define NI_ENC_PARAM_CONF_WIN_LEFT "confWinLeft"
2099 #define NI_ENC_PARAM_CONF_WIN_RIGHT "confWinRight"
2100 #define NI_ENC_PARAM_INTRA_PERIOD "intraPeriod"
2101 #define NI_ENC_PARAM_TRANS_RATE "transRate"
2102 #define NI_ENC_PARAM_FRAME_RATE "frameRate"
2103 #define NI_ENC_PARAM_FRAME_RATE_DENOM "frameRateDenom"
2104 #define NI_ENC_PARAM_INTRA_QP "intraQP"
2105 #define NI_ENC_PARAM_DECODING_REFRESH_TYPE "decodingRefreshType"
2106 #define NI_ENC_PARAM_INTRA_REFRESH_RESET "intraRefreshResetOnForceIDR"
2107 // Rev. B: H.264 only parameters.
2108 #define NI_ENC_PARAM_ENABLE_8X8_TRANSFORM "transform8x8Enable"
2109 #define NI_ENC_PARAM_ENTROPY_CODING_MODE "entropyCodingMode"
2110 // Rev. B: shared between HEVC and H.264
2111 #define NI_ENC_PARAM_SLICE_MODE "sliceMode"
2112 #define NI_ENC_PARAM_SLICE_ARG "sliceArg"
2113 #define NI_ENC_PARAM_INTRA_MB_REFRESH_MODE "intraMbRefreshMode"
2114 #define NI_ENC_PARAM_INTRA_MB_REFRESH_ARG "intraMbRefreshArg"
2115 #define NI_ENC_PARAM_INTRA_REFRESH_MODE "intraRefreshMode"
2116 #define NI_ENC_PARAM_INTRA_REFRESH_ARG "intraRefreshArg"
2117 #define NI_ENC_PARAM_ENABLE_MB_LEVEL_RC "mbLevelRcEnable"
2118 #define NI_ENC_PARAM_PREFERRED_TRANSFER_CHARACTERISTICS "prefTRC"
2119 
2120 // To be deprecated: RcInitDelay -> vbvBufferSize, cbr -> fillerEnable
2121 #define NI_ENC_PARAM_RC_INIT_DELAY "RcInitDelay"
2122 #define NI_ENC_PARAM_CBR "cbr"
2123 #define NI_ENC_PARAM_INTRA_REFRESH_MIN_PERIOD "intraRefreshMinPeriod"
2124 
2125 //QUADRA
2127 #define NI_ENC_PARAM_CONSTANT_RATE_FACTOR NI_DEPRECATED_MACRO "crf"
2128 #define NI_ENC_PARAM_CONSTANT_RATE_FACTOR_FLOAT "crfFloat"
2129 #define NI_ENC_PARAM_RDO_LEVEL "rdoLevel"
2130 #define NI_ENC_PARAM_RDO_QUANT "EnableRdoQuant"
2131 #define NI_ENC_PARAM_MAX_CLL "maxCLL"
2132 #define NI_ENC_PARAM_MASTER_DISPLAY "masterDisplay"
2133 #define NI_ENC_PARAM_LOOK_AHEAD_DEPTH "lookAheadDepth"
2134 #define NI_ENC_PARAM_ENABLE_AUD "enableAUD"
2135 #define NI_ENC_PARAM_CTB_RC_MODE "ctbRcMode"
2136 #define NI_ENC_PARAM_GOP_SIZE "gopSize"
2137 #define NI_ENC_PARAM_GOP_LOW_DELAY "gopLowdelay"
2138 #define NI_ENC_PARAM_GDR_DURATION "intraRefreshDuration"
2139 #define NI_ENC_PARAM_HRD_ENABLE "hrdEnable"
2140 #define NI_ENC_PARAM_DOLBY_VISION_PROFILE "dolbyVisionProfile"
2141 #define NI_ENC_PARAM_VBV_BUFFER_SIZE "vbvBufferSize"
2142 #define NI_ENC_PARAM_VBV_MAXRAE "vbvMaxRate"
2143 #define NI_ENC_PARAM_ENABLE_FILLER "fillerEnable"
2144 #define NI_ENC_PARAM_ENABLE_PIC_SKIP "picSkip"
2146 #define NI_ENC_PARAM_MAX_FRAME_SIZE_LOW_DELAY NI_DEPRECATED_MACRO "maxFrameSize"
2147 #define NI_ENC_PARAM_MAX_FRAME_SIZE_BITS_LOW_DELAY "maxFrameSize-Bits"
2148 #define NI_ENC_PARAM_MAX_FRAME_SIZE_BYTES_LOW_DELAY "maxFrameSize-Bytes"
2149 #define NI_ENC_PARAM_LTR_REF_INTERVAL "ltrRefInterval"
2150 #define NI_ENC_PARAM_LTR_REF_QPOFFSET "ltrRefQpOffset"
2151 #define NI_ENC_PARAM_LTR_FIRST_GAP "ltrFirstGap"
2152 #define NI_ENC_PARAM_LTR_NEXT_INTERVAL "ltrNextInterval"
2153 #define NI_ENC_PARAM_MULTICORE_JOINT_MODE "multicoreJointMode"
2154 #define NI_ENC_PARAM_JPEG_QLEVEL "qlevel"
2155 #define NI_ENC_PARAM_CHROMA_QP_OFFSET "chromaQpOffset"
2156 #define NI_ENC_PARAM_TOL_RC_INTER "tolCtbRcInter"
2157 #define NI_ENC_PARAM_TOL_RC_INTRA "tolCtbRcIntra"
2158 #define NI_ENC_PARAM_BITRATE_WINDOW "bitrateWindow"
2159 #define NI_ENC_INLOOP_DS_RATIO "inLoopDSRatio"
2160 #define NI_ENC_BLOCK_RC_SIZE "blockRCSize"
2161 #define NI_ENC_RC_QP_DELTA_RANGE "rcQpDeltaRange"
2162 #define NI_ENC_CTB_ROW_QP_STEP "ctbRowQpStep"
2163 #define NI_ENC_NEW_RC_ENABLE "newRcEnable"
2164 #define NI_ENC_PARAM_INTRA_QP_DELTA "intraQpDelta"
2165 #define NI_ENC_PARAM_LONG_TERM_REFERENCE_ENABLE "longTermReferenceEnable"
2166 #define NI_ENC_PARAM_LONG_TERM_REFERENCE_COUNT "longTermReferenceCount"
2167 #define NI_ENC_PARAM_LONG_TERM_REFERENCE_INTERVAL "longTermReferenceInterval"
2168 #define NI_ENC_PARAM_SKIP_FRAME_ENABLE "skipFrameEnable"
2169 #define NI_ENC_PARAM_MAX_CONSUTIVE_SKIP_FRAME_NUMBER "maxConsecutiveSkipFrameNum"
2170 #define NI_ENC_PARAM_SKIP_FRAME_INTERVAL "skipFrameInterVal"
2171 #define NI_ENC_PARAM_IFRAME_SIZE_RATIO "iFrameSizeRatio"
2172 #define NI_ENC_PARAM_STILL_IMAGE_DETECT_LEVEL "stillImageDetectLevel"
2173 #define NI_ENC_PARAM_SCENE_CHANG_DETECT_LEVEL "sceneChangeDetectLevel"
2174 #define NI_ENC_PARAM_ENABLE_SMOOTH_CRF "enableSmoothCRF"
2175 #define NI_ENC_PARAM_ENABLE_COMPENSATE_QP "enableCompensateQp"
2176 // stream color info
2177 #define NI_ENC_PARAM_COLOR_PRIMARY "colorPri"
2178 #define NI_ENC_PARAM_COLOR_TRANSFER_CHARACTERISTIC "colorTrc"
2179 #define NI_ENC_PARAM_COLOR_SPACE "colorSpc"
2180 // sample aspect ratio specified in numerator/denominator
2181 #define NI_ENC_PARAM_SAR_NUM "sarNum"
2182 #define NI_ENC_PARAM_SAR_DENOM "sarDenom"
2183 // video_full_range_flag
2184 #define NI_ENC_PARAM_VIDEO_FULL_RANGE_FLAG "videoFullRangeFlag"
2185 // VFR related
2186 #define NI_ENC_PARAM_ENABLE_VFR "enableVFR"
2187 #define NI_ENC_ENABLE_SSIM "enableSSIM"
2188 #define NI_ENC_PARAM_AVCC_HVCC "avccHvcc"
2189 #define NI_ENC_PARAM_AV1_ERROR_RESILIENT_MODE "av1ErrorResilientMode"
2190 // set memory allocation parameters, M_MMAP_THRESHOLD and M_TRIM_THRESHOLD
2191 #define NI_ENC_PARAM_STATIC_MMAP_THRESHOLD "staticMmapThreshold"
2192 #define NI_ENC_PARAM_TEMPORAL_LAYERS_ENABLE "temporalLayersEnable"
2193 #define NI_ENC_PARAM_ENABLE_AI_ENHANCE "enableAIEnhance"
2194 #define NI_ENC_PARAM_ENABLE_AI_HVSPLUS "enableHVSPlus"
2195 #define NI_ENC_PARAM_ENABLE_2PASS_GOP "enable2PassGop"
2196 #define NI_ENC_PARAM_ZEROCOPY_MODE "zeroCopyMode"
2197 #define NI_ENC_PARAM_AI_ENHANCE_LEVEL "AIEnhanceLevel"
2198 #define NI_ENC_PARAM_HVSPLUS_LEVEL "HVSPlusLevel"
2199 #define NI_ENC_PARAM_CROP_WIDTH "cropWidth"
2200 #define NI_ENC_PARAM_CROP_HEIGHT "cropHeight"
2201 #define NI_ENC_PARAM_HORIZONTAL_OFFSET "horOffset"
2202 #define NI_ENC_PARAM_VERTICAL_OFFSET "verOffset"
2203 #define NI_ENC_PARAM_CONSTANT_RATE_FACTOR_MAX "crfMax"
2204 #define NI_ENC_PARAM_QCOMP "qcomp"
2205 #define NI_ENC_PARAM_NO_MBTREE "noMbtree"
2206 #define NI_ENC_PARAM_NO_HW_MULTIPASS_SUPPORT "noHWMultiPassSupport"
2207 #define NI_ENC_PARAM_CU_TREE_FACTOR "cuTreeFactor"
2208 #define NI_ENC_PARAM_IP_RATIO "ipRatio"
2209 #define NI_ENC_PARAM_ENABLE_IP_RATIO "enableipRatio"
2210 #define NI_ENC_PARAM_PB_RATIO "pbRatio"
2211 #define NI_ENC_PARAM_CPLX_DECAY "cplxDecay"
2212 #define NI_ENC_PARAM_PPS_INIT_QP "ppsInitQp"
2213 #define NI_ENC_PARAM_DDR_PRIORITY_MODE "ddrPriorityMode"
2214 #define NI_ENC_PARAM_BITRATE_MODE "bitrateMode"
2215 #define NI_ENC_PARAM_PASS1_QP "pass1Qp"
2216 #define NI_ENC_PARAM_HVS_BASE_MB_COMPLEXITY "hvsBaseMbComplexity"
2217 #define NI_ENC_PARAM_STATISTIC_OUTPUT_LEVEL "statisticOutputLevel"
2218 #define NI_ENC_PARAM_ENABLE_ALL_SEI_PASSTHRU "enableAllSeiPassthru"
2219 #define NI_ENC_PARAM_CRF_MAX_IFRAME_ENABLE "crfMaxIframeEnable"
2220 #define NI_ENC_PARAM_VBV_MINRATE "vbvMinRate"
2221 #define NI_ENC_PARAM_DISABLE_ADAPTIVE_BUFFERS "disableAdaptiveBuffers"
2222 #define NI_ENC_PARAM_DISABLE_BFRAME_RDOQ "disableBframeRDOQ"
2223 #define NI_ENC_PARAM_FORCE_BFRAME_QPFACTOR "forceBframeQpfactor"
2224 #define NI_ENC_PARAM_TUNE_BFRAME_VISUAL "tuneBframeVisual"
2225 #define NI_ENC_PARAM_ENABLE_ACQUIRE_LIMIT "enableAcqLimit"
2226 #define NI_ENC_PARAM_GET_PSNR_MODE "getPsnrMode"
2227 #define NI_ENC_PARAM_PSNR_INTERVAL "intervalOfPsnr"
2228 #define NI_ENC_PARAM_CUSTOMIZE_ROI_QP_LEVEL "customizeQpLevel"
2229 #define NI_ENC_PARAM_CUSTOMIZE_ROI_QP_MAP "customizeQpMapFile"
2230 #define NI_ENC_PARAM_MOTION_CONSTRAINED_MODE "motionConstrainedMode"
2231 #define NI_ENC_PARAM_ALLOCATE_STRAEGY "encMemAllocateStrategy"
2232 #define NI_ENC_PARAM_SPATIAL_LAYERS "spatialLayers"
2233 #define NI_ENC_PARAM_ENABLE_TIMECODE "enableTimecode"
2234 #define NI_ENC_PARAM_SPATIAL_LAYERS_REF_BASE_LAYER "spatialLayersRefBaseLayer"
2235 #define NI_ENC_PARAM_GET_RECONSTRUCTED_MODE "getReconstructedMode"
2236 #define NI_ENC_PARAM_VBV_BUFFER_REENCODE "vbvBufferReencode"
2237 
2238  //----- Start supported by all codecs -----
2242  int planar;
2245  //----- End supported by all codecs -----
2246 
2247  //----- Start supported by AV1, AVC, HEVC only -----
2248  int profile;
2250  //GOP Pattern
2252  /*!*< A GOP structure preset option (IPP, IBP, IBBP, IbBbP, use Custom GOP, etc) */ // 0-custom 1-I-only 2-IPPP 3-IBBB 4-IBP .....
2253 
2254  // CUSTOM_GOP
2256 
2263 
2264  // HLG preferred transfer characteristics
2266 
2269  int crf;
2280  int HDR10wx;
2281  int HDR10wy;
2293  //----- End supported by AV1, AVC, HEVC only -----
2294 
2295  //----- Start supported by AVC, HEVC only -----
2296  //ConformanceWindowOffsets
2297  int conf_win_top; /*!*< A conformance window size of TOP */
2298  int conf_win_bottom; /*!*< A conformance window size of BOTTOM */
2299  int conf_win_left; /*!*< A conformance window size of LEFT */
2300  int conf_win_right; /*!*< A conformance window size of RIGHT */
2304  //----- End supported by AVC, HEVC only -----
2305 
2306  //----- Start supported by AVC only -----
2308  //----- End supported by AVC only -----
2309 
2310  //----- Start supported by HEVC only -----
2315  //----- End supported by HEVC only -----
2316 
2317  //----- Start supported by JPEG only -----
2318  int qlevel;
2319  //----- End supported by JPEG only -----
2320 
2321  //----- Start test use only -----
2323  int gopSize;
2325  //----- End test use only -----
2326 
2327  //----- Start supported by AV1, AVC, HEVC only -----
2332  //----- End supported by AV1, AVC, HEVC only -----
2333 
2334  //----- Start test use only -----
2337  //----- End test use only -----
2338 
2339  //----- Start supported by AV1, AVC, HEVC only -----
2341  //----- End supported by AV1, AVC, HEVC only -----
2342 
2343  //----- start DEPRECATED or for T408 -----
2345  //Preset Mode
2346  int use_recommend_enc_params; /*!*< 0: Custom, 1: Slow speed and best quality, 2: Normal Speed and quality, 3: Fast Speed and Low Quality */
2347  //Encode Options
2348  int cu_size_mode; /*!*< bit 0: enable 8x8 CU, bit 1: enable 16x16 CU, bit 2: enable 32x32 CU */
2349  int max_num_merge; /*!*< Maximum number of merge candidates (0~2) */
2350  int enable_dynamic_8x8_merge; /*!*< It enables dynamic merge 8x8 candidates. */
2351  int enable_dynamic_16x16_merge; /*!*< It enables dynamic merge 16x16 candidates. */
2352  int enable_dynamic_32x32_merge; /*!*< It enables dynamic merge 32x32 candidates. */
2353 
2354  // Rev. B: H.264 only parameters, in ni_t408_config_t
2355  // - for H.264 on T408:
2359 
2361  //----- end DEPRECATED or for T408 -----
2362 
2363  struct //Rate control parameters
2364  {
2365  int enable_rate_control; /*!*< It enable rate control */
2366  int min_qp; /*!*< A minimum QP for rate control */ //8
2367  int max_qp; /*!*< A maximum QP for rate control */ //51
2368  int intra_qp;
2371 
2372  //no JPEG
2373  int enable_cu_level_rate_control; /*!*< It enable CU level rate control */
2374  int enable_hvs_qp; /*!*< It enable CU QP adjustment for subjective quality enhancement */
2375  int hvs_qp_scale; /*!*< A QP scaling factor for CU QP adjustment when hvcQpenable = 1 */
2379 
2380  //deprecated
2381  int enable_hvs_qp_scale; /*!*< It enable QP scaling factor for CU QP adjustment when enable_hvs_qp = 1 */
2382  int max_delta_qp; /*!*< A maximum delta QP for rate control */ //10
2385  } rc;
2386  int keep_alive_timeout; /* keep alive timeout setting */
2399  int crfMax;
2400  float qcomp;
2404  float ipRatio;
2405  float pbRatio;
2406  float cplxDecay;
2410  float crfFloat;
2412  // 0: no extra output encoder information
2413  // 1: Frame Level output encoder information
2414  // 2: Cu Level Output encoder information
2415  // 3: Frame&Cu Level encoder information
2444 
2446 {
2447 #define NI_DEC_PARAM_OUT "out"
2448 #define NI_DEC_PARAM_ENABLE_OUT_1 "enableOut1"
2449 #define NI_DEC_PARAM_ENABLE_OUT_2 "enableOut2"
2450 #define NI_DEC_PARAM_FORCE_8BIT_0 "force8Bit0"
2451 #define NI_DEC_PARAM_FORCE_8BIT_1 "force8Bit1"
2452 #define NI_DEC_PARAM_FORCE_8BIT_2 "force8Bit2"
2453 #define NI_DEC_PARAM_SEMI_PLANAR_0 "semiplanar0"
2454 #define NI_DEC_PARAM_SEMI_PLANAR_1 "semiplanar1"
2455 #define NI_DEC_PARAM_SEMI_PLANAR_2 "semiplanar2"
2456 #define NI_DEC_PARAM_CROP_MODE_0 "cropMode0"
2457 #define NI_DEC_PARAM_CROP_MODE_1 "cropMode1"
2458 #define NI_DEC_PARAM_CROP_MODE_2 "cropMode2"
2459 #define NI_DEC_PARAM_CROP_PARAM_0 "crop0"
2460 #define NI_DEC_PARAM_CROP_PARAM_1 "crop1"
2461 #define NI_DEC_PARAM_CROP_PARAM_2 "crop2"
2462 #define NI_DEC_PARAM_SCALE_0 "scale0"
2463 #define NI_DEC_PARAM_SCALE_1 "scale1"
2464 #define NI_DEC_PARAM_SCALE_2 "scale2"
2465 #define NI_DEC_PARAM_SCALE_0_LONG_SHORT_ADAPT "scale0LongShortAdapt"
2466 #define NI_DEC_PARAM_SCALE_1_LONG_SHORT_ADAPT "scale1LongShortAdapt"
2467 #define NI_DEC_PARAM_SCALE_2_LONG_SHORT_ADAPT "scale2LongShortAdapt"
2468 #define NI_DEC_PARAM_SCALE_0_RES_CEIL "scale0ResCeil"
2469 #define NI_DEC_PARAM_SCALE_1_RES_CEIL "scale1ResCeil"
2470 #define NI_DEC_PARAM_SCALE_2_RES_CEIL "scale2ResCeil"
2471 #define NI_DEC_PARAM_SCALE_0_ROUND "scale0Round"
2472 #define NI_DEC_PARAM_SCALE_1_ROUND "scale1Round"
2473 #define NI_DEC_PARAM_SCALE_2_ROUND "scale2Round"
2474 #define NI_DEC_PARAM_MULTICORE_JOINT_MODE "multicoreJointMode"
2475 #define NI_DEC_PARAM_SAVE_PKT "savePkt"
2476 #define NI_DEC_PARAM_LOW_DELAY "lowDelay"
2477 #define NI_DEC_PARAM_FORCE_LOW_DELAY "forceLowDelay"
2478 #define NI_DEC_PARAM_MIN_PACKETS_DELAY "minPacketsDelay"
2479 #define NI_DEC_PARAM_ENABLE_LOW_DELAY_CHECK "enableLowDelayCheck"
2480 #define NI_DEC_PARAM_ENABLE_USR_DATA_SEI_PASSTHRU "enableUserDataSeiPassthru"
2481 #define NI_DEC_PARAM_ENABLE_CUSTOM_SEI_PASSTHRU "customSeiPassthru"
2482 #define NI_DEC_PARAM_SVC_T_DECODING_LAYER "svctDecodingLayer"
2483 #define NI_DEC_PARAM_DDR_PRIORITY_MODE "ddrPriorityMode"
2484 #define NI_DEC_PARAM_EC_POLICY "ecPolicy"
2485 #define NI_DEC_PARAM_ENABLE_ADVANCED_EC "enableAdvancedEc"
2486 #define NI_DEC_PARAM_ERROR_THRESHOLD "ecErrThreshold"
2487 #define NI_DEC_PARAM_ENABLE_PPU_SCALE_ADAPT "enablePpuScaleAdapt"
2488 #define NI_DEC_PARAM_ENABLE_PPU_SCALE_LIMIT "enablePpuScaleLimit"
2489 #define NI_DEC_PARAM_MAX_EXTRA_HW_FRAME_CNT "maxExtraHwFrameCnt"
2490 #define NI_DEC_PARAM_SKIP_PTS_GUESS "skipPtsGuess"
2491 #define NI_DEC_PARAM_PKT_PTS_UNCHANGE "pktPtsUnchange"
2492 #define NI_DEC_PARAM_ENABLE_ALL_SEI_PASSTHRU "enableAllSeiPassthru"
2493 #define NI_DEC_PARAM_ENABLE_FOLLOW_IFRAME "enableFollowIFrame"
2494 #define NI_DEC_PARAM_DISABLE_ADAPTIVE_BUFFERS "disableAdaptiveBuffers"
2495 #define NI_DEC_PARAM_SURVIVE_STREAM_ERR "surviveStreamErr"
2496 #define NI_DEC_PARAM_REDUCE_DPB_DELAY "reduceDpbDelay"
2497 #define NI_DEC_PARAM_SKIP_EXTRA_HEADERS "skipExtraHeaders"
2498 
2502  int mcmode;
2503  int nb_save_pkt; // number of decoder input packets to be saved
2510  1]; /*cut-out of expression to be parsed*/
2514  1]; /*cut-out of expression to be parsed*/
2515  int keep_alive_timeout; /* keep alive timeout setting */
2516  // decoder lowDelay mode for All I packets or IPPP packets
2525  int enable_ppu_scale_adapt; // 0: disabled; 1: adapt to long edge; 2: adapt to short edge.
2532  // 0: disabled; 1: adapt to long edge; 2: adapt to short edge.
2535  int scale_round[NI_MAX_NUM_OF_DECODER_OUTPUTS]; // 0 up align 1 dowm align
2543 
2545 {
2547  int32_t input_width;
2548  int32_t input_height;
2549  int32_t in_rec_width;
2550  int32_t in_rec_height;
2551  int32_t in_rec_x;
2552  int32_t in_rec_y;
2553 
2555  int32_t output_width;
2556  int32_t output_height;
2557  int32_t out_rec_width;
2559  int32_t out_rec_x;
2560  int32_t out_rec_y;
2561 
2562  uint32_t rgba_color;
2565 
2566 typedef struct _ni_scaler_params_t
2567 {
2574 
2576 {
2577  uint32_t start_x;
2578  uint32_t start_y;
2579  uint32_t end_x;
2580  uint32_t end_y;
2581  uint32_t rgba_c;
2583 
2585  uint32_t ui32StartX;
2586  uint32_t ui32StartY;
2587  uint32_t ui32Width;
2588  uint32_t ui32Height;
2589  uint32_t ui32Valid;
2591 
2593 {
2596 
2600 
2601 typedef struct _ni_frame
2602 {
2603  // codec of the source from which this frame is decoded
2605 
2606  long long dts;
2607  long long pts;
2608  uint32_t end_of_stream;
2610  uint32_t video_width;
2611  uint32_t video_height;
2612 
2613  uint32_t crop_top;
2614  uint32_t crop_bottom;
2615  uint32_t crop_left;
2616  uint32_t crop_right;
2617 
2618  // for encoder: force headers on this frame
2619  uint16_t force_headers;
2620  // for encoder: control long term reference picture feature
2623 
2625  // for encoding: frame picture type sent to encoder
2626  // for decoding: frame picture type returned from decoder
2628  // total SEI size: used by encoder
2629  unsigned int sei_total_len;
2630 
2631  // SEI info of closed caption: returned by decoder or set by encoder
2632  unsigned int sei_cc_offset;
2633  unsigned int sei_cc_len;
2634  // SEI info of HDR: returned by decoder
2639  // SEI info of HDR10+: returned by decoder
2640  unsigned int sei_hdr_plus_offset;
2641  unsigned int sei_hdr_plus_len;
2642  // SEI info of User Data Unregistered SEI: returned by decoder
2645  // SEI info of alternative transfer characteristics: returned by decoder
2648  // VUI info: returned by decoder
2649  unsigned int vui_offset;
2650  unsigned int vui_len;
2651 
2652  // ROI data length: for encoder
2653  unsigned int roi_len;
2654  // reconfig data length: for encoder
2655  unsigned int reconf_len;
2656  // total extra data data length: for encoder
2657  unsigned int extra_data_len;
2658  // force pic qp value
2659  uint16_t force_pic_qp;
2660  // frame chunk index
2662 
2665 
2666  uint8_t *p_buffer;
2667  uint32_t buffer_size;
2668 
2669  ni_buf_t
2670  *dec_buf; // buffer pool entry (has memory pointed to by p_buffer)
2673 
2675 
2676  // frame auxiliary data
2679 
2680  // the following info is of the source stream that is returned by decoder:
2681  // color info, sample aspect ratio, timing etc that are useful at encoding.
2683  uint8_t color_trc;
2684  uint8_t color_space;
2687  uint16_t sar_width;
2688  uint16_t sar_height;
2690  uint32_t vui_time_scale;
2691 
2692  int flags; // flags of demuxed packet
2693 
2694  // for encoder: metadata buffer info if not contiguous with YUV
2697  // for encoder: whether metadata should be sent separately for frame
2699  uint64_t pkt_pos;
2700 
2701  // for encoder: non-4k-aligned part at the start of YUV data
2702  uint8_t *p_start_buffer;
2706  // for encoder: whether the start of non-4k-aligned YUV data should be sent separately for frame
2709  long long orignal_pts;
2710  uint32_t error_ratio;
2711 } ni_frame_t;
2712 
2713 typedef struct _ni_xcoder_params
2714 {
2715  int log;
2716  int preset;
2717  /* Numerator and denominator of frame rate */
2718  uint32_t fps_number;
2720  /* Width (in pixels) of the source pictures. If this width is not an even
2721  * multiple of 4, the encoder will pad the pictures internally to meet this
2722  * minimum requirement. All valid HEVC widths are supported */
2724 
2725  /* Height (in pixels) of the source pictures. If this height is not an even
2726  * multiple of 4, the encoder will pad the pictures internally to meet this
2727  * minimum requirement. All valid HEVC heights are supported */
2729  int bitrate;
2730  int roi_demo_mode; // for encoder ROI testing
2731  int reconf_demo_mode; // for encoder reconfiguration testing
2732  int force_pic_qp_demo_mode; // for force pic qp mode testing
2733  int low_delay_mode; // encoder low latency mode
2734  int padding; // encoder input padding setting
2735  NI_DEPRECATED int generate_enc_hdrs; // in libavcodec, open a dummy session to generate codec headers during init
2736  int use_low_delay_poc_type; // specifies the encoder to set
2737  // picture_order_count_type=2 in the H.264 SPS
2738 
2740 
2741  // 1: force on every frame with same input type; 0: no (except for I-frame)
2743 
2746 
2747  int cacheRoi; // enables caching of ROIs applied to subsequent frames
2748 
2750  NI_DEPRECATED uint32_t
2755 
2759  int sar_num;
2762 
2763  union
2764  {
2767  };
2768 
2769  // for encoder reconfiguration testing, saving key:val1,val2,val3,...val9
2770  // (max 9 values) in the demo reconfig data file this supports max 50000
2771  // lines in reconfig file, max 10 key/values per line
2777 
2778  int enable_vfr; //enable the vfr
2779 
2792 
2793 typedef struct _niFrameSurface1
2794 {
2795  uint16_t ui16FrameIdx; //frame location on device
2796  uint16_t ui16session_ID; //for instance tracking
2797  uint16_t ui16width; // width on device
2798  uint16_t ui16height; // height on device
2799  uint32_t ui32nodeAddress; //currently not in use, formerly offset
2800  int32_t device_handle; //handle to access device
2801  int8_t bit_depth; //1 == 8bit per pixel, 2 == 10bit
2802  int8_t encoding_type; //0 = semiplanar, 1 = planar, 2 = tiled4x4
2803  int8_t output_idx; // 0-2 for decoder output index
2804  int8_t src_cpu; // frame origin location
2805  int32_t dma_buf_fd; // P2P dma buffer file descriptor
2807 
2808 typedef struct _ni_frame_config
2809 {
2810  uint16_t picture_width;
2811  uint16_t picture_height;
2812  uint16_t picture_format;
2813  uint16_t options;
2816  int16_t rectangle_x;
2817  int16_t rectangle_y;
2818  uint32_t rgba_color;
2819  uint16_t frame_index;
2820  uint16_t session_id;
2821  uint8_t output_index;
2822  uint8_t orientation; // 0 <= n <= 3, (n * 90°) clockwise rotation
2824 
2825 typedef struct _ni_packet
2826 {
2827  long long dts;
2828  long long pts;
2829  long long pos;
2830  uint64_t pkt_pos;
2831  uint32_t end_of_stream;
2833  uint32_t video_width;
2834  uint32_t video_height;
2835  uint32_t frame_type; // encoding only 0=I, 1=P, 2=B
2837  void* p_data;
2838  uint32_t data_len;
2840 
2841  void* p_buffer;
2842  uint32_t buffer_size;
2843  uint32_t avg_frame_qp; // average frame QP reported by VPU
2850 
2851  int flags; // flags of demuxed packet
2852 
2854 
2855  double psnr_y;
2856  double psnr_u;
2857  double psnr_v;
2859  double ssim_y;
2860  double ssim_u;
2861  double ssim_v;
2864 } ni_packet_t;
2865 
2866 typedef struct _ni_session_data_io
2867 {
2868  union
2869  {
2872  }data;
2873 
2875 
2876 #define NI_XCODER_PRESET_NAMES_ARRAY_LEN 3
2877 #define NI_XCODER_LOG_NAMES_ARRAY_LEN 7
2878 
2879 #define NI_XCODER_PRESET_NAME_DEFAULT "default"
2880 #define NI_XCODER_PRESET_NAME_CUSTOM "custom"
2881 
2882 #define NI_XCODER_LOG_NAME_NONE "none"
2883 #define NI_XCODER_LOG_NAME_ERROR "error"
2884 #define NI_XCODER_LOG_NAME_WARN "warning"
2885 #define NI_XCODER_LOG_NAME_INFO "info"
2886 #define NI_XCODER_LOG_NAME_DEBUG "debug"
2887 #define NI_XCODER_LOG_NAME_FULL "full"
2888 
2890 extern LIB_API const char* const g_xcoder_log_names[NI_XCODER_LOG_NAMES_ARRAY_LEN];
2891 
2892 /*!*****************************************************************************
2893  * \brief Allocate and initialize a new ni_session_context_t struct
2894  *
2895  *
2896  * \return On success returns a valid pointer to newly allocated context
2897  * On failure returns NULL
2898  ******************************************************************************/
2900 
2901 /*!*****************************************************************************
2902  * \brief Initialize already allocated session context to a known state
2903  *
2904  * \param[in] p_ctx Pointer to an already allocated ni_session_context_t
2905  * struct
2906  *
2907  * \return On success
2908  * NI_RETCODE_SUCCESS
2909  * On failure
2910  * NI_RETCODE_INVALID_PARAM
2911  * NI_RETCODE_FAILURE
2912  ******************************************************************************/
2915 
2916 /*!*****************************************************************************
2917  * \brief Clear already allocated session context
2918  *
2919  * \param[in] p_ctx Pointer to an already allocated ni_session_context_t
2920  *
2921  *
2922  ******************************************************************************/
2924 
2925 /*!*****************************************************************************
2926  * \brief Free previously allocated session context
2927  *
2928  * \param[in] p_ctx Pointer to an already allocated ni_session_context_t
2929  * struct
2930  *
2931  ******************************************************************************/
2933 
2934 /*!*****************************************************************************
2935  * \brief Create event and return event handle if successful (Windows only)
2936  *
2937  * \return On success returns a event handle
2938  * On failure returns NI_INVALID_EVENT_HANDLE
2939  ******************************************************************************/
2940 LIB_API ni_event_handle_t ni_create_event(void);
2941 
2942 /*!*****************************************************************************
2943  * \brief Close event and release resources (Windows only)
2944  *
2945  * \return NONE
2946  *
2947  ******************************************************************************/
2948 LIB_API void ni_close_event(ni_event_handle_t event_handle);
2949 
2950 /*!*****************************************************************************
2951  * \brief Open device and return device device_handle if successful
2952  *
2953  * \param[in] p_dev Device name represented as c string. ex: "/dev/nvme0"
2954  * \param[out] p_max_io_size_out Maximum IO Transfer size supported
2955  *
2956  * \return On success returns a device device_handle
2957  * On failure returns NI_INVALID_DEVICE_HANDLE
2958  ******************************************************************************/
2959 LIB_API ni_device_handle_t ni_device_open(const char *dev,
2960  uint32_t *p_max_io_size_out);
2961 
2962 /*!*****************************************************************************
2963  * \brief Close device and release resources
2964  *
2965  * \param[in] device_handle Device handle obtained by calling ni_device_open()
2966  *
2967  * \return NONE
2968  *
2969  ******************************************************************************/
2970 LIB_API void ni_device_close(ni_device_handle_t dev);
2971 
2972 /*!*****************************************************************************
2973  * \brief Query device and return device capability structure
2974  * This function had been replaced by ni_device_capability_query2
2975  * This function can't be callback in multi thread
2976  *
2977  * \param[in] device_handle Device handle obtained by calling ni_device_open
2978  * \param[in] p_cap Pointer to a caller allocated ni_device_capability_t
2979  * struct
2980  * \return On success
2981  * NI_RETCODE_SUCCESS
2982  * On failure
2983  * NI_RETCODE_INVALID_PARAM
2984  * NI_RETCODE_ERROR_MEM_ALOC
2985  * NI_RETCODE_ERROR_NVME_CMD_FAILED
2986  ******************************************************************************/
2988  ni_device_handle_t device_handle, ni_device_capability_t *p_cap);
2989 
2990 /*!*****************************************************************************
2991  * \brief Query device and return device capability structure
2992  * This function had replaced ni_device_capability_query
2993  * This function can be callback with multi thread
2994  *
2995  * \param[in] device_handle Device handle obtained by calling ni_device_open
2996  * \param[in] p_cap Pointer to a caller allocated ni_device_capability_t
2997  * struct
2998  * \param[in] device_in_ctxt If device is in ctx
2999  * \return On success
3000  * NI_RETCODE_SUCCESS
3001  * On failure
3002  * NI_RETCODE_INVALID_PARAM
3003  * NI_RETCODE_ERROR_MEM_ALOC
3004  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3005  ******************************************************************************/
3006 LIB_API ni_retcode_t ni_device_capability_query2(ni_device_handle_t device_handle,
3007  ni_device_capability_t *p_cap, bool device_in_ctxt);
3008 
3009 /*!*****************************************************************************
3010  * \brief Open a new device session depending on the device_type parameter
3011  * If device_type is NI_DEVICE_TYPE_DECODER opens decoding session
3012  * If device_type is NI_DEVICE_TYPE_ENCODER opens encoding session
3013  * If device_type is NI_DEVICE_TYPE_SCALER opens scaling session
3014  *
3015  * \param[in] p_ctx Pointer to a caller allocated
3016  * ni_session_context_t struct
3017  * \param[in] device_type NI_DEVICE_TYPE_DECODER, NI_DEVICE_TYPE_ENCODER,
3018  * or NI_DEVICE_TYPE_SCALER
3019  * \return On success
3020  * NI_RETCODE_SUCCESS
3021  * On failure
3022  * NI_RETCODE_INVALID_PARAM
3023  * NI_RETCODE_ERROR_MEM_ALOC
3024  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3025  * NI_RETCODE_ERROR_INVALID_SESSION
3026  ******************************************************************************/
3028  ni_device_type_t device_type);
3029 
3030 /*!*****************************************************************************
3031  * \brief Close device session that was previously opened by calling
3032  * ni_device_session_open()
3033  * If device_type is NI_DEVICE_TYPE_DECODER closes decoding session
3034  * If device_type is NI_DEVICE_TYPE_ENCODER closes encoding session
3035  * If device_type is NI_DEVICE_TYPE_SCALER closes scaling session
3036  *
3037  * \param[in] p_ctx Pointer to a caller allocated
3038  * ni_session_context_t struct
3039  * \param[in] eos_received Flag indicating if End Of Stream indicator was
3040  * received
3041  * \param[in] device_type NI_DEVICE_TYPE_DECODER, NI_DEVICE_TYPE_ENCODER,
3042  * or NI_DEVICE_TYPE_SCALER
3043  * \return On success
3044  * NI_RETCODE_SUCCESS
3045  * On failure
3046  * NI_RETCODE_INVALID_PARAM
3047  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3048  * NI_RETCODE_ERROR_INVALID_SESSION
3049  ******************************************************************************/
3051  int eos_received,
3052  ni_device_type_t device_type);
3053 
3054 /*!*****************************************************************************
3055  * \brief Send a flush command to the device
3056  * If device_type is NI_DEVICE_TYPE_DECODER sends EOS command to
3057  * decoder
3058  * If device_type is NI_DEVICE_TYPE_ENCODER sends EOS command to
3059  * encoder
3060  *
3061  * \param[in] p_ctx Pointer to a caller allocated
3062  * ni_session_context_t struct
3063  * \param[in] device_type NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER
3064  * \return On success
3065  * NI_RETCODE_SUCCESS
3066  * On failure
3067  * NI_RETCODE_INVALID_PARAM
3068  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3069  * NI_RETCODE_ERROR_INVALID_SESSION
3070  ******************************************************************************/
3072  ni_device_type_t device_type);
3073 
3074 /*!*****************************************************************************
3075  * \brief Save a stream's headers in a decoder session that can be used later
3076  * for continuous decoding from the same source.
3077  *
3078  * \param[in] p_ctx Pointer to a caller allocated
3079  * ni_session_context_t struct
3080  * \param[in] hdr_data Pointer to header data
3081  * \param[in] hdr_size Size of header data in bytes
3082  * \return On success
3083  * NI_RETCODE_SUCCESS
3084  * On failure
3085  * NI_RETCODE_INVALID_PARAM
3086  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3087  * NI_RETCODE_ERROR_INVALID_SESSION
3088  ******************************************************************************/
3090  ni_session_context_t *p_ctx, uint8_t *hdr_data, uint8_t hdr_size);
3091 
3092 /*!*****************************************************************************
3093  * \brief Flush a decoder session to get ready to continue decoding.
3094  * Note: this is different from ni_device_session_flush in that it closes the
3095  * current decode session and opens a new one for continuous decoding.
3096  *
3097  * \param[in] p_ctx Pointer to a caller allocated
3098  * ni_session_context_t struct
3099  * \return On success
3100  * NI_RETCODE_SUCCESS
3101  * On failure
3102  * NI_RETCODE_INVALID_PARAM
3103  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3104  * NI_RETCODE_ERROR_INVALID_SESSION
3105  ******************************************************************************/
3107 
3108 /*!*****************************************************************************
3109  * \brief Send data to the device
3110  * If device_type is NI_DEVICE_TYPE_DECODER sends data packet to
3111  * decoder
3112  * If device_type is NI_DEVICE_TYPE_ENCODER sends data frame to encoder
3113  * If device_type is NI_DEVICE_TYPE_AI sends data frame to AI engine
3114  *
3115  * \param[in] p_ctx Pointer to a caller allocated
3116  * ni_session_context_t struct
3117  * \param[in] p_data Pointer to a caller allocated
3118  * ni_session_data_io_t struct which contains either a
3119  * ni_frame_t data frame or ni_packet_t data packet to
3120  * send
3121  * \param[in] device_type NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER or
3122  * NI_DEVICE_TYPE_AI
3123  * If NI_DEVICE_TYPE_DECODER is specified, it is
3124  * expected that the ni_packet_t struct inside the
3125  * p_data pointer contains data to send.
3126  * If NI_DEVICE_TYPE_ENCODER or NI_DEVICE_TYPE_AI is
3127  * specified, it is expected that the ni_frame_t
3128  * struct inside the p_data pointer contains data to
3129  * send.
3130  * \return On success
3131  * Total number of bytes written
3132  * On failure
3133  * NI_RETCODE_INVALID_PARAM
3134  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3135  * NI_RETCODE_ERROR_INVALID_SESSION
3136  ******************************************************************************/
3138  ni_session_data_io_t *p_data,
3139  ni_device_type_t device_type);
3140 
3141 /*!*****************************************************************************
3142  * \brief Read data from the device
3143  * If device_type is NI_DEVICE_TYPE_DECODER reads data packet from
3144  * decoder
3145  * If device_type is NI_DEVICE_TYPE_ENCODER reads data frame from
3146  * encoder
3147  * If device_type is NI_DEVICE_TYPE_AI reads data frame from AI engine
3148  *
3149  * \param[in] p_ctx Pointer to a caller allocated
3150  * ni_session_context_t struct
3151  * \param[in] p_data Pointer to a caller allocated ni_session_data_io_t
3152  * struct which contains either a ni_frame_t data frame
3153  * or ni_packet_t data packet to send
3154  * \param[in] device_type NI_DEVICE_TYPE_DECODER, NI_DEVICE_TYPE_ENCODER, or
3155  * NI_DEVICE_TYPE_SCALER
3156  * If NI_DEVICE_TYPE_DECODER is specified, data that
3157  * was read will be placed into ni_frame_t struct
3158  * inside the p_data pointer
3159  * If NI_DEVICE_TYPE_ENCODER is specified, data that
3160  * was read will be placed into ni_packet_t struct
3161  * inside the p_data pointer
3162  * If NI_DEVICE_TYPE_AI is specified, data that was
3163  * read will be placed into ni_frame_t struct inside
3164  * the p_data pointer
3165  * \return On success
3166  * Total number of bytes read
3167  * On failure
3168  * NI_RETCODE_INVALID_PARAM
3169  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3170  * NI_RETCODE_ERROR_INVALID_SESSION
3171  ******************************************************************************/
3173  ni_session_data_io_t *p_data,
3174  ni_device_type_t device_type);
3175 
3176 /*!*****************************************************************************
3177  * \brief Query session data from the device -
3178  * If device_type is valid, will query session data
3179  * from specified device type
3180  *
3181  * \param[in] p_ctx Pointer to a caller allocated
3182  * ni_session_context_t struct
3183  * \param[in] device_type NI_DEVICE_TYPE_DECODER or
3184  * NI_DEVICE_TYPE_ENCODER or
3185  * NI_DEVICE_TYPE_SCALER or
3186  * NI_DEVICE_TYPE_AI or
3187  * NI_DEVICE_TYPE_UPLOADER
3188  *
3189  * \return On success
3190  * NI_RETCODE_SUCCESS
3191  * On failure
3192  * NI_RETCODE_INVALID_PARAM
3193  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3194  * NI_RETCODE_ERROR_INVALID_SESSION
3195  ******************************************************************************/
3197  ni_device_type_t device_type);
3198 /*!*****************************************************************************
3199  * \brief Query detail session data from the device -
3200  * If device_type is valid, will query session data
3201  * from specified device type
3202  *
3203  * \param[in] p_ctx Pointer to a caller allocated
3204  * ni_session_context_t struct
3205  * \param[in] device_type NI_DEVICE_TYPE_DECODER or
3206  * NI_DEVICE_TYPE_ENCODER or
3207  *
3208  * \return On success
3209  * NI_RETCODE_SUCCESS
3210  * On failure
3211  * NI_RETCODE_INVALID_PARAM
3212  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3213  * NI_RETCODE_ERROR_INVALID_SESSION
3214  ******************************************************************************/
3216  ni_device_type_t device_type, ni_instance_mgr_detail_status_t *detail_data);
3217 
3218 /*!*****************************************************************************
3219  * \brief Query detail session data from the device -
3220  * If device_type is valid, will query session data
3221  * from specified device type
3222  *
3223  * \param[in] p_ctx Pointer to a caller allocated
3224  * ni_session_context_t struct
3225  * \param[in] device_type NI_DEVICE_TYPE_DECODER or
3226  * NI_DEVICE_TYPE_ENCODER or
3227  *
3228  * \return On success
3229  * NI_RETCODE_SUCCESS
3230  * On failure
3231  * NI_RETCODE_INVALID_PARAM
3232  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3233  * NI_RETCODE_ERROR_INVALID_SESSION
3234  ******************************************************************************/
3236 
3237 /*!*****************************************************************************
3238  * \brief Send namespace num and SRIOv index to the device with specified logic block
3239  * address.
3240  *
3241  * \param[in] device_handle Device handle obtained by calling ni_device_open
3242  * \param[in] namespace_num Set the namespace number with designated sriov
3243  * \param[in] sriov_index Identify which sriov need to be set
3244  *
3245  * \return On success
3246  * NI_RETCODE_SUCCESS
3247  * On failure
3248  * NI_RETCODE_ERROR_MEM_ALOC
3249  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3250  ******************************************************************************/
3251 LIB_API ni_retcode_t ni_device_config_namespace_num(ni_device_handle_t device_handle,
3252  uint32_t namespace_num, uint32_t sriov_index);
3253 
3254 /*!*****************************************************************************
3255  * \brief Send qos mode to the device with specified logic block
3256  * address.
3257  *
3258  * \param[in] device_handle Device handle obtained by calling ni_device_open
3259  * \param[in] mode The requested qos mode
3260  *
3261  * \return On success
3262  * NI_RETCODE_SUCCESS
3263  * On failure
3264  * NI_RETCODE_ERROR_MEM_ALOC
3265  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3266  ******************************************************************************/
3267 LIB_API ni_retcode_t ni_device_config_qos(ni_device_handle_t device_handle,
3268  uint32_t mode);
3269 
3270  /*!*****************************************************************************
3271  * \brief Send qos over provisioning mode to target namespace with specified logic
3272  * block address.
3273  *
3274  * \param[in] device_handle Device handle obtained by calling ni_device_open
3275  * \param[in] device_handle_t Target device handle of namespace required for OP
3276  * \param[in] over_provision The request overprovision percent
3277  *
3278  * \return On success
3279  * NI_RETCODE_SUCCESS
3280  * On failure
3281  * NI_RETCODE_ERROR_MEM_ALOC
3282  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3283  ******************************************************************************/
3284 LIB_API ni_retcode_t ni_device_config_qos_op(ni_device_handle_t device_handle,
3285  ni_device_handle_t device_handle_t,
3286  uint32_t over_provision);
3287 
3288 /*!*****************************************************************************
3289  * \brief Allocate preliminary memory for the frame buffer based on provided
3290  * parameters. Applicable to YUV420 Planar pixel (8 or 10 bit/pixel)
3291  * format or 32-bit RGBA.
3292  *
3293  * \param[in] p_frame Pointer to a caller allocated
3294  * ni_frame_t struct
3295  * \param[in] video_width Width of the video frame
3296  * \param[in] video_height Height of the video frame
3297  * \param[in] alignment Allignment requirement
3298  * \param[in] metadata_flag Flag indicating if space for additional metadata
3299  * should be allocated
3300  * \param[in] factor 1 for 8 bits/pixel format, 2 for 10 bits/pixel,
3301  * 4 for 32 bits/pixel (RGBA)
3302  * \param[in] hw_frame_count Number of hw descriptors stored in lieu of raw YUV
3303  * \param[in] is_planar 0 if semiplanar else planar
3304  *
3305  * \return On success
3306  * NI_RETCODE_SUCCESS
3307  * On failure
3308  * NI_RETCODE_INVALID_PARAM
3309  * NI_RETCODE_ERROR_MEM_ALOC
3310  ******************************************************************************/
3311 LIB_API ni_retcode_t ni_frame_buffer_alloc(ni_frame_t *p_frame, int video_width,
3312  int video_height, int alignment,
3313  int metadata_flag, int factor,
3314  int hw_frame_count, int is_planar);
3315 
3316 /*!*****************************************************************************
3317  * \brief Wrapper function for ni_frame_buffer_alloc. Meant to handle RGBA min.
3318  * resoulution considerations for encoder.
3319  *
3320  * \param[in] p_frame Pointer to a caller allocated
3321  * ni_frame_t struct
3322  * \param[in] video_width Width of the video frame
3323  * \param[in] video_height Height of the video frame
3324  * \param[in] alignment Allignment requirement
3325  * \param[in] metadata_flag Flag indicating if space for additional metadata
3326  * should be allocated
3327  * \param[in] factor 1 for 8 bits/pixel format, 2 for 10 bits/pixel,
3328  * 4 for 32 bits/pixel (RGBA)
3329  * \param[in] hw_frame_count Number of hw descriptors stored
3330  * \param[in] is_planar 0 if semiplanar else planar
3331  * \param[in] pix_fmt pixel format to distinguish between planar types
3332  * and/or components
3333  *
3334  * \return On success
3335  * NI_RETCODE_SUCCESS
3336  * On failure
3337  * NI_RETCODE_INVALID_PARAM
3338  * NI_RETCODE_ERROR_MEM_ALOC
3339  ******************************************************************************/
3340 LIB_API ni_retcode_t ni_enc_frame_buffer_alloc(ni_frame_t *p_frame, int video_width,
3341  int video_height, int alignment,
3342  int metadata_flag, int factor,
3343  int hw_frame_count, int is_planar,
3344  ni_pix_fmt_t pix_fmt);
3345 
3347  int video_width, int video_height,
3348  int pixel_format);
3349 
3350 /*!*****************************************************************************
3351  * \brief Allocate memory for decoder frame buffer based on provided
3352  * parameters; the memory is retrieved from a buffer pool and will be
3353  * returned to the same buffer pool by ni_decoder_frame_buffer_free.
3354  * Note: all attributes of ni_frame_t will be set up except for memory and
3355  * buffer, which rely on the pool being allocated; the pool will be
3356  * allocated only after the frame resolution is known.
3357  *
3358  * \param[in] p_pool Buffer pool to get the memory from
3359  * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
3360  * \param[in] alloc_mem Whether to get memory from buffer pool
3361  * \param[in] video_width Width of the video frame
3362  * \param[in] video_height Height of the video frame
3363  * \param[in] alignment Alignment requirement
3364  * \param[in] factor 1 for 8 bits/pixel format, 2 for 10 bits/pixel
3365  * \param[in] is_planar 0 if semiplanar else planar
3366  *
3367  * \return On success
3368  * NI_RETCODE_SUCCESS
3369  * On failure
3370  * NI_RETCODE_INVALID_PARAM
3371  * NI_RETCODE_ERROR_MEM_ALOC
3372  ******************************************************************************/
3374  ni_buf_pool_t *p_pool, ni_frame_t *pframe, int alloc_mem, int video_width,
3375  int video_height, int alignment, int factor, int is_planar);
3376 
3377 /*!*****************************************************************************
3378  * \brief Allocate memory for the frame buffer for encoding based on given
3379  * parameters, taking into account pic line size and extra data.
3380  * Applicable to YUV420p AVFrame only. 8 or 10 bit/pixel.
3381  * Cb/Cr size matches that of Y.
3382  *
3383  * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
3384  *
3385  * \param[in] video_width Width of the video frame
3386  * \param[in] video_height Height of the video frame
3387  * \param[in] linesize Picture line size
3388  * \param[in] alignment Allignment requirement
3389  * \param[in] extra_len Extra data size (incl. meta data). < 0 means not
3390  * to allocate any buffer (zero-copy from existing)
3391  * \param[in] alignment_2pass_wa set alignment to work with 2pass encode
3392  *
3393  * \return On success
3394  * NI_RETCODE_SUCCESS
3395  * On failure
3396  * NI_RETCODE_INVALID_PARAM
3397  * NI_RETCODE_ERROR_MEM_ALOC
3398  *****************************************************************************/
3400  ni_frame_t *pframe, int video_width, int video_height, int linesize[],
3401  int alignment, int extra_len, bool alignment_2pass_wa);
3402 
3404  ni_session_context_t *p_ctx, ni_scaler_input_params_t scaler_params,
3405  niFrameSurface1_t *p_surface);
3406 
3408  ni_session_context_t *p_ctx, ni_scaler_input_params_t scaler_params,
3409  niFrameSurface1_t *p_src_surface);
3410 
3412  ni_session_context_t *p_ctx, ni_scaler_input_params_t scaler_params);
3413 
3414 /*!*****************************************************************************
3415 * \brief Allocate memory for the frame buffer based on provided parameters
3416 * taking into account pic line size and extra data.
3417 * Applicable to nv12 AVFrame only. Cb/Cr size matches that of Y.
3418 *
3419 * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
3420 *
3421 * \param[in] video_width Width of the video frame
3422 * \param[in] video_height Height of the video frame
3423 * \param[in] linesize Picture line size
3424 * \param[in] extra_len Extra data size (incl. meta data). < 0 means not
3425 * to allocate any buffer (zero-copy from existing)
3426 * \param[in] alignment_2pass_wa set alignment to work with 2pass encode
3427 *
3428 * \return On success
3429 * NI_RETCODE_SUCCESS
3430 * On failure
3431 * NI_RETCODE_INVALID_PARAM
3432 * NI_RETCODE_ERROR_MEM_ALOC
3433 *****************************************************************************/
3435  int video_width, int video_height,
3436  int linesize[], int extra_len,
3437  bool alignment_2pass_wa);
3438 
3439 /*!*****************************************************************************
3440  * \brief This API is a wrapper for ni_encoder_frame_buffer_alloc(), used
3441  * for planar pixel formats, and ni_frame_buffer_alloc_nv(), used for
3442  * semi-planar pixel formats. This API is meant to combine the
3443  * functionality for both formats.
3444  * Allocate memory for the frame buffer for encoding based on given
3445  * parameters, taking into account pic line size and extra data.
3446  * Applicable to YUV420p(8 or 10 bit/pixel) or nv12 AVFrame.
3447  * Cb/Cr size matches that of Y.
3448  *
3449  * \param[in] planar true: if planar:
3450  * pixel_format == (NI_PIX_FMT_YUV420P ||
3451  * NI_PIX_FMT_YUV420P10LE ||NI_PIX_FMT_RGBA).
3452  * false: semi-planar:
3453  * pixel_format == (NI_PIX_FMT_NV12 ||
3454  * NI_PIX_FMT_P010LE).
3455  * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
3456  * \param[in] video_width Width of the video frame
3457  * \param[in] video_height Height of the video frame
3458  * \param[in] linesize Picture line size
3459  * \param[in] alignment Allignment requirement. Only used for planar format.
3460  * \param[in] extra_len Extra data size (incl. meta data). < 0 means not
3461  * to allocate any buffer (zero-copy from existing)
3462  * \param[in] alignment_2pass_wa set alignment to work with 2pass encode
3463  *
3464  * \return On success
3465  * NI_RETCODE_SUCCESS
3466  * On failure
3467  * NI_RETCODE_INVALID_PARAM
3468  * NI_RETCODE_ERROR_MEM_ALOC
3469  *****************************************************************************/
3471  int video_width, int video_height,
3472  int linesize[], int alignment,
3473  int extra_len,
3474  bool alignment_2pass_wa);
3475 
3476 /*!*****************************************************************************
3477  * \brief Free frame buffer that was previously allocated with either
3478  * ni_frame_buffer_alloc or ni_encoder_frame_buffer_alloc or
3479  * ni_frame_buffer_alloc_nv
3480  *
3481  * \param[in] p_frame Pointer to a previously allocated ni_frame_t struct
3482  *
3483  * \return On success NI_RETCODE_SUCCESS
3484  * On failure NI_RETCODE_INVALID_PARAM
3485  ******************************************************************************/
3487 
3488 /*!*****************************************************************************
3489  * \brief Free decoder frame buffer that was previously allocated with
3490  * ni_decoder_frame_buffer_alloc, returning memory to a buffer pool.
3491  *
3492  * \param[in] p_frame Pointer to a previously allocated ni_frame_t struct
3493  *
3494  * \return On success NI_RETCODE_SUCCESS
3495  * On failure NI_RETCODE_INVALID_PARAM
3496  ******************************************************************************/
3498 
3499 /*!*****************************************************************************
3500  * \brief Return a memory buffer to memory buffer pool, for a decoder frame.
3501  *
3502  * \param[in] buf Buffer to be returned.
3503  * \param[in] p_buffer_pool Buffer pool to return buffer to.
3504  *
3505  * \return None
3506  ******************************************************************************/
3507 LIB_API void
3509  ni_buf_pool_t *p_buffer_pool);
3510 
3511 /*!*****************************************************************************
3512  * \brief Allocate memory for the packet buffer based on provided packet size
3513  *
3514  * \param[in] p_packet Pointer to a caller allocated
3515  * ni_packet_t struct
3516  * \param[in] packet_size Required allocation size
3517  *
3518  * \return On success
3519  * NI_RETCODE_SUCCESS
3520  * On failure
3521  * NI_RETCODE_INVALID_PARAM
3522  * NI_RETCODE_ERROR_MEM_ALOC
3523  ******************************************************************************/
3525  int packet_size);
3526 
3527 /*!*****************************************************************************
3528  * \brief Allocate packet buffer using a user provided pointer, the memory
3529  * is expected to have already been allocated.
3530  *
3531  * For ideal performance memory should be 4k aligned. If it is not 4K aligned
3532  * then a temporary 4k aligned memory will be used to copy data to and from
3533  * when writing and reading. This will negatively impact performance.
3534  *
3535  * This API will overwrite p_packet->buffer_size, p_packet->p_buffer and
3536  * p_packet->p_data fields in p_packet.
3537  *
3538  * This API will not free any memory associated with p_packet->p_buffer and
3539  * p_packet->p_data fields in p_packet.
3540  * Common use case could be,
3541  * 1. Allocate memory to pointer
3542  * 2. Call ni_custom_packet_buffer_alloc() with allocated pointer.
3543  * 3. Use p_packet as required.
3544  * 4. Call ni_packet_buffer_free() to free up the memory.
3545  *
3546  * \param[in] p_buffer User provided pointer to be used for buffer
3547  * \param[in] p_packet Pointer to a caller allocated
3548  * ni_packet_t struct
3549  * \param[in] buffer_size Buffer size
3550  *
3551  * \return On success
3552  * NI_RETCODE_SUCCESS
3553  * On failure
3554  * NI_RETCODE_INVALID_PARAM
3555  * NI_RETCODE_ERROR_MEM_ALOC
3556  ******************************************************************************/
3558  ni_packet_t *p_packet,
3559  int buffer_size);
3560 
3561 /*!*****************************************************************************
3562  * \brief Free packet buffer that was previously allocated with
3563  * ni_packet_buffer_alloc
3564  *
3565  * \param[in] p_packet Pointer to a previously allocated ni_packet_t struct
3566  *
3567  * \return On success NI_RETCODE_SUCCESS
3568  * On failure NI_RETCODE_INVALID_PARAM
3569  ******************************************************************************/
3571 
3572 /*!*****************************************************************************
3573  * \brief Free packet buffer that was previously allocated with
3574  * ni_packet_buffer_alloc for AV1 packets merge
3575  *
3576  * \param[in] p_packet Pointer to a previously allocated ni_packet_t struct
3577  *
3578  * \return On success NI_RETCODE_SUCCESS
3579  * On failure NI_RETCODE_INVALID_PARAM
3580  ******************************************************************************/
3582 
3583 /*!*****************************************************************************
3584  * \brief Copy video packet accounting for alignment
3585  *
3586  * \param[in] p_destination Destination to where to copy to
3587  * \param[in] p_source Source from where to copy from
3588  * \param[in] cur_size current size
3589  * \param[out] p_leftover Pointer to the data that was left over
3590  * \param[out] p_prev_size Size of the data leftover
3591  *
3592  * \return On success Total number of bytes that were copied
3593  * On failure NI_RETCODE_FAILURE
3594  ******************************************************************************/
3595 LIB_API int ni_packet_copy(void *p_destination, const void *const p_source,
3596  int cur_size, void *p_leftover, int *p_prev_size);
3597 
3598 /*!*****************************************************************************
3599  * \brief Add a new auxiliary data to a frame
3600  *
3601  * \param[in/out] frame a frame to which the auxiliary data should be added
3602  * \param[in] type type of the added auxiliary data
3603  * \param[in] data_size size of the added auxiliary data
3604  *
3605  * \return a pointer to the newly added aux data on success, NULL otherwise
3606  ******************************************************************************/
3608  ni_aux_data_type_t type,
3609  int data_size);
3610 
3611 /*!*****************************************************************************
3612  * \brief Add a new auxiliary data to a frame and copy in the raw data
3613  *
3614  * \param[in/out] frame a frame to which the auxiliary data should be added
3615  * \param[in] type type of the added auxiliary data
3616  * \param[in] raw_data the raw data of the aux data
3617  * \param[in] data_size size of the added auxiliary data
3618  *
3619  * \return a pointer to the newly added aux data on success, NULL otherwise
3620  ******************************************************************************/
3623  const uint8_t *raw_data, int data_size);
3624 
3625 /*!*****************************************************************************
3626  * \brief Retrieve from the frame auxiliary data of a given type if exists
3627  *
3628  * \param[in] frame a frame from which the auxiliary data should be retrieved
3629  * \param[in] type type of the auxiliary data to be retrieved
3630  *
3631  * \return a pointer to the aux data of a given type on success, NULL otherwise
3632  ******************************************************************************/
3634  ni_aux_data_type_t type);
3635 
3636 /*!*****************************************************************************
3637  * \brief If auxiliary data of the given type exists in the frame, free it
3638  * and remove it from the frame.
3639  *
3640  * \param[in/out] frame a frame from which the auxiliary data should be removed
3641  * \param[in] type type of the auxiliary data to be removed
3642  *
3643  * \return None
3644  ******************************************************************************/
3646 
3647 /*!*****************************************************************************
3648  * \brief Free and remove all auxiliary data from the frame.
3649  *
3650  * \param[in/out] frame a frame from which the auxiliary data should be removed
3651  *
3652  * \return None
3653  ******************************************************************************/
3655 
3656 /*!*****************************************************************************
3657  * \brief Initialize default encoder parameters
3658  *
3659  * \param[out] param Pointer to a user allocated ni_xcoder_params_t
3660  * to initialize to default parameters
3661  * \param[in] fps_num Frames per second
3662  * \param[in] fps_denom FPS denomination
3663  * \param[in] bit_rate bit rate
3664  * \param[in] width frame width
3665  * \param[in] height frame height
3666  * \param[in] codec_format codec from ni_codec_format_t
3667  *
3668  * \return On success
3669  * NI_RETCODE_SUCCESS
3670  * On failure
3671  * NI_RETCODE_FAILURE
3672  * NI_RETCODE_INVALID_PARAM
3673  ******************************************************************************/
3675  ni_xcoder_params_t *p_param, int fps_num, int fps_denom, long bit_rate,
3676  int width, int height, ni_codec_format_t codec_format);
3677 
3678 /*!*****************************************************************************
3679  * \brief Initialize default decoder parameters
3680  *
3681  * \param[out] param Pointer to a user allocated ni_xcoder_params_t
3682  * to initialize to default parameters
3683  * \param[in] fps_num Frames per second
3684  * \param[in] fps_denom FPS denomination
3685  * \param[in] bit_rate bit rate
3686  * \param[in] width frame width
3687  * \param[in] height frame height
3688  *
3689  * \return On success
3690  * NI_RETCODE_SUCCESS
3691  * On failure
3692  * NI_RETCODE_FAILURE
3693  * NI_RETCODE_INVALID_PARAM
3694  ******************************************************************************/
3696  int fps_num, int fps_denom,
3697  long bit_rate, int width,
3698  int height);
3699 
3700 /*!*****************************************************************************
3701  * \brief Set value referenced by name in encoder parameters structure
3702  *
3703  * \param[in] p_params Pointer to a user allocated ni_xcoder_params_t
3704  * to find and set a particular parameter
3705  * \param[in] name String represented parameter name to search
3706  * \param[in] value Parameter value to set
3707 *
3708  * \return On success
3709  * NI_RETCODE_SUCCESS
3710  * On failure
3711  * NI_RETCODE_FAILURE
3712  * NI_RETCODE_INVALID_PARAM
3713  ******************************************************************************/
3715  const char *name,
3716  const char *value);
3717 
3718 /*!*****************************************************************************
3719 * \brief Set value referenced by name in decoder parameters structure
3720 *
3721 * \param[in] p_params Pointer to a user allocated ni_xcoder_params_t (used
3722 * for decoder too for now ) to find and set a particular
3723 * parameter
3724 * \param[in] name String represented parameter name to search
3725 * \param[in] value Parameter value to set
3726 *
3727 * \return On success
3728 * NI_RETCODE_SUCCESS
3729 * On failure
3730 * NI_RETCODE_FAILURE
3731 * NI_RETCODE_INVALID_PARAM
3732 ******************************************************************************/
3734  const char *name, char *value);
3735 
3736 /*!*****************************************************************************
3737  * \brief Set GOP parameter value referenced by name in encoder parameters
3738  * structure
3739  *
3740  * \param[in] p_params Pointer to a user allocated ni_xcoder_params_t
3741  * to find and set a particular parameter
3742  * \param[in] name String represented parameter name to search
3743  * \param[in] value Parameter value to set
3744 *
3745  * \return On success
3746  * NI_RETCODE_SUCCESS
3747  * On failure
3748  * NI_RETCODE_FAILURE
3749  * NI_RETCODE_INVALID_PARAM
3750  ******************************************************************************/
3752  ni_xcoder_params_t *p_params, const char *name, const char *value);
3753 
3754 /*!*****************************************************************************
3755 * \brief Copy existing decoding session params for hw frame usage
3756 *
3757 * \param[in] src_p_ctx Pointer to a caller allocated source session context
3758 * \param[in] dst_p_ctx Pointer to a caller allocated destination session
3759 * context
3760 * \return On success
3761 * NI_RETCODE_SUCCESS
3762 * On failure
3763 * NI_RETCODE_INVALID_PARAM
3764 ******************************************************************************/
3766  ni_session_context_t *dst_p_ctx);
3767 
3768 /*!*****************************************************************************
3769 * \brief Send frame pool setup info to device
3770 *
3771 * \param[in] p_ctx Pointer to a caller allocated
3772 * ni_session_context_t struct
3773 * \param[in] pool_size Upload session initial allocated frames count
3774 * must be > 0,
3775 * \param[in] pool 0 use the normal pool
3776 * 1 use a dedicated P2P pool
3777 *
3778 * \return On success Return code
3779 * On failure
3780 * NI_RETCODE_INVALID_PARAM
3781 * NI_RETCODE_ERROR_NVME_CMD_FAILED
3782 * NI_RETCODE_ERROR_INVALID_SESSION
3783 * NI_RETCODE_ERROR_MEM_ALOC
3784 ******************************************************************************/
3786  uint32_t pool_size, uint32_t pool);
3787 
3788 /*!*****************************************************************************
3789 * \brief Sends frame pool change info to device
3790 *
3791 * \param[in] p_ctx Pointer to a caller allocated
3792 * ni_session_context_t struct
3793 * \param[in] pool_size if pool_size = 0, free allocated device memory buffers
3794 * if pool_size > 0, expand device frame buffer pool of
3795 * current instance with pool_size more frame buffers
3796 *
3797 * \return On success Return code
3798 * On failure
3799 * NI_RETCODE_FAILURE
3800 * NI_RETCODE_INVALID_PARAM
3801 * NI_RETCODE_ERROR_NVME_CMD_FAILED
3802 * NI_RETCODE_ERROR_INVALID_SESSION
3803 * NI_RETCODE_ERROR_MEM_ALOC
3804 * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
3805 *******************************************************************************/
3807  uint32_t pool_size);
3808 
3809 /*!*****************************************************************************
3810 * \brief Read data from the device
3811 * If device_type is NI_DEVICE_TYPE_DECODER reads data hwdesc from
3812 * decoder
3813 * If device_type is NI_DEVICE_TYPE_SCALER reads data hwdesc from
3814 * scaler
3815 *
3816 * \param[in] p_ctx Pointer to a caller allocated
3817 * ni_session_context_t struct
3818 * \param[in] p_data Pointer to a caller allocated
3819 * ni_session_data_io_t struct which contains either a
3820 * ni_frame_t data frame or ni_packet_t data packet to
3821 * send
3822 * \param[in] device_type NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_SCALER
3823 * If NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_SCALER is specified,
3824 * hw descriptor info will be stored in p_data ni_frame
3825 * \return On success
3826 * Total number of bytes read
3827 * On failure
3828 * NI_RETCODE_INVALID_PARAM
3829 * NI_RETCODE_ERROR_NVME_CMD_FAILED
3830 * NI_RETCODE_ERROR_INVALID_SESSION
3831 ******************************************************************************/
3833  ni_session_data_io_t *p_data,
3834  ni_device_type_t device_type);
3835 
3836 /*!*****************************************************************************
3837 * \brief Read YUV data from hw descriptor stored location on device
3838 *
3839 * \param[in] p_ctx Pointer to a caller allocated
3840 * ni_session_context_t struct
3841 * \param[in] p_data Pointer to a caller allocated
3842 * ni_session_data_io_t struct which contains either a
3843 * ni_frame_t data frame or ni_packet_t data packet to
3844 * send
3845 * \param[in] hwdesc HW descriptor to find frame in XCODER
3846 * \return On success
3847 * Total number of bytes read
3848 * On failure
3849 * NI_RETCODE_INVALID_PARAM
3850 * NI_RETCODE_ERROR_NVME_CMD_FAILED
3851 * NI_RETCODE_ERROR_INVALID_SESSION
3852 ******************************************************************************/
3854  ni_session_data_io_t *p_data,
3855  niFrameSurface1_t *hwdesc);
3856 
3857 /*!*****************************************************************************
3858 * \brief Query the session if a buffer is available
3859 *
3860 * \param[in] p_ctx Pointer to a caller allocated
3861 * ni_session_context_t struct
3862 * \param[in] device_type Quadra device type
3863 *
3864 * \return On success
3865 * NI_RETCODE_SUCCESS
3866 * On failure
3867 * NI_RETCODE_INVALID_PARAM
3868 * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
3869 * NI_RETCODE_ERROR_NVME_CMD_FAILED
3870 * NI_RETCODE_ERROR_INVALID_SESSION
3871 *******************************************************************************/
3873  ni_device_type_t device_type);
3874 
3875 
3876 /*!*****************************************************************************
3877 * \brief Send raw YUV input to uploader instance and retrieve a HW descriptor
3878 * to represent it
3879 *
3880 * \param[in] p_ctx Pointer to a caller allocated
3881 * ni_session_context_t struct
3882 * \param[in] p_src_data Pointer to a caller allocated
3883 * ni_session_data_io_t struct which contains a
3884 * ni_frame_t data frame to send to uploader
3885 * \param[out] hwdesc HW descriptor to find frame in XCODER
3886 * \return On success
3887 * Total number of bytes read
3888 * On failure
3889 * NI_RETCODE_INVALID_PARAM
3890 * NI_RETCODE_ERROR_NVME_CMD_FAILED
3891 * NI_RETCODE_ERROR_INVALID_SESSION
3892 *******************************************************************************/
3894 
3895 /*!*****************************************************************************
3896 * \brief Allocate memory for the hwDescriptor buffer based on provided
3897 * parameters taking into account pic size and extra data.
3898 *
3899 * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
3900 *
3901 * \param[in] video_width Width of the video frame
3902 * \param[in] video_height Height of the video frame
3903 * \param[in] extra_len Extra data size (incl. meta data)
3904 *
3905 * \return On success
3906 * NI_RETCODE_SUCCESS
3907 * On failure
3908 * NI_RETCODE_INVALID_PARAM
3909 * NI_RETCODE_ERROR_MEM_ALOC
3910 *****************************************************************************/
3912  int video_width,
3913  int video_height,
3914  int extra_len);
3915 
3916 /*!*****************************************************************************
3917 * \brief Recycle a hwframe buffer on card
3918 *
3919 * \param[in] surface Struct containing device and frame location to clear out
3920 * \param[in] device_handle handle to access device memory buffer is stored in
3921 *
3922 * \return On success NI_RETCODE_SUCCESS
3923 * On failure NI_RETCODE_INVALID_PARAM
3924 *******************************************************************************/
3926  int32_t device_handle);
3927 
3928 
3929 /*!*****************************************************************************
3930 * \brief Recycle a hwframe buffer on card
3931 *
3932 * \param[in] surface Struct containing device and frame location to clear out
3933 *
3934 * \return On success NI_RETCODE_SUCCESS
3935 * On failure NI_RETCODE_INVALID_PARAM
3936 *******************************************************************************/
3938 
3939 /*!*****************************************************************************
3940  * \brief Set parameters on the device for the 2D engine
3941  *
3942  * \param[in] p_ctx pointer to session context
3943  * \param[in] p_params pointer to the scaler parameters
3944  *
3945  * \return NI_RETCODE_INVALID_PARAM
3946  * NI_RETCODE_ERROR_INVALID_SESSION
3947  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3948 
3949  ******************************************************************************/
3951  ni_scaler_params_t *p_params);
3952 
3953 /*!*****************************************************************************
3954  * \brief Allocate a frame on the device for 2D engine or AI engine
3955  * to work on based on provided parameters
3956  *
3957  * \param[in] p_ctx pointer to session context
3958  * \param[in] width width, in pixels
3959  * \param[in] height height, in pixels
3960  * \param[in] format pixel format
3961  * \param[in] options options bitmap flags, bit 0 (NI_SCALER_FLAG_IO) is
3962  * 0=input frame or 1=output frame. Bit 1 (NI_SCALER_FLAG_PC) is
3963  * 0=single allocation, 1=create pool. Bit 2 (NI_SCALER_FLAG_PA) is
3964  * 0=straight alpha, 1=premultiplied alpha
3965  * \param[in] rectangle_width clipping rectangle width
3966  * \param[in] rectangle_height clipping rectangle height
3967  * \param[in] rectangle_x horizontal position of clipping rectangle
3968  * \param[in] rectangle_y vertical position of clipping rectangle
3969  * \param[in] rgba_color RGBA fill colour (for padding only)
3970  * \param[in] frame_index input hwdesc index
3971  * \param[in] device_type only NI_DEVICE_TYPE_SCALER
3972  * and NI_DEVICE_TYPE_AI (only needs p_ctx and frame_index)
3973  *
3974  * \return NI_RETCODE_INVALID_PARAM
3975  * NI_RETCODE_ERROR_INVALID_SESSION
3976  * NI_RETCODE_ERROR_NVME_CMD_FAILED
3977  * NI_RETCODE_ERROR_MEM_ALOC
3978  ******************************************************************************/
3980  int width,
3981  int height,
3982  int format,
3983  int options,
3984  int rectangle_width,
3985  int rectangle_height,
3986  int rectangle_x,
3987  int rectangle_y,
3988  int rgba_color,
3989  int frame_index,
3990  ni_device_type_t device_type);
3991 
3992 /*!*****************************************************************************
3993  * \brief Allocate a frame on the device and return the frame index
3994  *
3995  * \param[in] p_ctx pointer to session context
3996  * \param[in] p_out_surface pointer to output frame surface
3997  * \param[in] device_type currently only NI_DEVICE_TYPE_AI
3998  *
3999  * \return NI_RETCODE_INVALID_PARAM
4000  * NI_RETCODE_ERROR_INVALID_SESSION
4001  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4002  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4003  * NI_RETCODE_ERROR_MEM_ALOC
4004  ******************************************************************************/
4006  niFrameSurface1_t *p_out_surface,
4007  ni_device_type_t device_type);
4008 
4009 /*!*****************************************************************************
4010  * \brief Copy the data of src hwframe to dst hwframe
4011  *
4012  * \param[in] p_ctx pointer to session context
4013  * \param[in] p_frameclone_desc pointer to the frameclone descriptor
4014  *
4015  * \return NI_RETCODE_INVALID_PARAM
4016  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4017  * NI_RETCODE_ERROR_INVALID_SESSION
4018  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4019  * NI_RETCODE_ERROR_MEM_ALOC
4020  ******************************************************************************/
4022  ni_frameclone_desc_t *p_frameclone_desc);
4023 
4024 /*!*****************************************************************************
4025  * \brief Config a frame on the device for 2D engined
4026  * to work on based on provided parameters
4027  *
4028  * \param[in] p_ctx pointer to session context
4029  * \param[in] p_cfg pointer to frame config
4030  *
4031  * \return NI_RETCODE_INVALID_PARAM
4032  * NI_RETCODE_ERROR_INVALID_SESSION
4033  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4034  * NI_RETCODE_ERROR_MEM_ALOC
4035  ******************************************************************************/
4037  ni_frame_config_t *p_cfg);
4038 
4040  ni_scaler_drawbox_params_t *p_params);
4041 
4043  ni_scaler_watermark_params_t *p_params);
4044 
4045 /*!*****************************************************************************
4046  * \brief Config multiple frame on the device for 2D engined
4047  * to work on based on provided parameters
4048  *
4049  * \param[in] p_ctx pointer to session context
4050  * \param[in] p_cfg_in input frame config array
4051  * \param[in] numInCfgs number of frame config entries in the p_cfg_in array
4052  * \param[in] p_cfg_out output frame config
4053  *
4054  * \return NI_RETCODE_INVALID_PARAM
4055  * NI_RETCODE_ERROR_INVALID_SESSION
4056  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4057  * NI_RETCODE_ERROR_MEM_ALOC
4058  ******************************************************************************/
4060  ni_frame_config_t p_cfg_in[],
4061  int numInCfgs,
4062  ni_frame_config_t *p_cfg_out);
4063 
4064 /*!*****************************************************************************
4065  * \brief Allocate memory for the frame buffer based on provided parameters
4066  * taking into account the pixel format, width, height, stride,
4067  * alignment, and extra data
4068  * \param[in] p_frame Pointer to caller allocated ni_frame_t
4069  * \param[in] pixel_format a pixel format in ni_pix_fmt_t enum
4070  * \param[in] video_width width, in pixels
4071  * \param[in] video_height height, in pixels
4072  * \param[in] linesize horizontal stride
4073  * \param[in] alignment apply a 16 pixel height alignment (T408 only)
4074  * \param[in] extra_len meta data size
4075  *
4076  * \return NI_RETCODE_SUCCESS
4077  * NI_RETCODE_INVALID_PARAM
4078  * NI_RETCODE_ERROR_MEM_ALOC
4079  *
4080  ******************************************************************************/
4082  ni_frame_t *pframe, int pixel_format, int video_width, int video_height,
4083  int linesize[], int alignment, int extra_len);
4084 
4085 /*!*****************************************************************************
4086  * \brief configure a network context based with the network binary
4087  *
4088  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4089  * \param[in] file Pointer to caller network binary file path
4090  *
4091  * \return NI_RETCODE_SUCCESS
4092  * NI_RETCODE_INVALID_PARAM
4093  * NI_RETCODE_ERROR_MEM_ALOC
4094  * NI_RETCODE_ERROR_INVALID_SESSION
4095  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4096  * NI_RETCODE_FAILURE
4097  *
4098  ******************************************************************************/
4100  ni_network_data_t *p_network,
4101  const char *file);
4102 
4103 /*!*****************************************************************************
4104  * \brief configure a hvsplus filter
4105  *
4106  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4107  *
4108  * \return NI_RETCODE_SUCCESS
4109  * NI_RETCODE_FAILURE
4110  *
4111  ******************************************************************************/
4113  ni_network_data_t *p_network);
4114 
4115 /*!*****************************************************************************
4116  * \brief Allocate input layers memory for AI frame buffer based on provided parameters
4117  * taking into account width, height, format defined by network.
4118  *
4119  * \param[out] p_frame Pointer to caller allocated ni_frame_t
4120  * \param[in] p_network Pointer to caller allocated ni_network_data_t
4121  *
4122  * \return NI_RETCODE_SUCCESS
4123  * NI_RETCODE_INVALID_PARAM
4124  * NI_RETCODE_ERROR_MEM_ALOC
4125  *
4126  ******************************************************************************/
4128  ni_network_data_t *p_network);
4129 
4130 /*!*****************************************************************************
4131  * \brief Allocate output layers memory for the packet buffer based on provided network
4132  *
4133  * \param[out] p_packet Pointer to a caller allocated
4134  * ni_packet_t struct
4135  * \param[in] p_network Pointer to a caller allocated
4136  * ni_network_data_t struct
4137  *
4138  * \return On success
4139  * NI_RETCODE_SUCCESS
4140  * On failure
4141  * NI_RETCODE_INVALID_PARAM
4142  * NI_RETCODE_ERROR_MEM_ALOC
4143  ******************************************************************************/
4145  ni_network_data_t *p_network);
4146 
4147 // wrapper API request, dynamic encode configuration setting to be sent to the
4148 // encoder with the next frame
4149 
4150 /*!*****************************************************************************
4151  * \brief Reconfigure bitrate dynamically during encoding.
4152  *
4153  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4154  * \param[in] bitrate Target bitrate to set
4155  *
4156  * \return On success NI_RETCODE_SUCCESS
4157  * On failure NI_RETCODE_INVALID_PARAM
4158  ******************************************************************************/
4160  int32_t bitrate);
4161 
4162 /*!*****************************************************************************
4163  * \brief Reconfigure intraPeriod dynamically during encoding.
4164  *
4165  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4166  * \param[in] intra_period Target intra period to set
4167  *
4168  * \return On success NI_RETCODE_SUCCESS
4169  * On failure NI_RETCODE_INVALID_PARAM
4170  *
4171  * NOTE - the frame upon which intra period is reconfigured is encoded as IDR frame
4172  * NOTE - reconfigure intra period is not allowed if intraRefreshMode is enabled or if gopPresetIdx is 1
4173  *
4174  ******************************************************************************/
4176  int32_t intra_period);
4177 
4178 /*!*****************************************************************************
4179  * \brief Reconfigure VUI dynamically during encoding.
4180  *
4181  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4182  * \param[in] bitrate Target bitrate to set
4183  *
4184  * \return On success NI_RETCODE_SUCCESS
4185  * On failure NI_RETCODE_INVALID_PARAM
4186  ******************************************************************************/
4188  ni_vui_hrd_t *vui);
4189 
4190 /*!*****************************************************************************
4191  * \brief Force next frame to be IDR frame during encoding.
4192  *
4193  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4194  *
4195  * \return On success NI_RETCODE_SUCCESS
4196  ******************************************************************************/
4198 
4199 /*!*****************************************************************************
4200  * \brief Set a frame's support of Long Term Reference frame during encoding.
4201  *
4202  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4203  * \param[in] ltr Pointer to struct specifying LTR support
4204  *
4205  * \return On success NI_RETCODE_SUCCESS
4206  * On failure NI_RETCODE_INVALID_PARAM
4207  ******************************************************************************/
4209  ni_long_term_ref_t *ltr);
4210 
4211 /*!*****************************************************************************
4212  * \brief Set Long Term Reference interval
4213  *
4214  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4215  * \param[in] ltr_interval the new long term reference inteval value
4216  *
4217  * \return On success NI_RETCODE_SUCCESS
4218  * On failure NI_RETCODE_INVALID_PARAM
4219  ******************************************************************************/
4221  int32_t ltr_interval);
4222 
4223 /*!*****************************************************************************
4224  * \brief Set frame reference invalidation
4225  *
4226  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4227  * \param[in] frame_num frame number after which all references shall be
4228  * invalidated
4229  *
4230  * \return On success NI_RETCODE_SUCCESS
4231  * On failure NI_RETCODE_INVALID_PARAM
4232  ******************************************************************************/
4234  int32_t frame_num);
4235 
4236 /*!*****************************************************************************
4237  * \brief Reconfigure framerate dynamically during encoding.
4238  *
4239  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4240  * \param[in] framerate Pointer to struct specifying framerate to set
4241  *
4242  * \return On success NI_RETCODE_SUCCESS
4243  * On failure NI_RETCODE_INVALID_PARAM
4244  ******************************************************************************/
4246  ni_framerate_t *framerate);
4247 
4248 /*!*****************************************************************************
4249  * \brief Reconfigure maxFrameSize dynamically during encoding.
4250  *
4251  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4252  * \param[in] max_frame_size the new maxFrameSize value
4253  *
4254  * \return On success NI_RETCODE_SUCCESS
4255  * On failure NI_RETCODE_INVALID_PARAM
4256  *
4257  * NOTE - maxFrameSize_Bytes value less than ((bitrate / 8) / framerate) will be rejected
4258  *
4259  ******************************************************************************/
4261  int32_t max_frame_size);
4262 
4263 /*!*****************************************************************************
4264  * \brief Reconfigure min&max qp dynamically during encoding.
4265  *
4266  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4267  * \param[in] ni_rc_min_max_qp Target min&max qp to set
4268  *
4269  * \return On success NI_RETCODE_SUCCESS
4270  * On failure NI_RETCODE_INVALID_PARAM
4271  ******************************************************************************/
4273  ni_rc_min_max_qp *p_min_max_qp);
4274 
4275 
4276 /*!*****************************************************************************
4277  * \brief Reconfigure crf value dynamically during encoding.
4278  *
4279  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4280  * \param[in] crf crf value to reconfigure
4281  *
4282  * \return On success NI_RETCODE_SUCCESS
4283  * On failure NI_RETCODE_INVALID_PARAM
4284  ******************************************************************************/
4286  int32_t crf);
4287 
4288 /*!*****************************************************************************
4289  * \brief Reconfigure crf float point value dynamically during encoding.
4290  *
4291  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4292  * \param[in] crf crf float point value to reconfigure
4293  *
4294  * \return On success NI_RETCODE_SUCCESS
4295  * On failure NI_RETCODE_INVALID_PARAM
4296  ******************************************************************************/
4298  float crf);
4299 
4300 
4301 /*!*****************************************************************************
4302  * \brief Reconfigure vbv buffer size and vbv max rate dynamically during encoding.
4303  *
4304  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4305  * \param[in] vbvBufferSize Target vbvBufferSize to set
4306  * \param[in] vbvMaxRate Target vbvMaxRate to set
4307  *
4308  * \return On success NI_RETCODE_SUCCESS
4309  * On failure NI_RETCODE_INVALID_PARAM
4310  ******************************************************************************/
4312  int32_t vbvMaxRate, int32_t vbvBufferSize);
4313 
4314 /*!*****************************************************************************
4315  * \brief Reconfigure maxFrameSizeRatio dynamically during encoding.
4316  *
4317  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4318  * \param[in] max_frame_size_ratio the new maxFrameSizeRatio value
4319  *
4320  * \return On success NI_RETCODE_SUCCESS
4321  * On failure NI_RETCODE_INVALID_PARAM
4322  ******************************************************************************/
4324  int32_t max_frame_size_ratio);
4325 
4326 /*!*****************************************************************************
4327  * \brief Reconfigure sliceArg dynamically during encoding.
4328  *
4329  * \param[in] p_ctx Pointer to caller allocated ni_session_context_t
4330  * \param[in] sliceArg the new sliceArg value
4331  *
4332  * \return On success NI_RETCODE_SUCCESS
4333  * On failure NI_RETCODE_INVALID_PARAM
4334  ******************************************************************************/
4336  int16_t sliceArg);
4337 
4338 #ifndef _WIN32
4339 /*!*****************************************************************************
4340 * \brief Acquire a P2P frame buffer from the hwupload session
4341 *
4342 * \param[in] p_upl_ctx Pointer to a caller allocated
4343 * ni_session_context_t struct
4344 * \param[out] p_frame Pointer to a caller allocated hw frame
4345 *
4346 * \return On success
4347 * NI_RETCODE_SUCCESS
4348 * On failure
4349 * NI_RETCODE_INVALID_PARAM
4350 * NI_RETCODE_ERROR_NVME_CMD_FAILED
4351 * NI_RETCODE_ERROR_INVALID_SESSION
4352 *******************************************************************************/
4354  ni_frame_t *p_frame);
4355 
4356 /*!*****************************************************************************
4357 * \brief Acquire a P2P frame buffer from the hwupload session for P2P read
4358 *
4359 * \param[in] p_upl_ctx Pointer to a caller allocated
4360 * ni_session_context_t struct
4361 * \param[out] p_frame Pointer to a caller allocated hw frame
4362 *
4363 * \return On success
4364 * NI_RETCODE_SUCCESS
4365 * On failure
4366 * NI_RETCODE_INVALID_PARAM
4367 * NI_RETCODE_ERROR_NVME_CMD_FAILED
4368 * NI_RETCODE_ERROR_INVALID_SESSION
4369 *******************************************************************************/
4371  ni_frame_t *p_frame);
4372 
4373 /*!*****************************************************************************
4374  * \brief Lock a hardware P2P frame prior to encoding
4375  *
4376  * \param[in] p_upl_ctx pointer to caller allocated upload context
4377  * [in] p_frame pointer to caller allocated hardware P2P frame
4378  *
4379  * \return On success
4380  * NI_RETCODE_SUCCESS
4381  * On failure NI_RETCODE_FAILURE
4382  * NI_RETCODE_INVALID_PARAM
4383 *******************************************************************************/
4385  ni_session_context_t *p_upl_ctx, ni_frame_t *p_frame);
4386 
4387 /*!*****************************************************************************
4388  * \brief Unlock a hardware P2P frame after encoding
4389  *
4390  * \param[in] p_upl_ctx pointer to caller allocated upload context
4391  * [in] p_frame pointer to caller allocated hardware P2P frame
4392  *
4393  * \return On success
4394  * NI_RETCODE_SUCCESS
4395  * On failure NI_RETCODE_FAILURE
4396  * NI_RETCODE_INVALID_PARAM
4397 *******************************************************************************/
4399  ni_session_context_t *p_upl_ctx, ni_frame_t *p_frame);
4400 
4401 /*!*****************************************************************************
4402  * \brief Special P2P test API call. Copies YUV data from the software
4403  * frame to the hardware P2P frame on the Quadra device
4404  *
4405  * \param[in] p_upl_ctx pointer to caller allocated uploader session
4406  * context
4407  * [in] p_swframe pointer to a caller allocated software frame
4408  * [in] p_hwframe pointer to a caller allocated hardware frame
4409  *
4410  * \return On success
4411  * NI_RETCODE_SUCCESS
4412  * On failure
4413  * NI_RETCODE_FAILURE
4414  * NI_RETCODE_INVALID_PARAM
4415 *******************************************************************************/
4417  uint8_t *p_data, uint32_t len,
4418  ni_frame_t *p_hwframe);
4419 
4420 
4422  uint8_t *p_data, uint32_t len,
4423  ni_frame_t *p_hwframe);
4424 
4425 /*!*****************************************************************************
4426  * \brief Set the incoming frame format for the encoder
4427  *
4428  * \param[in] p_enc_ctx pointer to encoder context
4429  * [in] p_enc_params pointer to encoder parameters
4430  * [in] width input width
4431  * [in] height input height
4432  * [in] bit_depth 8 for 8-bit YUV, 10 for 10-bit YUV
4433  * [in] src_endian NI_FRAME_LITTLE_ENDIAN or NI_FRAME_BIG_ENDIAN
4434  * [in] planar 0 for semi-planar YUV, 1 for planar YUV
4435  *
4436  * \return on success
4437  * NI_RETCODE_SUCCESS
4438  *
4439  * on failure
4440  * NI_RETCODE_INVALID_PARAM
4441 *******************************************************************************/
4443  ni_session_context_t *p_enc_ctx, ni_xcoder_params_t *p_enc_params,
4444  int width, int height, int bit_depth, int src_endian, int planar);
4445 
4446 /*!*****************************************************************************
4447  * \brief Acquire the scaler P2P DMA buffer for read/write
4448  *
4449  * \param [in] p_ctx pointer to caller allocated upload context
4450  * [in] p_surface pointer to a caller allocated hardware frame
4451  * [in] data_len scaler frame buffer data length
4452  *
4453  * \return on success
4454  * NI_RETCODE_SUCCESS
4455  *
4456  * on failure
4457  * NI_RETCODE_FAILURE
4458 *******************************************************************************/
4460  niFrameSurface1_t *p_surface,
4461  int data_len);
4462 
4463 /*!*****************************************************************************
4464  * \brief Recycle hw P2P frames
4465  *
4466  * \param [in] p_frame pointer to an acquired P2P hw frame
4467  *
4468  * \return on success
4469  * NI_RETCODE_SUCCESS
4470  *
4471  * on failure
4472  * NI_RETCODE_INVALID_PARAM
4473 *******************************************************************************/
4475 #endif
4476 
4477 /*!*****************************************************************************
4478  * \brief Set the frame format for the uploader
4479  *
4480  * \param[in] p_upl_ctx pointer to uploader context
4481  * [in] width width
4482  * [in] height height
4483  * [in] pixel_format pixel format
4484  * [in] isP2P 0 = normal, 1 = P2P
4485  *
4486  * \return on success
4487  * NI_RETCODE_SUCCESS
4488  *
4489  * on failure
4490  * NI_RETCODE_INVALID_PARAM
4491 *******************************************************************************/
4494  int height, ni_pix_fmt_t pixel_format, int isP2P);
4495 
4496 /*!*****************************************************************************
4497  * \brief Read encoder stream header from the device
4498  *
4499  * \param[in] p_ctx Pointer to a caller allocated
4500  * ni_session_context_t struct from encoder
4501  * \param[in] p_data Pointer to a caller allocated ni_session_data_io_t
4502  * struct which contains a ni_packet_t data packet to
4503  * receive
4504  * \return On success
4505  * Total number of bytes read
4506  * On failure
4507  * NI_RETCODE_INVALID_PARAM
4508  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4509  * NI_RETCODE_ERROR_INVALID_SESSION
4510 *******************************************************************************/
4512  ni_session_data_io_t *p_data);
4513 
4514 
4515 /*!*****************************************************************************
4516  * \brief Get the DMA buffer file descriptor from the P2P frame
4517  *
4518  * \param[in] p_frame pointer to a P2P frame
4519  *
4520  * \return On success
4521  * DMA buffer file descriptor
4522  * On failure
4523  * NI_RETCODE_FAILURE
4524 *******************************************************************************/
4525 LIB_API int32_t ni_get_dma_buf_file_descriptor(const ni_frame_t* p_frame);
4526 
4527 
4528 /*!*****************************************************************************
4529  * \brief Send sequence change information to device
4530  *
4531  * \param[in] p_ctx Pointer to a caller allocated
4532  * ni_session_context_t struct
4533  * \param[in] width input width
4534  * \param[in] height input height
4535  * \param[in] bit_depth_factor 1 for 8-bit YUV, 2 for 10-bit YUV
4536  * \param[in] device_type device type (must be encoder)
4537  * \return On success
4538  * NI_RETCODE_SUCCESS
4539  * On failure
4540  * NI_RETCODE_INVALID_PARAM
4541  * NI_RETCODE_ERROR_MEM_ALOC
4542  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4543  * NI_RETCODE_ERROR_INVALID_SESSION
4544  ******************************************************************************/
4546  int width, int height, int bit_depth_factor, ni_device_type_t device_type);
4547 
4548 /*!*****************************************************************************
4549  * \brief Fetch perf metrics of inferences from device
4550  *
4551  * \param[in] p_ctx Pointer to a caller allocated
4552  * ni_session_context_t struct
4553  * \param[in] p_metrics Pointer to network metrics
4554  * \return On success
4555  * NI_RETCODE_SUCCESS
4556  * On failure
4557  * NI_RETCODE_INVALID_PARAM
4558  * NI_RETCODE_ERROR_MEM_ALOC
4559  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4560  ******************************************************************************/
4562  ni_session_context_t *p_ctx, ni_network_perf_metrics_t *p_metrics);
4563 
4564 /*!*****************************************************************************
4565  * \brief Query firmware loader and firmware versions from the device
4566  *
4567  * \param[in] device_handle Device handle obtained by calling ni_device_open()
4568  * \param[in] device_info
4569  *
4570  * \return On success
4571  * NI_RETCODE_SUCCESS
4572  * On failure
4573  * NI_RETCODE_INVALID_PARAM
4574  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4575  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4576  * NI_RETCODE_ERROR_MEM_ALOC
4577  ******************************************************************************/
4578 LIB_API ni_retcode_t ni_query_fl_fw_versions(ni_device_handle_t device_handle,
4579  ni_device_info_t *p_dev_info);
4580 
4581 /*!*****************************************************************************
4582  * \brief Query NVMe load from the device
4583  *
4584  * \param[in] p_ctx Pointer to a caller allocated
4585  * ni_session_context_t struct
4586  * \param[in] p_load_query Pointer to a caller allocated
4587  * ni_load_query_t struct
4588  *
4589  * \return On success
4590  * NI_RETCODE_SUCCESS
4591  * On failure
4592  * NI_RETCODE_INVALID_PARAM
4593  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4594  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4595  * NI_RETCODE_ERROR_MEM_ALOC
4596  ******************************************************************************/
4598  ni_session_context_t *p_ctx, ni_load_query_t *p_load_query);
4599 
4600 /*!*****************************************************************************
4601  * \brief Query VF and NS id from device
4602  *
4603  * \param[in] device_handle Device handle obtained by calling ni_device_open()
4604  * \param[in] p_dev_ns_vf Pointer to a ni_device_vf_ns_id_t struct
4605  * \param[in] fw_rev[] Fw version to check if this function is supported
4606  *
4607  * \return On success
4608  * NI_RETCODE_SUCCESS
4609  * On failure
4610  * NI_RETCODE_INVALID_PARAM
4611  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4612  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4613  * NI_RETCODE_ERROR_MEM_ALOC
4614  ******************************************************************************/
4615 LIB_API ni_retcode_t ni_query_vf_ns_id(ni_device_handle_t device_handle,
4616  ni_device_vf_ns_id_t *p_dev_ns_vf,
4617  uint8_t fw_rev[]);
4618 
4619 /*!*****************************************************************************
4620  * \brief Query CompositeTemp from device
4621  *
4622  * \param[in] device_handle Device handle obtained by calling ni_device_open()
4623  * \param[in] p_dev_temp Pointer to device temperature
4624  * \param[in] fw_rev[] Fw version to check if this function is supported
4625  *
4626  * \return On success
4627  * NI_RETCODE_SUCCESS
4628  * On failure
4629  * NI_RETCODE_INVALID_PARAM
4630  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4631  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4632  * NI_RETCODE_ERROR_MEM_ALOC
4633  ******************************************************************************/
4634 LIB_API ni_retcode_t ni_query_temperature(ni_device_handle_t device_handle,
4635  ni_device_temp_t *p_dev_temp,
4636  uint8_t fw_rev[]);
4637 
4638 /*!*****************************************************************************
4639  * \brief Query CompositeTemp from device
4640  *
4641  * \param[in] device_handle Device handle obtained by calling ni_device_open()
4642  * \param[in] p_dev_extra_info Pointer to device extra info
4643  * \param[in] fw_rev[] Fw version to check if this function is supported
4644  *
4645  * \return On success
4646  * NI_RETCODE_SUCCESS
4647  * On failure
4648  * NI_RETCODE_INVALID_PARAM
4649  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4650  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4651  * NI_RETCODE_ERROR_MEM_ALOC
4652  ******************************************************************************/
4653 LIB_API ni_retcode_t ni_query_extra_info(ni_device_handle_t device_handle,
4654  ni_device_extra_info_t *p_dev_extra_info,
4655  uint8_t fw_rev[]);
4656 
4657 /*!*****************************************************************************
4658  * \brief Check if incoming frame is encoder zero copy compatible or not
4659  *
4660  * \param[in] p_enc_ctx pointer to encoder context
4661  * [in] p_enc_params pointer to encoder parameters
4662  * [in] width input width
4663  * [in] height input height
4664  * [in] linesize input linesizes (pointer to array)
4665  * [in] set_linesize setup linesizes 0 means not setup linesizes, 1 means setup linesizes (before encoder open)
4666  *
4667  * \return on success and can do zero copy
4668  * NI_RETCODE_SUCCESS
4669  *
4670  * cannot do zero copy
4671  * NI_RETCODE_ERROR_UNSUPPORTED_FEATURE
4672  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4673  * NI_RETCODE_INVALID_PARAM
4674  *
4675 *******************************************************************************/
4677  ni_xcoder_params_t *p_enc_params,
4678  int width, int height,
4679  const int linesize[],
4680  bool set_linesize);
4681 
4682 /*!*****************************************************************************
4683  * \brief Allocate memory for encoder zero copy (metadata, etc.)
4684  * for encoding based on given
4685  * parameters, taking into account pic linesize and extra data.
4686  * Applicable to YUV planr / semi-planar 8 or 10 bit and RGBA pixel formats.
4687  *
4688  *
4689  * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
4690  * \param[in] video_width Width of the video frame
4691  * \param[in] video_height Height of the video frame
4692  * \param[in] linesize Picture line size
4693  * \param[in] data Picture data pointers (for each of YUV planes)
4694  * \param[in] extra_len Extra data size (incl. meta data)
4695  *
4696  * \return On success
4697  * NI_RETCODE_SUCCESS
4698  * On failure
4699  * NI_RETCODE_INVALID_PARAM
4700  * NI_RETCODE_ERROR_MEM_ALOC
4701  *****************************************************************************/
4703  int video_width, int video_height,
4704  const int linesize[], const uint8_t *data[],
4705  int extra_len);
4706 
4707 /*!*****************************************************************************
4708  * \brief Check if incoming frame is hwupload zero copy compatible or not
4709  *
4710  * \param[in] p_upl_ctx pointer to uploader context
4711  * [in] width input width
4712  * [in] height input height
4713  * [in] linesize input linesizes (pointer to array)
4714  * [in] pixel_format input pixel format
4715  *
4716  * \return on success and can do zero copy
4717  * NI_RETCODE_SUCCESS
4718  *
4719  * cannot do zero copy
4720  * NI_RETCODE_ERROR_UNSUPPORTED_FEATURE
4721  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4722  * NI_RETCODE_INVALID_PARAM
4723  *
4724 *******************************************************************************/
4726  int width, int height,
4727  const int linesize[], int pixel_format);
4728 
4729 /*!*****************************************************************************
4730  * \brief Allocate log buffer if needed and retrieve firmware logs from device
4731  *
4732  * \param[in] p_ctx Pointer to a caller allocated
4733  * ni_session_context_t struct
4734  * \param[in] p_log_buffer Reference to pointer to a log buffer
4735  * If log buffer pointer is NULL, this function will allocate log buffer
4736  * NOTE caller is responsible for freeing log buffer after calling this function
4737  * \param[in] gen_log_file Indicating whether it is required to generate log files
4738  *
4739  *
4740  * \return on success
4741  * NI_RETCODE_SUCCESS
4742  *
4743  * on failure
4744  * NI_RETCODE_ERROR_MEM_ALOC
4745  * NI_RETCODE_INVALID_PARAM
4746 *******************************************************************************/
4747 LIB_API ni_retcode_t ni_device_alloc_and_get_firmware_logs(ni_session_context_t *p_ctx, void** p_log_buffer, bool gen_log_file);
4748 
4749 /*!*****************************************************************************
4750  * \brief Set up hard coded demo ROI map
4751  *
4752  * \param[in] p_enc_ctx Pointer to a caller allocated
4753  *
4754  * \return on success
4755  * NI_RETCODE_SUCCESS
4756  *
4757  * on failure
4758  * NI_RETCODE_ERROR_MEM_ALOC
4759 *******************************************************************************/
4761 
4762 /*!*****************************************************************************
4763  * \brief Convert various reconfig and demo modes (stored in encoder configuration) to
4764  * aux data and store them in frame
4765  *
4766  * \param[in] p_enc_ctx Pointer to a caller allocated
4767  * ni_session_context_t struct
4768  * \param[in] p_frame Pointer to a caller allocated ni_frame_t struct
4769  *
4770  *
4771  * \return on success
4772  * NI_RETCODE_SUCCESS
4773  *
4774  * on failure
4775  * NI_RETCODE_ERROR_MEM_ALOC
4776 *******************************************************************************/
4778  ni_frame_t *p_frame);
4779 
4780 /*!*****************************************************************************
4781  * \brief Set custom gop and prepare to check if success
4782  *
4783  * \param[in] p_param Pointer to a caller allocated ni_xcoder_params_t struct
4784  * \param[in] value Pointer to a caller allocated custom gop name
4785  *
4786  * \return none
4787  *
4788 *******************************************************************************/
4789 LIB_API void ni_gop_params_check_set(ni_xcoder_params_t *p_param, char *value);
4790 
4791 /*!*****************************************************************************
4792  * \brief Check custom gop params set.
4793  *
4794  * \param[in] p_param Pointer to a caller allocated ni_xcoder_params_t struct
4795  *
4796  *
4797  * \return on success
4798  * true
4799  *
4800  * on failure
4801  * false
4802 *******************************************************************************/
4804 
4805 /*!*****************************************************************************
4806  * \brief Initiate P2P transfer (P2P write) (deprecated)
4807  *
4808  * \param[in] pSession Pointer to source card destination
4809  * \param[in] source Pointer to source frame to transmit
4810  * \param[in] ui64DestAddr Destination address on target device
4811  * \param[in] ui32FrameSize Size of frame to transfer
4812  *
4813  * \return always returns
4814  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4815 *******************************************************************************/
4817  niFrameSurface1_t *source,
4818  uint64_t ui64DestAddr,
4819  uint32_t ui32FrameSize);
4820 
4821 /*!*****************************************************************************
4822  * \brief Initiate P2P transfer to another device (P2P write)
4823  *
4824  * \param[in] pSession Pointer to source card destination
4825  * \param[in] source Pointer to source frame to transmit
4826  * \param[in] ui64DestAddr Destination address on target device
4827  * \param[in] ui32FrameSize Size of frame to transfer
4828  *
4829  * \return on success
4830  * NI_RETCODE_SUCCESS
4831  * on failure
4832  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4833  * NI_RETCODE_INVALID_PARAM
4834  * NI_RETCODE_ERROR_INVALID_SESSION
4835  * NI_RETCODE_ERROR_MEM_ALOC
4836  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4837 *******************************************************************************/
4839  niFrameSurface1_t *source,
4840  uint64_t ui64DestAddr,
4841  uint32_t ui32FrameSize);
4842 
4843 /*!*****************************************************************************
4844  * \brief Calculate the total size of a frame based on the upload
4845  * context attributes and includes rounding up to the page size
4846  *
4847  * \param[in] p_upl_ctx pointer to an uploader session context
4848  * \param[in] linesize array of line stride
4849  *
4850  * \return size
4851  * NI_RETCODE_INVALID_PARAM
4852  *
4853  ******************************************************************************/
4855  const int linesize[]);
4856 
4857 
4858 /*!*****************************************************************************
4859  * \brief Initiate a P2P transfer (P2P read)
4860  *
4861  * \param[in] pSession Pointer to destination upload session
4862  * \param[in] dmaAddrs Pointer to source DMA addresses
4863  * \param[in] pDstFrame Pointer to destination P2P frame
4864  *
4865  * \return on success
4866  * NI_RETCODE_SUCCESS
4867  * on failure
4868  * NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
4869  * NI_RETCODE_INVALID_PARAM
4870  * NI_RETCODE_ERROR_INVALID_SESSION
4871  * NI_RETCODE_ERROR_MEM_ALOC
4872  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4873 *******************************************************************************/
4875  const ni_p2p_sgl_t *dmaAddrs,
4876  ni_frame_t *pDstFrame);
4877 
4878 /*!*****************************************************************************
4879  * \brief Send a restart command after flush command
4880  * Only support Encoder now
4881  *
4882  * \param[in] p_ctx Pointer to a caller allocated
4883  * ni_session_context_t struct
4884  * \param[in] width width, in pixels
4885  * \param[in] height height, in pixels
4886  * \param[in] device_type NI_DEVICE_TYPE_ENCODER
4887  * \return On success
4888  * NI_RETCODE_SUCCESS
4889  * On failure
4890  * NI_RETCODE_INVALID_PARAM
4891  * NI_RETCODE_ERROR_NVME_CMD_FAILED
4892  * NI_RETCODE_ERROR_INVALID_SESSION
4893  ******************************************************************************/
4895  int video_width,
4896  int video_height,
4897  ni_device_type_t device_type);
4898 
4899 #ifdef __cplusplus
4900 }
4901 #endif
XCODER_TEST_RECONF_LTR_INTERVAL_API
@ XCODER_TEST_RECONF_LTR_INTERVAL_API
Definition: ni_device_api.h:1765
_ni_dec_h264_vui_param::colour_description_present_flag
uint8_t colour_description_present_flag
Definition: ni_device_api.h:810
ni_vui_hrd_t
struct _ni_vui_hrd ni_vui_hrd_t
_ni_xcoder_params::reconf_demo_mode
int reconf_demo_mode
Definition: ni_device_api.h:2731
NI_CODEC_HW_RSVD
@ NI_CODEC_HW_RSVD
Definition: ni_device_api.h:943
_ni_xcoder_params::ui32VuiDataSizeBytes
NI_DEPRECATED uint32_t ui32VuiDataSizeBytes
Definition: ni_device_api.h:2751
_ni_encoder_cfg_params::enable_mb_level_rc
int enable_mb_level_rc
Definition: ni_device_api.h:2384
_ni_long_term_ref::use_long_term_ref
uint8_t use_long_term_ref
Definition: ni_device_api.h:691
_ni_instance_mgr_detail_status_append
Definition: ni_device_api.h:1242
ni_frame_buffer_alloc_pixfmt
LIB_API ni_retcode_t ni_frame_buffer_alloc_pixfmt(ni_frame_t *pframe, int pixel_format, int video_width, int video_height, int linesize[], int alignment, int extra_len)
Allocate memory for the frame buffer based on provided parameters taking into account the pixel forma...
Definition: ni_device_api.c:9252
_ni_param_change_flags
_ni_param_change_flags
This is an enumeration for encoder parameter change.
Definition: ni_device_api.h:950
_ni_encoder_cfg_params::frame_rate
int frame_rate
Definition: ni_device_api.h:2239
NI_ENC_MEM_ALLOCATE_STRATEGY_INVALID_MAX
@ NI_ENC_MEM_ALLOCATE_STRATEGY_INVALID_MAX
Definition: ni_device_api.h:286
NI_XCODER_CLOSE_STATE
@ NI_XCODER_CLOSE_STATE
Definition: ni_device_api.h:248
_ni_frame_config::picture_width
uint16_t picture_width
Definition: ni_device_api.h:2810
_ni_xcoder_params::fps_denominator
uint32_t fps_denominator
Definition: ni_device_api.h:2719
_ni_dec_h264_vui_param::overscan_appropriate_flag
uint8_t overscan_appropriate_flag
Definition: ni_device_api.h:805
NI_PIX_FMT_UYVY422
@ NI_PIX_FMT_UYVY422
Definition: ni_device_api.h:274
_ni_region_of_interest::left
int left
Definition: ni_device_api.h:636
ni_device_session_restart
LIB_API ni_retcode_t ni_device_session_restart(ni_session_context_t *p_ctx, int video_width, int video_height, ni_device_type_t device_type)
Send a restart command after flush command Only support Encoder now.
Definition: ni_device_api.c:12913
_ni_xcoder_params::luma_linesize
int luma_linesize
Definition: ni_device_api.h:2784
NI_PIX_FMT_BGRA
@ NI_PIX_FMT_BGRA
Definition: ni_device_api.h:267
_ni_instance_mgr_detail_status_v1::sInstDetailStatusAppend
ni_instance_mgr_detail_status_append_t sInstDetailStatusAppend[NI_MAX_CONTEXTS_PER_HW_INSTANCE]
Definition: ni_device_api.h:1254
ni_encoder_frame_buffer_alloc
LIB_API ni_retcode_t ni_encoder_frame_buffer_alloc(ni_frame_t *pframe, int video_width, int video_height, int linesize[], int alignment, int extra_len, bool alignment_2pass_wa)
Allocate memory for the frame buffer for encoding based on given parameters, taking into account pic ...
Definition: ni_device_api.c:3161
_ni_scaler_input_params_t::output_height
int32_t output_height
Definition: ni_device_api.h:2556
_ni_packet::psnr_v
double psnr_v
Definition: ni_device_api.h:2857
_ni_load_query::fw_p2p_mem_usage
uint32_t fw_p2p_mem_usage
Definition: ni_device_api.h:1211
ni_uploader_p2p_test_send
LIB_API ni_retcode_t ni_uploader_p2p_test_send(ni_session_context_t *p_upl_ctx, uint8_t *p_data, uint32_t len, ni_frame_t *p_hwframe)
Special P2P test API call. Copies YUV data from the software frame to the hardware P2P frame on the Q...
Definition: ni_device_api.c:10869
_ni_sei_header::size
uint16_t size
Definition: ni_device_api.h:345
_ni_session_context::force_idr_frame
int force_idr_frame
Definition: ni_device_api.h:1600
NI_CODEC_FORMAT_JPEG
@ NI_CODEC_FORMAT_JPEG
Definition: ni_device_api.h:914
_ni_encoder_cfg_params::ver_offset
int ver_offset
Definition: ni_device_api.h:2398
_ni_scaler_watermark_params_t::ui32Height
uint32_t ui32Height
Definition: ni_device_api.h:2588
ni_device_alloc_frame
LIB_API ni_retcode_t ni_device_alloc_frame(ni_session_context_t *p_ctx, int width, int height, int format, int options, int rectangle_width, int rectangle_height, int rectangle_x, int rectangle_y, int rgba_color, int frame_index, ni_device_type_t device_type)
Allocate a frame on the device for 2D engine or AI engine to work on based on provided parameters.
Definition: ni_device_api.c:8880
NI_FRAME_AUX_DATA_MAX_FRAME_SIZE
@ NI_FRAME_AUX_DATA_MAX_FRAME_SIZE
Definition: ni_device_api.h:566
_ni_dec_mastering_display_colour_volume_bytes::display_primaries
uint16_t display_primaries[3][2]
Definition: ni_device_api.h:1063
_ni_dec_h265_vui_param::vui_poc_proportional_to_timing_flag
uint8_t vui_poc_proportional_to_timing_flag
Definition: ni_device_api.h:773
_ni_session_context::sei_hdr_mastering_display_color_vol_len
int sei_hdr_mastering_display_color_vol_len
Definition: ni_device_api.h:1429
_ni_dec_h265_vui_param::bitstream_restriction_flag
uint8_t bitstream_restriction_flag
Definition: ni_device_api.h:779
_ni_dec_win
Definition: ni_device_api.h:713
_ni_context_query::codec_format
uint32_t codec_format
Definition: ni_device_api.h:1189
_ni_device_capability::fw_commit_time
uint8_t fw_commit_time[26]
Definition: ni_device_api.h:1166
ni_device_session_hwup
LIB_API int ni_device_session_hwup(ni_session_context_t *p_ctx, ni_session_data_io_t *p_src_data, niFrameSurface1_t *hwdesc)
Send raw YUV input to uploader instance and retrieve a HW descriptor to represent it.
Definition: ni_device_api.c:8363
NI_SET_CHANGE_PARAM_RC_TARGET_RATE
@ NI_SET_CHANGE_PARAM_RC_TARGET_RATE
Definition: ni_device_api.h:955
_ni_session_context::hevc_sub_ctu_roi_buf
uint8_t * hevc_sub_ctu_roi_buf
Definition: ni_device_api.h:1587
_ni_decoder_input_params_t::mcmode
int mcmode
Definition: ni_device_api.h:2502
NI_ENC_PARAM_MAX_FRAME_SIZE_LOW_DELAY
#define NI_ENC_PARAM_MAX_FRAME_SIZE_LOW_DELAY
Definition: ni_device_api.h:2146
_ni_dec_h264_vui_param::chroma_sample_loc_type_bottom_field
int8_t chroma_sample_loc_type_bottom_field
Definition: ni_device_api.h:821
_ni_frame::separate_start
uint8_t separate_start
Definition: ni_device_api.h:2707
ni_hwframe_p2p_buffer_recycle
LIB_API ni_retcode_t ni_hwframe_p2p_buffer_recycle(ni_frame_t *p_frame)
Recycle hw P2P frames.
Definition: ni_device_api.c:10996
_ni_session_context::hwd_Inst_ID
uint32_t hwd_Inst_ID
Definition: ni_device_api.h:1539
_ni_packet::p_custom_sei_set
ni_custom_sei_set_t * p_custom_sei_set
Definition: ni_device_api.h:2853
XCODER_TEST_RECONF_CRF_FLOAT
@ XCODER_TEST_RECONF_CRF_FLOAT
Definition: ni_device_api.h:1755
_ni_hw_capability
hardware capability type
Definition: ni_device_api.h:1134
_ni_p2p_sgl_t
Definition: ni_defs.h:403
ni_encoder_frame_zerocopy_buffer_alloc
LIB_API ni_retcode_t ni_encoder_frame_zerocopy_buffer_alloc(ni_frame_t *p_frame, int video_width, int video_height, const int linesize[], const uint8_t *data[], int extra_len)
Allocate memory for encoder zero copy (metadata, etc.) for encoding based on given parameters,...
Definition: ni_device_api.c:2879
_ni_frame::buffer_size
uint32_t buffer_size
Definition: ni_device_api.h:2667
_ni_network_data
Definition: ni_device_api.h:1363
_ni_xcoder_params::dolby_vision_profile
int dolby_vision_profile
Definition: ni_device_api.h:2739
_ni_session_context::ltr_interval
int32_t ltr_interval
Definition: ni_device_api.h:1602
_ni_session_context::decoder_low_delay
int decoder_low_delay
Definition: ni_device_api.h:1594
_ni_decoder_input_params_t::error_ratio_threshold
int error_ratio_threshold
Definition: ni_device_api.h:2538
ni_param_change_flags_t
enum _ni_param_change_flags ni_param_change_flags_t
This is an enumeration for encoder parameter change.
_ni_session_context::p_all_zero_buf
void * p_all_zero_buf
Definition: ni_device_api.h:1571
_ni_session_context::required_buf_size
uint32_t required_buf_size
Definition: ni_device_api.h:1720
_ni_session_context::auto_dl_handle
ni_device_handle_t auto_dl_handle
Definition: ni_device_api.h:1469
ni_custom_packet_buffer_alloc
LIB_API ni_retcode_t ni_custom_packet_buffer_alloc(void *p_buffer, ni_packet_t *p_packet, int buffer_size)
Allocate packet buffer using a user provided pointer, the memory is expected to have already been all...
Definition: ni_device_api.c:3807
_ni_instance_mgr_detail_status::ui8AvgCost
uint8_t ui8AvgCost
Definition: ni_device_api.h:1232
_ni_thread_arg_struct_t::p_mutex
ni_pthread_mutex_t * p_mutex
Definition: ni_device_api.h:1267
_ni_encoder_cfg_params::skip_frame_interval
int skip_frame_interval
Definition: ni_device_api.h:2419
ni_pix_fmt_t
ni_pix_fmt_t
Definition: ni_device_api.h:260
_ni_dec_h265_vui_param::overscan_appropriate_flag
uint8_t overscan_appropriate_flag
Definition: ni_device_api.h:747
NI_POOL_TYPE_P2P
@ NI_POOL_TYPE_P2P
Definition: ni_device_api.h:493
NI_H265_USERDATA_FLAG_MASTERING_COLOR_VOL
@ NI_H265_USERDATA_FLAG_MASTERING_COLOR_VOL
Definition: ni_device_api.h:369
_ni_context_query::reserved
uint32_t reserved
Definition: ni_device_api.h:1193
NI_ENC_MEM_ALLOCATE_STRATEGY_REGION_1_FIRST
@ NI_ENC_MEM_ALLOCATE_STRATEGY_REGION_1_FIRST
Definition: ni_device_api.h:285
_ni_hw_capability::codec_type
uint8_t codec_type
Definition: ni_device_api.h:1140
ni_enc_avc_roi_custom_map_t
union _ni_enc_avc_roi_custom_map ni_enc_avc_roi_custom_map_t
encoder AVC ROI custom map (1 MB = 8bits)
_ni_encoder_cfg_params::enable_dynamic_32x32_merge
int enable_dynamic_32x32_merge
Definition: ni_device_api.h:2352
_ni_encoder_cfg_params::hor_offset
int hor_offset
Definition: ni_device_api.h:2397
_ni_encoder_cfg_params::inLoopDSRatio
int inLoopDSRatio
Definition: ni_device_api.h:2335
ni_rational_t
struct _ni_rational ni_rational_t
_ni_session_context::max_retry_fail_count
int max_retry_fail_count[2]
Definition: ni_device_api.h:1701
XCODER_TEST_RECONF_END
@ XCODER_TEST_RECONF_END
Definition: ni_device_api.h:1775
ni_custom_gop_params_t
struct _ni_custom_gop_params ni_custom_gop_params_t
XCODER_TEST_CRF_API
@ XCODER_TEST_CRF_API
Definition: ni_device_api.h:1770
_ni_enc_avc_roi_custom_map
encoder AVC ROI custom map (1 MB = 8bits)
Definition: ni_device_api.h:870
ni_device_config_qos_op
LIB_API ni_retcode_t ni_device_config_qos_op(ni_device_handle_t device_handle, ni_device_handle_t device_handle_t, uint32_t over_provision)
Send qos over provisioning mode to target namespace with specified logic block address.
Definition: ni_device_api.c:2080
_ni_dec_h264_vui_param::aspect_ratio_idc
uint8_t aspect_ratio_idc
Definition: ni_device_api.h:803
_ni_content_light_level_info_bytes
payload format of HDR SEI content light level info
Definition: ni_device_api.h:1074
NI_SET_CHANGE_PARAM_CRF
@ NI_SET_CHANGE_PARAM_CRF
Definition: ni_device_api.h:973
ni_scaler_input_frame_alloc
LIB_API ni_retcode_t ni_scaler_input_frame_alloc(ni_session_context_t *p_ctx, ni_scaler_input_params_t scaler_params, niFrameSurface1_t *p_src_surface)
allocate device input frame by hw descriptor. This call won't actually allocate a frame but sends the...
Definition: ni_device_api.c:3333
ni_reconfig_crf
LIB_API ni_retcode_t ni_reconfig_crf(ni_session_context_t *p_ctx, int32_t crf)
Reconfigure crf value dynamically during encoding.
Definition: ni_device_api.c:10301
_ni_frame::vui_len
unsigned int vui_len
Definition: ni_device_api.h:2650
_ni_frame::sei_hdr_content_light_level_info_offset
unsigned int sei_hdr_content_light_level_info_offset
Definition: ni_device_api.h:2637
ni_queue_buffer_pool_t
struct _ni_queue_buffer_pool_t ni_queue_buffer_pool_t
_ni_queue_buffer_pool_t::p_free_head
ni_queue_node_t * p_free_head
Definition: ni_device_api.h:1307
_ni_decoder_input_params_t::enable_ppu_scale_adapt
int enable_ppu_scale_adapt
Definition: ni_device_api.h:2525
_ni_encoder_cfg_params::pbRatio
float pbRatio
Definition: ni_device_api.h:2405
_ni_decoder_input_params_t::enable_out1
int enable_out1
Definition: ni_device_api.h:2500
ni_device_session_sequence_change
LIB_API ni_retcode_t ni_device_session_sequence_change(ni_session_context_t *p_ctx, int width, int height, int bit_depth_factor, ni_device_type_t device_type)
Send sequence change information to device.
Definition: ni_device_api.c:11322
ni_encoder_sw_frame_buffer_alloc
LIB_API ni_retcode_t ni_encoder_sw_frame_buffer_alloc(bool planar, ni_frame_t *p_frame, int video_width, int video_height, int linesize[], int alignment, int extra_len, bool alignment_2pass_wa)
This API is a wrapper for ni_encoder_frame_buffer_alloc(), used for planar pixel formats,...
Definition: ni_device_api.c:3531
_ni_scaler_multi_watermark_params_t
Definition: ni_device_api.h:2597
_ni_network_layer_info::in_param
ni_network_layer_params_t * in_param
Definition: ni_device_api.h:1354
_ni_packet::pts
long long pts
Definition: ni_device_api.h:2828
_ni_dec_h265_vui_param::vui_timing_info_present_flag
uint8_t vui_timing_info_present_flag
Definition: ni_device_api.h:772
ni_frame_wipe_aux_data
LIB_API void ni_frame_wipe_aux_data(ni_frame_t *frame)
Free and remove all auxiliary data from the frame.
Definition: ni_device_api.c:4115
_ni_encoder_cfg_params::vbvBufferReencode
int vbvBufferReencode
Definition: ni_device_api.h:2442
ni_frame_buffer_alloc_dl
LIB_API ni_retcode_t ni_frame_buffer_alloc_dl(ni_frame_t *p_frame, int video_width, int video_height, int pixel_format)
Allocate preliminary memory for the frame buffer based on provided parameters.
Definition: ni_device_api.c:2393
NI_H265_USERDATA_FLAG_ITU_T_T35_SUF_2
@ NI_H265_USERDATA_FLAG_ITU_T_T35_SUF_2
Definition: ni_device_api.h:379
_ni_session_context::nb_rois
int nb_rois
Definition: ni_device_api.h:1581
_ni_session_context::xcoder_state
uint32_t xcoder_state
Definition: ni_device_api.h:1568
_ni_buf_pool_t::p_free_tail
ni_buf_t * p_free_tail
Definition: ni_device_api.h:1288
ni_instance_mgr_detail_status_v1_t
struct _ni_instance_mgr_detail_status_v1 ni_instance_mgr_detail_status_v1_t
_ni_frame::sar_width
uint16_t sar_width
Definition: ni_device_api.h:2687
XCODER_TEST_RECONF_MAX_FRAME_SIZE
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE
Definition: ni_device_api.h:1752
_ni_dec_h265_vui_param::vui_time_scale
uint32_t vui_time_scale
Definition: ni_device_api.h:776
_ni_dec_h265_vui_param::max_bits_per_mincu_denom
int8_t max_bits_per_mincu_denom
Definition: ni_device_api.h:786
_ni_xcoder_params::padding
int padding
Definition: ni_device_api.h:2734
_ni_encoder_cfg_params::enable_filler
int enable_filler
Definition: ni_device_api.h:2376
_ni_session_context::itu_t_t35_cc_sei_hdr_h264
uint8_t itu_t_t35_cc_sei_hdr_h264[NI_CC_SEI_HDR_H264_LEN]
Definition: ni_device_api.h:1418
NI_AI_BUFFER_QUANTIZE_NONE
@ NI_AI_BUFFER_QUANTIZE_NONE
Definition: ni_device_api.h:1812
_ni_split_context_t::f8b
int f8b[3]
Definition: ni_device_api.h:1732
_ni_session_context::mdcv_max_min_lum_data_len
int mdcv_max_min_lum_data_len
Definition: ni_device_api.h:1430
ni_frame_new_aux_data
LIB_API ni_aux_data_t * ni_frame_new_aux_data(ni_frame_t *frame, ni_aux_data_type_t type, int data_size)
Add a new auxiliary data to a frame.
Definition: ni_device_api.c:4005
_ni_session_context::force_low_delay
bool force_low_delay
Definition: ni_device_api.h:1699
_ni_custom_sei::size
uint32_t size
Definition: ni_device_api.h:1121
ni_encoder_init_default_params
LIB_API ni_retcode_t ni_encoder_init_default_params(ni_xcoder_params_t *p_param, int fps_num, int fps_denom, long bit_rate, int width, int height, ni_codec_format_t codec_format)
Initialize default encoder parameters.
Definition: ni_device_api.c:4147
_ni_session_context::hwd_Frame_Idx
uint32_t hwd_Frame_Idx
Definition: ni_device_api.h:1535
_ni_encoder_cfg_params::gopLowdelay
int gopLowdelay
Definition: ni_device_api.h:2324
_ni_session_context::prev_fps
uint32_t prev_fps
Params used in VFR mode Start///.
Definition: ni_device_api.h:1631
_ni_session_context::preferred_characteristics_data
uint8_t preferred_characteristics_data
Definition: ni_device_api.h:1433
_ni_frame_config::rectangle_x
int16_t rectangle_x
Definition: ni_device_api.h:2816
ni_gop_params_t
struct _ni_gop_params ni_gop_params_t
_ni_frame::aspect_ratio_idc
uint8_t aspect_ratio_idc
Definition: ni_device_api.h:2686
_ni_gop_rps::ref_pic_used
int ref_pic_used
Definition: ni_device_api.h:1956
_ni_buf_t::p_next_buffer
struct _ni_buf_t * p_next_buffer
Definition: ni_device_api.h:1279
ni_frame_buffer_alloc_nv
LIB_API ni_retcode_t ni_frame_buffer_alloc_nv(ni_frame_t *p_frame, int video_width, int video_height, int linesize[], int extra_len, bool alignment_2pass_wa)
Allocate memory for the frame buffer based on provided parameters taking into account pic line size a...
Definition: ni_device_api.c:3397
_ni_load_query::current_load
uint32_t current_load
Definition: ni_device_api.h:1198
_ni_packet::ssim_u
double ssim_u
Definition: ni_device_api.h:2860
_ni_session_context::dev_xcoder_name
char dev_xcoder_name[MAX_CHAR_IN_DEVICE_NAME]
Definition: ni_device_api.h:1488
ni_dec_win_t
struct _ni_dec_win ni_dec_win_t
NI_AI_BUFFER_FORMAT_INT16
@ NI_AI_BUFFER_FORMAT_INT16
Definition: ni_device_api.h:1792
_ni_packet::recycle_index
int recycle_index
Definition: ni_device_api.h:2836
_ni_scaler_input_params_t::op
ni_scaler_opcode_t op
Definition: ni_device_api.h:2563
_ni_dec_h265_vui_param::aspect_ratio_idc
uint8_t aspect_ratio_idc
Definition: ni_device_api.h:745
NI_AI_BUFFER_QUANTIZE_TF_ASYMM
@ NI_AI_BUFFER_QUANTIZE_TF_ASYMM
Definition: ni_device_api.h:1817
_ni_dec_win::right
int16_t right
Definition: ni_device_api.h:716
_ni_load_query::total_contexts
uint32_t total_contexts
Definition: ni_device_api.h:1201
ni_encoder_change_params_t
struct _ni_encoder_change_params_t ni_encoder_change_params_t
This is a data structure for encoding parameters that have changed.
_ni_session_context::frame_time_q
void * frame_time_q
Definition: ni_device_api.h:1413
XCODER_TEST_RECONF_LTR_INTERVAL
@ XCODER_TEST_RECONF_LTR_INTERVAL
Definition: ni_device_api.h:1749
_ni_encoder_cfg_params::statistic_output_level
int statistic_output_level
Definition: ni_device_api.h:2416
_ni_dec_mastering_display_colour_volume_bytes::white_point_y
uint16_t white_point_y
Definition: ni_device_api.h:1065
_ni_session_statistic_t
Definition: ni_defs.h:374
_ni_session_context::itu_t_t35_hdr10p_sei_hdr_h264
uint8_t itu_t_t35_hdr10p_sei_hdr_h264[NI_HDR10P_SEI_HDR_H264_LEN]
Definition: ni_device_api.h:1420
NI_SET_CHANGE_PARAM_VBV
@ NI_SET_CHANGE_PARAM_VBV
Definition: ni_device_api.h:974
XCODER_TEST_RECONF_FRAMERATE_API
@ XCODER_TEST_RECONF_FRAMERATE_API
Definition: ni_device_api.h:1767
_ni_dec_mastering_display_colour_volume_bytes
decoded payload format of HDR SEI mastering display colour volume
Definition: ni_device_api.h:1061
_ni_decoder_input_params_t::ec_policy
int ec_policy
Definition: ni_device_api.h:2523
_ni_pkt_info::reserved
double reserved[1]
Definition: ni_device_api.h:1102
_ni_frame::metadata_buffer_size
uint32_t metadata_buffer_size
Definition: ni_device_api.h:2696
_ni_queue_buffer_pool_t::p_free_tail
ni_queue_node_t * p_free_tail
Definition: ni_device_api.h:1308
_ni_decoder_input_params_t::skip_pts_guess
int skip_pts_guess
Definition: ni_device_api.h:2528
_ni_packet::psnr_u
double psnr_u
Definition: ni_device_api.h:2856
_ni_vui_hrd
Definition: ni_device_api.h:654
_ni_session_context::ui8_mdcv_max_min_lum_data
uint8_t ui8_mdcv_max_min_lum_data[9]
Definition: ni_device_api.h:1431
_ni_rc_min_max_qp::minQpI
int32_t minQpI
Definition: ni_device_api.h:706
_ni_encoder_cfg_params::temporal_layers_enable
int temporal_layers_enable
Definition: ni_device_api.h:2392
_ni_session_context::fn
unsigned short fn
Definition: ni_device_api.h:1622
_ni_packet::flags
int flags
Definition: ni_device_api.h:2851
_niFrameSurface1::ui16height
uint16_t ui16height
Definition: ni_device_api.h:2798
_ni_enc_avc_roi_custom_map::field
struct _ni_enc_avc_roi_custom_map::@5 field
SESSION_RUN_STATE_FLUSHING
@ SESSION_RUN_STATE_FLUSHING
Definition: ni_device_api.h:1181
_ni_session_context::enc_pts_w_idx
int64_t enc_pts_w_idx
Definition: ni_device_api.h:1441
_ni_session_context::key_frame_type
int key_frame_type
Definition: ni_device_api.h:1525
_ni_session_context::roi_side_data_size
int roi_side_data_size
Definition: ni_device_api.h:1578
_ni_dec_h264_vui_param::vui_time_scale
uint32_t vui_time_scale
Definition: ni_device_api.h:827
_ni_dec_h264_vui_param::max_bits_per_mincu_denom
int8_t max_bits_per_mincu_denom
Definition: ni_device_api.h:837
XCODER_TEST_RECONF_RC_MIN_MAX_QP_API
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP_API
Definition: ni_device_api.h:1769
_ni_session_context::input_frame_fifo
ni_input_frame input_frame_fifo[120]
encoder:calculate PSNR start
Definition: ni_device_api.h:1709
ni_query_nvme_status
LIB_API ni_retcode_t ni_query_nvme_status(ni_session_context_t *p_ctx, ni_load_query_t *p_load_query)
Query NVMe load from the device.
Definition: ni_device_api.c:11447
_ni_session_context::current_frame_delay
int current_frame_delay
Definition: ni_device_api.h:1693
_ni_extended_dec_metadata
Definition: ni_device_api.h:721
_ni_scaler_watermark_params_t
Definition: ni_device_api.h:2584
ni_set_ltr_interval
LIB_API ni_retcode_t ni_set_ltr_interval(ni_session_context_t *p_ctx, int32_t ltr_interval)
Set Long Term Reference interval.
Definition: ni_device_api.c:10054
_ni_session_context::session_id
uint32_t session_id
Definition: ni_device_api.h:1480
NI_SET_CHANGE_PARAM_DEPEND_SLICE
@ NI_SET_CHANGE_PARAM_DEPEND_SLICE
Definition: ni_device_api.h:961
NI_H265_USERDATA_FLAG_ITU_T_T35_SUF
@ NI_H265_USERDATA_FLAG_ITU_T_T35_SUF
Definition: ni_device_api.h:366
ni_codec_hw_actions
ni_codec_hw_actions
This is an enumeration for hw actions.
Definition: ni_device_api.h:937
_ni_queue_buffer_pool_t::p_used_tail
ni_queue_node_t * p_used_tail
Definition: ni_device_api.h:1310
_ni_packet::start_of_stream
uint32_t start_of_stream
Definition: ni_device_api.h:2832
_ni_xcoder_params::source_width
int source_width
Definition: ni_device_api.h:2723
_ni_frame::reconf_len
unsigned int reconf_len
Definition: ni_device_api.h:2655
_ni_scaler_multi_watermark_params_t::multi_watermark_params
ni_scaler_watermark_params_t multi_watermark_params[NI_MAX_SUPPORT_WATERMARK_NUM]
Definition: ni_device_api.h:2598
_ni_instance_mgr_detail_status::ui16FrameRate
uint16_t ui16FrameRate
Definition: ni_device_api.h:1234
_ni_input_frame::usable
int8_t usable
Definition: ni_device_api.h:1405
_ni_decoder_input_params_t::enable_ppu_scale_limit
int enable_ppu_scale_limit
Definition: ni_device_api.h:2526
_ni_scaler_input_params_t::out_rec_height
int32_t out_rec_height
Definition: ni_device_api.h:2558
ni_device_session_hwdl
LIB_API int ni_device_session_hwdl(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data, niFrameSurface1_t *hwdesc)
Read YUV data from hw descriptor stored location on device.
Definition: ni_device_api.c:8210
_ni_encoder_cfg_params::ltrRefInterval
int ltrRefInterval
Definition: ni_device_api.h:2285
_ni_session_context::target_bitrate
int32_t target_bitrate
Definition: ni_device_api.h:1599
_ni_session_context::mutex_initialized
bool mutex_initialized
Definition: ni_device_api.h:1671
ni_scaler_p2p_frame_acquire
LIB_API ni_retcode_t ni_scaler_p2p_frame_acquire(ni_session_context_t *p_ctx, niFrameSurface1_t *p_surface, int data_len)
Acquire the scaler P2P DMA buffer for read/write.
Definition: ni_device_api.c:11029
ni_enc_frame_buffer_alloc
LIB_API ni_retcode_t ni_enc_frame_buffer_alloc(ni_frame_t *p_frame, int video_width, int video_height, int alignment, int metadata_flag, int factor, int hw_frame_count, int is_planar, ni_pix_fmt_t pix_fmt)
Wrapper function for ni_frame_buffer_alloc. Meant to handle RGBA min. resoulution considerations for ...
Definition: ni_device_api.c:2321
_ni_device_capability::xcoder_devices
ni_hw_capability_t xcoder_devices[NI_MAX_DEVICES_PER_HW_INSTANCE]
Definition: ni_device_api.h:1159
_ni_device_capability::fw_branch_name
uint8_t fw_branch_name[256]
Definition: ni_device_api.h:1165
_ni_custom_sei::location
ni_custom_sei_location_t location
Definition: ni_device_api.h:1120
NI_HDR10P_SEI_HDR_H264_LEN
#define NI_HDR10P_SEI_HDR_H264_LEN
Definition: ni_device_api.h:463
ni_reconfig_t
enum _ni_reconfig ni_reconfig_t
This is an enumeration for encoder reconfiguration test settings.
_ni_session_context::netint_fd
int netint_fd
Definition: ni_device_api.h:1618
_ni_hw_capability::hw_id
uint8_t hw_id
Definition: ni_device_api.h:1136
_ni_frame_config::frame_index
uint16_t frame_index
Definition: ni_device_api.h:2819
_ni_session_context::keyframe_factor
int keyframe_factor
Definition: ni_device_api.h:1530
_ni_pkt_info::psnr_u
double psnr_u
Definition: ni_device_api.h:1096
QOS_OP_CONFIG_REC_OP_CODE
@ QOS_OP_CONFIG_REC_OP_CODE
Definition: ni_device_api.h:237
PIC_TYPE_P
@ PIC_TYPE_P
Definition: ni_device_api.h:385
NI_CODEC_HW_NONE
@ NI_CODEC_HW_NONE
Definition: ni_device_api.h:939
_ni_buf_t::p_previous_buffer
struct _ni_buf_t * p_previous_buffer
Definition: ni_device_api.h:1278
NI_PIX_FMT_YUV420P
@ NI_PIX_FMT_YUV420P
Definition: ni_device_api.h:262
_ni_scaler_drawbox_params_t::start_y
uint32_t start_y
Definition: ni_device_api.h:2578
ni_category_classify_t
struct _ni_category_classify ni_category_classify_t
ni_buf_t
struct _ni_buf_t ni_buf_t
_ni_rc_min_max_qp
Definition: ni_device_api.h:704
_ni_scaler_watermark_params_t::ui32Valid
uint32_t ui32Valid
Definition: ni_device_api.h:2589
ni_device_type_t
ni_device_type_t
Definition: ni_defs.h:341
_niFrameSurface1::ui32nodeAddress
uint32_t ui32nodeAddress
Definition: ni_device_api.h:2799
ni_p2p_recv
LIB_API ni_retcode_t ni_p2p_recv(ni_session_context_t *pSession, const ni_p2p_sgl_t *dmaAddrs, ni_frame_t *pDstFrame)
Initiate a P2P transfer (P2P read)
Definition: ni_device_api.c:12866
_ni_session_context::isP2P
int32_t isP2P
Definition: ni_device_api.h:1617
_ni_packet::end_of_stream
uint32_t end_of_stream
Definition: ni_device_api.h:2831
_ni_encoder_cfg_params::enable_hvs_qp_scale
int enable_hvs_qp_scale
Definition: ni_device_api.h:2381
ni_reconfig_vbv_value
LIB_API ni_retcode_t ni_reconfig_vbv_value(ni_session_context_t *p_ctx, int32_t vbvMaxRate, int32_t vbvBufferSize)
Reconfigure vbv buffer size and vbv max rate dynamically during encoding.
Definition: ni_device_api.c:10418
NI_SET_CHANGE_PARAM_RC2
@ NI_SET_CHANGE_PARAM_RC2
Definition: ni_device_api.h:967
NI_XCODER_READ_STATE
@ NI_XCODER_READ_STATE
Definition: ni_device_api.h:247
_ni_encoder_cfg_params::trans_rate
int trans_rate
Definition: ni_device_api.h:2383
_ni_thread_arg_struct_t::close_thread
bool close_thread
Definition: ni_device_api.h:1262
_ni_session_context::p_leftover
uint8_t * p_leftover
Definition: ni_device_api.h:1506
NI_H265_USER_DATA_FLAG_COLOUR_REMAPPING_INFO
@ NI_H265_USER_DATA_FLAG_COLOUR_REMAPPING_INFO
Definition: ni_device_api.h:375
_ni_session_data_io::packet
ni_packet_t packet
Definition: ni_device_api.h:2871
_ni_network_layer_params_t::quant_data
union _ni_network_layer_params_t::@13 quant_data
_ni_dec_h265_vui_param::motion_vectors_over_pic_boundaries_flag
uint8_t motion_vectors_over_pic_boundaries_flag
Definition: ni_device_api.h:782
_ni_xcoder_params::enable2PassGop
int enable2PassGop
Definition: ni_device_api.h:2782
_ni_frame::src_codec
ni_codec_format_t src_codec
Definition: ni_device_api.h:2604
_ni_device_capability::model_number
uint8_t model_number[40]
Definition: ni_device_api.h:1162
_ni_session_context::ltr_to_set
ni_long_term_ref_t ltr_to_set
Definition: ni_device_api.h:1601
_ni_encoder_change_params_t::frameRateDenom
int32_t frameRateDenom
Definition: ni_device_api.h:1051
_ni_packet::dts
long long dts
Definition: ni_device_api.h:2827
NI_NAMESPACE_MAX_NUM
#define NI_NAMESPACE_MAX_NUM
Definition: ni_device_api.h:216
_ni_encoder_cfg_params::crf_max_iframe_enable
int crf_max_iframe_enable
Definition: ni_device_api.h:2423
ni_frame_new_aux_data_from_raw_data
LIB_API ni_aux_data_t * ni_frame_new_aux_data_from_raw_data(ni_frame_t *frame, ni_aux_data_type_t type, const uint8_t *raw_data, int data_size)
Add a new auxiliary data to a frame and copy in the raw data.
Definition: ni_device_api.c:4045
XCODER_TEST_RECONF_SLICE_ARG
@ XCODER_TEST_RECONF_SLICE_ARG
Definition: ni_device_api.h:1758
_ni_session_context::active_video_width
uint32_t active_video_width
Definition: ni_device_api.h:1549
ni_codec_hw_actions_t
enum ni_codec_hw_actions ni_codec_hw_actions_t
This is an enumeration for hw actions.
_ni_network_layer_params_t::num_of_dims
uint32_t num_of_dims
Definition: ni_device_api.h:1328
_ni_extended_dec_metadata::rsvd0
uint64_t rsvd0
Definition: ni_device_api.h:730
_ni_encoder_cfg_params::enable_ai_enhance
int enable_ai_enhance
Definition: ni_device_api.h:2393
ni_device_session_flush
LIB_API ni_retcode_t ni_device_session_flush(ni_session_context_t *p_ctx, ni_device_type_t device_type)
Send a flush command to the device If device_type is NI_DEVICE_TYPE_DECODER sends EOS command to deco...
Definition: ni_device_api.c:1512
_ni_network_layer_params_t::data_format
int32_t data_format
Definition: ni_device_api.h:1331
_ni_gop_params::poc_offset
int poc_offset
Definition: ni_device_api.h:1961
NI_SET_CHANGE_PARAM_CUSTOM_LAMBDA
@ NI_SET_CHANGE_PARAM_CUSTOM_LAMBDA
Definition: ni_device_api.h:966
_ni_gop_params::qp_offset
int qp_offset
Definition: ni_device_api.h:1962
_ni_framerate::framerate_denom
int32_t framerate_denom
Definition: ni_device_api.h:701
_ni_decoder_input_params_t::enable_user_data_sei_passthru
int enable_user_data_sei_passthru
Definition: ni_device_api.h:2520
_ni_session_context::pts_correction_last_dts
int64_t pts_correction_last_dts
Definition: ni_device_api.h:1443
NI_XCODER_HWDL_STATE
@ NI_XCODER_HWDL_STATE
Definition: ni_device_api.h:255
_ni_session_context::status
int status
Definition: ni_device_api.h:1524
_ni_network_perf_metrics::ddr_write_bw
uint64_t ddr_write_bw
Definition: ni_device_api.h:1393
NI_H265_USERDATA_FLAG_ITU_T_T35_PRE_2
@ NI_H265_USERDATA_FLAG_ITU_T_T35_PRE_2
Definition: ni_device_api.h:377
_ni_session_context::domain
unsigned short domain
Definition: ni_device_api.h:1619
ni_encoder_session_read_stream_header
LIB_API int ni_encoder_session_read_stream_header(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data)
Read encoder stream header from the device.
Definition: ni_device_api.c:11232
NI_FRAME_AUX_DATA_CATEGORY_CLASSIFY
@ NI_FRAME_AUX_DATA_CATEGORY_CLASSIFY
Definition: ni_device_api.h:594
_ni_session_context::is_dec_pkt_512_aligned
int is_dec_pkt_512_aligned
Definition: ni_device_api.h:1459
_ni_session_context::pool_type
ni_frame_pool_type_t pool_type
Definition: ni_device_api.h:1697
_ni_session_context::av_rois
ni_region_of_interest_t * av_rois
Definition: ni_device_api.h:1580
_ni_frame::color_trc
uint8_t color_trc
Definition: ni_device_api.h:2683
NI_SET_CHANGE_PARAM_RC_BIT_RATIO_LAYER
@ NI_SET_CHANGE_PARAM_RC_BIT_RATIO_LAYER
Definition: ni_device_api.h:958
XCODER_TEST_RECONF_CRF
@ XCODER_TEST_RECONF_CRF
Definition: ni_device_api.h:1754
NI_FRAME_AUX_DATA_CRF
@ NI_FRAME_AUX_DATA_CRF
Definition: ni_device_api.h:574
_ni_queue_node_t::p_next_buffer
struct _ni_queue_node_t * p_next_buffer
Definition: ni_device_api.h:1301
_ni_encoder_cfg_params::enable_ssim
int enable_ssim
Definition: ni_device_api.h:2387
ni_network_layer_params_t
struct _ni_network_layer_params_t ni_network_layer_params_t
_ni_region_of_interest
Definition: ni_device_api.h:626
_ni_session_context::param_err_msg
char param_err_msg[512]
Definition: ni_device_api.h:1528
_ni_xcoder_params::color_primaries
int color_primaries
Definition: ni_device_api.h:2756
_ni_device_capability::xcoder_cnt
uint8_t xcoder_cnt[NI_DEVICE_TYPE_XCODER_MAX]
Definition: ni_device_api.h:1158
_ni_session_context::ori_chroma_linesize
int ori_chroma_linesize
Definition: ni_device_api.h:1681
_ni_encoder_cfg_params::enable_compensate_qp
int enable_compensate_qp
Definition: ni_device_api.h:2437
_ni_queue_node_t::checkout_timestamp
time_t checkout_timestamp
Definition: ni_device_api.h:1297
_ni_network_layer_offset
Definition: ni_device_api.h:1358
ni_hw_capability_t
struct _ni_hw_capability ni_hw_capability_t
hardware capability type
_ni_frame::total_start_len
uint32_t total_start_len
Definition: ni_device_api.h:2705
_ni_session_context::last_bitrate
int32_t last_bitrate
Definition: ni_device_api.h:1674
ni_device_dec_session_flush
LIB_API ni_retcode_t ni_device_dec_session_flush(ni_session_context_t *p_ctx)
Flush a decoder session to get ready to continue decoding. Note: this is different from ni_device_ses...
Definition: ni_device_api.c:1621
_ni_input_frame::video_width
uint32_t video_width
Definition: ni_device_api.h:1400
_ni_session_context::pts_correction_num_faulty_dts
int pts_correction_num_faulty_dts
Definition: ni_device_api.h:1442
NI_AI_BUFFER_FORMAT_UINT32
@ NI_AI_BUFFER_FORMAT_UINT32
Definition: ni_device_api.h:1800
NI_DEC_CROP_MODE_AUTO
@ NI_DEC_CROP_MODE_AUTO
Definition: ni_device_api.h:929
_ni_session_context::actual_video_width
uint32_t actual_video_width
Definition: ni_device_api.h:1553
XCODER_TEST_RECONF_VUI_HRD
@ XCODER_TEST_RECONF_VUI_HRD
Definition: ni_device_api.h:1744
_ni_dec_h264_vui_param::motion_vectors_over_pic_boundaries_flag
uint8_t motion_vectors_over_pic_boundaries_flag
Definition: ni_device_api.h:835
NI_H265_USERDATA_FLAG_ITU_T_T35_SUF_1
@ NI_H265_USERDATA_FLAG_ITU_T_T35_SUF_1
Definition: ni_device_api.h:378
_ni_encoder_cfg_params::chromaQpOffset
int chromaQpOffset
Definition: ni_device_api.h:2328
NI_PIX_FMT_BGR0
@ NI_PIX_FMT_BGR0
Definition: ni_device_api.h:270
XCODER_TEST_RECONF_RC_MIN_MAX_QP_REDUNDANT
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP_REDUNDANT
Definition: ni_device_api.h:1753
_ni_load_query::pcie_throughput
uint32_t pcie_throughput
Definition: ni_device_api.h:1204
_ni_frameclone_desc
Definition: ni_device_api.h:1375
_ni_pkt_info::ssim_v
double ssim_v
Definition: ni_device_api.h:1101
NI_H265_USERDATA_FLAG_ITU_T_T35_PRE_1
@ NI_H265_USERDATA_FLAG_ITU_T_T35_PRE_1
Definition: ni_device_api.h:376
_ni_xcoder_params::rootBufId
int rootBufId
Definition: ni_device_api.h:2775
NI_H265_USERDATA_FLAG_VUI
@ NI_H265_USERDATA_FLAG_VUI
Definition: ni_device_api.h:361
_ni_encoder_change_params_t::bitRate
int32_t bitRate
Definition: ni_device_api.h:987
_ni_custom_sei::data
uint8_t data[NI_MAX_CUSTOM_SEI_DATA]
Definition: ni_device_api.h:1122
_ni_frame::vui_num_units_in_tick
uint32_t vui_num_units_in_tick
Definition: ni_device_api.h:2689
_ni_region_of_interest::right
int right
Definition: ni_device_api.h:637
ni_rsrc_api.h
Public definitions for managing NETINT video processing devices.
_ni_frame::p_start_buffer
uint8_t * p_start_buffer
Definition: ni_device_api.h:2702
_ni_session_context::event_handle
ni_event_handle_t event_handle
Definition: ni_device_api.h:1574
XCODER_TEST_RECONF_FRAMERATE
@ XCODER_TEST_RECONF_FRAMERATE
Definition: ni_device_api.h:1751
ni_scaler_multi_watermark_params_t
struct _ni_scaler_multi_watermark_params_t ni_scaler_multi_watermark_params_t
ni_device_multi_config_frame
LIB_API ni_retcode_t ni_device_multi_config_frame(ni_session_context_t *p_ctx, ni_frame_config_t p_cfg_in[], int numInCfgs, ni_frame_config_t *p_cfg_out)
Config multiple frame on the device for 2D engined to work on based on provided parameters.
Definition: ni_device_api.c:9095
ni_query_extra_info
LIB_API ni_retcode_t ni_query_extra_info(ni_device_handle_t device_handle, ni_device_extra_info_t *p_dev_extra_info, uint8_t fw_rev[])
Query CompositeTemp from device.
Definition: ni_device_api.c:11617
_ni_frame::aux_data
ni_aux_data_t * aux_data[NI_MAX_NUM_AUX_DATA_PER_FRAME]
Definition: ni_device_api.h:2677
g_xcoder_preset_names
const LIB_API char *const g_xcoder_preset_names[NI_XCODER_PRESET_NAMES_ARRAY_LEN]
Definition: ni_device_api.c:69
_ni_device_capability::hw_elements_cnt
uint8_t hw_elements_cnt
Definition: ni_device_api.h:1156
ni_aux_data_type_t
enum _ni_frame_aux_data_type ni_aux_data_type_t
ni_instance_mgr_detail_status_t
struct _ni_instance_mgr_detail_status ni_instance_mgr_detail_status_t
_ni_frame::crop_top
uint32_t crop_top
Definition: ni_device_api.h:2613
_ni_overall_load_query
Definition: ni_device_api.h:1222
_ni_encoder_cfg_params::enable_acq_limit
int enable_acq_limit
Definition: ni_device_api.h:2429
_ni_encoder_cfg_params::noMbtree
int noMbtree
Definition: ni_device_api.h:2401
_ni_scaler_drawbox_params_t::rgba_c
uint32_t rgba_c
Definition: ni_device_api.h:2581
XCODER_TEST_RECONF_INTRAPRD
@ XCODER_TEST_RECONF_INTRAPRD
Definition: ni_device_api.h:1743
ni_device_capability_query2
LIB_API ni_retcode_t ni_device_capability_query2(ni_device_handle_t device_handle, ni_device_capability_t *p_cap, bool device_in_ctxt)
Query device and return device capability structure This function had replaced ni_device_capability_q...
Definition: ni_device_api.c:647
_ni_session_context::last_dts
int64_t last_dts
Definition: ni_device_api.h:1438
_ni_session_context::blk_io_handle
ni_device_handle_t blk_io_handle
Definition: ni_device_api.h:1465
_ni_frame::start_len
uint32_t start_len[NI_MAX_NUM_DATA_POINTERS]
Definition: ni_device_api.h:2704
NI_HDR10P_SEI_HDR_HEVC_LEN
#define NI_HDR10P_SEI_HDR_HEVC_LEN
Definition: ni_device_api.h:462
_ni_scaler_input_params_t
Definition: ni_device_api.h:2544
_ni_encoder_cfg_params::roi_enable
int roi_enable
Definition: ni_device_api.h:2257
_ni_session_context::frame_pkt_offset
uint64_t frame_pkt_offset
Definition: ni_device_api.h:1647
NI_MAX_DEVICES_PER_HW_INSTANCE
#define NI_MAX_DEVICES_PER_HW_INSTANCE
Definition: ni_defs.h:239
_ni_encoder_cfg_params::intra_period
int intra_period
Definition: ni_device_api.h:2260
_ni_queue_t::name
char name[32]
Definition: ni_device_api.h:1315
_ni_session_context::pts_correction_last_pts
int64_t pts_correction_last_pts
Definition: ni_device_api.h:1445
_ni_encoder_cfg_params::EnableRdoQuant
int EnableRdoQuant
Definition: ni_device_api.h:2302
_ni_extended_dec_metadata::time_scale
uint32_t time_scale
Definition: ni_device_api.h:724
_ni_frame_config::rectangle_height
uint16_t rectangle_height
Definition: ni_device_api.h:2815
_ni_decoder_input_params_t::min_packets_delay
bool min_packets_delay
Definition: ni_device_api.h:2531
ni_reconfig_bitrate
LIB_API ni_retcode_t ni_reconfig_bitrate(ni_session_context_t *p_ctx, int32_t bitrate)
Reconfigure bitrate dynamically during encoding.
Definition: ni_device_api.c:9869
_ni_dec_h265_vui_param::sar_width
uint16_t sar_width
Definition: ni_device_api.h:755
_ni_frame::separate_metadata
uint8_t separate_metadata
Definition: ni_device_api.h:2698
ni_custom_sei_set_t
struct _ni_custom_sei_set ni_custom_sei_set_t
_ni_session_context::reconfig_slice_arg
int16_t reconfig_slice_arg
Definition: ni_device_api.h:1706
ni_enc_allocate_strategy_t
ni_enc_allocate_strategy_t
Definition: ni_device_api.h:280
_ni_encoder_cfg_params::enable_pic_skip
int enable_pic_skip
Definition: ni_device_api.h:2370
ni_qos_codes
ni_qos_codes
Definition: ni_device_api.h:234
_ni_network_data::outset
ni_network_layer_offset_t * outset
Definition: ni_device_api.h:1371
_ni_network_perf_metrics
Definition: ni_device_api.h:1384
_ni_hw_capability::max_4k_fps
uint8_t max_4k_fps
Definition: ni_device_api.h:1138
ni_scaler_set_drawbox_params
LIB_API ni_retcode_t ni_scaler_set_drawbox_params(ni_session_context_t *p_ctx, ni_scaler_drawbox_params_t *p_params)
Send a p_config command to configure scaling drawbox parameters.
Definition: ni_device_api.c:8701
ni_encoder_cfg_params_t
struct _ni_encoder_cfg_params ni_encoder_cfg_params_t
_ni_encoder_cfg_params::use_recommend_enc_params
int use_recommend_enc_params
Definition: ni_device_api.h:2346
_ni_packet::frame_type
uint32_t frame_type
Definition: ni_device_api.h:2835
_ni_thread_arg_struct_t::p_buffer
void * p_buffer
Definition: ni_device_api.h:1266
_ni_session_context::prev_pts
uint64_t prev_pts
Definition: ni_device_api.h:1633
_ni_network_layer_params_t::fixed_point_pos
int32_t fixed_point_pos
Definition: ni_device_api.h:1339
_ni_dec_h265_vui_param::default_display_window_flag
uint8_t default_display_window_flag
Definition: ni_device_api.h:771
ni_device_session_read
LIB_API int ni_device_session_read(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data, ni_device_type_t device_type)
Read data from the device If device_type is NI_DEVICE_TYPE_DECODER reads data packet from decoder If ...
Definition: ni_device_api.c:1769
_ni_session_context::light_level_data_len
int light_level_data_len
Definition: ni_device_api.h:1427
_ni_hw_capability::min_video_height
uint16_t min_video_height
Definition: ni_device_api.h:1144
_ni_load_query::fw_share_mem_usage
uint32_t fw_share_mem_usage
Definition: ni_device_api.h:1210
_ni_gop_params::pic_type
int pic_type
Definition: ni_device_api.h:1965
ni_split_context_t
struct _ni_split_context_t ni_split_context_t
_ni_encoder_cfg_params::min_qp
int min_qp
Definition: ni_device_api.h:2366
_ni_encoder_change_params_t::minQpPB
int32_t minQpPB
Definition: ni_device_api.h:1003
_ni_buf_pool_t::mutex
ni_pthread_mutex_t mutex
Definition: ni_device_api.h:1284
_ni_frame::error_ratio
uint32_t error_ratio
Definition: ni_device_api.h:2710
NI_FRAME_AUX_DATA_SLICE_ARG
@ NI_FRAME_AUX_DATA_SLICE_ARG
Definition: ni_device_api.h:590
_ni_encoder_cfg_params::gop_preset_index
int gop_preset_index
Definition: ni_device_api.h:2251
ni_set_demo_roi_map
LIB_API ni_retcode_t ni_set_demo_roi_map(ni_session_context_t *p_enc_ctx)
Set up hard coded demo ROI map.
Definition: ni_device_api.c:11751
_ni_frame::sei_user_data_unreg_len
unsigned int sei_user_data_unreg_len
Definition: ni_device_api.h:2644
_ni_encoder_cfg_params::max_qp
int max_qp
Definition: ni_device_api.h:2367
_ni_frame_config
Definition: ni_device_api.h:2808
ni_scaler_dest_frame_alloc
LIB_API ni_retcode_t ni_scaler_dest_frame_alloc(ni_session_context_t *p_ctx, ni_scaler_input_params_t scaler_params, niFrameSurface1_t *p_surface)
allocate device destination frame from scaler hwframe pool
Definition: ni_device_api.c:3298
_ni_encoder_cfg_params::ipRatio
float ipRatio
Definition: ni_device_api.h:2404
NI_PIX_FMT_BGRP
@ NI_PIX_FMT_BGRP
Definition: ni_device_api.h:271
ni_pic_type_t
ni_pic_type_t
Definition: ni_device_api.h:382
_ni_packet::av1_p_data
uint8_t * av1_p_data[MAX_AV1_ENCODER_GOP_NUM]
Definition: ni_device_api.h:2845
ni_frame_t
struct _ni_frame ni_frame_t
QOS_MODE_ENABLED_NO_SHARE
@ QOS_MODE_ENABLED_NO_SHARE
Definition: ni_device_api.h:227
_ni_session_context::force_frame_type
int force_frame_type
Definition: ni_device_api.h:1542
_ni_encoder_cfg_params::blockRCSize
int blockRCSize
Definition: ni_device_api.h:2336
ni_uploader_frame_buffer_lock
LIB_API ni_retcode_t ni_uploader_frame_buffer_lock(ni_session_context_t *p_upl_ctx, ni_frame_t *p_frame)
Lock a hardware P2P frame prior to encoding.
Definition: ni_device_api.c:10763
_ni_instance_mgr_detail_status::ui32NumOutFrame
uint32_t ui32NumOutFrame
Definition: ni_device_api.h:1239
_ni_xcoder_params::roi_demo_mode
int roi_demo_mode
Definition: ni_device_api.h:2730
_ni_sei_header::status
uint8_t status
Definition: ni_device_api.h:344
_niFrameSurface1::src_cpu
int8_t src_cpu
Definition: ni_device_api.h:2804
_ni_network_perf_metrics::total_idle_cycles
uint32_t total_idle_cycles
Definition: ni_device_api.h:1387
NI_H265_USERDATA_FLAG_TONE_MAPPING_INFO
@ NI_H265_USERDATA_FLAG_TONE_MAPPING_INFO
Definition: ni_device_api.h:372
_ni_session_context::src_endian
int src_endian
Definition: ni_device_api.h:1493
_ni_dec_win::top
int16_t top
Definition: ni_device_api.h:717
NI_ENC_MEM_ALLOCATE_STRATEGY_INVALID_MIN
@ NI_ENC_MEM_ALLOCATE_STRATEGY_INVALID_MIN
Definition: ni_device_api.h:282
ni_qos_modes_t
enum ni_qos_modes ni_qos_modes_t
ni_device_session_read_hwdesc
LIB_API int ni_device_session_read_hwdesc(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data, ni_device_type_t device_type)
Read data from the device If device_type is NI_DEVICE_TYPE_DECODER reads data hwdesc from decoder If ...
Definition: ni_device_api.c:8043
_ni_session_context::low_delay_sync_mutex
ni_pthread_mutex_t low_delay_sync_mutex
Definition: ni_device_api.h:1665
_ni_encoder_cfg_params::intra_mb_refresh_mode
int intra_mb_refresh_mode
Definition: ni_device_api.h:2261
_ni_xcoder_params::pos_time_scale
NI_DEPRECATED uint32_t pos_time_scale
Definition: ni_device_api.h:2754
_ni_gop_params
Definition: ni_device_api.h:1959
NI_PIX_FMT_NONE
@ NI_PIX_FMT_NONE
Definition: ni_device_api.h:277
_ni_frame::orignal_pts
long long orignal_pts
Definition: ni_device_api.h:2709
_ni_encoder_cfg_params::vbv_buffer_size
int vbv_buffer_size
Definition: ni_device_api.h:2377
_ni_packet::av1_buffer_size
uint32_t av1_buffer_size[MAX_AV1_ENCODER_GOP_NUM]
Definition: ni_device_api.h:2846
_ni_frame::sei_total_len
unsigned int sei_total_len
Definition: ni_device_api.h:2629
_ni_session_context::pts_offsets
int64_t pts_offsets[NI_FIFO_SZ]
Definition: ni_device_api.h:1449
_ni_frame::p_buffer
uint8_t * p_buffer
Definition: ni_device_api.h:2666
NI_H265_USERDATA_FLAG_CHROMA_RESAMPLING_FILTER_HINT
@ NI_H265_USERDATA_FLAG_CHROMA_RESAMPLING_FILTER_HINT
Definition: ni_device_api.h:370
_ni_encoder_cfg_params::noHWMultiPassSupport
int noHWMultiPassSupport
Definition: ni_device_api.h:2402
_ni_encoder_cfg_params::gdrDuration
int gdrDuration
Definition: ni_device_api.h:2284
NI_AI_BUFFER_FORMAT_FP64
@ NI_AI_BUFFER_FORMAT_FP64
Definition: ni_device_api.h:1806
_ni_packet::psnr_y
double psnr_y
Definition: ni_device_api.h:2855
_ni_xcoder_params::video_full_range_flag
int video_full_range_flag
Definition: ni_device_api.h:2761
NI_FIFO_SZ
#define NI_FIFO_SZ
Definition: ni_defs.h:291
_ni_encoder_change_params_t::aspectRatioHeight
uint16_t aspectRatioHeight
Definition: ni_device_api.h:1024
_ni_frame::dts
long long dts
Definition: ni_device_api.h:2606
_ni_encoder_change_params_t::enable_option
uint32_t enable_option
Definition: ni_device_api.h:984
XCODER_TEST_RECONF_VBV
@ XCODER_TEST_RECONF_VBV
Definition: ni_device_api.h:1756
_ni_decoder_input_params_t::force_low_delay
bool force_low_delay
Definition: ni_device_api.h:2518
_ni_encoder_change_params_t::mbLevelRcEnable
int32_t mbLevelRcEnable
Definition: ni_device_api.h:995
_ni_encoder_cfg_params::aspectRatioWidth
int aspectRatioWidth
Definition: ni_device_api.h:2240
_ni_instance_mgr_detail_status::ui32BitRate
uint32_t ui32BitRate
Definition: ni_device_api.h:1235
_ni_network_perf_metrics::ddr_read_bw
uint64_t ddr_read_bw
Definition: ni_device_api.h:1392
_ni_split_context_t::h
int h[3]
Definition: ni_device_api.h:1730
_ni_session_context::avc_roi_map
ni_enc_avc_roi_custom_map_t * avc_roi_map
Definition: ni_device_api.h:1585
_ni_scaler_input_params_t::input_height
int32_t input_height
Definition: ni_device_api.h:2548
_ni_frame::pkt_pos
uint64_t pkt_pos
Definition: ni_device_api.h:2699
_ni_session_context::buffered_frame_index
int16_t buffered_frame_index
Definition: ni_device_api.h:1717
ni_decoder_params_set_value
LIB_API ni_retcode_t ni_decoder_params_set_value(ni_xcoder_params_t *p_params, const char *name, char *value)
Set value referenced by name in decoder parameters structure.
Definition: ni_device_api.c:4881
NI_XCODER_INTER_FLUSH_STATE
@ NI_XCODER_INTER_FLUSH_STATE
Definition: ni_device_api.h:252
_ni_device_capability::fw_commit_hash
uint8_t fw_commit_hash[41]
Definition: ni_device_api.h:1167
ni_region_of_interest_t
struct _ni_region_of_interest ni_region_of_interest_t
_ni_frame::crop_left
uint32_t crop_left
Definition: ni_device_api.h:2615
_ni_packet::ssim_y
double ssim_y
Definition: ni_device_api.h:2859
_ni_encoder_cfg_params::maxFrameSizeRatio
int maxFrameSizeRatio
Definition: ni_device_api.h:2244
_ni_decoder_input_params_t::enable_advanced_ec
int enable_advanced_ec
Definition: ni_device_api.h:2524
ni_dec_crop_mode
enum _ni_dec_crop_mode ni_dec_crop_mode
_ni_encoder_cfg_params::HDR10AveLight
int HDR10AveLight
Definition: ni_device_api.h:2271
_ni_encoder_cfg_params::rc
struct _ni_encoder_cfg_params::@16 rc
XCODER_TEST_INVALID_REF_FRAME
@ XCODER_TEST_INVALID_REF_FRAME
Definition: ni_device_api.h:1750
_ni_decoder_input_params_t::sc_expr
char sc_expr[NI_MAX_NUM_OF_DECODER_OUTPUTS][2][NI_MAX_PPU_PARAM_EXPR_CHAR+1]
Definition: ni_device_api.h:2514
_ni_encoder_cfg_params::cu_size_mode
int cu_size_mode
Definition: ni_device_api.h:2348
ni_dec_mastering_display_colour_volume_bytes_t
struct _ni_dec_mastering_display_colour_volume_bytes ni_dec_mastering_display_colour_volume_bytes_t
decoded payload format of HDR SEI mastering display colour volume
_ni_packet::av1_data_len
uint32_t av1_data_len[MAX_AV1_ENCODER_GOP_NUM]
Definition: ni_device_api.h:2847
ni_dec_h264_vui_param_t
struct _ni_dec_h264_vui_param ni_dec_h264_vui_param_t
decoded payload format of H.264 VUI
_ni_encoder_cfg_params::hrdEnable
int hrdEnable
Definition: ni_device_api.h:2303
_ni_session_run_state
_ni_session_run_state
Session running state type.
Definition: ni_device_api.h:1175
_ni_frame::preferred_characteristics_data_len
uint8_t preferred_characteristics_data_len
Definition: ni_device_api.h:2671
_ni_frame_config::session_id
uint16_t session_id
Definition: ni_device_api.h:2820
_ni_network_perf_metrics::write_bw
uint64_t write_bw
Definition: ni_device_api.h:1389
NI_SET_CHANGE_PARAM_PPS
@ NI_SET_CHANGE_PARAM_PPS
Definition: ni_device_api.h:953
NI_PIX_FMT_8_TILED4X4
@ NI_PIX_FMT_8_TILED4X4
Definition: ni_device_api.h:275
_ni_session_context::bit_depth_factor
int bit_depth_factor
Definition: ni_device_api.h:1494
_ni_queue_node_t::frame_info
uint64_t frame_info
Definition: ni_device_api.h:1296
XCODER_TEST_RECONF_RC_MIN_MAX_QP_API_REDUNDANT
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP_API_REDUNDANT
Definition: ni_device_api.h:1764
ni_scaler_set_watermark_params
LIB_API ni_retcode_t ni_scaler_set_watermark_params(ni_session_context_t *p_ctx, ni_scaler_watermark_params_t *p_params)
Send a p_config command to configure scaling watermark parameters.
Definition: ni_device_api.c:8781
_ni_session_context::reconfig_crf_decimal
int reconfig_crf_decimal
Definition: ni_device_api.h:1686
_ni_encoder_change_params_t
This is a data structure for encoding parameters that have changed.
Definition: ni_device_api.h:982
_ni_encoder_cfg_params::encMallocStrategy
int encMallocStrategy
Definition: ni_device_api.h:2435
_ni_category_classify::prob
float prob
Definition: ni_device_api.h:650
ni_network_layer_info_t
struct _ni_network_layer_info ni_network_layer_info_t
ni_content_light_level_info_bytes_t
struct _ni_content_light_level_info_bytes ni_content_light_level_info_bytes_t
payload format of HDR SEI content light level info
_ni_xcoder_params::log
int log
Definition: ni_device_api.h:2715
ni_frame_get_aux_data
LIB_API ni_aux_data_t * ni_frame_get_aux_data(const ni_frame_t *frame, ni_aux_data_type_t type)
Retrieve from the frame auxiliary data of a given type if exists.
Definition: ni_device_api.c:4066
_ni_frame::force_pic_qp
uint16_t force_pic_qp
Definition: ni_device_api.h:2659
_ni_encoder_cfg_params::high_tier
int high_tier
Definition: ni_device_api.h:2344
_ni_session_context::mutex
ni_pthread_mutex_t mutex
Definition: ni_device_api.h:1565
NI_FRAME_AUX_DATA_HDR_PLUS
@ NI_FRAME_AUX_DATA_HDR_PLUS
Definition: ni_device_api.h:514
_ni_encoder_cfg_params::max_num_merge
int max_num_merge
Definition: ni_device_api.h:2349
_ni_gop_params::num_ref_pics
int num_ref_pics
Definition: ni_device_api.h:1966
_ni_packet::av1_buffer_index
int av1_buffer_index
Definition: ni_device_api.h:2848
_ni_decoder_input_params_t::crop_mode
int crop_mode[NI_MAX_NUM_OF_DECODER_OUTPUTS]
Definition: ni_device_api.h:2506
ni_frame_buffer_free
LIB_API ni_retcode_t ni_frame_buffer_free(ni_frame_t *pframe)
Free frame buffer that was previously allocated with either ni_frame_buffer_alloc or ni_encoder_frame...
Definition: ni_device_api.c:3561
_ni_aux_data::size
int size
Definition: ni_device_api.h:622
_ni_encoder_cfg_params::crf
int crf
Definition: ni_device_api.h:2269
_ni_load_query::pcie_load
uint32_t pcie_load
Definition: ni_device_api.h:1208
NI_H265_USERDATA_FLAG_ITU_T_T35_PRE
@ NI_H265_USERDATA_FLAG_ITU_T_T35_PRE
Definition: ni_device_api.h:364
_ni_session_context::hw_id
int hw_id
Definition: ni_device_api.h:1478
ni_xcoder_params_t
struct _ni_xcoder_params ni_xcoder_params_t
_ni_hw_capability::video_level
uint8_t video_level
Definition: ni_device_api.h:1146
_ni_dec_h264_vui_param::pic_struct_present_flag
uint8_t pic_struct_present_flag
Definition: ni_device_api.h:832
_ni_region_of_interest::self_size
uint32_t self_size
Definition: ni_device_api.h:629
_ni_network_layer_params_t
Definition: ni_device_api.h:1326
ni_device_session_write
LIB_API int ni_device_session_write(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data, ni_device_type_t device_type)
Send data to the device If device_type is NI_DEVICE_TYPE_DECODER sends data packet to decoder If devi...
Definition: ni_device_api.c:1668
NI_FRAME_AUX_DATA_VBV_BUFFER_SIZE
@ NI_FRAME_AUX_DATA_VBV_BUFFER_SIZE
Definition: ni_device_api.h:586
ni_scaler_drawbox_params_t
struct _ni_scaler_drawbox_params_t ni_scaler_drawbox_params_t
_ni_dec_h264_vui_param::video_format
int8_t video_format
Definition: ni_device_api.h:808
ni_session_context_t
struct _ni_session_context ni_session_context_t
_ni_session_context::ori_width
int ori_width
Definition: ni_device_api.h:1562
_ni_xcoder_params::fps_number
uint32_t fps_number
Definition: ni_device_api.h:2718
NI_FRAME_AUX_DATA_VBV_MAX_RATE
@ NI_FRAME_AUX_DATA_VBV_MAX_RATE
Definition: ni_device_api.h:582
_ni_enc_quad_roi_custom_map::roiAbsQp_flag
uint8_t roiAbsQp_flag
Definition: ni_device_api.h:887
ni_device_session_query
LIB_API ni_retcode_t ni_device_session_query(ni_session_context_t *p_ctx, ni_device_type_t device_type)
Query session data from the device - If device_type is valid, will query session data from specified ...
Definition: ni_device_api.c:1920
_ni_session_context::ddr_config
uint8_t ddr_config
Definition: ni_device_api.h:1626
_ni_enc_mastering_display_colour_volume::max_display_mastering_luminance
uint32_t max_display_mastering_luminance
Definition: ni_device_api.h:1089
NI_XCODER_OPEN_STATE
@ NI_XCODER_OPEN_STATE
Definition: ni_device_api.h:245
_ni_scaler_input_params_t::input_format
int input_format
Definition: ni_device_api.h:2546
_ni_instance_mgr_detail_status_append::ui32Height
uint32_t ui32Height
Definition: ni_device_api.h:1244
_ni_xcoder_params::hdrEnableVUI
int hdrEnableVUI
Definition: ni_device_api.h:2745
_ni_load_query::fw_video_shared_mem_usage
uint32_t fw_video_shared_mem_usage
Definition: ni_device_api.h:1207
_ni_scaler_params_t
Definition: ni_device_api.h:2566
ni_calculate_total_frame_size
LIB_API int ni_calculate_total_frame_size(const ni_session_context_t *p_upl_ctx, const int linesize[])
Calculate the total size of a frame based on the upload context attributes and includes rounding up t...
Definition: ni_device_api.c:9145
_ni_scaler_input_params_t::out_rec_width
int32_t out_rec_width
Definition: ni_device_api.h:2557
NI_SET_CHANGE_PARAM_VUI_HRD_PARAM
@ NI_SET_CHANGE_PARAM_VUI_HRD_PARAM
Definition: ni_device_api.h:968
_ni_device_capability::fw_build_id
uint8_t fw_build_id[256]
Definition: ni_device_api.h:1169
ni_set_ltr
LIB_API ni_retcode_t ni_set_ltr(ni_session_context_t *p_ctx, ni_long_term_ref_t *ltr)
Set a frame's support of Long Term Reference frame during encoding.
Definition: ni_device_api.c:10026
_ni_queue_node_t::timestamp
uint64_t timestamp
Definition: ni_device_api.h:1295
_ni_timestamp_table_t::list
ni_queue_t list
Definition: ni_device_api.h:1323
_ni_encoder_cfg_params::enable_timecode
int enable_timecode
Definition: ni_device_api.h:2439
_ni_session_context::reconfig_intra_period
int reconfig_intra_period
Definition: ni_device_api.h:1704
ni_retcode_t
ni_retcode_t
Definition: ni_defs.h:425
NI_FRAME_AUX_DATA_MAX_MIN_QP
@ NI_FRAME_AUX_DATA_MAX_MIN_QP
Definition: ni_device_api.h:570
_ni_load_query::fw_model_load
uint32_t fw_model_load
Definition: ni_device_api.h:1199
_ni_session_context::template_config_id
uint32_t template_config_id
Definition: ni_device_api.h:1472
NI_SET_CHANGE_PARAM_BG
@ NI_SET_CHANGE_PARAM_BG
Definition: ni_device_api.h:964
ni_uploader_p2p_test_load
LIB_API ni_retcode_t ni_uploader_p2p_test_load(ni_session_context_t *p_upl_ctx, uint8_t *p_data, uint32_t len, ni_frame_t *p_hwframe)
Special P2P test API function. Copies video data from the software frame to the hardware P2P frame on...
Definition: ni_device_api.c:10924
_ni_enc_hevc_roi_custom_map::sub_ctu_qp_2
uint32_t sub_ctu_qp_2
Definition: ni_device_api.h:857
_ni_vui_hrd::colorPrimaries
int32_t colorPrimaries
Definition: ni_device_api.h:661
_ni_enc_hevc_roi_custom_map::sub_ctu_qp_0
uint32_t sub_ctu_qp_0
Definition: ni_device_api.h:855
SESSION_RUN_STATE_SEQ_CHANGE_DRAINING
@ SESSION_RUN_STATE_SEQ_CHANGE_DRAINING
Definition: ni_device_api.h:1178
NI_FRAME_AUX_DATA_UDU_SEI
@ NI_FRAME_AUX_DATA_UDU_SEI
Definition: ni_device_api.h:525
_ni_frame_aux_data_type
_ni_frame_aux_data_type
Definition: ni_device_api.h:497
NI_CC_SEI_HDR_H264_LEN
#define NI_CC_SEI_HDR_H264_LEN
Definition: ni_device_api.h:464
_ni_enc_mastering_display_colour_volume::white_point_y
uint16_t white_point_y
Definition: ni_device_api.h:1088
_ni_session_context::fw_rev
uint8_t fw_rev[8]
Definition: ni_device_api.h:1625
_ni_reconfig
_ni_reconfig
This is an enumeration for encoder reconfiguration test settings.
Definition: ni_device_api.h:1739
_ni_enc_mastering_display_colour_volume::display_primaries
uint16_t display_primaries[3][2]
Definition: ni_device_api.h:1086
ni_thread_arg_struct_t
struct _ni_thread_arg_struct_t ni_thread_arg_struct_t
_ni_dec_win::bottom
int16_t bottom
Definition: ni_device_api.h:718
_ni_encoder_cfg_params::intra_mb_refresh_arg
int intra_mb_refresh_arg
Definition: ni_device_api.h:2262
_ni_network_data::output_num
uint32_t output_num
Definition: ni_device_api.h:1366
_ni_extended_dec_metadata::rsvd4
uint64_t rsvd4
Definition: ni_device_api.h:734
SESSION_RUN_STATE_NORMAL
@ SESSION_RUN_STATE_NORMAL
Definition: ni_device_api.h:1177
_ni_session_context::decoder_last_drop_frame_num
uint32_t decoder_last_drop_frame_num
Definition: ni_device_api.h:1723
NI_MAX_REF_PIC
#define NI_MAX_REF_PIC
Definition: ni_device_api.h:59
_ni_session_context::pts_correction_num_faulty_pts
int pts_correction_num_faulty_pts
Definition: ni_device_api.h:1444
_ni_custom_sei_location
_ni_custom_sei_location
This is an enumeration for illustrating the custom SEI locations.
Definition: ni_device_api.h:1108
NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE
#define NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE
Definition: ni_device_api.h:476
ni_frame_pool_type_t
enum _ni_frame_pool_type ni_frame_pool_type_t
Frame pool type.
_ni_encoder_cfg_params::pps_init_qp
int pps_init_qp
Definition: ni_device_api.h:2407
_ni_session_context::pkt_pos
uint64_t pkt_pos[NI_FIFO_SZ]
Definition: ni_device_api.h:1453
_ni_encoder_change_params_t::colorPrimaries
uint8_t colorPrimaries
Definition: ni_device_api.h:1020
_ni_frame::sei_hdr_mastering_display_color_vol_offset
unsigned int sei_hdr_mastering_display_color_vol_offset
Definition: ni_device_api.h:2635
ni_ai_config_hvsplus
LIB_API ni_retcode_t ni_ai_config_hvsplus(ni_session_context_t *p_ctx, ni_network_data_t *p_network)
configure a hvsplus filter
Definition: ni_device_api.c:9651
_ni_frame::sei_cc_offset
unsigned int sei_cc_offset
Definition: ni_device_api.h:2632
_ni_packet::pkt_pos
uint64_t pkt_pos
Definition: ni_device_api.h:2830
_ni_extended_dec_metadata::rsvd2
uint64_t rsvd2
Definition: ni_device_api.h:732
_ni_encoder_cfg_params::gopSize
int gopSize
Definition: ni_device_api.h:2323
_ni_pkt_info::average_psnr
double average_psnr
Definition: ni_device_api.h:1098
_ni_session_context::reconfig_vbv_buffer_size
int reconfig_vbv_buffer_size
Definition: ni_device_api.h:1688
_ni_session_context::average_psnr
double average_psnr
Definition: ni_device_api.h:1713
_ni_frameclone_desc::reserved
uint32_t reserved
Definition: ni_device_api.h:1381
_ni_frame_config::options
uint16_t options
Definition: ni_device_api.h:2813
_ni_session_context::framerate
ni_framerate_t framerate
Definition: ni_device_api.h:1604
_ni_buf_pool_t::buf_size
uint32_t buf_size
Definition: ni_device_api.h:1286
_ni_xcoder_params::ui8VuiRbsp
NI_DEPRECATED uint8_t ui8VuiRbsp[NI_MAX_VUI_SIZE]
Definition: ni_device_api.h:2752
ni_gop_params_check_set
LIB_API void ni_gop_params_check_set(ni_xcoder_params_t *p_param, char *value)
Set custom gop and prepare to check if success.
Definition: ni_device_api.c:12614
_ni_session_context::pext_mutex
ni_pthread_mutex_t * pext_mutex
Definition: ni_device_api.h:1670
_ni_frame_config::picture_format
uint16_t picture_format
Definition: ni_device_api.h:2812
_ni_dec_h264_vui_param::sar_width
uint16_t sar_width
Definition: ni_device_api.h:812
_ni_thread_arg_struct_t::device_handle
ni_device_handle_t device_handle
Definition: ni_device_api.h:1264
_ni_context_query
Definition: ni_device_api.h:1184
_ni_decoder_input_params_t::crop_whxy
int crop_whxy[NI_MAX_NUM_OF_DECODER_OUTPUTS][4]
Definition: ni_device_api.h:2507
NI_MAX_NUM_AUX_DATA_PER_FRAME
#define NI_MAX_NUM_AUX_DATA_PER_FRAME
Definition: ni_device_api.h:470
_ni_input_frame::pts
int64_t pts
Definition: ni_device_api.h:1403
_ni_encoder_cfg_params::qlevel
int qlevel
Definition: ni_device_api.h:2318
_ni_decoder_input_params_t::keep_alive_timeout
int keep_alive_timeout
Definition: ni_device_api.h:2515
NI_MAX_CONTEXTS_PER_HW_INSTANCE
#define NI_MAX_CONTEXTS_PER_HW_INSTANCE
Definition: ni_defs.h:236
_ni_custom_gop_params::custom_gop_size
int custom_gop_size
Definition: ni_device_api.h:2052
XCODER_TEST_RECONF_OFF
@ XCODER_TEST_RECONF_OFF
Definition: ni_device_api.h:1741
_ni_scaler_input_params_t::rgba_color
uint32_t rgba_color
Definition: ni_device_api.h:2562
_ni_encoder_change_params_t::crf
uint8_t crf
Definition: ni_device_api.h:1038
_ni_pkt_info
Definition: ni_device_api.h:1093
NI_SET_CHANGE_PARAM_NR
@ NI_SET_CHANGE_PARAM_NR
Definition: ni_device_api.h:963
_niFrameSurface1::ui16FrameIdx
uint16_t ui16FrameIdx
Definition: ni_device_api.h:2795
ni_reconfig_slice_arg
LIB_API ni_retcode_t ni_reconfig_slice_arg(ni_session_context_t *p_ctx, int16_t sliceArg)
Reconfigure sliceArg dynamically during encoding.
Definition: ni_device_api.c:10541
_ni_encoder_cfg_params::HDR10dx2
int HDR10dx2
Definition: ni_device_api.h:2278
NI_AI_BUFFER_FORMAT_FP32
@ NI_AI_BUFFER_FORMAT_FP32
Definition: ni_device_api.h:1782
_ni_context_query::fps
uint32_t fps
Definition: ni_device_api.h:1192
_ni_rational
Definition: ni_device_api.h:598
_ni_long_term_ref
Definition: ni_device_api.h:683
_ni_session_context::psnr_v
double psnr_v
Definition: ni_device_api.h:1712
_ni_vui_hrd::colorDescPresent
int32_t colorDescPresent
Definition: ni_device_api.h:657
_ni_scaler_multi_drawbox_params_t
Definition: ni_device_api.h:2592
_ni_session_context::reconfig_vbv_max_rate
int reconfig_vbv_max_rate
Definition: ni_device_api.h:1689
_ni_frameclone_desc::ui16DstIdx
uint16_t ui16DstIdx
Definition: ni_device_api.h:1378
_ni_dec_crop_mode
_ni_dec_crop_mode
Definition: ni_device_api.h:926
NI_SET_CHANGE_PARAM_RDO
@ NI_SET_CHANGE_PARAM_RDO
Definition: ni_device_api.h:962
_ni_encoder_cfg_params::HDR10wx
int HDR10wx
Definition: ni_device_api.h:2280
_ni_ddr_priority_mode_t
_ni_ddr_priority_mode_t
Definition: ni_device_api.h:1822
_ni_xcoder_params::source_height
int source_height
Definition: ni_device_api.h:2728
NI_SET_CHANGE_PARAM_CUSTOM_MD
@ NI_SET_CHANGE_PARAM_CUSTOM_MD
Definition: ni_device_api.h:965
_ni_encoder_change_params_t::colorSpace
uint8_t colorSpace
Definition: ni_device_api.h:1022
_ni_decoder_input_params_t::cr_expr
char cr_expr[NI_MAX_NUM_OF_DECODER_OUTPUTS][4][NI_MAX_PPU_PARAM_EXPR_CHAR+1]
Definition: ni_device_api.h:2510
_ni_encoder_cfg_params::rcQpDeltaRange
int rcQpDeltaRange
Definition: ni_device_api.h:2340
_ni_encoder_change_params_t::intraQP
int32_t intraQP
Definition: ni_device_api.h:1013
_ni_encoder_change_params_t::maxDeltaQp
int32_t maxDeltaQp
Definition: ni_device_api.h:1001
NI_MAX_CUSTOM_SEI_CNT
#define NI_MAX_CUSTOM_SEI_CNT
Definition: ni_defs.h:303
XCODER_TEST_RECONF_BR_API
@ XCODER_TEST_RECONF_BR_API
Definition: ni_device_api.h:1760
_ni_encoder_cfg_params::hvsBaseMbComplexity
int hvsBaseMbComplexity
Definition: ni_device_api.h:2411
_ni_frame::ni_pict_type
ni_pic_type_t ni_pict_type
Definition: ni_device_api.h:2627
_ni_session_context::src_bit_depth
int src_bit_depth
Definition: ni_device_api.h:1492
NI_FRAME_AUX_DATA_VUI
@ NI_FRAME_AUX_DATA_VUI
Definition: ni_device_api.h:543
_ni_vui_hrd::colorTrc
int32_t colorTrc
Definition: ni_device_api.h:665
_ni_framerate::framerate_num
int32_t framerate_num
Definition: ni_device_api.h:698
_ni_network_layer_params_t::scale
float scale
Definition: ni_device_api.h:1344
_ni_packet::ssim_v
double ssim_v
Definition: ni_device_api.h:2861
_ni_network_perf_metrics::ocb_write_bw
uint64_t ocb_write_bw
Definition: ni_device_api.h:1391
ni_uploader_frame_zerocopy_check
LIB_API ni_retcode_t ni_uploader_frame_zerocopy_check(ni_session_context_t *p_upl_ctx, int width, int height, const int linesize[], int pixel_format)
Check if incoming frame is hwupload zero copy compatible or not.
Definition: ni_device_api.c:3028
_ni_scaler_watermark_params_t::ui32Width
uint32_t ui32Width
Definition: ni_device_api.h:2587
_ni_encoder_cfg_params::HDR10maxluma
int HDR10maxluma
Definition: ni_device_api.h:2282
ni_frame_buffer_alloc
LIB_API ni_retcode_t ni_frame_buffer_alloc(ni_frame_t *p_frame, int video_width, int video_height, int alignment, int metadata_flag, int factor, int hw_frame_count, int is_planar)
Allocate preliminary memory for the frame buffer based on provided parameters. Applicable to YUV420 P...
Definition: ni_device_api.c:2123
_ni_network_data::linfo
ni_network_layer_info_t linfo
Definition: ni_device_api.h:1367
_niFrameSurface1::ui16session_ID
uint16_t ui16session_ID
Definition: ni_device_api.h:2796
_ni_enc_hevc_roi_custom_map::lambda_sad_2
uint32_t lambda_sad_2
Definition: ni_device_api.h:862
_ni_encoder_change_params_t::repeatHeaders
int32_t repeatHeaders
Definition: ni_device_api.h:1015
_ni_xcoder_params::cfg_enc_params
ni_encoder_cfg_params_t cfg_enc_params
Definition: ni_device_api.h:2765
_ni_session_context::last_pkt_pos
uint64_t last_pkt_pos
Definition: ni_device_api.h:1454
ni_pkt_info
struct _ni_pkt_info ni_pkt_info
_ni_encoder_cfg_params::vbv_max_rate
int vbv_max_rate
Definition: ni_device_api.h:2378
_ni_gop_params::qp_factor
float qp_factor
Definition: ni_device_api.h:1963
_ni_ai_buffer_quantize_format_e
_ni_ai_buffer_quantize_format_e
Definition: ni_device_api.h:1809
_ni_category_classify
Definition: ni_device_api.h:646
NI_FRAME_AUX_DATA_NONE
@ NI_FRAME_AUX_DATA_NONE
Definition: ni_device_api.h:499
ni_defs.h
Common NETINT definitions used by all modules.
_ni_xcoder_params::force_frame_type
int force_frame_type
Definition: ni_device_api.h:2742
_ni_gop_rps::ref_pic
int ref_pic
Definition: ni_device_api.h:1955
_ni_ai_buffer_format_e
_ni_ai_buffer_format_e
Definition: ni_device_api.h:1779
NI_XCODER_IDLE_STATE
@ NI_XCODER_IDLE_STATE
Definition: ni_device_api.h:244
_ni_dec_h265_vui_param::vui_hrd_parameters_present_flag
uint8_t vui_hrd_parameters_present_flag
Definition: ni_device_api.h:778
NI_PIX_FMT_NV12
@ NI_PIX_FMT_NV12
Definition: ni_device_api.h:264
ni_device_session_context_clear
LIB_API void ni_device_session_context_clear(ni_session_context_t *p_ctx)
Clear already allocated session context.
Definition: ni_device_api.c:249
_ni_network_layer_params_t::dfp
struct _ni_network_layer_params_t::@13::@14 dfp
NI_SET_CHANGE_PARAM_SLICE_ARG
@ NI_SET_CHANGE_PARAM_SLICE_ARG
Definition: ni_device_api.h:959
_ni_gop_rps
Definition: ni_device_api.h:1953
XCODER_TEST_RECONF_INTRAPRD_API
@ XCODER_TEST_RECONF_INTRAPRD_API
Definition: ni_device_api.h:1761
_ni_frame::data_len
uint32_t data_len[NI_MAX_NUM_DATA_POINTERS]
Definition: ni_device_api.h:2664
NI_H265_USERDATA_FLAG_UNREGISTERED_PRE
@ NI_H265_USERDATA_FLAG_UNREGISTERED_PRE
Definition: ni_device_api.h:365
_ni_dec_h265_vui_param::field_seq_flag
uint8_t field_seq_flag
Definition: ni_device_api.h:768
_ni_session_context::pixel_format_changed
int pixel_format_changed
Definition: ni_device_api.h:1705
_ni_frame::extra_data_len
unsigned int extra_data_len
Definition: ni_device_api.h:2657
NI_AI_BUFFER_FORMAT_INT64
@ NI_AI_BUFFER_FORMAT_INT64
Definition: ni_device_api.h:1802
NI_H265_USERDATA_FLAG_RESERVED_3
@ NI_H265_USERDATA_FLAG_RESERVED_3
Definition: ni_device_api.h:362
ni_create_event
LIB_API ni_event_handle_t ni_create_event(void)
Create event and return event handle if successful (Windows only)
Definition: ni_device_api.c:266
_ni_encoder_change_params_t::maxFrameSize
uint16_t maxFrameSize
Definition: ni_device_api.h:1041
_ni_encoder_cfg_params::intra_qp
int intra_qp
Definition: ni_device_api.h:2368
PIC_TYPE_I
@ PIC_TYPE_I
Definition: ni_device_api.h:384
_ni_encoder_cfg_params::enable_rate_control
int enable_rate_control
Definition: ni_device_api.h:2365
_ni_session_context::start_dts_offset
NI_DEPRECATED int64_t start_dts_offset
Definition: ni_device_api.h:1446
ni_reconfig_vui
LIB_API ni_retcode_t ni_reconfig_vui(ni_session_context_t *p_ctx, ni_vui_hrd_t *vui)
Reconfigure VUI dynamically during encoding.
Definition: ni_device_api.c:9945
ni_ddr_priority_mode_t
enum _ni_ddr_priority_mode_t ni_ddr_priority_mode_t
_ni_network_layer_params_t::zeroPoint
int32_t zeroPoint
Definition: ni_device_api.h:1345
_ni_encoder_cfg_params::max_consecutive_skip_num
int max_consecutive_skip_num
Definition: ni_device_api.h:2418
DECODER_PIC_TYPE_IDR
@ DECODER_PIC_TYPE_IDR
Definition: ni_device_api.h:390
_ni_encoder_change_params_t::crfDecimal
uint8_t crfDecimal
Definition: ni_device_api.h:1037
_ni_dec_h264_vui_param::nal_hrd_parameters_present_flag
uint8_t nal_hrd_parameters_present_flag
Definition: ni_device_api.h:829
NI_PIXEL_PLANAR_MAX
@ NI_PIXEL_PLANAR_MAX
Definition: ni_device_api.h:923
_ni_decoder_input_params_t::semi_planar
int semi_planar[NI_MAX_NUM_OF_DECODER_OUTPUTS]
Definition: ni_device_api.h:2505
_ni_decoder_input_params_t::scale_long_short_edge
int scale_long_short_edge[NI_MAX_NUM_OF_DECODER_OUTPUTS]
Definition: ni_device_api.h:2533
NI_ENC_MEM_ALLOCATE_STRATEGY_REGION_0_FIRST
@ NI_ENC_MEM_ALLOCATE_STRATEGY_REGION_0_FIRST
Definition: ni_device_api.h:284
ni_aux_data_t
struct _ni_aux_data ni_aux_data_t
_ni_scaler_input_params_t::out_rec_y
int32_t out_rec_y
Definition: ni_device_api.h:2560
ni_enc_mastering_display_colour_volume_t
struct _ni_enc_mastering_display_colour_volume ni_enc_mastering_display_colour_volume_t
encoded payload format of HDR SEI mastering display colour volume
NI_H265_USER_DATA_FLAG_FILM_GRAIN_CHARACTERISTICS_INFO
@ NI_H265_USER_DATA_FLAG_FILM_GRAIN_CHARACTERISTICS_INFO
Definition: ni_device_api.h:373
_ni_network_perf_metrics::ocb_read_bw
uint64_t ocb_read_bw
Definition: ni_device_api.h:1390
_ni_decoder_input_params_t::hwframes
int hwframes
Definition: ni_device_api.h:2499
NI_POOL_TYPE_NORMAL
@ NI_POOL_TYPE_NORMAL
Definition: ni_device_api.h:492
_ni_device_info
Definition: ni_rsrc_api.h:102
ni_overall_load_query_t
struct _ni_overall_load_query ni_overall_load_query_t
ni_packet_buffer_free_av1
LIB_API ni_retcode_t ni_packet_buffer_free_av1(ni_packet_t *ppacket)
Free packet buffer that was previously allocated with ni_packet_buffer_alloc for AV1 packets merge.
Definition: ni_device_api.c:3884
_ni_context_query::context_id
uint32_t context_id
Definition: ni_device_api.h:1186
ni_device_close
LIB_API void ni_device_close(ni_device_handle_t dev)
Close device and release resources.
Definition: ni_device_api.c:503
ni_frame_config_t
struct _ni_frame_config ni_frame_config_t
_ni_session_context::passed_time_in_timebase_unit
uint32_t passed_time_in_timebase_unit
Definition: ni_device_api.h:1653
PIC_TYPE_B
@ PIC_TYPE_B
Definition: ni_device_api.h:386
_ni_dec_h265_vui_param::min_spatial_segmentation_idc
int8_t min_spatial_segmentation_idc
Definition: ni_device_api.h:784
_ni_buf_t::pool
struct _ni_buf_pool_t * pool
Definition: ni_device_api.h:1275
_ni_xcoder_params::customize_roi_qp_map
int8_t customize_roi_qp_map[NI_CUSTOMIZE_ROI_QPOFFSET_LEVEL][NI_CUSTOMIZE_ROI_QP_NUM]
Definition: ni_device_api.h:2790
ni_packet_copy
LIB_API int ni_packet_copy(void *p_destination, const void *const p_source, int cur_size, void *p_leftover, int *p_prev_size)
Copy video packet accounting for alignment.
Definition: ni_device_api.c:3936
_ni_encoder_cfg_params::multicoreJointMode
int multicoreJointMode
Definition: ni_device_api.h:2289
_ni_encoder_change_params_t::colorDescPresent
uint8_t colorDescPresent
Definition: ni_device_api.h:1019
_ni_xcoder_params::reconf_hash
int reconf_hash[NI_BITRATE_RECONFIG_FILE_MAX_LINES][NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE]
Definition: ni_device_api.h:2773
_ni_hw_capability::max_video_height
uint16_t max_video_height
Definition: ni_device_api.h:1142
NI_FRAME_AUX_DATA_FRAMERATE
@ NI_FRAME_AUX_DATA_FRAMERATE
Definition: ni_device_api.h:562
_ni_xcoder_params::enable_ai_enhance
int enable_ai_enhance
Definition: ni_device_api.h:2781
ni_encoder_gop_params_set_value
LIB_API ni_retcode_t ni_encoder_gop_params_set_value(ni_xcoder_params_t *p_params, const char *name, const char *value)
Set GOP parameter value referenced by name in encoder parameters structure.
Definition: ni_device_api.c:7197
ni_device_session_context_init
LIB_API ni_retcode_t ni_device_session_context_init(ni_session_context_t *p_ctx)
Initialize already allocated session context to a known state.
Definition: ni_device_api.c:156
_ni_load_query::tp_fw_load
uint32_t tp_fw_load
Definition: ni_device_api.h:1214
_ni_queue_t::p_first
ni_queue_node_t * p_first
Definition: ni_device_api.h:1317
_ni_session_context::p_dump
void * p_dump[2]
Definition: ni_device_api.h:1527
ni_dec_h265_vui_param_t
struct _ni_dec_h265_vui_param ni_dec_h265_vui_param_t
decoded payload format of H.265 VUI
ni_enc_prep_reconf_demo_data
LIB_API ni_retcode_t ni_enc_prep_reconf_demo_data(ni_session_context_t *p_enc_ctx, ni_frame_t *p_frame)
Convert various reconfig and demo modes (stored in encoder configuration) to aux data and store them ...
Definition: ni_device_api.c:11947
_ni_thread_arg_struct_t::device_type
uint32_t device_type
Definition: ni_device_api.h:1263
_ni_dec_h265_vui_param::video_format
int8_t video_format
Definition: ni_device_api.h:750
ni_device_session_acquire
LIB_API int ni_device_session_acquire(ni_session_context_t *p_upl_ctx, ni_frame_t *p_frame)
Acquire a P2P frame buffer from the hwupload session.
Definition: ni_device_api.c:10602
_ni_decoder_input_params_t
Definition: ni_device_api.h:2445
NI_XCODER_HWUP_STATE
@ NI_XCODER_HWUP_STATE
Definition: ni_device_api.h:254
_ni_queue_node_t::p_next
struct _ni_queue_node_t * p_next
Definition: ni_device_api.h:1299
NI_AI_BUFFER_QUANTIZE_DYNAMIC_FIXED_POINT
@ NI_AI_BUFFER_QUANTIZE_DYNAMIC_FIXED_POINT
Definition: ni_device_api.h:1814
_ni_enc_hevc_roi_custom_map::ctu_coeff_drop
uint32_t ctu_coeff_drop
Definition: ni_device_api.h:853
ni_device_open
LIB_API ni_device_handle_t ni_device_open(const char *dev, uint32_t *p_max_io_size_out)
Open device and return device device_handle if successful.
Definition: ni_device_api.c:360
_ni_encoder_cfg_params::HDR10dy0
int HDR10dy0
Definition: ni_device_api.h:2275
_ni_load_query::fw_video_mem_usage
uint32_t fw_video_mem_usage
Definition: ni_device_api.h:1203
_ni_encoder_change_params_t::hvsQPEnable
int32_t hvsQPEnable
Definition: ni_device_api.h:992
_ni_encoder_cfg_params::enable_dynamic_8x8_merge
int enable_dynamic_8x8_merge
Definition: ni_device_api.h:2350
_ni_scaler_params_t::nb_inputs
int nb_inputs
Definition: ni_device_api.h:2569
_ni_encoder_cfg_params::ctbRcMode
int ctbRcMode
Definition: ni_device_api.h:2322
_ni_scaler_drawbox_params_t
Definition: ni_device_api.h:2575
_ni_dec_h264_vui_param
decoded payload format of H.264 VUI
Definition: ni_device_api.h:800
_ni_thread_arg_struct_t::keep_alive_timeout
uint32_t keep_alive_timeout
Definition: ni_device_api.h:1268
_ni_encoder_cfg_params::long_term_ref_interval
int long_term_ref_interval
Definition: ni_device_api.h:2291
ni_ai_buffer_quantize_format_e
enum _ni_ai_buffer_quantize_format_e ni_ai_buffer_quantize_format_e
NI_FRAME_AUX_DATA_A53_CC
@ NI_FRAME_AUX_DATA_A53_CC
Definition: ni_device_api.h:502
_ni_xcoder_params::interval_of_psnr
int interval_of_psnr
Definition: ni_device_api.h:2789
_ni_frame::end_of_stream
uint32_t end_of_stream
Definition: ni_device_api.h:2608
ni_device_alloc_and_get_firmware_logs
LIB_API ni_retcode_t ni_device_alloc_and_get_firmware_logs(ni_session_context_t *p_ctx, void **p_log_buffer, bool gen_log_file)
Allocate log buffer if needed and retrieve firmware logs from device.
Definition: ni_device_api.c:11713
_ni_session_context::network_data
ni_network_data_t * network_data
Definition: ni_device_api.h:1678
_ni_dec_h265_vui_param::aspect_ratio_info_present_flag
uint8_t aspect_ratio_info_present_flag
Definition: ni_device_api.h:744
_ni_frame_config::orientation
uint8_t orientation
Definition: ni_device_api.h:2822
_ni_buf_t
Definition: ni_device_api.h:1272
_ni_hw_capability::video_profile
uint8_t video_profile
Definition: ni_device_api.h:1145
ni_session_data_io_t
struct _ni_session_data_io ni_session_data_io_t
NI_CODEC_HW_DOWNLOAD
@ NI_CODEC_HW_DOWNLOAD
Definition: ni_device_api.h:941
PIC_TYPE_IDR
@ PIC_TYPE_IDR
Definition: ni_device_api.h:389
_ni_scaler_watermark_params_t::ui32StartX
uint32_t ui32StartX
Definition: ni_device_api.h:2585
ni_queue_t
struct _ni_queue_t ni_queue_t
ni_device_session_acquire_for_read
LIB_API int ni_device_session_acquire_for_read(ni_session_context_t *p_upl_ctx, ni_frame_t *p_frame)
Acquire a P2P frame buffer from the hwupload session for P2P read.
Definition: ni_device_api.c:10697
_niFrameSurface1::encoding_type
int8_t encoding_type
Definition: ni_device_api.h:2802
_ni_xcoder_params::generate_enc_hdrs
NI_DEPRECATED int generate_enc_hdrs
Definition: ni_device_api.h:2735
_ni_frameclone_desc::ui16SrcIdx
uint16_t ui16SrcIdx
Definition: ni_device_api.h:1377
_ni_xcoder_params::hwframes
int hwframes
Definition: ni_device_api.h:2774
_ni_session_context::prev_size
int prev_size
Definition: ni_device_api.h:1507
NI_PIX_FMT_NV16
@ NI_PIX_FMT_NV16
Definition: ni_device_api.h:272
ni_ai_buffer_format_e
enum _ni_ai_buffer_format_e ni_ai_buffer_format_e
_ni_encoder_cfg_params::newRcEnable
int newRcEnable
Definition: ni_device_api.h:2391
_ni_session_context::device_handle
ni_device_handle_t device_handle
Definition: ni_device_api.h:1462
_ni_session_context::enc_change_params
ni_encoder_change_params_t * enc_change_params
Definition: ni_device_api.h:1592
_ni_instance_mgr_detail_status_v1::sInstDetailStatus
ni_instance_mgr_detail_status_t sInstDetailStatus[NI_MAX_CONTEXTS_PER_HW_INSTANCE]
Definition: ni_device_api.h:1253
_ni_session_context::p_session_config
void * p_session_config
Definition: ni_device_api.h:1473
NI_CODEC_FORMAT_AV1
@ NI_CODEC_FORMAT_AV1
Definition: ni_device_api.h:915
_ni_encoder_cfg_params::skip_frame_enable
int skip_frame_enable
Definition: ni_device_api.h:2417
_ni_frame::sei_hdr_plus_len
unsigned int sei_hdr_plus_len
Definition: ni_device_api.h:2641
XCODER_TEST_RECONF_SLICE_ARG_API
@ XCODER_TEST_RECONF_SLICE_ARG_API
Definition: ni_device_api.h:1774
_ni_packet::av1_p_buffer
uint8_t * av1_p_buffer[MAX_AV1_ENCODER_GOP_NUM]
Definition: ni_device_api.h:2844
_ni_dec_h265_vui_param::transfer_characteristics
uint8_t transfer_characteristics
Definition: ni_device_api.h:759
_ni_xcoder_params::preset
int preset
Definition: ni_device_api.h:2716
_ni_dec_win::left
int16_t left
Definition: ni_device_api.h:715
_ni_session_context::dec_fme_buf_pool
ni_buf_pool_t * dec_fme_buf_pool
Definition: ni_device_api.h:1559
_ni_enc_avc_roi_custom_map::mb_qp
uint8_t mb_qp
Definition: ni_device_api.h:875
NI_DDR_PRIORITY_MAX
@ NI_DDR_PRIORITY_MAX
Definition: ni_device_api.h:1829
_ni_encoder_change_params_t::intraPeriod
int32_t intraPeriod
Definition: ni_device_api.h:1014
_ni_custom_sei_set
Definition: ni_device_api.h:1125
_ni_encoder_cfg_params::entropy_coding_mode
int entropy_coding_mode
Definition: ni_device_api.h:2307
_ni_extended_dec_metadata::video_full_range_flag
uint8_t video_full_range_flag
Definition: ni_device_api.h:728
NI_AI_BUFFER_FORMAT_FP16
@ NI_AI_BUFFER_FORMAT_FP16
Definition: ni_device_api.h:1784
_ni_packet::p_data
void * p_data
Definition: ni_device_api.h:2837
_ni_session_context::hwd_src_cpu
uint32_t hwd_src_cpu
Definition: ni_device_api.h:1536
_ni_hw_capability::min_video_width
uint16_t min_video_width
Definition: ni_device_api.h:1143
_ni_region_of_interest::top
int top
Definition: ni_device_api.h:634
_ni_session_data_io
Definition: ni_device_api.h:2866
_ni_enc_quad_roi_custom_map::ipcm_flag
uint8_t ipcm_flag
Definition: ni_device_api.h:891
ni_hwframe_buffer_recycle
LIB_API ni_retcode_t ni_hwframe_buffer_recycle(niFrameSurface1_t *surface, int32_t device_handle)
Recycle a hwframe buffer on card.
Definition: ni_device_api.c:8487
_ni_context_query::context_status
uint32_t context_status
Definition: ni_device_api.h:1187
_ni_decoder_input_params_t::svct_decoding_layer
int svct_decoding_layer
Definition: ni_device_api.h:2522
_ni_encoder_cfg_params::ltrFirstGap
int ltrFirstGap
Definition: ni_device_api.h:2287
_ni_extended_dec_metadata::rsvd5
uint64_t rsvd5
Definition: ni_device_api.h:735
_ni_content_light_level_info_bytes::max_pic_average_light_level
uint16_t max_pic_average_light_level
Definition: ni_device_api.h:1077
_ni_encoder_cfg_params::ltrRefQpOffset
int ltrRefQpOffset
Definition: ni_device_api.h:2286
_ni_enc_quad_roi_custom_map::field
struct _ni_enc_quad_roi_custom_map::@6 field
ni_device_session_copy
LIB_API ni_retcode_t ni_device_session_copy(ni_session_context_t *src_p_ctx, ni_session_context_t *dst_p_ctx)
Copy existing decoding session params for hw frame usage.
Definition: ni_device_api.c:8015
_ni_scaler_drawbox_params_t::end_x
uint32_t end_x
Definition: ni_device_api.h:2579
ni_custom_sei_t
struct _ni_custom_sei ni_custom_sei_t
custom sei payload passthrough
_ni_session_context::last_change_framenum
uint32_t last_change_framenum
Definition: ni_device_api.h:1634
_ni_dec_h265_vui_param::frame_field_info_present_flag
uint8_t frame_field_info_present_flag
Definition: ni_device_api.h:770
_ni_dec_h264_vui_param::aspect_ratio_info_present_flag
uint8_t aspect_ratio_info_present_flag
Definition: ni_device_api.h:802
_ni_rational::num
int num
Definition: ni_device_api.h:600
NI_PIX_FMT_YUV420P10LE
@ NI_PIX_FMT_YUV420P10LE
Definition: ni_device_api.h:263
ni_scaler_multi_drawbox_params_t
struct _ni_scaler_multi_drawbox_params_t ni_scaler_multi_drawbox_params_t
_ni_frame_config::rgba_color
uint32_t rgba_color
Definition: ni_device_api.h:2818
_ni_scaler_input_params_t::in_rec_x
int32_t in_rec_x
Definition: ni_device_api.h:2551
ni_device_config_qos
LIB_API ni_retcode_t ni_device_config_qos(ni_device_handle_t device_handle, uint32_t mode)
Send qos mode to the device with specified logic block address.
Definition: ni_device_api.c:2058
_ni_enc_mastering_display_colour_volume
encoded payload format of HDR SEI mastering display colour volume
Definition: ni_device_api.h:1084
_ni_dec_h265_vui_param::vui_num_ticks_poc_diff_one_minus1
int16_t vui_num_ticks_poc_diff_one_minus1
Definition: ni_device_api.h:788
_ni_extended_dec_metadata::color_space
uint8_t color_space
Definition: ni_device_api.h:727
_ni_encoder_cfg_params::enable_transform_8x8
int enable_transform_8x8
Definition: ni_device_api.h:2356
_ni_session_context::sender_handle
ni_device_handle_t sender_handle
Definition: ni_device_api.h:1468
_ni_frame::vui_time_scale
uint32_t vui_time_scale
Definition: ni_device_api.h:2690
_ni_split_context_t
Definition: ni_device_api.h:1726
ni_ai_packet_buffer_alloc
LIB_API ni_retcode_t ni_ai_packet_buffer_alloc(ni_packet_t *p_packet, ni_network_data_t *p_network)
Allocate output layers memory for the packet buffer based on provided network.
Definition: ni_device_api.c:9779
_ni_xcoder_params::pos_num_units_in_tick
NI_DEPRECATED uint32_t pos_num_units_in_tick
Definition: ni_device_api.h:2753
NI_H265_USERDATA_FLAG_RESERVED_1
@ NI_H265_USERDATA_FLAG_RESERVED_1
Definition: ni_device_api.h:360
QOS_NAMESPACE_CODE
@ QOS_NAMESPACE_CODE
Definition: ni_device_api.h:236
ni_packet_buffer_alloc
LIB_API ni_retcode_t ni_packet_buffer_alloc(ni_packet_t *ppacket, int packet_size)
Allocate memory for the packet buffer based on provided packet size.
Definition: ni_device_api.c:3713
_ni_dec_mastering_display_colour_volume_bytes::min_display_mastering_luminance
uint32_t min_display_mastering_luminance
Definition: ni_device_api.h:1067
NI_MAX_GOP_NUM
#define NI_MAX_GOP_NUM
Definition: ni_device_api.h:57
NI_FRAME_AUX_DATA_REGIONS_OF_INTEREST
@ NI_FRAME_AUX_DATA_REGIONS_OF_INTEREST
Definition: ni_device_api.h:519
NI_CUSTOMIZE_ROI_QP_NUM
#define NI_CUSTOMIZE_ROI_QP_NUM
Max number of entries per line supported for the qp number.
Definition: ni_device_api.h:481
_ni_encoder_change_params_t::frameRateNum
int32_t frameRateNum
Definition: ni_device_api.h:1050
_ni_encoder_cfg_params::enable_smooth_crf
int enable_smooth_crf
Definition: ni_device_api.h:2436
_ni_network_layer_info
Definition: ni_device_api.h:1352
ni_buf_pool_t
struct _ni_buf_pool_t ni_buf_pool_t
_ni_dec_h264_vui_param::transfer_characteristics
uint8_t transfer_characteristics
Definition: ni_device_api.h:816
NI_AI_BUFFER_FORMAT_UINT8
@ NI_AI_BUFFER_FORMAT_UINT8
Definition: ni_device_api.h:1786
ni_device_session_close
LIB_API ni_retcode_t ni_device_session_close(ni_session_context_t *p_ctx, int eos_received, ni_device_type_t device_type)
Close device session that was previously opened by calling ni_device_session_open() If device_type is...
Definition: ni_device_api.c:1379
_ni_session_context::keep_alive_timeout
uint32_t keep_alive_timeout
Definition: ni_device_api.h:1521
NI_SET_CHANGE_PARAM_INDEPEND_SLICE
@ NI_SET_CHANGE_PARAM_INDEPEND_SLICE
Definition: ni_device_api.h:960
_ni_dec_h264_vui_param::max_dec_frame_buffering
int8_t max_dec_frame_buffering
Definition: ni_device_api.h:842
_ni_encoder_cfg_params::customize_roi_qp_level
int customize_roi_qp_level
Definition: ni_device_api.h:2431
_ni_packet::scene_change_detected
uint8_t scene_change_detected
Definition: ni_device_api.h:2863
_ni_encoder_cfg_params
Definition: ni_device_api.h:2060
NI_AI_BUFFER_FORMAT_INT32
@ NI_AI_BUFFER_FORMAT_INT32
Definition: ni_device_api.h:1798
ni_framerate_t
struct _ni_framerate ni_framerate_t
_ni_buf_pool_t::p_free_head
ni_buf_t * p_free_head
Definition: ni_device_api.h:1287
_ni_enc_mastering_display_colour_volume::min_display_mastering_luminance
uint32_t min_display_mastering_luminance
Definition: ni_device_api.h:1090
_ni_encoder_cfg_params::EnableAUD
int EnableAUD
Definition: ni_device_api.h:2301
_ni_session_context::pkt_offsets_index
uint64_t pkt_offsets_index[NI_FIFO_SZ]
Definition: ni_device_api.h:1451
_ni_encoder_cfg_params::spatial_layers
int spatial_layers
Definition: ni_device_api.h:2438
_ni_encoder_cfg_params::ai_enhance_level
int ai_enhance_level
Definition: ni_device_api.h:2394
ni_device_capability_t
struct _ni_device_capability ni_device_capability_t
device capability type
_ni_encoder_cfg_params::scene_change_detect_level
int scene_change_detect_level
Definition: ni_device_api.h:2434
_ni_session_context::device_type
uint32_t device_type
Definition: ni_device_api.h:1484
ni_device_session_query_detail_v1
LIB_API ni_retcode_t ni_device_session_query_detail_v1(ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_detail_status_v1_t *detail_data)
Query detail session data from the device - If device_type is valid, will query session data from spe...
Definition: ni_device_api.c:2000
niFrameSurface1_t
struct _niFrameSurface1 niFrameSurface1_t
_ni_dec_h265_vui_param::max_bytes_per_pic_denom
int8_t max_bytes_per_pic_denom
Definition: ni_device_api.h:785
_ni_session_context::ui8_light_level_data
uint8_t ui8_light_level_data[5]
Definition: ni_device_api.h:1428
_ni_frame::force_key_frame
int force_key_frame
Definition: ni_device_api.h:2624
NI_DDR_PRIORITY_AI
@ NI_DDR_PRIORITY_AI
Definition: ni_device_api.h:1828
_ni_scaler_params_t::scaler_param_b
double scaler_param_b
Definition: ni_device_api.h:2570
NI_PIXEL_PLANAR_FORMAT_SEMIPLANAR
@ NI_PIXEL_PLANAR_FORMAT_SEMIPLANAR
Definition: ni_device_api.h:920
ni_xcoder_state_t
ni_xcoder_state_t
Definition: ni_device_api.h:242
_ni_dec_h264_vui_param::fixed_frame_rate_flag
uint8_t fixed_frame_rate_flag
Definition: ni_device_api.h:824
_ni_encoder_cfg_params::HDR10CLLEnable
int HDR10CLLEnable
Definition: ni_device_api.h:2272
ni_qos_codes_t
enum ni_qos_codes ni_qos_codes_t
_ni_scaler_params_t::enable_scaler_params
bool enable_scaler_params
Definition: ni_device_api.h:2572
_ni_session_context::E2EID
char E2EID[128]
Definition: ni_device_api.h:1703
_ni_frameclone_desc::ui32Offset
uint32_t ui32Offset
Definition: ni_device_api.h:1379
ni_network_layer_offset_t
struct _ni_network_layer_offset ni_network_layer_offset_t
_ni_aux_data::data
void * data
Definition: ni_device_api.h:621
_ni_content_light_level_info_bytes::max_content_light_level
uint16_t max_content_light_level
Definition: ni_device_api.h:1076
_ni_packet::video_height
uint32_t video_height
Definition: ni_device_api.h:2834
_ni_frame::dec_buf
ni_buf_t * dec_buf
Definition: ni_device_api.h:2670
_ni_session_context::buffer_pool
ni_queue_buffer_pool_t * buffer_pool
Definition: ni_device_api.h:1558
_ni_xcoder_params::chroma_linesize
int chroma_linesize
Definition: ni_device_api.h:2785
_ni_network_perf_metrics::read_bw
uint64_t read_bw
Definition: ni_device_api.h:1388
_ni_xcoder_params::minFramesDelay
int minFramesDelay
Definition: ni_device_api.h:2788
_ni_xcoder_params::sar_num
int sar_num
Definition: ni_device_api.h:2759
XCODER_TEST_RECONF_RC_MIN_MAX_QP
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP
Definition: ni_device_api.h:1747
_ni_hw_capability::reserved
uint8_t reserved
Definition: ni_device_api.h:1147
_ni_packet
Definition: ni_device_api.h:2825
_ni_buf_pool_t
Definition: ni_device_api.h:1282
_ni_device_temp
Definition: ni_rsrc_api.h:235
_ni_session_context::frame_num
uint64_t frame_num
Definition: ni_device_api.h:1531
_ni_frame::sei_cc_len
unsigned int sei_cc_len
Definition: ni_device_api.h:2633
_ni_encoder_cfg_params::HDR10Enable
int HDR10Enable
Definition: ni_device_api.h:2273
_ni_enc_hevc_roi_custom_map::sub_ctu_qp_1
uint32_t sub_ctu_qp_1
Definition: ni_device_api.h:856
_ni_encoder_cfg_params::keep_alive_timeout
int keep_alive_timeout
Definition: ni_device_api.h:2386
ni_uploader_set_frame_format
LIB_API ni_retcode_t ni_uploader_set_frame_format(ni_session_context_t *p_upl_ctx, int width, int height, ni_pix_fmt_t pixel_format, int isP2P)
Set the frame format for the uploader.
Definition: ni_device_api.c:11171
_ni_queue_t::p_last
ni_queue_node_t * p_last
Definition: ni_device_api.h:1318
g_xcoder_log_names
const LIB_API char *const g_xcoder_log_names[NI_XCODER_LOG_NAMES_ARRAY_LEN]
Definition: ni_device_api.c:71
_ni_queue_t::count
uint32_t count
Definition: ni_device_api.h:1316
_ni_encoder_cfg_params::intra_qp_delta
int intra_qp_delta
Definition: ni_device_api.h:2369
_ni_session_context::ori_luma_linesize
int ori_luma_linesize
Definition: ni_device_api.h:1680
PIC_TYPE_CRA
@ PIC_TYPE_CRA
Definition: ni_device_api.h:388
_ni_xcoder_params::ai_enhance_level
int ai_enhance_level
Definition: ni_device_api.h:2786
_ni_network_layer_params_t::sizes
uint32_t sizes[6]
Definition: ni_device_api.h:1329
_ni_session_context::roi_map
ni_enc_quad_roi_custom_map * roi_map
Definition: ni_device_api.h:1582
_ni_buf_t::p_prev
struct _ni_buf_t * p_prev
Definition: ni_device_api.h:1276
_ni_category_classify::category
int category
Definition: ni_device_api.h:649
_ni_network_layer_offset::offset
int32_t offset
Definition: ni_device_api.h:1360
NI_H265_USERDATA_FLAG_PIC_TIMING
@ NI_H265_USERDATA_FLAG_PIC_TIMING
Definition: ni_device_api.h:363
NI_MAX_CUSTOM_SEI_DATA
#define NI_MAX_CUSTOM_SEI_DATA
Definition: ni_device_api.h:428
_ni_custom_sei::type
uint8_t type
Definition: ni_device_api.h:1119
_ni_instance_mgr_detail_status::ui32NumIDR
uint32_t ui32NumIDR
Definition: ni_device_api.h:1237
_ni_encoder_cfg_params::colorDescPresent
int colorDescPresent
Definition: ni_device_api.h:2311
_ni_encoder_change_params_t::hvsQpScale
int32_t hvsQpScale
Definition: ni_device_api.h:993
_ni_overall_load_query::overall_fw_model_load
uint32_t overall_fw_model_load
Definition: ni_device_api.h:1225
_ni_session_context::last_gop_size
int last_gop_size
Definition: ni_device_api.h:1691
_ni_dec_h264_vui_param::vcl_hrd_parameters_present_flag
uint8_t vcl_hrd_parameters_present_flag
Definition: ni_device_api.h:830
_ni_frame::vui_offset
unsigned int vui_offset
Definition: ni_device_api.h:2649
_ni_session_context::force_idr_intra_offset
uint32_t force_idr_intra_offset
Definition: ni_device_api.h:1648
_ni_encoder_cfg_params::tolCtbRcInter
float tolCtbRcInter
Definition: ni_device_api.h:2329
_ni_frame::p_data
uint8_t * p_data[NI_MAX_NUM_DATA_POINTERS]
Definition: ni_device_api.h:2663
_ni_encoder_cfg_params::custom_gop_params
ni_custom_gop_params_t custom_gop_params
Definition: ni_device_api.h:2255
ni_close_event
LIB_API void ni_close_event(ni_event_handle_t event_handle)
Close event and release resources (Windows only)
Definition: ni_device_api.c:294
_ni_encoder_cfg_params::HDR10dx0
int HDR10dx0
Definition: ni_device_api.h:2274
_ni_xcoder_params::zerocopy_mode
int zerocopy_mode
Definition: ni_device_api.h:2783
_ni_xcoder_params::sar_denom
int sar_denom
Definition: ni_device_api.h:2760
_ni_buf_t::p_next
struct _ni_buf_t * p_next
Definition: ni_device_api.h:1277
_ni_session_context::fps_change_detect_count
uint32_t fps_change_detect_count
Definition: ni_device_api.h:1635
_ni_decoder_input_params_t::max_extra_hwframe_cnt
int max_extra_hwframe_cnt
Definition: ni_device_api.h:2527
_ni_device_capability::fw_build_time
uint8_t fw_build_time[26]
Definition: ni_device_api.h:1168
_ni_session_context::pkt_index
int pkt_index
Definition: ni_device_api.h:1450
_ni_encoder_cfg_params::disableBframeRdoq
int disableBframeRdoq
Definition: ni_device_api.h:2426
NI_CODEC_FORMAT_VP9
@ NI_CODEC_FORMAT_VP9
Definition: ni_device_api.h:913
_ni_frame::force_headers
uint16_t force_headers
Definition: ni_device_api.h:2619
_ni_dec_h265_vui_param
decoded payload format of H.265 VUI
Definition: ni_device_api.h:742
XCODER_TEST_RECONF_VBV_API
@ XCODER_TEST_RECONF_VBV_API
Definition: ni_device_api.h:1772
XCODER_TEST_FORCE_IDR_FRAME
@ XCODER_TEST_FORCE_IDR_FRAME
Definition: ni_device_api.h:1759
_ni_enc_hevc_roi_custom_map::reserved
uint32_t reserved
Definition: ni_device_api.h:854
_ni_scaler_input_params_t::in_rec_y
int32_t in_rec_y
Definition: ni_device_api.h:2552
ni_device_clone_hwframe
LIB_API ni_retcode_t ni_device_clone_hwframe(ni_session_context_t *p_ctx, ni_frameclone_desc_t *p_frameclone_desc)
Copy the data of src hwframe to dst hwframe.
Definition: ni_device_api.c:8997
_ni_encoder_cfg_params::tolCtbRcIntra
float tolCtbRcIntra
Definition: ni_device_api.h:2330
_ni_instance_mgr_detail_status_append::ui32UserIDR
uint32_t ui32UserIDR
Definition: ni_device_api.h:1245
QOS_MODE_ENABLED_SHARE
@ QOS_MODE_ENABLED_SHARE
Definition: ni_device_api.h:228
NI_XCODER_WRITE_STATE
@ NI_XCODER_WRITE_STATE
Definition: ni_device_api.h:246
NI_DDR_PRIORITY_RESET
@ NI_DDR_PRIORITY_RESET
Definition: ni_device_api.h:1825
_ni_dec_h264_vui_param::overscan_info_present_flag
uint8_t overscan_info_present_flag
Definition: ni_device_api.h:804
ni_device_session_context_alloc_init
LIB_API ni_session_context_t * ni_device_session_context_alloc_init(void)
Allocate and initialize a new ni_session_context_t struct.
Definition: ni_device_api.c:98
NI_XCODER_LOG_NAMES_ARRAY_LEN
#define NI_XCODER_LOG_NAMES_ARRAY_LEN
Definition: ni_device_api.h:2877
_ni_frame::roi_len
unsigned int roi_len
Definition: ni_device_api.h:2653
_ni_encoder_change_params_t::reserved
uint8_t reserved[5]
Definition: ni_device_api.h:1028
NI_ENC_MEM_ALLOCATE_STRATEGY_DEFAULT
@ NI_ENC_MEM_ALLOCATE_STRATEGY_DEFAULT
Definition: ni_device_api.h:283
_ni_session_context::last_pts_interval
int64_t last_pts_interval
Definition: ni_device_api.h:1640
_ni_encoder_cfg_params::enable_all_sei_passthru
bool enable_all_sei_passthru
Definition: ni_device_api.h:2421
_ni_decoder_input_params_t::enable_all_sei_passthru
bool enable_all_sei_passthru
Definition: ni_device_api.h:2530
_ni_frame_config::picture_height
uint16_t picture_height
Definition: ni_device_api.h:2811
_ni_encoder_cfg_params::disable_adaptive_buffers
bool disable_adaptive_buffers
Definition: ni_device_api.h:2425
_ni_queue_buffer_pool_t
Definition: ni_device_api.h:1304
_ni_session_context::vui
ni_vui_hrd_t vui
Definition: ni_device_api.h:1605
_ni_frame::sei_hdr_plus_offset
unsigned int sei_hdr_plus_offset
Definition: ni_device_api.h:2640
_ni_encoder_cfg_params::enable_dynamic_16x16_merge
int enable_dynamic_16x16_merge
Definition: ni_device_api.h:2351
ni_p2p_send
LIB_API ni_retcode_t ni_p2p_send(ni_session_context_t *pSession, niFrameSurface1_t *source, uint64_t ui64DestAddr, uint32_t ui32FrameSize)
Initiate P2P transfer to another device (P2P write)
Definition: ni_device_api.c:12822
_ni_dec_h264_vui_param::chroma_loc_info_present_flag
uint8_t chroma_loc_info_present_flag
Definition: ni_device_api.h:818
_ni_dec_h265_vui_param::sar_height
uint16_t sar_height
Definition: ni_device_api.h:756
_ni_session_context::hw_action
int hw_action
Definition: ni_device_api.h:1609
_ni_input_frame::video_height
uint32_t video_height
Definition: ni_device_api.h:1401
ni_frame_free_aux_data
LIB_API void ni_frame_free_aux_data(ni_frame_t *frame, ni_aux_data_type_t type)
If auxiliary data of the given type exists in the frame, free it and remove it from the frame.
Definition: ni_device_api.c:4089
ni_scaler_input_params_t
struct _ni_scaler_input_params_t ni_scaler_input_params_t
_ni_session_context
Definition: ni_device_api.h:1408
_ni_session_context::itu_t_t35_cc_sei_hdr_hevc
uint8_t itu_t_t35_cc_sei_hdr_hevc[NI_CC_SEI_HDR_HEVC_LEN]
Definition: ni_device_api.h:1417
NI_AI_BUFFER_FORMAT_CHAR
@ NI_AI_BUFFER_FORMAT_CHAR
Definition: ni_device_api.h:1794
_ni_rc_min_max_qp::minQpPB
int32_t minQpPB
Definition: ni_device_api.h:709
_ni_scaler_input_params_t::out_rec_x
int32_t out_rec_x
Definition: ni_device_api.h:2559
_ni_encoder_cfg_params::iframe_size_ratio
int iframe_size_ratio
Definition: ni_device_api.h:2422
_ni_scaler_input_params_t::input_width
int32_t input_width
Definition: ni_device_api.h:2547
NI_H265_USERDATA_FLAG_RESERVED_0
@ NI_H265_USERDATA_FLAG_RESERVED_0
Definition: ni_device_api.h:359
ni_device_session_open
LIB_API ni_retcode_t ni_device_session_open(ni_session_context_t *p_ctx, ni_device_type_t device_type)
Open a new device session depending on the device_type parameter If device_type is NI_DEVICE_TYPE_DEC...
Definition: ni_device_api.c:710
ni_device_config_frame
LIB_API ni_retcode_t ni_device_config_frame(ni_session_context_t *p_ctx, ni_frame_config_t *p_cfg)
Config a frame on the device for 2D engined to work on based on provided parameters.
Definition: ni_device_api.c:9049
NI_PIX_FMT_P010LE
@ NI_PIX_FMT_P010LE
Definition: ni_device_api.h:265
_ni_session_context::bus
unsigned short bus
Definition: ni_device_api.h:1620
ni_decoder_init_default_params
LIB_API ni_retcode_t ni_decoder_init_default_params(ni_xcoder_params_t *p_param, int fps_num, int fps_denom, long bit_rate, int width, int height)
Initialize default decoder parameters.
Definition: ni_device_api.c:4546
_ni_region_of_interest::qoffset
ni_rational_t qoffset
Definition: ni_device_api.h:642
_ni_thread_arg_struct_t::hw_id
int hw_id
Definition: ni_device_api.h:1259
NI_H265_USERDATA_FLAG_KNEE_FUNCTION_INFO
@ NI_H265_USERDATA_FLAG_KNEE_FUNCTION_INFO
Definition: ni_device_api.h:371
NI_CODEC_HW_UPLOAD
@ NI_CODEC_HW_UPLOAD
Definition: ni_device_api.h:942
ni_query_fl_fw_versions
LIB_API ni_retcode_t ni_query_fl_fw_versions(ni_device_handle_t device_handle, ni_device_info_t *p_dev_info)
Query firmware loader and firmware versions from the device.
Definition: ni_device_api.c:11385
ni_long_term_ref_t
struct _ni_long_term_ref ni_long_term_ref_t
_niFrameSurface1
Definition: ni_device_api.h:2793
_ni_dec_h265_vui_param::matrix_coefficients
uint8_t matrix_coefficients
Definition: ni_device_api.h:760
NI_CODEC_HW_ENABLE
@ NI_CODEC_HW_ENABLE
Definition: ni_device_api.h:940
ni_sei_header_t
struct _ni_sei_header ni_sei_header_t
NI_MAX_NUM_DATA_POINTERS
#define NI_MAX_NUM_DATA_POINTERS
Definition: ni_defs.h:232
NI_MAX_DEVICE_NAME_LEN
#define NI_MAX_DEVICE_NAME_LEN
Definition: ni_defs.h:224
NI_XCODER_GENERAL_STATE
@ NI_XCODER_GENERAL_STATE
Definition: ni_device_api.h:257
_ni_pixel_planar_format
_ni_pixel_planar_format
Definition: ni_device_api.h:918
_ni_session_context::last_dts_interval
int64_t last_dts_interval
Definition: ni_device_api.h:1639
_ni_session_data_io::data
union _ni_session_data_io::@19 data
_ni_session_context::blk_xcoder_name
char blk_xcoder_name[MAX_CHAR_IN_DEVICE_NAME]
Definition: ni_device_api.h:1490
_ni_frame
Definition: ni_device_api.h:2601
_ni_session_context::prev_read_frame_time
NI_DEPRECATED uint64_t prev_read_frame_time
Definition: ni_device_api.h:1414
_ni_network_data::input_num
uint32_t input_num
Definition: ni_device_api.h:1365
_ni_packet::sent_size
int sent_size
Definition: ni_device_api.h:2839
_ni_dec_h265_vui_param::overscan_info_present_flag
uint8_t overscan_info_present_flag
Definition: ni_device_api.h:746
_ni_encoder_cfg_params::HDR10dy1
int HDR10dy1
Definition: ni_device_api.h:2277
NI_PIX_FMT_YUYV422
@ NI_PIX_FMT_YUYV422
Definition: ni_device_api.h:273
NI_PIX_FMT_RGBA
@ NI_PIX_FMT_RGBA
Definition: ni_device_api.h:266
_ni_encoder_change_params_t::maxQpPB
int32_t maxQpPB
Definition: ni_device_api.h:1004
ni_decoder_frame_buffer_alloc
LIB_API ni_retcode_t ni_decoder_frame_buffer_alloc(ni_buf_pool_t *p_pool, ni_frame_t *pframe, int alloc_mem, int video_width, int video_height, int alignment, int factor, int is_planar)
Allocate memory for decoder frame buffer based on provided parameters; the memory is retrieved from a...
Definition: ni_device_api.c:2586
_ni_encoder_cfg_params::conf_win_bottom
int conf_win_bottom
Definition: ni_device_api.h:2298
_ni_frame::color_space
uint8_t color_space
Definition: ni_device_api.h:2684
_ni_decoder_input_params_t::scale_round
int scale_round[NI_MAX_NUM_OF_DECODER_OUTPUTS]
Definition: ni_device_api.h:2535
NI_DEPRECATED
#define NI_DEPRECATED
Definition: ni_defs.h:77
_ni_overall_load_query::overall_instance_count
uint32_t overall_instance_count
Definition: ni_device_api.h:1226
_ni_session_context::roi_len
uint32_t roi_len
Definition: ni_device_api.h:1496
ni_reconfig_crf2
LIB_API ni_retcode_t ni_reconfig_crf2(ni_session_context_t *p_ctx, float crf)
Reconfigure crf float point value dynamically during encoding.
Definition: ni_device_api.c:10358
NI_DDR_PRIORITY_NONE
@ NI_DDR_PRIORITY_NONE
Definition: ni_device_api.h:1824
NI_AI_BUFFER_QUANTIZE_MAX
@ NI_AI_BUFFER_QUANTIZE_MAX
Definition: ni_device_api.h:1819
_ni_encoder_cfg_params::profile
int profile
Definition: ni_device_api.h:2248
_ni_context_query::video_width
uint32_t video_width
Definition: ni_device_api.h:1190
XCODER_TEST_RECONF_VUI_HRD_API
@ XCODER_TEST_RECONF_VUI_HRD_API
Definition: ni_device_api.h:1762
_ni_encoder_cfg_params::colorSpace
int colorSpace
Definition: ni_device_api.h:2314
_ni_session_context::max_frame_delay
int max_frame_delay
Definition: ni_device_api.h:1694
NI_SET_CHANGE_PARAM_MAX_FRAME_SIZE
@ NI_SET_CHANGE_PARAM_MAX_FRAME_SIZE
Definition: ni_device_api.h:972
_ni_gop_params::rps
ni_gop_rps_t rps[NI_MAX_REF_PIC]
Definition: ni_device_api.h:1967
ni_query_vf_ns_id
LIB_API ni_retcode_t ni_query_vf_ns_id(ni_device_handle_t device_handle, ni_device_vf_ns_id_t *p_dev_ns_vf, uint8_t fw_rev[])
Query VF and NS id from device.
Definition: ni_device_api.c:11509
NI_DDR_PRIORITY_DECENC
@ NI_DDR_PRIORITY_DECENC
Definition: ni_device_api.h:1826
_ni_xcoder_params::force_pic_qp_demo_mode
int force_pic_qp_demo_mode
Definition: ni_device_api.h:2732
NI_DEC_CROP_MODE_MANUAL
@ NI_DEC_CROP_MODE_MANUAL
Definition: ni_device_api.h:930
XCODER_TEST_RECONF_LONG_TERM_REF
@ XCODER_TEST_RECONF_LONG_TERM_REF
Definition: ni_device_api.h:1745
ni_encoder_params_set_value
LIB_API ni_retcode_t ni_encoder_params_set_value(ni_xcoder_params_t *p_params, const char *name, const char *value)
Set value referenced by name in encoder parameters structure.
Definition: ni_device_api.c:5635
PIC_TYPE_MAX
@ PIC_TYPE_MAX
Definition: ni_device_api.h:392
NI_MAX_SUPPORT_DRAWBOX_NUM
#define NI_MAX_SUPPORT_DRAWBOX_NUM
Definition: ni_device_api.h:71
_ni_packet::average_psnr
double average_psnr
Definition: ni_device_api.h:2858
_ni_dec_h264_vui_param::sar_height
uint16_t sar_height
Definition: ni_device_api.h:813
_ni_encoder_cfg_params::bitrateWindow
int bitrateWindow
Definition: ni_device_api.h:2331
_ni_session_context::pkt_offsets_index_min
uint64_t pkt_offsets_index_min[NI_FIFO_SZ]
Definition: ni_device_api.h:1452
NI_PIX_FMT_ABGR
@ NI_PIX_FMT_ABGR
Definition: ni_device_api.h:269
_ni_frame::color_primaries
uint8_t color_primaries
Definition: ni_device_api.h:2682
ni_timestamp_table_t
struct _ni_timestamp_table_t ni_timestamp_table_t
ni_encoder_frame_zerocopy_check
LIB_API ni_retcode_t ni_encoder_frame_zerocopy_check(ni_session_context_t *p_enc_ctx, ni_xcoder_params_t *p_enc_params, int width, int height, const int linesize[], bool set_linesize)
Check if incoming frame is encoder zero copy compatible or not.
Definition: ni_device_api.c:2733
_ni_instance_mgr_detail_status_append::ui32Width
uint32_t ui32Width
Definition: ni_device_api.h:1243
_ni_enc_hevc_roi_custom_map::field
struct _ni_enc_hevc_roi_custom_map::@4 field
ni_pixel_planar_format
enum _ni_pixel_planar_format ni_pixel_planar_format
_ni_load_query::total_pixel_load
uint32_t total_pixel_load
Definition: ni_device_api.h:1217
ni_session_run_state_t
enum _ni_session_run_state ni_session_run_state_t
Session running state type.
ni_decoder_frame_buffer_free
LIB_API ni_retcode_t ni_decoder_frame_buffer_free(ni_frame_t *pframe)
Free decoder frame buffer that was previously allocated with ni_decoder_frame_buffer_alloc,...
Definition: ni_device_api.c:3644
NI_PIX_FMT_ARGB
@ NI_PIX_FMT_ARGB
Definition: ni_device_api.h:268
NI_ENC_PARAM_CONSTANT_RATE_FACTOR
#define NI_ENC_PARAM_CONSTANT_RATE_FACTOR
Definition: ni_device_api.h:2127
_ni_xcoder_params
Definition: ni_device_api.h:2713
_ni_frame::sei_hdr_content_light_level_info_len
unsigned int sei_hdr_content_light_level_info_len
Definition: ni_device_api.h:2638
_ni_session_context::p_hdr_buf
uint8_t * p_hdr_buf
Definition: ni_device_api.h:1511
_ni_dec_h264_vui_param::max_num_reorder_frames
int8_t max_num_reorder_frames
Definition: ni_device_api.h:841
_ni_enc_mastering_display_colour_volume::white_point_x
uint16_t white_point_x
Definition: ni_device_api.h:1087
SESSION_RUN_STATE_RESETTING
@ SESSION_RUN_STATE_RESETTING
Definition: ni_device_api.h:1180
NI_XCODER_READ_DESC_STATE
@ NI_XCODER_READ_DESC_STATE
Definition: ni_device_api.h:253
_ni_dec_h264_vui_param::max_bytes_per_pic_denom
int8_t max_bytes_per_pic_denom
Definition: ni_device_api.h:836
_ni_decoder_input_params_t::reduce_dpb_delay
int reduce_dpb_delay
Definition: ni_device_api.h:2540
_ni_encoder_cfg_params::max_delta_qp
int max_delta_qp
Definition: ni_device_api.h:2382
_ni_xcoder_params::staticMmapThreshold
int staticMmapThreshold
Definition: ni_device_api.h:2780
_ni_encoder_cfg_params::ctbRowQpStep
int ctbRowQpStep
Definition: ni_device_api.h:2390
_ni_dec_h265_vui_param::colour_primaries
uint8_t colour_primaries
Definition: ni_device_api.h:758
ni_scaler_opcode_t
enum _ni_scaler_opcode ni_scaler_opcode_t
_ni_extended_dec_metadata::rsvd1
uint64_t rsvd1
Definition: ni_device_api.h:731
_ni_session_context::low_delay_sync_cond
ni_pthread_cond_t low_delay_sync_cond
Definition: ni_device_api.h:1666
_ni_frame::sei_hdr_mastering_display_color_vol_len
unsigned int sei_hdr_mastering_display_color_vol_len
Definition: ni_device_api.h:2636
_ni_encoder_cfg_params::motionConstrainedMode
int motionConstrainedMode
Definition: ni_device_api.h:2432
_ni_frame::video_full_range_flag
int video_full_range_flag
Definition: ni_device_api.h:2685
XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO_API
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO_API
Definition: ni_device_api.h:1773
_ni_session_context::ready_to_close
uint32_t ready_to_close
Definition: ni_device_api.h:1544
_ni_session_context::overall_load_query
ni_overall_load_query_t overall_load_query
Definition: ni_device_api.h:1503
_ni_session_context::thread_event_handle
ni_event_handle_t thread_event_handle
Definition: ni_device_api.h:1575
_ni_encoder_cfg_params::decoding_refresh_type
int decoding_refresh_type
Definition: ni_device_api.h:2360
ni_scaler_frame_pool_alloc
LIB_API ni_retcode_t ni_scaler_frame_pool_alloc(ni_session_context_t *p_ctx, ni_scaler_input_params_t scaler_params)
init output pool of scaler frames
Definition: ni_device_api.c:3355
NI_DEC_CROP_MODE_DISABLE
@ NI_DEC_CROP_MODE_DISABLE
Definition: ni_device_api.h:928
_ni_device_capability::xcoder_devices_cnt
uint8_t xcoder_devices_cnt
Definition: ni_device_api.h:1157
ni_input_frame
struct _ni_input_frame ni_input_frame
_ni_encoder_change_params_t::invalidFrameNum
int32_t invalidFrameNum
Definition: ni_device_api.h:1044
_ni_load_query::fw_load
uint32_t fw_load
Definition: ni_device_api.h:1200
_ni_device_capability::fw_rev
uint8_t fw_rev[8]
Definition: ni_device_api.h:1164
_ni_encoder_cfg_params::crop_width
int crop_width
Definition: ni_device_api.h:2395
_ni_thread_arg_struct_t
Definition: ni_device_api.h:1257
_ni_device_vf_ns_id
Definition: ni_rsrc_api.h:229
_ni_encoder_cfg_params::slice_mode
int slice_mode
Definition: ni_device_api.h:2357
_ni_encoder_cfg_params::HDR10minluma
int HDR10minluma
Definition: ni_device_api.h:2283
NI_MAX_PPU_PARAM_EXPR_CHAR
#define NI_MAX_PPU_PARAM_EXPR_CHAR
Definition: ni_defs.h:247
XCODER_TEST_RECONF_LTR_API
@ XCODER_TEST_RECONF_LTR_API
Definition: ni_device_api.h:1763
_ni_extended_dec_metadata::num_units_in_tick
uint32_t num_units_in_tick
Definition: ni_device_api.h:723
_ni_session_context::codec_format
uint32_t codec_format
Definition: ni_device_api.h:1486
_ni_session_context::max_frame_size
int32_t max_frame_size
Definition: ni_device_api.h:1655
_ni_device_capability
device capability type
Definition: ni_device_api.h:1153
_ni_enc_hevc_roi_custom_map::ctu_force_mode
uint32_t ctu_force_mode
Definition: ni_device_api.h:852
NI_MAX_NUM_OF_DECODER_OUTPUTS
#define NI_MAX_NUM_OF_DECODER_OUTPUTS
Definition: ni_defs.h:243
_ni_rc_min_max_qp::maxQpPB
int32_t maxQpPB
Definition: ni_device_api.h:710
XCODER_TEST_RECONF_MAX_FRAME_SIZE_API
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE_API
Definition: ni_device_api.h:1768
_ni_instance_mgr_detail_status_append::reserved
uint32_t reserved[6]
Definition: ni_device_api.h:1249
NI_DDR_PRIORITY_FILT
@ NI_DDR_PRIORITY_FILT
Definition: ni_device_api.h:1827
_ni_session_context::scaler_operation
uint32_t scaler_operation
Definition: ni_device_api.h:1610
_ni_session_context::stream_dir_name
char stream_dir_name[256]
Definition: ni_device_api.h:1608
_ni_session_context::itu_t_t35_hdr10p_sei_hdr_hevc
uint8_t itu_t_t35_hdr10p_sei_hdr_hevc[NI_HDR10P_SEI_HDR_HEVC_LEN]
Definition: ni_device_api.h:1419
_ni_session_context::psnr_y
double psnr_y
Definition: ni_device_api.h:1710
_ni_decoder_input_params_t::scale_wh
int scale_wh[NI_MAX_NUM_OF_DECODER_OUTPUTS][2]
Definition: ni_device_api.h:2511
_ni_encoder_cfg_params::colorPrimaries
int colorPrimaries
Definition: ni_device_api.h:2312
_ni_dec_h265_vui_param::log2_max_mv_length_horizontal
int8_t log2_max_mv_length_horizontal
Definition: ni_device_api.h:789
NI_XCODER_PRESET_NAMES_ARRAY_LEN
#define NI_XCODER_PRESET_NAMES_ARRAY_LEN
Definition: ni_device_api.h:2876
ni_device_config_namespace_num
LIB_API ni_retcode_t ni_device_config_namespace_num(ni_device_handle_t device_handle, uint32_t namespace_num, uint32_t sriov_index)
Send namespace num and SRIOv index to the device with specified logic block address.
Definition: ni_device_api.c:2037
_ni_encoder_cfg_params::forceBframeQpfactor
float forceBframeQpfactor
Definition: ni_device_api.h:2427
ni_decoder_frame_buffer_pool_return_buf
LIB_API void ni_decoder_frame_buffer_pool_return_buf(ni_buf_t *buf, ni_buf_pool_t *p_buffer_pool)
Return a memory buffer to memory buffer pool, for a decoder frame.
Definition: ni_device_api.c:3694
_ni_frame::frame_chunk_idx
uint32_t frame_chunk_idx
Definition: ni_device_api.h:2661
_ni_network_layer_params_t::quant_format
int32_t quant_format
Definition: ni_device_api.h:1333
_ni_load_query
Definition: ni_device_api.h:1196
XCODER_TEST_CRF_FLOAT_API
@ XCODER_TEST_CRF_FLOAT_API
Definition: ni_device_api.h:1771
_ni_session_context::is_auto_dl
uint8_t is_auto_dl
Definition: ni_device_api.h:1470
XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO
Definition: ni_device_api.h:1757
ni_force_idr_frame_type
LIB_API ni_retcode_t ni_force_idr_frame_type(ni_session_context_t *p_ctx)
Force next frame to be IDR frame during encoding.
Definition: ni_device_api.c:9992
_ni_thread_arg_struct_t::session_id
uint32_t session_id
Definition: ni_device_api.h:1260
ni_ai_session_read_metrics
LIB_API ni_retcode_t ni_ai_session_read_metrics(ni_session_context_t *p_ctx, ni_network_perf_metrics_t *p_metrics)
Fetch perf metrics of inferences from device.
Definition: ni_device_api.c:11379
_ni_encoder_cfg_params::crfFloat
float crfFloat
Definition: ni_device_api.h:2410
_ni_encoder_cfg_params::long_term_ref_count
int long_term_ref_count
Definition: ni_device_api.h:2292
NI_CC_SEI_HDR_HEVC_LEN
#define NI_CC_SEI_HDR_HEVC_LEN
Definition: ni_device_api.h:461
NI_SET_CHANGE_PARAM_INTRA_PERIOD
@ NI_SET_CHANGE_PARAM_INTRA_PERIOD
Definition: ni_device_api.h:975
_niFrameSurface1::ui16width
uint16_t ui16width
Definition: ni_device_api.h:2797
ni_scaler_watermark_params_t
struct _ni_scaler_watermark_params_t ni_scaler_watermark_params_t
_ni_frame::sar_height
uint16_t sar_height
Definition: ni_device_api.h:2688
_ni_session_context::flags_array
int flags_array[NI_FIFO_SZ]
Definition: ni_device_api.h:1644
ni_scaler_params_t
struct _ni_scaler_params_t ni_scaler_params_t
_ni_frame::sei_alt_transfer_characteristics_offset
unsigned int sei_alt_transfer_characteristics_offset
Definition: ni_device_api.h:2646
_ni_thread_arg_struct_t::thread_event_handle
ni_event_handle_t thread_event_handle
Definition: ni_device_api.h:1265
_ni_session_context::keep_alive_thread
ni_pthread_t keep_alive_thread
Definition: ni_device_api.h:1556
_ni_session_context::load_query
ni_load_query_t load_query
Definition: ni_device_api.h:1500
_ni_session_data_io::frame
ni_frame_t frame
Definition: ni_device_api.h:2870
_ni_session_context::ori_pix_fmt
int ori_pix_fmt
Definition: ni_device_api.h:1562
ni_device_alloc_dst_frame
LIB_API ni_retcode_t ni_device_alloc_dst_frame(ni_session_context_t *p_ctx, niFrameSurface1_t *p_out_surface, ni_device_type_t device_type)
Allocate a frame on the device and return the frame index.
Definition: ni_device_api.c:8947
_ni_decoder_input_params_t::enable_out2
int enable_out2
Definition: ni_device_api.h:2501
ni_rc_min_max_qp
struct _ni_rc_min_max_qp ni_rc_min_max_qp
ni_device_session_init_framepool
LIB_API int ni_device_session_init_framepool(ni_session_context_t *p_ctx, uint32_t pool_size, uint32_t pool)
Send frame pool setup info to device.
Definition: ni_device_api.c:8564
_ni_encoder_cfg_params::level_idc
int level_idc
Definition: ni_device_api.h:2249
_ni_scaler_params_t::filterblit
int filterblit
Definition: ni_device_api.h:2568
_ni_pkt_info::ssim_y
double ssim_y
Definition: ni_device_api.h:1099
_ni_encoder_cfg_params::HDR10dy2
int HDR10dy2
Definition: ni_device_api.h:2279
_ni_instance_mgr_detail_status_append::u32InstanceId
uint32_t u32InstanceId
Definition: ni_device_api.h:1248
_ni_dec_h265_vui_param::chroma_loc_info_present_flag
uint8_t chroma_loc_info_present_flag
Definition: ni_device_api.h:762
_ni_queue_node_t
Definition: ni_device_api.h:1293
ni_set_frame_ref_invalid
LIB_API ni_retcode_t ni_set_frame_ref_invalid(ni_session_context_t *p_ctx, int32_t frame_num)
Set frame reference invalidation.
Definition: ni_device_api.c:10082
_niFrameSurface1::output_idx
int8_t output_idx
Definition: ni_device_api.h:2803
NI_H265_USER_DATA_FLAG_CONTENT_LIGHT_LEVEL_INFO
@ NI_H265_USER_DATA_FLAG_CONTENT_LIGHT_LEVEL_INFO
Definition: ni_device_api.h:374
_ni_thread_arg_struct_t::session_timestamp
uint64_t session_timestamp
Definition: ni_device_api.h:1261
NI_FRAME_AUX_DATA_LTR_INTERVAL
@ NI_FRAME_AUX_DATA_LTR_INTERVAL
Definition: ni_device_api.h:553
_ni_dec_h265_vui_param::video_full_range_flag
uint8_t video_full_range_flag
Definition: ni_device_api.h:752
_ni_session_context::pts_table
ni_timestamp_table_t * pts_table
Definition: ni_device_api.h:1515
ni_qos_modes
ni_qos_modes
Definition: ni_device_api.h:224
_ni_pkt_info::psnr_y
double psnr_y
Definition: ni_device_api.h:1095
_ni_frameclone_desc::ui32Size
uint32_t ui32Size
Definition: ni_device_api.h:1380
_ni_session_context::keep_alive_thread_args
ni_thread_arg_struct_t * keep_alive_thread_args
Definition: ni_device_api.h:1557
_ni_xcoder_params::color_space
int color_space
Definition: ni_device_api.h:2758
_ni_encoder_change_params_t::ltrInterval
int32_t ltrInterval
Definition: ni_device_api.h:1047
QOS_MODE_DISABLED
@ QOS_MODE_DISABLED
Definition: ni_device_api.h:226
_ni_frame::nb_aux_data
int nb_aux_data
Definition: ni_device_api.h:2678
_ni_split_context_t::enabled
int enabled
Definition: ni_device_api.h:1728
_ni_session_context::reconfig_crf
int reconfig_crf
Definition: ni_device_api.h:1685
NI_SET_CHANGE_PARAM_LTR_INTERVAL
@ NI_SET_CHANGE_PARAM_LTR_INTERVAL
Definition: ni_device_api.h:970
_ni_dec_h264_vui_param::matrix_coefficients
uint8_t matrix_coefficients
Definition: ni_device_api.h:817
_ni_encoder_cfg_params::maxFrameSize
int maxFrameSize
Definition: ni_device_api.h:2243
_ni_encoder_cfg_params::hvs_qp_scale
int hvs_qp_scale
Definition: ni_device_api.h:2375
_ni_encoder_cfg_params::cplxDecay
float cplxDecay
Definition: ni_device_api.h:2406
_ni_packet::av1_show_frame
int av1_show_frame
Definition: ni_device_api.h:2849
_ni_encoder_change_params_t::minQpI
int32_t minQpI
Definition: ni_device_api.h:998
_ni_frame::sei_user_data_unreg_offset
unsigned int sei_user_data_unreg_offset
Definition: ni_device_api.h:2643
_ni_decoder_input_params_t::skip_extra_headers
int skip_extra_headers
Definition: ni_device_api.h:2541
_ni_instance_mgr_detail_status
Definition: ni_device_api.h:1230
_ni_enc_hevc_roi_custom_map
encoder HEVC ROI custom map (1 CTU = 64bits)
Definition: ni_device_api.h:848
MAX_AV1_ENCODER_GOP_NUM
#define MAX_AV1_ENCODER_GOP_NUM
Definition: ni_defs.h:313
_ni_decoder_input_params_t::enable_follow_iframe
int enable_follow_iframe
Definition: ni_device_api.h:2536
_ni_encoder_cfg_params::enable_hvs_qp
int enable_hvs_qp
Definition: ni_device_api.h:2374
_ni_device_extra_info
Definition: ni_rsrc_api.h:242
ni_encoder_set_input_frame_format
LIB_API ni_retcode_t ni_encoder_set_input_frame_format(ni_session_context_t *p_enc_ctx, ni_xcoder_params_t *p_enc_params, int width, int height, int bit_depth, int src_endian, int planar)
Set the incoming frame format for the encoder.
Definition: ni_device_api.c:11083
ni_uploader_frame_buffer_unlock
LIB_API ni_retcode_t ni_uploader_frame_buffer_unlock(ni_session_context_t *p_upl_ctx, ni_frame_t *p_frame)
Unlock a hardware P2P frame after encoding.
Definition: ni_device_api.c:10821
_ni_frame::video_height
uint32_t video_height
Definition: ni_device_api.h:2611
ni_device_dec_session_save_hdrs
LIB_API ni_retcode_t ni_device_dec_session_save_hdrs(ni_session_context_t *p_ctx, uint8_t *hdr_data, uint8_t hdr_size)
Save a stream's headers in a decoder session that can be used later for continuous decoding from the ...
Definition: ni_device_api.c:1566
_ni_decoder_input_params_t::pkt_pts_unchange
int pkt_pts_unchange
Definition: ni_device_api.h:2529
_ni_network_data::inset
ni_network_layer_offset_t * inset
Definition: ni_device_api.h:1369
_ni_packet::p_buffer
void * p_buffer
Definition: ni_device_api.h:2841
ni_decoder_input_params_t
struct _ni_decoder_input_params_t ni_decoder_input_params_t
_ni_decoder_input_params_t::force_8_bit
int force_8_bit[NI_MAX_NUM_OF_DECODER_OUTPUTS]
Definition: ni_device_api.h:2504
_ni_vui_hrd::colorSpace
int32_t colorSpace
Definition: ni_device_api.h:668
_ni_encoder_cfg_params::qcomp
float qcomp
Definition: ni_device_api.h:2400
_ni_session_context::low_delay_sync_flag
int low_delay_sync_flag
Definition: ni_device_api.h:1664
NI_CUSTOMIZE_ROI_QPOFFSET_LEVEL
#define NI_CUSTOMIZE_ROI_QPOFFSET_LEVEL
Max number of lines supported for qpoffset level.
Definition: ni_device_api.h:479
_ni_packet::pos
long long pos
Definition: ni_device_api.h:2829
_ni_frame_config::output_index
uint8_t output_index
Definition: ni_device_api.h:2821
_ni_encoder_cfg_params::avcc_hvcc
int avcc_hvcc
Definition: ni_device_api.h:2440
NI_DEPRECATE_MACRO
#define NI_DEPRECATE_MACRO(X)
Definition: ni_defs.h:79
_ni_decoder_input_params_t::custom_sei_passthru
int custom_sei_passthru
Definition: ni_device_api.h:2521
_ni_input_frame::p_input_buffer
uint8_t * p_input_buffer
Definition: ni_device_api.h:1398
_ni_xcoder_params::ddr_priority_mode
ni_ddr_priority_mode_t ddr_priority_mode
Definition: ni_device_api.h:2787
_ni_encoder_cfg_params::colorTrc
int colorTrc
Definition: ni_device_api.h:2313
_ni_session_context::hvsplus_level
int hvsplus_level
encoder:calculate PSNR end
Definition: ni_device_api.h:1715
_ni_session_context::active_video_height
uint32_t active_video_height
Definition: ni_device_api.h:1551
NI_FRAME_AUX_DATA_LONG_TERM_REF
@ NI_FRAME_AUX_DATA_LONG_TERM_REF
Definition: ni_device_api.h:548
ni_gop_params_check
LIB_API bool ni_gop_params_check(ni_xcoder_params_t *p_param)
Check custom gop params set.
Definition: ni_device_api.c:12749
ni_ai_config_network_binary
LIB_API ni_retcode_t ni_ai_config_network_binary(ni_session_context_t *p_ctx, ni_network_data_t *p_network, const char *file)
configure a network context based with the network binary
Definition: ni_device_api.c:9562
_ni_session_context::pkt_delay_cnt
uint32_t pkt_delay_cnt
Definition: ni_device_api.h:1702
_ni_encoder_cfg_params::av1_error_resilient_mode
int av1_error_resilient_mode
Definition: ni_device_api.h:2388
_ni_session_context::enc_pts_r_idx
int64_t enc_pts_r_idx
Definition: ni_device_api.h:1440
_ni_encoder_cfg_params::tune_bframe_visual
int tune_bframe_visual
Definition: ni_device_api.h:2428
_ni_custom_sei
custom sei payload passthrough
Definition: ni_device_api.h:1117
_ni_session_context::count_frame_num_in_sec
uint32_t count_frame_num_in_sec
Definition: ni_device_api.h:1652
_ni_encoder_cfg_params::conf_win_left
int conf_win_left
Definition: ni_device_api.h:2299
_ni_encoder_cfg_params::pass1_qp
int pass1_qp
Definition: ni_device_api.h:2409
_ni_session_context::rc_error_count
int rc_error_count
Definition: ni_device_api.h:1533
_ni_encoder_cfg_params::conf_win_right
int conf_win_right
Definition: ni_device_api.h:2300
_ni_dec_h264_vui_param::video_full_range_flag
uint8_t video_full_range_flag
Definition: ni_device_api.h:809
NI_AI_BUFFER_FORMAT_BFP16
@ NI_AI_BUFFER_FORMAT_BFP16
Definition: ni_device_api.h:1796
ni_enc_hevc_roi_custom_map_t
union _ni_enc_hevc_roi_custom_map ni_enc_hevc_roi_custom_map_t
encoder HEVC ROI custom map (1 CTU = 64bits)
_ni_enc_hevc_roi_custom_map::sub_ctu_qp_3
uint32_t sub_ctu_qp_3
Definition: ni_device_api.h:858
_ni_session_context::blk_dev_name
char blk_dev_name[NI_MAX_DEVICE_NAME_LEN]
Definition: ni_device_api.h:1659
_ni_decoder_input_params_t::enable_low_delay_check
int enable_low_delay_check
Definition: ni_device_api.h:2519
_ni_session_context::biggest_bitstream_buffer_allocated
uint32_t biggest_bitstream_buffer_allocated
Definition: ni_device_api.h:1555
NI_POOL_TYPE_NONE
@ NI_POOL_TYPE_NONE
Definition: ni_device_api.h:491
_ni_session_context::session_run_state
ni_session_run_state_t session_run_state
Definition: ni_device_api.h:1547
_ni_buf_pool_t::p_used_head
ni_buf_t * p_used_head
Definition: ni_device_api.h:1289
ni_query_temperature
LIB_API ni_retcode_t ni_query_temperature(ni_device_handle_t device_handle, ni_device_temp_t *p_dev_temp, uint8_t fw_rev[])
Query CompositeTemp from device.
Definition: ni_device_api.c:11562
_ni_instance_mgr_detail_status::ui8MaxCost
uint8_t ui8MaxCost
Definition: ni_device_api.h:1233
_ni_long_term_ref::use_cur_src_as_long_term_pic
uint8_t use_cur_src_as_long_term_pic
Definition: ni_device_api.h:687
_ni_session_context::enable_low_delay_check
int enable_low_delay_check
Definition: ni_device_api.h:1595
_ni_session_context::sent_size
uint32_t sent_size
Definition: ni_device_api.h:1508
ni_hwframe_buffer_recycle2
LIB_API ni_retcode_t ni_hwframe_buffer_recycle2(niFrameSurface1_t *surface)
Recycle a hwframe buffer on card.
Definition: ni_device_api.c:8517
_niFrameSurface1::device_handle
int32_t device_handle
Definition: ni_device_api.h:2800
_ni_encoder_cfg_params::crfMax
int crfMax
Definition: ni_device_api.h:2399
NI_CC_SEI_TRAILER_LEN
#define NI_CC_SEI_TRAILER_LEN
Definition: ni_device_api.h:465
NI_MAX_VUI_SIZE
#define NI_MAX_VUI_SIZE
Definition: ni_device_api.h:62
_niFrameSurface1::bit_depth
int8_t bit_depth
Definition: ni_device_api.h:2801
_ni_scaler_drawbox_params_t::start_x
uint32_t start_x
Definition: ni_device_api.h:2577
ni_gop_rps_t
struct _ni_gop_rps ni_gop_rps_t
ni_h265_sei_user_data_type_t
ni_h265_sei_user_data_type_t
Definition: ni_device_api.h:357
_ni_dec_h264_vui_param::low_delay_hrd_flag
uint8_t low_delay_hrd_flag
Definition: ni_device_api.h:831
_ni_dec_h264_vui_param::log2_max_mv_length_vertical
int8_t log2_max_mv_length_vertical
Definition: ni_device_api.h:840
_ni_instance_mgr_detail_status::ui32NumInFrame
uint32_t ui32NumInFrame
Definition: ni_device_api.h:1238
_ni_encoder_cfg_params::cuTreeFactor
int cuTreeFactor
Definition: ni_device_api.h:2403
_ni_network_layer_info::out_param
ni_network_layer_params_t * out_param
Definition: ni_device_api.h:1355
XCODER_TEST_INVALID_REF_FRAME_API
@ XCODER_TEST_INVALID_REF_FRAME_API
Definition: ni_device_api.h:1766
_ni_encoder_cfg_params::enableipRatio
int enableipRatio
Definition: ni_device_api.h:2420
NI_CODEC_HW_PAYLOAD_OFFSET
@ NI_CODEC_HW_PAYLOAD_OFFSET
Definition: ni_device_api.h:944
_ni_enc_quad_roi_custom_map
encoder AVC ROI custom map (1 MB = 8bits)
Definition: ni_device_api.h:883
_ni_enc_hevc_roi_custom_map::lambda_sad_3
uint32_t lambda_sad_3
Definition: ni_device_api.h:863
_ni_decoder_input_params_t::scale_resolution_ceil
int scale_resolution_ceil[NI_MAX_NUM_OF_DECODER_OUTPUTS]
Definition: ni_device_api.h:2534
_ni_device_capability::serial_number
uint8_t serial_number[20]
Definition: ni_device_api.h:1161
ni_frame_buffer_alloc_hwenc
LIB_API ni_retcode_t ni_frame_buffer_alloc_hwenc(ni_frame_t *pframe, int video_width, int video_height, int extra_len)
Allocate memory for the hwDescriptor buffer based on provided parameters taking into account pic size...
Definition: ni_device_api.c:8399
_ni_dec_h264_vui_param::colour_primaries
uint8_t colour_primaries
Definition: ni_device_api.h:815
_ni_session_context::meta_size
uint32_t meta_size
Params used in VFR mode Done///.
Definition: ni_device_api.h:1638
NI_SET_CHANGE_PARAM_RC_FRAMERATE
@ NI_SET_CHANGE_PARAM_RC_FRAMERATE
Definition: ni_device_api.h:971
_ni_encoder_cfg_params::vbv_min_rate
int vbv_min_rate
Definition: ni_device_api.h:2424
NI_DEVICE_TYPE_XCODER_MAX
@ NI_DEVICE_TYPE_XCODER_MAX
Definition: ni_defs.h:350
_ni_enc_avc_roi_custom_map::mb_force_mode
uint8_t mb_force_mode
Definition: ni_device_api.h:874
_ni_encoder_cfg_params::HDR10MaxLight
int HDR10MaxLight
Definition: ni_device_api.h:2270
ni_extended_dec_metadata_t
struct _ni_extended_dec_metadata ni_extended_dec_metadata_t
_ni_dec_h265_vui_param::neutral_chroma_indication_flag
uint8_t neutral_chroma_indication_flag
Definition: ni_device_api.h:766
_ni_network_layer_params_t::affine
struct _ni_network_layer_params_t::@13::@15 affine
_ni_xcoder_params::cacheRoi
int cacheRoi
Definition: ni_device_api.h:2747
_ni_session_context::session_timestamp
uint64_t session_timestamp
Definition: ni_device_api.h:1482
_ni_session_context::psnr_u
double psnr_u
Definition: ni_device_api.h:1711
_ni_dec_mastering_display_colour_volume_bytes::white_point_x
uint16_t white_point_x
Definition: ni_device_api.h:1064
ni_reconfig_max_frame_size
LIB_API ni_retcode_t ni_reconfig_max_frame_size(ni_session_context_t *p_ctx, int32_t max_frame_size)
Reconfigure maxFrameSize dynamically during encoding.
Definition: ni_device_api.c:10176
_ni_encoder_cfg_params::still_image_detect_level
int still_image_detect_level
Definition: ni_device_api.h:2433
_ni_encoder_change_params_t::maxQpI
int32_t maxQpI
Definition: ni_device_api.h:999
_ni_region_of_interest::bottom
int bottom
Definition: ni_device_api.h:635
_ni_dec_h264_vui_param::vui_num_units_in_tick
uint32_t vui_num_units_in_tick
Definition: ni_device_api.h:826
_ni_encoder_cfg_params::crop_height
int crop_height
Definition: ni_device_api.h:2396
_ni_hw_capability::codec_format
uint8_t codec_format
Definition: ni_device_api.h:1139
_ni_frame_config::rectangle_width
uint16_t rectangle_width
Definition: ni_device_api.h:2814
_ni_queue_buffer_pool_t::p_used_head
ni_queue_node_t * p_used_head
Definition: ni_device_api.h:1309
_ni_session_context::max_nvme_io_size
uint32_t max_nvme_io_size
Definition: ni_device_api.h:1476
_ni_session_context::enable_user_data_sei_passthru
int enable_user_data_sei_passthru
Definition: ni_device_api.h:1614
_ni_encoder_cfg_params::aspectRatioHeight
int aspectRatioHeight
Definition: ni_device_api.h:2241
_ni_timestamp_table_t
Definition: ni_device_api.h:1321
_ni_dec_mastering_display_colour_volume_bytes::max_display_mastering_luminance
uint32_t max_display_mastering_luminance
Definition: ni_device_api.h:1066
NI_FRAME_AUX_DATA_MASTERING_DISPLAY_METADATA
@ NI_FRAME_AUX_DATA_MASTERING_DISPLAY_METADATA
Definition: ni_device_api.h:505
_ni_overall_load_query::admin_queried
uint32_t admin_queried
Definition: ni_device_api.h:1227
_ni_encoder_cfg_params::HDR10dx1
int HDR10dx1
Definition: ni_device_api.h:2276
_ni_instance_mgr_detail_status_append::u8PixelFormat
uint8_t u8PixelFormat
Definition: ni_device_api.h:1246
_ni_session_context::is_first_frame
int is_first_frame
Definition: ni_device_api.h:1436
_ni_encoder_change_params_t::vbvMaxRate
int32_t vbvMaxRate
Definition: ni_device_api.h:1033
XCODER_TEST_RECONF_BR
@ XCODER_TEST_RECONF_BR
Definition: ni_device_api.h:1742
NI_CUSTOM_SEI_LOC_BEFORE_VCL
@ NI_CUSTOM_SEI_LOC_BEFORE_VCL
Definition: ni_device_api.h:1110
_ni_dec_h265_vui_param::video_signal_type_present_flag
uint8_t video_signal_type_present_flag
Definition: ni_device_api.h:749
_ni_aux_data::type
ni_aux_data_type_t type
Definition: ni_device_api.h:620
_ni_pkt_info::ssim_u
double ssim_u
Definition: ni_device_api.h:1100
_ni_hw_capability::max_video_width
uint16_t max_video_width
Definition: ni_device_api.h:1141
ni_device_capability_query
LIB_API ni_retcode_t ni_device_capability_query(ni_device_handle_t device_handle, ni_device_capability_t *p_cap)
Query device and return device capability structure This function had been replaced by ni_device_capa...
Definition: ni_device_api.c:587
_ni_scaler_drawbox_params_t::end_y
uint32_t end_y
Definition: ni_device_api.h:2580
_ni_dec_h265_vui_param::tiles_fixed_structure_flag
uint8_t tiles_fixed_structure_flag
Definition: ni_device_api.h:781
_niFrameSurface1::dma_buf_fd
int32_t dma_buf_fd
Definition: ni_device_api.h:2805
_ni_encoder_cfg_params::planar
int planar
Definition: ni_device_api.h:2242
_ni_buf_t::buf
void * buf
Definition: ni_device_api.h:1274
_ni_rational::den
int den
Definition: ni_device_api.h:601
_ni_frame::start_of_stream
uint32_t start_of_stream
Definition: ni_device_api.h:2609
_ni_session_context::reconfigCount
int reconfigCount
Definition: ni_device_api.h:1698
_ni_encoder_change_params_t::colorTrc
uint8_t colorTrc
Definition: ni_device_api.h:1021
_ni_packet::buffer_size
uint32_t buffer_size
Definition: ni_device_api.h:2842
ni_queue_node_t
struct _ni_queue_node_t ni_queue_node_t
NI_SET_CHANGE_PARAM_RC_MIN_MAX_QP
@ NI_SET_CHANGE_PARAM_RC_MIN_MAX_QP
Definition: ni_device_api.h:957
_ni_vui_hrd::videoFullRange
int32_t videoFullRange
Definition: ni_device_api.h:679
NI_FRAME_AUX_DATA_CUSTOM_SEI
@ NI_FRAME_AUX_DATA_CUSTOM_SEI
Definition: ni_device_api.h:531
_ni_sei_header::type
uint8_t type
Definition: ni_device_api.h:346
ni_p2p_xfer
LIB_API ni_retcode_t ni_p2p_xfer(ni_session_context_t *pSession, niFrameSurface1_t *source, uint64_t ui64DestAddr, uint32_t ui32FrameSize)
Initiate P2P transfer (P2P write) (deprecated)
Definition: ni_device_api.c:12791
_ni_session_context::dts_queue
ni_timestamp_table_t * dts_queue
Definition: ni_device_api.h:1518
_ni_buf_pool_t::number_of_buffers
uint32_t number_of_buffers
Definition: ni_device_api.h:1285
_ni_vui_hrd::aspectRatioHeight
int32_t aspectRatioHeight
Definition: ni_device_api.h:675
_ni_session_context::hdr_buf_size
uint8_t hdr_buf_size
Definition: ni_device_api.h:1512
ni_scaler_set_params
LIB_API ni_retcode_t ni_scaler_set_params(ni_session_context_t *p_ctx, ni_scaler_params_t *p_params)
Set parameters on the device for the 2D engine.
Definition: ni_device_api.c:8671
ni_device_session_query_buffer_avail
LIB_API ni_retcode_t ni_device_session_query_buffer_avail(ni_session_context_t *p_ctx, ni_device_type_t device_type)
Query the session if a buffer is available.
Definition: ni_device_api.c:8296
NI_SET_CHANGE_PARAM_INVALID_REF_FRAME
@ NI_SET_CHANGE_PARAM_INVALID_REF_FRAME
Definition: ni_device_api.h:969
_ni_instance_mgr_detail_status_v1
Definition: ni_device_api.h:1252
ni_reconfig_max_frame_size_ratio
LIB_API ni_retcode_t ni_reconfig_max_frame_size_ratio(ni_session_context_t *p_ctx, int32_t max_frame_size_ratio)
Reconfigure maxFrameSizeRatio dynamically during encoding.
Definition: ni_device_api.c:10468
_ni_frame::pts
long long pts
Definition: ni_device_api.h:2607
_ni_xcoder_params::enable_vfr
int enable_vfr
Definition: ni_device_api.h:2778
LIB_API
#define LIB_API
Definition: ni_libxcoder_dynamic_loading.h:52
_ni_frame::inconsecutive_transfer
uint8_t inconsecutive_transfer
Definition: ni_device_api.h:2708
_ni_overall_load_query::overall_current_load
uint32_t overall_current_load
Definition: ni_device_api.h:1224
_ni_queue_buffer_pool_t::number_of_buffers
uint32_t number_of_buffers
Definition: ni_device_api.h:1306
NI_CUSTOM_SEI_LOC_AFTER_VCL
@ NI_CUSTOM_SEI_LOC_AFTER_VCL
Definition: ni_device_api.h:1111
_ni_frame::crop_right
uint32_t crop_right
Definition: ni_device_api.h:2616
_ni_session_context::last_framerate
ni_framerate_t last_framerate
Definition: ni_device_api.h:1675
_ni_session_context::ltr_frame_ref_invalid
int32_t ltr_frame_ref_invalid
Definition: ni_device_api.h:1603
_ni_dec_h265_vui_param::log2_max_mv_length_vertical
int8_t log2_max_mv_length_vertical
Definition: ni_device_api.h:790
_ni_encoder_cfg_params::rdoLevel
int rdoLevel
Definition: ni_device_api.h:2268
ni_packet_t
struct _ni_packet ni_packet_t
_ni_encoder_cfg_params::long_term_ref_enable
int long_term_ref_enable
Definition: ni_device_api.h:2259
_ni_frame::pixel_format
int pixel_format
Definition: ni_device_api.h:2672
_ni_dec_h264_vui_param::log2_max_mv_length_horizontal
int8_t log2_max_mv_length_horizontal
Definition: ni_device_api.h:839
_ni_encoder_change_params_t::sliceArg
int16_t sliceArg
Definition: ni_device_api.h:1031
ni_get_dma_buf_file_descriptor
LIB_API int32_t ni_get_dma_buf_file_descriptor(const ni_frame_t *p_frame)
Get the DMA buffer file descriptor from the P2P frame.
Definition: ni_device_api.c:11283
_ni_encoder_cfg_params::get_psnr_mode
int get_psnr_mode
Definition: ni_device_api.h:2430
_ni_context_query::video_height
uint32_t video_height
Definition: ni_device_api.h:1191
ni_codec_format_t
enum _ni_codec_format ni_codec_format_t
This is an enumeration for supported codec formats.
_ni_dec_h264_vui_param::bitstream_restriction_flag
uint8_t bitstream_restriction_flag
Definition: ni_device_api.h:834
ni_load_query_t
struct _ni_load_query ni_load_query_t
_ni_session_context::av1_pkt_num
uint64_t av1_pkt_num
Definition: ni_device_api.h:1695
_ni_encoder_cfg_params::ltrNextInterval
int ltrNextInterval
Definition: ni_device_api.h:2288
_ni_decoder_input_params_t::survive_stream_err
int survive_stream_err
Definition: ni_device_api.h:2539
ni_context_query_t
struct _ni_context_query ni_context_query_t
_ni_encoder_cfg_params::videoFullRange
int videoFullRange
Definition: ni_device_api.h:2290
_ni_session_context::last_pts
int64_t last_pts
Definition: ni_device_api.h:1437
ni_network_perf_metrics_t
struct _ni_network_perf_metrics ni_network_perf_metrics_t
_ni_encoder_cfg_params::intra_reset_refresh
int intra_reset_refresh
Definition: ni_device_api.h:2389
_ni_split_context_t::f
int f[3]
Definition: ni_device_api.h:1731
_ni_custom_sei_set::count
int count
Definition: ni_device_api.h:1128
ni_enc_quad_roi_custom_map
union _ni_enc_quad_roi_custom_map ni_enc_quad_roi_custom_map
encoder AVC ROI custom map (1 MB = 8bits)
_ni_scaler_input_params_t::in_rec_height
int32_t in_rec_height
Definition: ni_device_api.h:2550
_ni_dec_h265_vui_param::chroma_sample_loc_type_bottom_field
int8_t chroma_sample_loc_type_bottom_field
Definition: ni_device_api.h:764
ni_network_data_t
struct _ni_network_data ni_network_data_t
NI_PIX_FMT_10_TILED4X4
@ NI_PIX_FMT_10_TILED4X4
Definition: ni_device_api.h:276
_ni_encoder_cfg_params::slice_arg
int slice_arg
Definition: ni_device_api.h:2358
_ni_frame::p_metadata_buffer
uint8_t * p_metadata_buffer
Definition: ni_device_api.h:2695
NI_H265_USERDATA_FLAG_UNREGISTERED_SUF
@ NI_H265_USERDATA_FLAG_UNREGISTERED_SUF
Definition: ni_device_api.h:367
_ni_dec_h265_vui_param::chroma_sample_loc_type_top_field
int8_t chroma_sample_loc_type_top_field
Definition: ni_device_api.h:763
_ni_dec_h264_vui_param::video_signal_type_present_flag
uint8_t video_signal_type_present_flag
Definition: ni_device_api.h:807
ni_device_session_query_detail
LIB_API ni_retcode_t ni_device_session_query_detail(ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_detail_status_t *detail_data)
Query detail session data from the device - If device_type is valid, will query session data from spe...
Definition: ni_device_api.c:1960
_ni_rc_min_max_qp::maxQpI
int32_t maxQpI
Definition: ni_device_api.h:707
_ni_session_context::enc_pts_list
int64_t enc_pts_list[NI_FIFO_SZ]
Definition: ni_device_api.h:1439
NI_MAX_SUPPORT_WATERMARK_NUM
#define NI_MAX_SUPPORT_WATERMARK_NUM
Definition: ni_device_api.h:72
_ni_custom_sei_set::custom_sei
ni_custom_sei_t custom_sei[NI_MAX_CUSTOM_SEI_CNT]
Definition: ni_device_api.h:1127
_ni_dec_h265_vui_param::restricted_ref_pic_lists_flag
uint8_t restricted_ref_pic_lists_flag
Definition: ni_device_api.h:783
_ni_encoder_cfg_params::lookAheadDepth
int lookAheadDepth
Definition: ni_device_api.h:2267
SESSION_RUN_STATE_SEQ_CHANGE_OPENING
@ SESSION_RUN_STATE_SEQ_CHANGE_OPENING
Definition: ni_device_api.h:1179
_ni_packet::still_image_detected
uint8_t still_image_detected
Definition: ni_device_api.h:2862
_ni_frame_config::rectangle_y
int16_t rectangle_y
Definition: ni_device_api.h:2817
_ni_buf_pool_t::p_used_tail
ni_buf_t * p_used_tail
Definition: ni_device_api.h:1290
_ni_encoder_change_params_t::vbvBufferSize
int32_t vbvBufferSize
Definition: ni_device_api.h:994
NI_FRAME_AUX_DATA_CRF_FLOAT
@ NI_FRAME_AUX_DATA_CRF_FLOAT
Definition: ni_device_api.h:578
ni_device_session_update_framepool
LIB_API ni_retcode_t ni_device_session_update_framepool(ni_session_context_t *p_ctx, uint32_t pool_size)
Sends frame pool change info to device.
Definition: ni_device_api.c:8612
_ni_scaler_watermark_params_t::ui32StartY
uint32_t ui32StartY
Definition: ni_device_api.h:2586
_ni_frame::sei_alt_transfer_characteristics_len
unsigned int sei_alt_transfer_characteristics_len
Definition: ni_device_api.h:2647
_ni_session_context::hevc_roi_map
ni_enc_hevc_roi_custom_map_t * hevc_roi_map
Definition: ni_device_api.h:1589
_ni_custom_gop_params::pic_param
ni_gop_params_t pic_param[NI_MAX_GOP_NUM]
Definition: ni_device_api.h:2053
ni_packet_buffer_free
LIB_API ni_retcode_t ni_packet_buffer_free(ni_packet_t *ppacket)
Free packet buffer that was previously allocated with ni_packet_buffer_alloc.
Definition: ni_device_api.c:3843
_ni_session_context::pic_reorder_delay
int pic_reorder_delay
Definition: ni_device_api.h:1641
_ni_dec_h265_vui_param::def_disp_win
ni_dec_win_t def_disp_win
Definition: ni_device_api.h:792
_ni_session_context::dev
unsigned short dev
Definition: ni_device_api.h:1621
_ni_codec_format
_ni_codec_format
This is an enumeration for supported codec formats.
Definition: ni_device_api.h:909
NI_FRAME_AUX_DATA_CONTENT_LIGHT_LEVEL
@ NI_FRAME_AUX_DATA_CONTENT_LIGHT_LEVEL
Definition: ni_device_api.h:509
_ni_xcoder_params::low_delay_mode
int low_delay_mode
Definition: ni_device_api.h:2733
_ni_decoder_input_params_t::decoder_low_delay
int decoder_low_delay
Definition: ni_device_api.h:2517
_ni_decoder_input_params_t::nb_save_pkt
int nb_save_pkt
Definition: ni_device_api.h:2503
ni_custom_sei_location_t
enum _ni_custom_sei_location ni_custom_sei_location_t
This is an enumeration for illustrating the custom SEI locations.
_ni_packet::video_width
uint32_t video_width
Definition: ni_device_api.h:2833
ni_instance_mgr_detail_status_append_t
struct _ni_instance_mgr_detail_status_append ni_instance_mgr_detail_status_append_t
_ni_session_context::pkt_num
uint64_t pkt_num
Definition: ni_device_api.h:1532
_ni_encoder_cfg_params::enable_cu_level_rate_control
int enable_cu_level_rate_control
Definition: ni_device_api.h:2373
_ni_decoder_input_params_t::disable_adaptive_buffers
int disable_adaptive_buffers
Definition: ni_device_api.h:2537
NI_CODEC_FORMAT_H264
@ NI_CODEC_FORMAT_H264
Definition: ni_device_api.h:911
_ni_instance_mgr_detail_status_append::u8rsvd
uint8_t u8rsvd[3]
Definition: ni_device_api.h:1247
_ni_frame::use_cur_src_as_long_term_pic
uint8_t use_cur_src_as_long_term_pic
Definition: ni_device_api.h:2621
NI_AI_BUFFER_FORMAT_INT8
@ NI_AI_BUFFER_FORMAT_INT8
Definition: ni_device_api.h:1788
_ni_queue_t
Definition: ni_device_api.h:1313
NI_FRAME_AUX_DATA_INVALID_REF_FRAME
@ NI_FRAME_AUX_DATA_INVALID_REF_FRAME
Definition: ni_device_api.h:558
_ni_thread_arg_struct_t::plast_access_time
volatile uint64_t * plast_access_time
Definition: ni_device_api.h:1269
_ni_enc_hevc_roi_custom_map::lambda_sad_0
uint32_t lambda_sad_0
Definition: ni_device_api.h:860
_ni_frame::start_buffer_size
uint32_t start_buffer_size
Definition: ni_device_api.h:2703
NI_AI_BUFFER_FORMAT_UINT16
@ NI_AI_BUFFER_FORMAT_UINT16
Definition: ni_device_api.h:1790
_ni_frame::video_width
uint32_t video_width
Definition: ni_device_api.h:2610
_ni_session_context::initial_frame_delay
int initial_frame_delay
Definition: ni_device_api.h:1692
_ni_input_frame
Definition: ni_device_api.h:1396
_ni_xcoder_params::bitrate
int bitrate
Definition: ni_device_api.h:2729
_ni_encoder_cfg_params::HDR10wy
int HDR10wy
Definition: ni_device_api.h:2281
_ni_dec_h264_vui_param::vui_timing_info_present_flag
uint8_t vui_timing_info_present_flag
Definition: ni_device_api.h:823
_ni_session_context::sei_hdr_content_light_level_info_len
int sei_hdr_content_light_level_info_len
Definition: ni_device_api.h:1426
_ni_encoder_cfg_params::preferred_transfer_characteristics
int preferred_transfer_characteristics
Definition: ni_device_api.h:2265
_ni_queue_node_t::p_previous_buffer
struct _ni_queue_node_t * p_previous_buffer
Definition: ni_device_api.h:1300
_ni_session_context::pixel_format
int pixel_format
Definition: ni_device_api.h:1616
_ni_xcoder_params::use_low_delay_poc_type
int use_low_delay_poc_type
Definition: ni_device_api.h:2736
_ni_frame::flags
int flags
Definition: ni_device_api.h:2692
_ni_encoder_cfg_params::conf_win_top
int conf_win_top
Definition: ni_device_api.h:2297
_ni_xcoder_params::ui32VuiDataSizeBits
NI_DEPRECATED uint32_t ui32VuiDataSizeBits
Definition: ni_device_api.h:2749
_ni_dec_h264_vui_param::chroma_sample_loc_type_top_field
int8_t chroma_sample_loc_type_top_field
Definition: ni_device_api.h:820
ni_ai_frame_buffer_alloc
LIB_API ni_retcode_t ni_ai_frame_buffer_alloc(ni_frame_t *p_frame, ni_network_data_t *p_network)
Allocate input layers memory for AI frame buffer based on provided parameters taking into account wid...
Definition: ni_device_api.c:9698
_ni_session_context::sei_trailer
uint8_t sei_trailer[NI_CC_SEI_TRAILER_LEN]
Definition: ni_device_api.h:1422
_ni_scaler_multi_drawbox_params_t::multi_drawbox_params
ni_scaler_drawbox_params_t multi_drawbox_params[NI_MAX_SUPPORT_DRAWBOX_NUM]
Definition: ni_device_api.h:2594
MAX_CHAR_IN_DEVICE_NAME
#define MAX_CHAR_IN_DEVICE_NAME
Definition: ni_device_api.h:184
_ni_category_classify::class_type
int class_type
Definition: ni_device_api.h:648
_ni_encoder_cfg_params::bitrateMode
int bitrateMode
Definition: ni_device_api.h:2408
_ni_scaler_input_params_t::in_rec_width
int32_t in_rec_width
Definition: ni_device_api.h:2549
_ni_enc_hevc_roi_custom_map::lambda_sad_1
uint32_t lambda_sad_1
Definition: ni_device_api.h:861
_ni_aux_data
Definition: ni_device_api.h:618
_ni_extended_dec_metadata::color_trc
uint8_t color_trc
Definition: ni_device_api.h:726
_ni_session_context::pkt_custom_sei_set
ni_custom_sei_set_t * pkt_custom_sei_set[NI_FIFO_SZ]
Definition: ni_device_api.h:1456
NI_AI_BUFFER_FORMAT_UINT64
@ NI_AI_BUFFER_FORMAT_UINT64
Definition: ni_device_api.h:1804
NI_PIXEL_PLANAR_FORMAT_TILED4X4
@ NI_PIXEL_PLANAR_FORMAT_TILED4X4
Definition: ni_device_api.h:922
ni_device_session_context_free
LIB_API void ni_device_session_context_free(ni_session_context_t *p_ctx)
Free previously allocated session context.
Definition: ni_device_api.c:130
_ni_framerate
Definition: ni_device_api.h:695
_ni_vui_hrd::aspectRatioWidth
int32_t aspectRatioWidth
Definition: ni_device_api.h:672
_ni_encoder_change_params_t::aspectRatioWidth
uint16_t aspectRatioWidth
Definition: ni_device_api.h:1023
NI_FRAME_AUX_DATA_INTRAPRD
@ NI_FRAME_AUX_DATA_INTRAPRD
Definition: ni_device_api.h:539
ni_reconfig_framerate
LIB_API ni_retcode_t ni_reconfig_framerate(ni_session_context_t *p_ctx, ni_framerate_t *framerate)
Reconfigure framerate dynamically during encoding.
Definition: ni_device_api.c:10107
_ni_frame::crop_bottom
uint32_t crop_bottom
Definition: ni_device_api.h:2614
_ni_session_context::ori_bit_depth_factor
int ori_bit_depth_factor
Definition: ni_device_api.h:1562
_ni_session_context::ori_height
int ori_height
Definition: ni_device_api.h:1562
_ni_xcoder_params::dec_input_params
ni_decoder_input_params_t dec_input_params
Definition: ni_device_api.h:2766
_ni_network_perf_metrics::total_cycles
uint32_t total_cycles
Definition: ni_device_api.h:1386
QOS_OP_CONFIG_CODE
@ QOS_OP_CONFIG_CODE
Definition: ni_device_api.h:238
_ni_dec_h265_vui_param::colour_description_present_flag
uint8_t colour_description_present_flag
Definition: ni_device_api.h:753
_ni_xcoder_params::color_transfer_characteristic
int color_transfer_characteristic
Definition: ni_device_api.h:2757
_ni_load_query::context_status
ni_context_query_t context_status[NI_MAX_CONTEXTS_PER_HW_INSTANCE]
Definition: ni_device_api.h:1219
_ni_sei_header
Definition: ni_device_api.h:343
_ni_custom_gop_params
Definition: ni_device_api.h:2050
PIC_TYPE_NIDR
@ PIC_TYPE_NIDR
Definition: ni_device_api.h:391
_ni_enc_quad_roi_custom_map::qp_info
uint8_t qp_info
Definition: ni_device_api.h:889
_ni_session_context::hwd_minor_offset
uint32_t hwd_minor_offset
Definition: ni_device_api.h:1537
_ni_gop_params::temporal_id
int temporal_id
Definition: ni_device_api.h:1964
NI_PIXEL_PLANAR_FORMAT_PLANAR
@ NI_PIXEL_PLANAR_FORMAT_PLANAR
Definition: ni_device_api.h:921
_ni_extended_dec_metadata::color_primaries
uint8_t color_primaries
Definition: ni_device_api.h:725
_ni_rc_min_max_qp::maxDeltaQp
int32_t maxDeltaQp
Definition: ni_device_api.h:708
_ni_frame::p_custom_sei_set
ni_custom_sei_set_t * p_custom_sei_set
Definition: ni_device_api.h:2674
ni_reconfig_min_max_qp
LIB_API ni_retcode_t ni_reconfig_min_max_qp(ni_session_context_t *p_ctx, ni_rc_min_max_qp *p_min_max_qp)
Reconfigure min&max qp dynamically during encoding.
Definition: ni_device_api.c:10251
NI_XCODER_FLUSH_STATE
@ NI_XCODER_FLUSH_STATE
Definition: ni_device_api.h:250
_ni_packet::avg_frame_qp
uint32_t avg_frame_qp
Definition: ni_device_api.h:2843
_ni_pkt_info::psnr_v
double psnr_v
Definition: ni_device_api.h:1097
_ni_session_context::hwd_chunk_offset
uint32_t hwd_chunk_offset
Definition: ni_device_api.h:1538
_ni_frame_pool_type
_ni_frame_pool_type
Frame pool type.
Definition: ni_device_api.h:489
_ni_session_context::roi_avg_qp
uint32_t roi_avg_qp
Definition: ni_device_api.h:1497
_ni_device_capability::device_is_xcoder
uint8_t device_is_xcoder
Definition: ni_device_api.h:1155
ni_frameclone_desc_t
struct _ni_frameclone_desc ni_frameclone_desc_t
_ni_split_context_t::w
int w[3]
Definition: ni_device_api.h:1729
NI_BITRATE_RECONFIG_FILE_MAX_LINES
#define NI_BITRATE_RECONFIG_FILE_MAX_LINES
Max number of lines supported for the bitrate reconfig file.
Definition: ni_device_api.h:473
_ni_session_context::force_low_delay_cnt
uint32_t force_low_delay_cnt
Definition: ni_device_api.h:1700
_ni_xcoder_params::p_first_frame
ni_frame_t * p_first_frame
Definition: ni_device_api.h:2776
_ni_session_context::p_master_display_meta_data
void * p_master_display_meta_data
Definition: ni_device_api.h:1432
_ni_session_context::last_frame_offset
uint64_t last_frame_offset
Definition: ni_device_api.h:1455
_ni_encoder_cfg_params::forced_header_enable
int forced_header_enable
Definition: ni_device_api.h:2258
_ni_hw_capability::max_number_of_contexts
uint8_t max_number_of_contexts
Definition: ni_device_api.h:1137
_ni_session_context::session_statistic
ni_session_statistic_t session_statistic
Definition: ni_device_api.h:1650
_ni_network_layer_params_t::memory_type
uint32_t memory_type
Definition: ni_device_api.h:1349
_ni_encoder_cfg_params::spatial_layers_ref_base_layer
int spatial_layers_ref_base_layer
Definition: ni_device_api.h:2441
_ni_session_context::burst_control
int burst_control
Definition: ni_device_api.h:1615
_ni_extended_dec_metadata::rsvd3
uint64_t rsvd3
Definition: ni_device_api.h:733
_ni_session_context::async_mode
int async_mode
Definition: ni_device_api.h:1663
NI_FRAME_AUX_DATA_BITRATE
@ NI_FRAME_AUX_DATA_BITRATE
Definition: ni_device_api.h:535
_ni_encoder_change_params_t::videoFullRange
uint8_t videoFullRange
Definition: ni_device_api.h:1025
_ni_scaler_params_t::scaler_param_c
double scaler_param_c
Definition: ni_device_api.h:2571
_ni_scaler_input_params_t::output_format
int output_format
Definition: ni_device_api.h:2554
_ni_scaler_input_params_t::output_width
int32_t output_width
Definition: ni_device_api.h:2555
NI_CODEC_FORMAT_H265
@ NI_CODEC_FORMAT_H265
Definition: ni_device_api.h:912
_ni_dec_h265_vui_param::vui_num_units_in_tick
uint32_t vui_num_units_in_tick
Definition: ni_device_api.h:775
_ni_queue_node_t::p_prev
struct _ni_queue_node_t * p_prev
Definition: ni_device_api.h:1298
_ni_load_query::active_hwuploaders
uint32_t active_hwuploaders
Definition: ni_device_api.h:1213
ni_reconfig_intraprd
LIB_API ni_retcode_t ni_reconfig_intraprd(ni_session_context_t *p_ctx, int32_t intra_period)
Reconfigure intraPeriod dynamically during encoding.
Definition: ni_device_api.c:9909
_ni_frame::use_long_term_ref
uint8_t use_long_term_ref
Definition: ni_device_api.h:2622
_ni_session_context::last_access_time
volatile uint64_t last_access_time
Definition: ni_device_api.h:1683
NI_H265_USERDATA_FLAG_RESERVED_9
@ NI_H265_USERDATA_FLAG_RESERVED_9
Definition: ni_device_api.h:368
_ni_instance_mgr_detail_status::ui32AvgBitRate
uint32_t ui32AvgBitRate
Definition: ni_device_api.h:1236
_ni_packet::data_len
uint32_t data_len
Definition: ni_device_api.h:2838