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