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