29#if __linux__ || __APPLE__
32#include <linux/types.h>
85#if __linux__ || __APPLE__
86static struct stat g_nvme_stat = { 0 };
88static int close_fd_zero_atexit = 0;
90static void close_fd_zero(
void)
112 "ERROR: %s() Failed to allocate memory for session context\n",
141#ifdef MEASURE_LATENCY
165 int framerate_num = 0;
166 int framerate_denom = 0;
205 "ERROR %s(): init xcoder_low_delay_sync_mutex fail return\n",
212 "ERROR %s(): init xcoder_low_delay_sync_cond fail return\n",
243 p_ctx->debug_write_ptr = NULL;
244 p_ctx->debug_write_index_ptr = NULL;
245 p_ctx->debug_write_sent_size = 0;
248#ifdef MEASURE_LATENCY
282 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
288 event_handle = CreateEvent(NULL, FALSE, FALSE, NULL);
289 if (event_handle == NULL)
293 return NI_INVALID_EVENT_HANDLE;
297 return NI_INVALID_EVENT_HANDLE;
309 if ( NI_INVALID_DEVICE_HANDLE == event_handle )
322 retval = CloseHandle(event_handle);
336 err = close(event_handle);
339 char error_message[100] = {
'\0'};
340 char unknown_error_message[20] = {
'\0'};
341 ni_sprintf(error_message, 100,
"ERROR: %s(): ", __func__);
345 ni_strcat(error_message, 100,
"EBADF\n");
348 ni_strcat(error_message, 100,
"EINTR\n");
354 ni_sprintf(unknown_error_message, 20,
"Unknown error %d\n", err);
355 ni_strcat(error_message, 100, unknown_error_message);
363#ifndef DEPRECATION_AS_ERROR
378 HANDLE device_handle;
383 return NI_INVALID_DEVICE_HANDLE;
393 device_handle = CreateFile(p_dev, GENERIC_READ | GENERIC_WRITE,
394 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
395 OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
398 if (INVALID_HANDLE_VALUE == device_handle)
400 retval = GetLastError();
407 return device_handle;
410 ni_device_handle_t fd = NI_INVALID_DEVICE_HANDLE;
421 *p_max_io_size_out = ni_get_kernel_max_io_size(p_dev);
423 *p_max_io_size_out = MAX_IO_TRANSFER_SIZE;
432 fd = open(p_dev, O_RDWR | O_SYNC | O_DIRECT);
435 fd = open(p_dev, O_RDWR | O_SYNC);
445 fd = NI_INVALID_DEVICE_HANDLE;
458 if(close_fd_zero_atexit == 0)
460 close_fd_zero_atexit = 1;
461 atexit(close_fd_zero);
465 ni_log(
NI_LOG_ERROR,
"libxcoder has held the fd=0, but open fd=0 again, maybe fd=0 was closed accidently.");
467 fd = NI_INVALID_DEVICE_HANDLE;
472 retval = fcntl(fd, F_NOCACHE, 1);
478 fd = NI_INVALID_DEVICE_HANDLE;
483 retval = fstat(fd, &g_nvme_stat);
489 fd = NI_INVALID_DEVICE_HANDLE;
493 if (!S_ISCHR(g_nvme_stat.st_mode) && !S_ISBLK(g_nvme_stat.st_mode))
499 fd = NI_INVALID_DEVICE_HANDLE;
525 HANDLE device_handle;
526 DWORD dwDesiredAccess = 0;
531 return NI_INVALID_DEVICE_HANDLE;
539 dwDesiredAccess = GENERIC_READ;
543 dwDesiredAccess = GENERIC_WRITE;
548 dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;
552 device_handle = CreateFile(p_dev, dwDesiredAccess,
553 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
554 OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
557 if (INVALID_HANDLE_VALUE == device_handle)
559 retval = GetLastError();
566 return device_handle;
569 ni_device_handle_t fd = NI_INVALID_DEVICE_HANDLE;
586 open_flags = O_RDONLY;
590 open_flags = O_WRONLY;
599 open_flags |= O_SYNC;
601 open_flags |= O_DIRECT;
606 fd = open(p_dev, open_flags);
612 fd = NI_INVALID_DEVICE_HANDLE;
618 retval = fcntl(fd, F_NOCACHE, 1);
624 fd = NI_INVALID_DEVICE_HANDLE;
629 retval = fstat(fd, &g_nvme_stat);
635 fd = NI_INVALID_DEVICE_HANDLE;
639 if (!S_ISCHR(g_nvme_stat.st_mode) && !S_ISBLK(g_nvme_stat.st_mode))
645 fd = NI_INVALID_DEVICE_HANDLE;
667 if ( NI_INVALID_DEVICE_HANDLE == device_handle )
674 if(device_handle == 0)
691 retval = CloseHandle(device_handle);
695 "ERROR: %s(): closing device device_handle %p failed, error: %d\n",
706 err = close(device_handle);
709 char error_message[100] = {
'\0'};
710 char unknown_error_message[20] = {
'\0'};
711 ni_sprintf(error_message, 100,
"ERROR: %s(): ", __func__);
715 ni_strcat(error_message, 100,
"EBADF\n");
718 ni_strcat(error_message, 100,
"EINTR\n");
724 ni_sprintf(unknown_error_message, 20,
"Unknown error %d\n", err);
725 ni_strcat(error_message, 100, unknown_error_message);
736#ifndef DEPRECATION_AS_ERROR
754 void * p_buffer = NULL;
756 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
760 if ( (NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_cap) )
816 void * p_buffer = NULL;
818 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
822 if ( (NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_cap) )
889 bool use_model_load =
true;
893 uint32_t num_sw_instances = 0;
894 uint32_t pixel_load = 0xFFFFFFFFU;
895 int user_handles =
false;
896 ni_lock_handle_t lock = NI_INVALID_LOCK_HANDLE;
897 ni_device_handle_t handle = NI_INVALID_DEVICE_HANDLE;
898 ni_device_handle_t handle1 = NI_INVALID_DEVICE_HANDLE;
911 if (!IsUserAnAdmin())
926 "device_type %d, session id %d\n",
978 for (i = 0; i < 120; i++)
987 "%s: device type %d hw_id %d blk_dev_name: %s dev_xcoder_name: %s.\n",
1007 "%s: block device name %s type %d guid %d is to "
1008 "override passed in guid %d\n",
1009 __func__, p_ctx->
blk_dev_name, device_type, tmp_guid_id,
1011 p_ctx->
hw_id = tmp_guid_id;
1022 if ((handle1 == NI_INVALID_DEVICE_HANDLE) && (handle == NI_INVALID_DEVICE_HANDLE))
1024 if (p_ctx->
hw_id >=0)
1046 user_handles =
true;
1065 user_handles =
true;
1084 use_model_load =
false;
1123 for (i = 0; i < num_coders; i++)
1128 if (p_device_context == NULL)
1131 "ERROR: %s() ni_rsrc_get_device_context() failed\n",
1142 if (NI_INVALID_DEVICE_HANDLE == p_session_context.
device_handle)
1151 if (NI_INVALID_DEVICE_HANDLE != p_session_context.
device_handle)
1159 g_device_type_str[query_type],
1186 curr_load = p_dev_info->
load;
1189 if (i == 0 || curr_load < least_load ||
1190 (curr_load == least_load &&
1194 least_load = curr_load;
1206 NI_INVALID_DEVICE_HANDLE)
1220 p_ctx->
hw_id = guid;
1242 p_ctx->
hw_id = guid;
1250 else if((handle1 == NI_INVALID_DEVICE_HANDLE) || (handle == NI_INVALID_DEVICE_HANDLE))
1258 user_handles =
true;
1262 "Finish open the session dev:%s guid:%d handle:%p handle1:%p\n",
1269 if (p_device_context == NULL)
1272 "ERROR: %s() ni_rsrc_get_device_context() failed\n",
1274 if (user_handles !=
true)
1300 "ERROR: %s() cannot retrieve DDR configuration\n",
1302 if (user_handles !=
true)
1316 "ERROR: %s() keep_alive_timeout was 0, should be between 1-100. "
1317 "Setting to default of %u\n",
1321 switch (device_type)
1326 if (user_handles !=
true)
1349 if (p_enc_params && p_enc_params->
hwframes &&
1365 if (user_handles !=
true)
1383 if (user_handles !=
true)
1401 if (user_handles !=
true)
1419 if (user_handles !=
true)
1436 if (user_handles !=
true)
1446 __func__, device_type);
1512 p_device_pool = NULL;
1571 "join keep alive thread fail! : sid %u ret %d\n",
1582 switch (device_type)
1613 __func__, device_type);
1688 switch (device_type)
1704 __func__, device_type);
1746 0 == memcmp(p_ctx->
p_hdr_buf, hdr_data, hdr_size))
1758 memcpy(p_ctx->
p_hdr_buf, hdr_data, hdr_size);
1835 if (!p_ctx || !p_data)
1851 "ERROR: %s() keep alive thread has been closed, "
1852 "hw:%d, session:%d\n",
1869 switch (device_type)
1890 __func__, device_type);
1935 if ((!p_ctx) || (!p_data))
1952 "ERROR: %s() keep alive thread has been closed, "
1953 "hw:%d, session:%d\n",
1970 switch (device_type)
1974 int seq_change_read_count = 0;
1984 uint32_t aligned_width;
1994 if (0 == retval && seq_change_read_count)
1997 "%s (decoder): seq change NO data, next time.\n", __func__);
2003 else if (retval < 0)
2019 "%s (decoder): resolution change, frame size %ux%u -> %ux%u, "
2020 "width %u bit %d, pix_fromat_changed %d, actual_video_width %d, continue read ...\n",
2029 seq_change_read_count++;
2052 __func__, device_type);
2100 __func__, device_type);
2140 __func__, device_type);
2180 __func__, device_type);
2201 uint32_t namespace_num, uint32_t sriov_index)
2204 __func__, namespace_num, sriov_index);
2225 __func__, device_handle, mode);
2244 ni_device_handle_t device_handle_t,
2245 uint32_t over_provision)
2248 float f_over_provision = 0;
2249 memcpy(&f_over_provision, &over_provision,
sizeof(int32_t));
2251 __func__, device_handle, device_handle_t, f_over_provision);
2287 int video_height,
int alignment,
2288 int metadata_flag,
int factor,
2289 int hw_frame_count,
int is_planar)
2291 void* p_buffer = NULL;
2292 int metadata_size = 0;
2294 int width_aligned = video_width;
2295 int height_aligned = video_height;
2297 if ((!p_frame) || ((factor!=1) && (factor!=2) && (factor !=4))
2302 "factor %d, video_width %d, video_height %d\n",
2303 __func__, factor, video_width, video_height);
2318 width_aligned = ((((video_width * factor) + 127) / 128) * 128) / factor;
2319 height_aligned = ((video_height + 1) / 2) * 2;
2324 height_aligned = ((video_height + 1) / 2) * 2;
2332 width_aligned = ((video_width + 31) / 32) * 32;
2333 height_aligned = ((video_height + 7) / 8) * 8;
2336 height_aligned = ((video_height + 15) / 16) * 16;
2340 int luma_size = width_aligned * height_aligned * factor;
2345 int chroma_width_aligned = ((((video_width / 2 * factor) + 127) / 128) * 128) / factor;
2349 chroma_width_aligned =
2350 ((((video_width * factor) + 127) / 128) * 128) / factor;
2352 int chroma_height_aligned = height_aligned / 2;
2353 chroma_b_size = chroma_r_size = chroma_width_aligned * chroma_height_aligned * factor;
2361 chroma_b_size = chroma_r_size = 0;
2367 chroma_b_size = luma_size / 4;
2368 chroma_r_size = chroma_b_size;
2373 if (hw_frame_count == 0)
2374 buffer_size = luma_size + chroma_b_size + chroma_r_size + metadata_size;
2388 "%s: free current p_frame, p_frame->buffer_size=%u\n", __func__,
2426 p_frame->
data_len[1] = chroma_b_size;
2427 p_frame->
data_len[2] = chroma_r_size;
2446 ni_log(
NI_LOG_DEBUG,
"ni_frame_buffer_alloc: p_buffer %p p_data [%p %p %p %p] data_len [%d %d %d %d] video_width %d video_height %d\n", p_frame->
p_buffer, p_frame->
p_data[0], p_frame->
p_data[1], p_frame->
p_data[2], p_frame->
p_data[3], p_frame->
data_len[0], p_frame->
data_len[1], p_frame->
data_len[2], p_frame->
data_len[3], p_frame->
video_width, p_frame->
video_height);
2485 int video_height,
int alignment,
2486 int metadata_flag,
int factor,
2487 int hw_frame_count,
int is_planar,
2494 if (((factor!=1) && (factor!=2) && (factor !=4))
2499 "factor %d, video_width %d, video_height %d\n",
2500 __func__, factor, video_width, video_height);
2527 dst_stride, height_aligned);
2535 video_height, dst_stride, alignment,
2557 int video_height,
int pixel_format)
2559 void *p_buffer = NULL;
2561 int width_aligned = video_width;
2562 int height_aligned = video_height;
2570 (video_height <= 0))
2573 "ERROR: %s passed parameters are null or not supported, "
2574 "video_width %d, video_height %d\n",
2575 __func__, video_width, video_height);
2579 switch (pixel_format)
2585 luma_size = width_aligned * height_aligned;
2588 chroma_r_size = chroma_b_size;
2594 luma_size = width_aligned * height_aligned * 2;
2596 chroma_r_size = chroma_b_size;
2602 luma_size = width_aligned * height_aligned;
2603 chroma_b_size = width_aligned * height_aligned / 2;
2610 luma_size = width_aligned * height_aligned * 2;
2616 height_aligned = video_height;
2618 luma_size = width_aligned * height_aligned;
2619 chroma_b_size = luma_size;
2625 height_aligned = video_height;
2627 luma_size = width_aligned * height_aligned * 2;
2637 height_aligned = video_height;
2639 luma_size = width_aligned * height_aligned * 4;
2645 height_aligned = video_height;
2647 luma_size = width_aligned * height_aligned;
2648 chroma_b_size = luma_size;
2649 chroma_r_size = luma_size;
2657 buffer_size = luma_size + chroma_b_size + chroma_r_size;
2663 __func__, luma_size, chroma_b_size, chroma_r_size, buffer_size);
2669 "%s: free current p_frame, p_frame->buffer_size=%u\n", __func__,
2681 "ERROR %d: %s() Cannot allocate p_frame buffer.\n",
NI_ERRNO,
2699 p_frame->
data_len[1] = chroma_b_size;
2700 p_frame->
data_len[2] = chroma_r_size;
2751 int video_width,
int video_height,
2752 int alignment,
int factor,
2760 if ((!p_frame) || ((factor!=1) && (factor!=2))
2765 "factor %d, video_width %d, video_height %d\n",
2766 __func__, factor, video_width, video_height);
2772 width_aligned = ((((video_width * factor) + 127) / 128) * 128) / factor;
2773 height_aligned = video_height;
2777 width_aligned = ((video_width + 31) / 32) * 32;
2778 height_aligned = ((video_height + 7) / 8) * 8;
2781 height_aligned = ((video_height + 15) / 16) * 16;
2786 width_aligned, height_aligned, video_width, video_height);
2788 int luma_size = width_aligned * height_aligned * factor;
2793 int chroma_width_aligned = ((((video_width / 2 * factor) + 127) / 128) * 128) / factor;
2796 chroma_width_aligned =
2797 ((((video_width * factor) + 127) / 128) * 128) / factor;
2799 int chroma_height_aligned = height_aligned / 2;
2800 chroma_b_size = chroma_r_size = chroma_width_aligned * chroma_height_aligned * factor;
2808 chroma_b_size = luma_size / 4;
2809 chroma_r_size = chroma_b_size;
2811 int buffer_size = luma_size + chroma_b_size + chroma_r_size +
2853 p_frame->
p_data[2] = p_frame->
p_data[1] + chroma_b_size;
2854 p_frame->
p_data[3] = p_frame->
p_data[2] + chroma_r_size;
2862 p_frame->
data_len[1] = chroma_b_size;
2863 p_frame->
data_len[2] = chroma_r_size;
2898 int width,
int height,
2899 const int linesize[],
2903 if ((!p_enc_ctx) || (!p_enc_params) || (!linesize)
2909 "p_enc_ctx %p, p_enc_params %p, linesize %p, "
2910 "width %d, height %d linesize[0] %d\n",
2911 __func__, p_enc_ctx, p_enc_params, linesize,
2912 width, height, (linesize) ? linesize[0] : 0);
2921 ni_log2(p_enc_ctx,
NI_LOG_DEBUG,
"%s: not supported on device with FW API version < 6.Q\n", __func__);
2925 bool isrgba =
false;
2926 bool isplanar =
false;
2927 bool issemiplanar =
false;
2937 issemiplanar =
true;
2956 ni_log2(p_enc_ctx,
NI_LOG_DEBUG,
"%s: semi-planar not supported on device with FW API version < 6.q\n", __func__);
2965 bool ishwframe = (p_enc_params->
hwframes) ?
true :
false;
2968 "p_enc_ctx %p, p_enc_params %p, linesize %p, "
2969 "width %d, height %d, linesize[0] %d linesize[1] %d\n",
2970 __func__, isrgba, issemiplanar, ishwframe, p_enc_ctx, p_enc_params, linesize,
2971 width, height, linesize[0], linesize[1]);
2973 if (linesize[0] <= max_linesize &&
2974 linesize[0] % 2 == 0 &&
2975 linesize[1] % 2 == 0 &&
2982 (!isplanar || linesize[2] == linesize[1])
3000 "luma_linesize %d, chroma_linesize %d, "
3001 "linesize[0] %d, linesize[1] %d\n",
3003 linesize[0], linesize[1]);
3010 ni_log2(p_enc_ctx,
NI_LOG_ERROR,
"%s: linesize changed from %u %u to %u %u - resolution change?\n", __func__,
3012 linesize[0], linesize[1]);
3046 const int linesize[],
const uint8_t *data[],
3047 int buf_size0,
int buf_size1,
int buf_size2,
3048 uint8_t *buf_data0, uint8_t *buf_data1, uint8_t *buf_data2)
3052 if (!p_frame || !p_enc_ctx || !data || !linesize)
3054 ni_log(
NI_LOG_ERROR,
"ERROR: %s: null parameters: p_frame=%p, p_enc_ctx=%p, linesize=%p, data=%p\n",
3055 __func__, p_frame, p_enc_ctx, linesize, data);
3067 const uint8_t *buf_data[3] = { buf_data0, buf_data1, buf_data2 };
3068 const int buf_size[3] = { buf_size0, buf_size1, buf_size2 };
3069 const uint8_t *end_used, *end_alloc;
3076 const int num_planes = (buf_size[2] != 0) ? 3 : (buf_size[1] != 0) ? 2 : 1;
3081 for (i = 0; i < num_planes; i++)
3083 if (!data[i] || !buf_data[i] || buf_size[i] <= 0)
3085 ni_log(
NI_LOG_ERROR,
"ERROR: %s: invalid parameter %d: data=%p, buf_data=%p, size=%d\n",
3086 __func__, i, data[i], buf_data[i], buf_size[i]);
3090 int plane_height = video_height >> (i > 0 ? 1 : 0);
3099 end_used = data[2] + linesize[2] * (video_height >> 1);
3104 end_used = data[1] + linesize[1] * (video_height >> 1);
3108 ni_log(
NI_LOG_ERROR,
"ERROR: %s: Single-plane pixel format not supported\n", __func__);
3115 end_used = data[i] + linesize[i] * plane_height;
3119 end_alloc = buf_data[i] + buf_size[i];
3122 int plane_offset = (int)(end_used - end_alloc);
3123 plane_offset = (plane_offset > 0) ? plane_offset : 0;
3129 offset = plane_offset * 2;
3130 ((uint8_t **)data)[0] -= offset;
3131 ((uint8_t **)data)[1] -= plane_offset;
3132 ((uint8_t **)data)[2] -= plane_offset;
3136 offset = plane_offset;
3137 ((uint8_t **)data)[0] -= plane_offset;
3138 ((uint8_t **)data)[1] -= plane_offset;
3143 ((uint8_t **)data)[i] -= plane_offset;
3146 offset = plane_offset;
3179 int video_width,
int video_height,
3180 const int linesize[],
const uint8_t *data[],
3185 if ((!p_frame) || (!linesize) || (!data))
3188 "p_frame %p, linesize %p, data %p\n",
3189 __func__, p_frame, linesize, data);
3194 "%s: resolution=%dx%d linesize=%d/%d/%d "
3195 "data=%p %p %p extra_len=%d\n",
3196 __func__, video_width, video_height,
3197 linesize[0], linesize[1], linesize[2],
3198 data[0], data[1], data[2], extra_len);
3206 p_frame->
p_buffer = (uint8_t *)data[0];
3207 p_frame->
p_data[0] = (uint8_t *)data[0];
3208 p_frame->
p_data[1] = (uint8_t *)data[1];
3209 p_frame->
p_data[2] = (uint8_t *)data[2];
3211 int luma_size = linesize[0] * video_height;
3212 int chroma_b_size = 0;
3213 int chroma_r_size = 0;
3217 chroma_b_size = linesize[1] * (video_height / 2);
3220 chroma_r_size = linesize[2] * (video_height / 2);
3224 uint32_t start_offset;
3225 uint32_t total_start_len = 0;
3231 if ((data[1] && (data[0] + luma_size != data[1]))
3232 || (data[2] && (data[1] + chroma_b_size != data[2])))
3243 total_start_len += p_frame->
start_len[i];
3251 total_start_len = p_frame->
start_len[0];
3264 if (total_start_len)
3276 int start_buffer_offset = 0;
3283 start_buffer_offset += p_frame->
start_len[i];
3289 p_frame->
data_len[1] = chroma_b_size;
3290 p_frame->
data_len[2] = chroma_r_size;
3297 "%s: success: p_metadata_buffer %p metadata_buffer_size %u "
3298 "p_start_buffer %p start_buffer_size %u data_len %u %u %u\n",
3328 int width,
int height,
3329 const int linesize[],
int pixel_format)
3332 if ((!p_upl_ctx) || (!linesize)
3338 "p_enc_ctx %p, linesize %p, "
3339 "width %d, height %d linesize[0] %d\n",
3340 __func__, p_upl_ctx, linesize,
3341 width, height, (linesize) ? linesize[0] : 0);
3350 ni_log2(p_upl_ctx,
NI_LOG_DEBUG,
"%s: not supported on device with FW API version < 6.S\n", __func__);
3360 "p_upl_ctx %p, linesize %p, "
3361 "width %d, height %d, linesize[0] %d\n",
3362 __func__, pixel_format, p_upl_ctx, linesize,
3363 width, height, linesize[0]);
3365 int bit_depth_factor;
3366 bool isrgba =
false;
3367 bool isplanar =
false;
3368 bool issemiplanar =
false;
3370 switch (pixel_format)
3374 bit_depth_factor = 1;
3378 bit_depth_factor = 2;
3381 issemiplanar =
true;
3382 bit_depth_factor = 1;
3385 issemiplanar =
true;
3386 bit_depth_factor = 2;
3393 bit_depth_factor = 4;
3406 ni_log2(p_upl_ctx,
NI_LOG_DEBUG,
"%s: semi-planar not supported on device with FW API version < 6.q\n", __func__);
3411 if (linesize[0] <= max_linesize &&
3420 linesize[2] == linesize[1])
3426 linesize[1] == linesize[0])
3461 int video_height,
int linesize[],
3462 int alignment,
int extra_len,
3463 bool alignment_2pass_wa)
3465 void* p_buffer = NULL;
3474 "p_frame %p, linesize %p, video_width %d, video_height %d\n",
3475 __func__, p_frame, linesize, video_width, video_height);
3481 height_aligned = ((video_height + 1) / 2) * 2;
3484 height_aligned = ((video_height + 7) / 8) * 8;
3488 height_aligned = ((video_height + 15) / 16) * 16;
3497 "%s: aligned=%dx%d org=%dx%d linesize=%d/%d/%d "
3499 __func__, video_width, height_aligned, video_width, video_height,
3500 linesize[0], linesize[1], linesize[2], extra_len);
3502 int luma_size = linesize[0] * height_aligned;
3507 chroma_b_size = chroma_r_size = linesize[1] * (height_aligned / 2);
3508 if (alignment_2pass_wa)
3511 chroma_r_size = linesize[1] * (((height_aligned + 31) / 32) * 32) / 2;
3517 chroma_b_size = luma_size / 4;
3518 chroma_r_size = luma_size / 4;
3522 int buffer_size = luma_size + chroma_b_size + chroma_r_size + extra_len;
3530 "%s: free current p_frame, "
3531 "p_frame->buffer_size=%u\n",
3548 memset(p_buffer, 0, buffer_size);
3559 p_frame->
p_data[1] = (uint8_t*)p_frame->
p_data[0] + luma_size;
3560 p_frame->
p_data[2] = (uint8_t*)p_frame->
p_data[1] + chroma_b_size;
3568 p_frame->
data_len[1] = chroma_b_size;
3569 p_frame->
data_len[2] = chroma_r_size;
3576 "%s: success: p_frame->p_buffer %p "
3577 "p_frame->buffer_size=%u\n",
3697 int video_height,
int linesize[],
3698 int extra_len,
bool alignment_2pass_wa)
3700 void* p_buffer = NULL;
3709 "p_frame %p, linesize %p, video_width %d, video_height %d\n",
3710 __func__, p_frame, linesize, video_width, video_height);
3714 height_aligned = ((video_height + 1) / 2) * 2;
3722 "%s: aligned=%dx%d org=%dx%d linesize=%d/%d/%d extra_len=%d\n",
3723 __func__, video_width, height_aligned, video_width, video_height,
3724 linesize[0], linesize[1], linesize[2], extra_len);
3726 int luma_size = linesize[0] * height_aligned;
3727 int chroma_br_size = luma_size / 2;
3729 if (alignment_2pass_wa)
3732 chroma_br_size = linesize[0] * ((((height_aligned + 31) / 32) * 32) / 2);
3736 int buffer_size = luma_size + chroma_br_size + extra_len;
3760 memset(p_buffer, 0, buffer_size);
3772 p_frame->
p_data[1] = (uint8_t*)p_frame->
p_data[0] + luma_size;
3773 p_frame->
p_data[2] = (uint8_t*)p_frame->
p_data[1] + chroma_br_size;
3780 p_frame->
data_len[1] = chroma_br_size;
3831 int video_width,
int video_height,
3832 int linesize[],
int alignment,
3834 bool alignment_2pass_wa)
3839 linesize, alignment, extra_len,
3840 alignment_2pass_wa);
3845 linesize, extra_len,
3846 alignment_2pass_wa);
3888 "%s: close p_surface->dma_buf_fd %d "
3889 "ui16FrameIdx %u\n",
3905 p_frame->
p_data[i] = NULL;
3974 p_frame->
p_data[i] = NULL;
4014 void* p_buffer = NULL;
4015 int metadata_size = 0;
4022 packet_size + metadata_size);
4024 if (!p_packet || !packet_size)
4049 "%s: free current p_packet, p_packet->buffer_size=%u\n", __func__,
4055 __func__, buffer_size);
4112 if (!p_buffer || !p_packet || !buffer_size)
4120 ni_log(
NI_LOG_INFO,
"Info: %s: Warning buffer not 4k aligned = %p!. Will do an extra copy\n",
4121 __func__, p_buffer);
4199 "%s(): no need to free previous av1 packet buffers\n", __func__);
4235int ni_packet_copy(
void* p_destination,
const void*
const p_source,
int cur_size,
void* p_leftover,
int* p_prev_size)
4238 int padding_size = 0;
4239 int prev_size = p_prev_size == NULL? 0 : *p_prev_size;
4241 int total_size = cur_size + prev_size;
4242 uint8_t* p_src = (uint8_t*)p_source;
4243 uint8_t* p_dst = (uint8_t*)p_destination;
4244 uint8_t* p_lftover = (uint8_t*)p_leftover;
4253 if ((0 == cur_size) && (0 == prev_size))
4258 if (((0 != cur_size) && (!p_source)) || (!p_destination) || (!p_leftover))
4265 if (copy_size > total_size)
4267 padding_size = copy_size - total_size;
4272 memcpy(p_dst, p_lftover, prev_size);
4277 memcpy(p_dst, p_src, cur_size);
4282 memset(p_dst, 0, padding_size);
4286 "%s(): exit, cur_size=%d, copy_size=%d, "
4287 "prev_size=%d, padding_size=%d\n", __func__, cur_size,
4288 copy_size, *p_prev_size, padding_size);
4313 "ERROR: %s No memory or exceeding max aux_data number !\n",
4319 ret->
size = data_size;
4320 ret->
data = calloc(1, data_size);
4346 const uint8_t *raw_data,
4352 memcpy(ret->
data, raw_data, data_size);
4396 if (aux->
type == type)
4447 int fps_num,
int fps_denom,
4448 long bit_rate,
int width,
4599 p_param->
bitrate = (int)bit_rate;
4699 p_enc->
qcomp = (float)0.6;
4792 ni_log(
NI_LOG_ERROR,
"AV1 Picture Width not aligned to %d - picture will be cropped\n",
4797 ni_log(
NI_LOG_ERROR,
"AV1 Picture Height not aligned to %d - picture will be cropped\n",
4866 int fps_num,
int fps_denom,
4867 long bit_rate,
int width,
4893 if(fps_num <= 0 || fps_denom <= 0)
4897 ni_log(
NI_LOG_INFO,
"%s(): FPS is not set, setting the default FPS to 30\n", __func__);
4955 p_param->
bitrate = (int)bit_rate;
4987 char keyChar[10] =
"";
4989 char valChar[10] =
"";
4995 FILE *reconf = NULL;
5004 ni_fopen(&reconf, reconf_file,
"r");
5013 while ((readc = fgetc(reconf)) != EOF)
5020 ni_strncat(keyChar, 10, (
const char *)(&readc), 1);
5024 ni_strncat(valChar, 10, (
const char *)(&readc), 1);
5027 else if (readc ==
':')
5030 key =
atoi(keyChar);
5031 hash_map[idx][0] = key;
5033 else if (readc ==
',')
5038 "ERROR: Number of entries per line in reconfig file is greater then the "
5044 val =
atoi(valChar);
5045 hash_map[idx][valIdx] = val;
5047 memset(valChar, 0, 10);
5049 else if (readc ==
'\n')
5054 "ERROR: Number of lines in reconfig file is greater then the "
5061 val =
atoi (valChar);
5062 hash_map[idx][valIdx] = val;
5064 memset(keyChar,0,10);
5065 memset(valChar,0,10);
5070 ni_log(
NI_LOG_ERROR,
"ERROR: character %c in reconfig file. this may lead to mistaken reconfiguration values\n", readc);
5079 "ERROR %d: %s(): Incorrect format / "
5080 "incomplete Key/Value pair in reconfig_file: %s\n",
5091 char valChar[5] =
"";
5097 FILE *reconf = NULL;
5099 if (!customize_file)
5106 ni_fopen(&reconf, customize_file,
"r");
5110 NI_ERRNO, __func__, customize_file);
5115 while ((readc = fgetc(reconf)) != EOF)
5120 ni_strncat(valChar, 5, (
const char *)(&readc), 1);
5122 else if (readc ==
'-') {
5125 else if (readc ==
',')
5130 "ERROR: Number of qpIdx %d greater then the limit of %d or"
5131 "Number of levelIdx %d greater then the limit of %d\n",
5138 qp_map[levelIdx][qpIdx] = val;
5140 val = clip3(0, 32,
atoi(valChar));
5141 qp_map[levelIdx][qpIdx] = val * -1;
5144 memset(valChar, 0, 5);
5147 else if (readc ==
'\n')
5152 "ERROR: Number of qpIdx %d greater then the limit of %d or"
5153 "Number of levelIdx %d greater then the limit of %d\n",
5160 qp_map[levelIdx][qpIdx] = val;
5162 val = clip3(0, 32,
atoi(valChar));
5163 qp_map[levelIdx][qpIdx] = val * -1;
5166 memset(valChar, 0, 5);
5172 ni_log(
NI_LOG_ERROR,
"ERROR: character %c in reconfig file. this may lead to mistaken reconfiguration values\n", readc);
5183#define atoi(p_str) ni_atoi(p_str, &b_error)
5184#define atof(p_str) ni_atof(p_str, &b_error)
5185#define atobool(p_str) (ni_atobool(p_str, &b_error))
5202 const char *name,
char *value)
5204 bool b_error =
false;
5205 bool bNameWasBool =
false;
5206 bool bValueWasNull = !value;
5208 char nameBuf[64] = { 0 };
5209 const char delim[2] =
",";
5210 const char xdelim[2] =
"x";
5232 if (name[0] ==
'-' && name[1] ==
'-')
5238 if (strlen(name) + 1 <
sizeof(nameBuf) && strchr(name,
'_'))
5241 ni_strcpy(nameBuf,
sizeof(nameBuf), name);
5242 while ((c = strchr(nameBuf,
'_')) != 0)
5253 else if (value[0] ==
'=')
5258#if defined(_MSC_VER)
5259#define OPT(STR) else if (!_stricmp(name, STR))
5260#define OPT2(STR1, STR2) \
5261 else if (!_stricmp(name, STR1) || !_stricmp(name, STR2))
5263#define OPT(STR) else if (!strcasecmp(name, STR))
5264#define OPT2(STR1, STR2) else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))
5269 if (!strncmp(value,
"hw",
sizeof(
"hw"))){
5272 else if (!strncmp(value,
"sw",
sizeof(
"sw"))) {
5283 if (
atoi(value) == 1)
5288 if (
atoi(value) == 1)
5293 if (
atoi(value) == 1)
5298 if (
atoi(value) == 1)
5303 if (
atoi(value) == 1)
5308 if (
atoi(value) == 1 ||
atoi(value) == 2)
5313 if (
atoi(value) == 1 ||
atoi(value) == 2)
5318 if (
atoi(value) == 1 ||
atoi(value) == 2)
5323 if (!strncmp(value,
"manual",
sizeof(
"manual"))) {
5326 else if (!strncmp(value,
"auto",
sizeof(
"auto"))) {
5331 "ERROR: %s():cropMode0 input can only be <manual,auto> got %s\n",
5338 if (!strncmp(value,
"manual",
sizeof(
"manual"))) {
5341 else if (!strncmp(value,
"auto",
sizeof(
"auto"))) {
5346 "ERROR: %s():cropMode1 input can only be <manual,auto> got %s\n",
5353 if (!strncmp(value,
"manual",
sizeof(
"manual"))) {
5356 else if (!strncmp(value,
"auto",
sizeof(
"auto"))) {
5361 "ERROR: %s():cropMode2 input can only be <manual,auto> got %s\n",
5368 char *saveptr = NULL;
5369 chunk =
ni_strtok(value, delim, &saveptr);
5370 for (i = 0; i < 4; i++)
5377 if (chunk[j] !=
'\"' && chunk[j] !=
'\'')
5379 p_dec->
cr_expr[0][i][k] = chunk[j];
5387 chunk =
ni_strtok(NULL, delim, &saveptr);
5404 char *saveptr = NULL;
5405 chunk =
ni_strtok(value, delim, &saveptr);
5406 for (i = 0; i < 4; i++)
5413 if (chunk[j] !=
'\"' && chunk[j] !=
'\'')
5415 p_dec->
cr_expr[1][i][k] = chunk[j];
5423 chunk =
ni_strtok(NULL, delim, &saveptr);
5441 char *saveptr = NULL;
5442 chunk =
ni_strtok(value, delim, &saveptr);
5443 for (i = 0; i < 4; i++)
5450 if (chunk[j] !=
'\"' && chunk[j] !=
'\'')
5452 p_dec->
cr_expr[2][i][k] = chunk[j];
5460 chunk =
ni_strtok(NULL, delim, &saveptr);
5481 if (*chunk == xdelim[0]) {
5490 char *saveptr = NULL;
5491 chunk =
ni_strtok(value, xdelim, &saveptr);
5492 for (i = 0; i < 2; i++)
5499 if (chunk[j] !=
'\"' && chunk[j] !=
'\'')
5501 p_dec->
sc_expr[0][i][k] = chunk[j];
5509 chunk =
ni_strtok(NULL, xdelim, &saveptr);
5522 if (*chunk == xdelim[0]) {
5531 char *saveptr = NULL;
5532 chunk =
ni_strtok(value, xdelim, &saveptr);
5533 for (i = 0; i < 2; i++)
5540 if (chunk[j] !=
'\"' && chunk[j] !=
'\'')
5542 p_dec->
sc_expr[1][i][k] = chunk[j];
5550 chunk =
ni_strtok(NULL, xdelim, &saveptr);
5563 if (*chunk == xdelim[0]) {
5572 char *saveptr = NULL;
5573 chunk =
ni_strtok(value, xdelim, &saveptr);
5574 for (i = 0; i < 2; i++)
5581 if (chunk[j] !=
'\"' && chunk[j] !=
'\'')
5583 p_dec->
sc_expr[2][i][k] = chunk[j];
5591 chunk =
ni_strtok(NULL, xdelim, &saveptr);
5601 if ((
atoi(value) < 0) || (
atoi(value) > 2))
5609 if ((
atoi(value) < 0) || (
atoi(value) > 2))
5617 if ((
atoi(value) < 0) || (
atoi(value) > 2))
5625 if (
atoi(value) < 2 ||
atoi(value) % 2 != 0 ||
atoi(value) > 128)
5628 "and must be even number and less than or equal to 128. Got: %s\n",
5637 if (
atoi(value) < 2 ||
atoi(value) % 2 != 0 ||
atoi(value) > 128)
5640 "and must be even number and less than or equal to 128. Got: %s\n",
5648 if (
atoi(value) < 2 ||
atoi(value) % 2 != 0 ||
atoi(value) > 128)
5651 "and must be even number and less than or equal to 128. Got: %s\n",
5659 if (!strncmp(value,
"up",
sizeof(
"up"))){
5662 else if (!strncmp(value,
"down",
sizeof(
"down"))) {
5673 if (!strncmp(value,
"up",
sizeof(
"up"))){
5676 else if (!strncmp(value,
"down",
sizeof(
"down"))) {
5687 if (!strncmp(value,
"up",
sizeof(
"up"))){
5690 else if (!strncmp(value,
"down",
sizeof(
"down"))) {
5701 if ((
atoi(value) != 0) && (
atoi(value) != 1))
5709 if (
atoi(value) < 0)
5726 if (
atoi(value) < 0)
5734 if ((
atoi(value) != 0) && (
atoi(value) != 1))
5742 if (
atoi(value) < 0)
5750 if (
atoi(value) < 0)
5758 if ((
atoi(value) != 0) && (
atoi(value) != 1))
5801 if (strncmp(value,
"tolerant",
sizeof(
"tolerant")) == 0) {
5803 }
else if (strncmp(value,
"ignore",
sizeof(
"ignore")) == 0) {
5805 }
else if (strncmp(value,
"skip",
sizeof(
"skip")) == 0) {
5807 }
else if (strncmp(value,
"best_effort",
sizeof(
"best_effort")) == 0) {
5809 }
else if (strncmp(value,
"limited_error",
sizeof(
"limited_error")) == 0) {
5811 }
else if (strncmp(value,
"best_effort_out_dc",
sizeof(
"best_effort_out_dc")) == 0) {
5819 if (
atoi(value) != 0 &&
5829 if (
atoi(value) < 0 || (
atoi(value) > 100))
5837 if (
atoi(value) < 0 || (
atoi(value) > 2))
5845 if (
atoi(value) < 0 || (
atoi(value) > 1))
5853 if (
atoi(value) < 0 ||
atoi(value) > 255)
5861 if (
atoi(value) < 0 ||
atoi(value) > 1)
5869 if (
atoi(value) != 0 &&
atoi(value) != 1)
5877 if (
atoi(value) < 0 ||
5886 if (
atoi(value) != 0 &&
atoi(value) != 1)
5894 if (
atoi(value) < 0 ||
5903 if (
atoi(value) < 0 ||
atoi(value) > 1)
5911 if ((
atoi(value) != 0) && (
atoi(value) != 1))
5919 if ((
atoi(value) != 0) && (
atoi(value) != 1))
5927 if ((
atoi(value) != 0) && (
atoi(value) != 1))
5942 b_error |= bValueWasNull && !bNameWasBool;
5951#define atoi(p_str) ni_atoi(p_str, &b_error)
5952#define atof(p_str) ni_atof(p_str, &b_error)
5953#define atobool(p_str) (ni_atobool(p_str, &b_error))
5970 const char *name,
const char *value)
5972 bool b_error =
false;
5973 bool bNameWasBool =
false;
5974 bool bValueWasNull = !value;
5976 char nameBuf[64] = { 0 };
5996 if (name[0] ==
'-' && name[1] ==
'-')
6002 if (strlen(name) + 1 <
sizeof(nameBuf) && strchr(name,
'_'))
6005 ni_strcpy(nameBuf,
sizeof(nameBuf), name);
6006 while ((c = strchr(nameBuf,
'_')) != 0)
6017 else if (value[0] ==
'=')
6022#if defined(_MSC_VER)
6023#define OPT(STR) else if (!_stricmp(name, STR))
6024#define OPT2(STR1, STR2) \
6025 else if (!_stricmp(name, STR1) || !_stricmp(name, STR2))
6027#define OPT(STR) else if (!strcasecmp(name, STR))
6028#define OPT2(STR1, STR2) else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))
6030#define COMPARE(STR1, STR2, STR3) \
6031 if ((atoi(STR1) > (STR2)) || (atoi(STR1) < (STR3))) \
6033 return NI_RETCODE_PARAM_ERROR_OOR; \
6074 if (0 >
atoi(value))
6082 if (
atoi(value) < 0 ||
atoi(value) > 2)
6092#ifndef DEPRECATION_AS_ERROR
6095 if (0 !=
atoi(value) && 1 !=
atoi(value))
6106 if (0 !=
atoi(value) && 1 !=
atoi(value))
6129 if (
atof(value) <= 10)
6287#ifndef DEPRECATION_AS_ERROR
6290 if ((
atoi(value) > 51) || (
atoi(value) < -1))
6329 if (0 !=
atoi(value) && 1 !=
atoi(value))
6336#ifndef DEPRECATION_AS_ERROR
6343 if (!_strnicmp(value,
"ratio", 5))
6345 if (!strncasecmp(value,
"ratio", 5))
6348 char value_buf[32] = {0};
6349 for (i = 0; i <
sizeof(value_buf); i++)
6351 if (value[i+6] ==
']')
6355 value_buf[i] = value[i+6];
6357 if (i ==
sizeof(value_buf) ||
atoi(value_buf) < 0)
6366 int size =
atoi(value);
6377 if (!_strnicmp(value,
"ratio", 5))
6379 if (!strncasecmp(value,
"ratio", 5))
6382 char value_buf[32] = {0};
6383 for (i = 0; i <
sizeof(value_buf); i++)
6385 if (value[i+6] ==
']')
6389 value_buf[i] = value[i+6];
6391 if (i ==
sizeof(value_buf) ||
atoi(value_buf) < 0)
6400 int size =
atoi(value) / 8;
6410 if (0 !=
atoi(value) && 1 !=
atoi(value))
6455 if (
atoi(value) <= 0 )
6465 if (
atoi(value) <= 0)
6513 if (0 !=
atoi(value) && 1 !=
atoi(value))
6542 if (0 !=
atoi(value) && 1 !=
atoi(value))
6572 if ((
atoi(value) > 255) || (
atoi(value) < 0))
6580 if (
atoi(value) != 0 &&
atoi(value) != 5)
6588 if ((
atoi(value) > 3) || (
atoi(value) < 1))
6596 const char delim[2] =
",";
6599 char *v = _strdup(value);
6601 char *v = strdup(value);
6603 char *saveptr = NULL;
6607 if ((
atoi(chunk) > 65535) || (
atoi(chunk) < 0))
6613 chunk =
ni_strtok(NULL, delim, &saveptr);
6616 if ((
atoi(chunk) > 65535) || (
atoi(chunk) < 0))
6641#define STRDUP(value) _strdup(value);
6643#define STRDUP(value) strdup(value);
6645 const char G[2] =
"G";
6646 const char B[2] =
"B";
6647 const char R[2] =
"R";
6648 const char W[2] =
"W";
6649 const char L[2] =
"L";
6650 const char P[2] =
"P";
6651 const char parL[2] =
"(";
6652 const char comma[2] =
",";
6653 const char parR[2] =
")";
6654 int synCheck_GBRWLPCP[8];
6655 int posCheck_GBRWL[5] = {0};
6660 for (i = 0; i<8; i++)
6662 synCheck_GBRWLPCP[i] = 0;
6671 synCheck_GBRWLPCP[0]++;
6672 posCheck_GBRWL[0] = i;
6674 else if (*chunk == B[0])
6676 synCheck_GBRWLPCP[1]++;
6677 posCheck_GBRWL[1] = i;
6679 else if (*chunk == R[0])
6681 synCheck_GBRWLPCP[2]++;
6682 posCheck_GBRWL[2] = i;
6684 else if (*chunk == W[0])
6686 synCheck_GBRWLPCP[3]++;
6687 posCheck_GBRWL[3] = i;
6689 else if (*chunk == L[0])
6691 synCheck_GBRWLPCP[4]++;
6692 posCheck_GBRWL[4] = i;
6694 else if (*chunk == parL[0])
6696 synCheck_GBRWLPCP[5]++;
6698 else if (*chunk == comma[0])
6700 synCheck_GBRWLPCP[6]++;
6702 else if (*chunk == parR[0])
6704 synCheck_GBRWLPCP[7]++;
6710 if (synCheck_GBRWLPCP[0] != 1 || synCheck_GBRWLPCP[1] != 1 || synCheck_GBRWLPCP[2] != 1 ||
6711 synCheck_GBRWLPCP[3] != 1 || synCheck_GBRWLPCP[4] != 1 || synCheck_GBRWLPCP[5] != 5 ||
6712 synCheck_GBRWLPCP[6] != 5 || synCheck_GBRWLPCP[7] != 5)
6718#define GBRWLPARSE(OUT1,OUT2,OFF,IDX) \
6720 char *v = STRDUP(value); \
6721 chunk = v + posCheck_GBRWL[IDX]; \
6723 while (chunk != NULL) \
6725 if (*chunk == parL[0] && i == 1+(OFF)) \
6729 if((OFF) == 1 && *chunk != P[0] && i == 1) \
6733 if (*chunk == parR[0]) \
6744 return NI_RETCODE_PARAM_INVALID_VALUE; \
6746 subchunk = malloc(i - 1 - (OFF)); \
6747 if (subchunk == NULL) \
6750 return NI_RETCODE_ERROR_MEM_ALOC; \
6752 memcpy(subchunk, v + posCheck_GBRWL[IDX] + 2 + (OFF), i - 2 - (OFF)); \
6753 subchunk[i - 2 - (OFF)] = '\0'; \
6754 char *saveptr = NULL; \
6755 chunk = ni_strtok(subchunk, comma, &saveptr); \
6756 if (chunk != NULL) \
6758 if(atoi(chunk) < 0) \
6761 if(subchunk != NULL){ \
6764 return NI_RETCODE_PARAM_INVALID_VALUE; \
6766 *(OUT1) = atoi(chunk); \
6768 chunk = ni_strtok(NULL, comma, &saveptr); \
6769 if (chunk != NULL) \
6771 if(atoi(chunk) < 0) \
6774 if(subchunk != NULL){ \
6777 return NI_RETCODE_PARAM_INVALID_VALUE; \
6779 *(OUT2) = atoi(chunk); \
6793 if (
atoi(value)!= 0 && ((
atoi(value) > 40 ) || (
atoi(value) < 4)))
6801 if (
atoi(value) != 0 &&
atoi(value) != 1)
6809 if ((
atoi(value) != 0) && (
atoi(value) != 1))
6817 if (
atoi(value) != 0 &&
atoi(value) != 1)
6825 if (
atoi(value) != 0 &&
atoi(value) != 1)
6837 if (
atoi(value) < 1 ||
atoi(value) > 2)
6845 if ((
atoi(value) != 0) && (
atoi(value) != 1))
6858 if ((
atoi(value) < 0) || (
atoi(value) > 3))
6880 if ((
atoi(value) != 0) && (
atoi(value) != 1))
6909 if ((
atoi(value) != 0) && (
atoi(value) != 1))
6917 if ((
atoi(value) < 0) || (
atoi(value) > 9))
6925 if ((
atoi(value) > 12) || (
atoi(value) < -12))
6935 if ((
atoi(value) > 300) || (
atoi(value) < 1))
6943 if ((
atoi(value) > 2) || (
atoi(value) < 0))
6951 if ((
atoi(value) > 15) || (
atoi(value) < 0))
6959 if ((
atoi(value) > 500) || (
atoi(value) < 0))
6967 if ((
atoi(value) > 1) || (
atoi(value) < 0))
6975 if ((
atoi(value) > 1) || (
atoi(value) < 0))
7022 if (
atoi(value) != 0 &&
atoi(value) != 1)
7030 if (
atoi(value) < 0 ||
atoi(value) > 3)
7038 if (
atoi(value) < 1)
7046 if (
atoi(value) < 0 ||
atoi(value) > 1)
7054 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7062 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7070 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7082 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7090 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7096 ni_log(
NI_LOG_ERROR,
"Cannot set enableAIEnhance and enableHVSPlus at same time, just enableHVSPlus\n");
7102 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7110 if ((
atoi(value) != 0) && (
atoi(value) != 1) && (
atoi(value) != -1))
7118 if ((
atoi(value) == 0) || (
atoi(value) > 3))
7126 if ((
atoi(value) == 0) || (
atoi(value) > 2))
7152 if ((
atoi(value) < 0) ||
7161 if ((
atoi(value) < 0) ||
7170 if ((
atoi(value) > 51) || (
atoi(value) < -1))
7178 if ((
atof(value) > 1.0) || (
atof(value) < 0.0))
7186 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7194 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7202 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7210 if ((
atoi(value) > 10) || (
atoi(value) < 1))
7218 if ((
atof(value) > 10.0) || (
atof(value) < 0.01))
7226 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7234 if ((
atof(value) > 10.0) || (
atof(value) < 0.01))
7242 if ((
atof(value) > 1.0) || (
atof(value) < 0.1))
7250 if ((
atoi(value) > 51) || (
atoi(value) < -1))
7267 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7275 if ((
atoi(value) > 51) || (
atoi(value) < -1))
7283 if (((
atof(value) < 0.0) && (
atof(value) != -1.0)) ||
7284 (
atof(value) > 51.00))
7292 if ((
atoi(value) < 0) || (
atoi(value) > 31))
7300 if (
atoi(value) != 0 &&
atoi(value) != 1 &&
atoi(value) != 6)
7311 if ((
atoi(value) < 0 ||
atoi(value) > 6))
7322 if ((
atoi(value) < 0 ||
atoi(value) > 10))
7330 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7338 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7346 if (
atoi(value) < 0 ||
atoi(value) > 1)
7354 if (
atoi(value) < 0)
7362 if (
atoi(value) < 0 ||
atoi(value) > 255)
7370 if (
atoi(value) != 0 &&
atoi(value) != 1)
7378 if (
atoi(value) <= 0)
7386 if ((
atoi(value) < 0 ||
atoi(value) > 2) &&
7387 atoi(value) != 5 &&
atoi(value) != 6)
7399 if (
atoi(value) != 0 &&
atoi(value) != 1)
7407 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7415 if ((
atof(value) > 1.0) || (
atof(value) < 0.0))
7423 if (
atoi(value) < 0 ||
atoi(value) > 2)
7431 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7457 if (
atoi(value) < 0 ||
atoi(value) > 2)
7474 if (
atoi(value) < 1 ||
atoi(value) > 4)
7482 if (
atoi(value) < 0 ||
atoi(value) > 1)
7490 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7498 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7506 if (
atoi(value)!= 0 && ((
atoi(value) > 40 ) || (
atoi(value) < 4)))
7514 if (
atoi(value) != 0 &&
atoi(value) != 1)
7522 if (
atoi(value) != 0 &&
atoi(value) != 1)
7530 if (
atoi(value) != 0 &&
atoi(value) != 1)
7538 if (
atoi(value) < 0 ||
atoi(value) > 100)
7546 if (
atoi(value) < 0 ||
atoi(value) > 100)
7554 const char delim[2] =
",";
7557 char *v = _strdup(value);
7559 char *v = strdup(value);
7561 char *saveptr = NULL;
7572 chunk =
ni_strtok(NULL, delim, &saveptr);
7579 const char delim[2] =
",";
7582 char *v = _strdup(value);
7584 char *v = strdup(value);
7586 char *saveptr = NULL;
7594 if (
atof(chunk) <= 10)
7602 chunk =
ni_strtok(NULL, delim, &saveptr);
7609 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7617 if ((
atoi(value) != 0) && (
atoi(value) != 1))
7637 if (
atoi(value) < 0 ||
atoi(value) > 3)
7645 if (
atoi(value) < 0 ||
atoi(value) > 2)
7653 if (
atoi(value) < 0 ||
atoi(value) > 3)
7661 if (
atoi(value) < 0 ||
atoi(value) > 255)
7675 b_error |= bValueWasNull && !bNameWasBool;
7684#define atoi(p_str) ni_atoi(p_str, &b_error)
7685#define atof(p_str) ni_atof(p_str, &b_error)
7686#define atobool(p_str) (ni_atobool(p_str, &b_error))
7707 bool b_error =
false;
7708 bool bNameWasBool =
false;
7709 bool bValueWasNull = !value;
7712 char nameBuf[64] = { 0 };
7733 if (name[0] ==
'-' && name[1] ==
'-')
7739 if (strlen(name) + 1 <
sizeof(nameBuf) && strchr(name,
'_'))
7742 ni_strcpy(nameBuf,
sizeof(nameBuf), name);
7743 while ((c = strchr(nameBuf,
'_')) != 0)
7754 else if (value[0] ==
'=')
7759#if defined(_MSC_VER)
7760#define OPT(STR) else if (!_stricmp(name, STR))
7762#define OPT(STR) else if (!strcasecmp(name, STR))
7787 OPT(NI_ENC_GOP_PARAMS_G0_PIC_QP)
7791 OPT(NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC_L0)
7795 OPT(NI_ENC_GOP_PARAMS_G0_NUM_REF_POC_L0)
7799 OPT(NI_ENC_GOP_PARAMS_G0_NUM_REF_POC_L1)
7816 OPT(NI_ENC_GOP_PARAMS_G1_PIC_QP)
7820 OPT(NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC_L0)
7824 OPT(NI_ENC_GOP_PARAMS_G1_NUM_REF_POC_L0)
7828 OPT(NI_ENC_GOP_PARAMS_G1_NUM_REF_POC_L1)
7845 OPT(NI_ENC_GOP_PARAMS_G2_PIC_QP)
7849 OPT(NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC_L0)
7853 OPT(NI_ENC_GOP_PARAMS_G2_NUM_REF_POC_L0)
7857 OPT(NI_ENC_GOP_PARAMS_G2_NUM_REF_POC_L1)
7874 OPT(NI_ENC_GOP_PARAMS_G3_PIC_QP)
7878 OPT(NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC_L0)
7882 OPT(NI_ENC_GOP_PARAMS_G3_NUM_REF_POC_L0)
7886 OPT(NI_ENC_GOP_PARAMS_G3_NUM_REF_POC_L1)
7903 OPT(NI_ENC_GOP_PARAMS_G4_PIC_QP)
7907 OPT(NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC_L0)
7911 OPT(NI_ENC_GOP_PARAMS_G4_NUM_REF_POC_L0)
7915 OPT(NI_ENC_GOP_PARAMS_G4_NUM_REF_POC_L1)
7932 OPT(NI_ENC_GOP_PARAMS_G5_PIC_QP)
7936 OPT(NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC_L0)
7940 OPT(NI_ENC_GOP_PARAMS_G5_NUM_REF_POC_L0)
7944 OPT(NI_ENC_GOP_PARAMS_G5_NUM_REF_POC_L1)
7961 OPT(NI_ENC_GOP_PARAMS_G6_PIC_QP)
7965 OPT(NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC_L0)
7969 OPT(NI_ENC_GOP_PARAMS_G6_NUM_REF_POC_L0)
7973 OPT(NI_ENC_GOP_PARAMS_G6_NUM_REF_POC_L1)
7990 OPT(NI_ENC_GOP_PARAMS_G7_PIC_QP)
7994 OPT(NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC_L0)
7998 OPT(NI_ENC_GOP_PARAMS_G7_NUM_REF_POC_L0)
8002 OPT(NI_ENC_GOP_PARAMS_G7_NUM_REF_POC_L1)
8503 b_error |= bValueWasNull && !bNameWasBool;
8553 if ((!p_ctx) || (!p_data))
8570 "ERROR: %s() keep alive thread has been closed, "
8571 "hw:%d, session:%d\n",
8588 switch (device_type)
8592 int seq_change_read_count = 0;
8603 uint32_t aligned_width;
8615 ", DFVWxDFVH %u x %u, AlWid %u, AVW x AVH %u x %u\n",
8620 if (0 == retval && seq_change_read_count)
8629 else if (retval < 0)
8645 "%s (decoder): resolution change, frame size %ux%u -> %ux%u, "
8646 "width %u bit %d, pix_fromat_changed %d, actual_video_width %d, continue read ...\n",
8655 seq_change_read_count++;
8687 __func__, device_type);
8719 if ((!hwdesc) || (!p_data))
8747 bool use_external_mutex =
false;
8748 uint32_t orig_session_id = p_ctx->
session_id;
8749 ni_device_handle_t orig_blk_io_handle = p_ctx->
blk_io_handle;
8754 ni_pthread_mutex_t *p_ctx_mutex = &(p_ctx->
mutex);
8760 use_external_mutex =
true;
8773 if (use_external_mutex)
8818 "%s function not supported in FW API version < 6rt\n",
8823 switch (device_type)
8872 if ((!hwdesc) || (!p_src_data))
8906 int video_height,
int extra_len)
8908 void* p_buffer = NULL;
8909 int height_aligned = video_height;
8945 memset(p_buffer, 0, buffer_size);
8957 p_frame->
p_data[0] = NULL;
8958 p_frame->
p_data[1] = NULL;
8959 p_frame->
p_data[2] = NULL;
8994 int32_t device_handle)
9002 "%s(): ui16FrameIdx=%d sessionId=%d device_handle=0x%x\n",
9026 int32_t saved_dma_buf_fd;
9036 "%s(): ui16FrameIdx=%d sessionId=%d device_handle=0x%x\n",
9071 uint32_t pool_size, uint32_t pool)
9133 "ERROR: %s function not supported in FW API version < 6r3\n",
9140 "ERROR: can't free or expand framepool of session 0x%x "
9141 "before init framepool\n", p_ctx->
session_id);
9182 if (!p_ctx || !p_params)
9210 void *p_scaler_config = NULL;
9213 uint32_t ui32LBA = 0;
9217 if (!p_ctx || !p_params)
9219 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s() passed parameters are null!, return\n", __func__);
9241 memset(p_scaler_config, 0, buffer_size);
9247 memcpy(p_scaler_config, p_params, buffer_size);
9250 p_scaler_config, buffer_size, ui32LBA) < 0)
9253 "ERROR: ni_nvme_send_write_cmd failed: blk_io_handle: %" PRIx64
9254 ", hw_id, %d, xcoder_inst_id: %d\n",
9261 "ERROR: %s failed: blk_io_handle: %" PRIx64
","
9262 "hw_id, %d, xcoder_inst_id: %d\n",
9290 void *p_scaler_config = NULL;
9293 uint32_t ui32LBA = 0;
9297 if (!p_ctx || !p_params)
9299 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s() passed parameters are null!, return\n", __func__);
9321 memset(p_scaler_config, 0, buffer_size);
9327 memcpy(p_scaler_config, p_params, buffer_size);
9330 p_scaler_config, buffer_size, ui32LBA) < 0)
9333 "ERROR: ni_nvme_send_write_cmd failed: blk_io_handle: %" PRIx64
9334 ", hw_id, %d, xcoder_inst_id: %d\n",
9341 "ERROR: %s failed: blk_io_handle: %" PRIx64
","
9342 "hw_id, %d, xcoder_inst_id: %d\n",
9391 int rectangle_width,
9392 int rectangle_height,
9410 switch (device_type)
9414 rectangle_width, rectangle_height,
9415 rectangle_x, rectangle_y,
9416 rgba_color, frame_index);
9468 switch (device_type)
9520 "Error: %s function not supported on device with FW API version < 6rL\n",
9560 if (!p_ctx || !p_cfg)
9608 if (!p_ctx || !p_cfg_in)
9652 const int linesize[])
9657 int luma, chroma_b, chroma_r;
9664 switch (pixel_format)
9703 switch (pixel_format)
9707 luma = linesize[0] * alignedh;
9708 chroma_b = linesize[1] * alignedh / 2;
9709 chroma_r = linesize[2] * alignedh / 2;
9716 luma = linesize[0] * alignedh;
9717 chroma_b = linesize[1] * alignedh / 2;
9759 int video_width,
int video_height,
9760 int linesize[],
int alignment,
9764 void *p_buffer = NULL;
9768 int chroma_b_size = 0;
9769 int chroma_r_size = 0;
9777 switch (pixel_format)
9848 switch (pixel_format)
9852 luma_size = linesize[0] * height_aligned;
9856 chroma_b_size = linesize[1] * height_aligned / 2;
9857 chroma_r_size = linesize[2] * height_aligned / 2;
9861 chroma_b_size = luma_size / 4;
9862 chroma_r_size = luma_size / 4;
9871 luma_size = linesize[0] * video_height;
9880 luma_size = linesize[0] * height_aligned;
9881 chroma_b_size = linesize[1] * height_aligned / 2;
9888 luma_size = linesize[0] * video_height;
9889 chroma_b_size = linesize[1] * video_height;
9897 luma_size = linesize[0] * video_height;
9916 buffer_size = luma_size + chroma_b_size + chroma_r_size + extra_len;
9938 memset(p_buffer, 0, buffer_size);
9948 switch (pixel_format)
9954 p_frame->
p_data[2] = p_frame->
p_data[1] + chroma_b_size;
9955 p_frame->
p_data[3] = NULL;
9958 p_frame->
data_len[1] = chroma_b_size;
9959 p_frame->
data_len[2] = chroma_r_size;
9970 p_frame->
p_data[1] = NULL;
9971 p_frame->
p_data[2] = NULL;
9972 p_frame->
p_data[3] = NULL;
9986 p_frame->
p_data[1] = (uint8_t *)p_frame->
p_data[0] + luma_size;
9987 p_frame->
p_data[2] = NULL;
9988 p_frame->
p_data[3] = NULL;
9991 p_frame->
data_len[1] = chroma_b_size;
10002 p_frame->
p_data[1] = (uint8_t *)p_frame->
p_data[0] + luma_size;
10003 p_frame->
p_data[2] = NULL;
10004 p_frame->
p_data[3] = NULL;
10007 p_frame->
data_len[1] = chroma_b_size;
10020 p_frame->
p_data[1] = NULL;
10021 p_frame->
p_data[2] = NULL;
10022 p_frame->
p_data[3] = NULL;
10035 p_frame->
p_data[1] = (uint8_t *)p_frame->
p_data[0] + luma_size;
10036 p_frame->
p_data[2] = (uint8_t *)p_frame->
p_data[1] + chroma_b_size;
10037 p_frame->
p_data[3] = NULL;
10040 p_frame->
data_len[1] = chroma_b_size;
10041 p_frame->
data_len[2] = chroma_r_size;
10056 __func__, video_width, video_height, buffer_size);
10073 struct stat file_stat;
10075 unsigned char *buffer = NULL;
10088 if (stat(file, &file_stat) != 0)
10097 if (file_stat.st_size == 0)
10114 buffer = malloc(file_stat.st_size);
10122 if (fread(buffer, file_stat.st_size, 1, fp) != 1)
10174 ni_log2(p_ctx,
NI_LOG_ERROR,
"Error: hvsplus filter not supported on device with FW API version < 6ro\n");
10210 uint32_t buffer_size = 0;
10211 void *p_buffer = NULL;
10213 uint32_t i, this_size;
10216 if (!p_frame || !p_network)
10222 p_linfo = &p_network->
linfo;
10223 for (i = 0; i < p_network->
input_num; i++)
10231 "ERROR: %s(): invalid buffer_size of network\n", __func__);
10234 buffer_size += this_size;
10238 p_frame->
data_len[0] = buffer_size;
10271 p_frame->
p_data[1] = NULL;
10272 p_frame->
p_data[2] = NULL;
10273 p_frame->
p_data[3] = NULL;
10275 p_frame->
iovec = NULL;
10294 void *p_buffer = NULL;
10296 uint32_t buffer_size = 0;
10297 uint32_t i, data_size;
10300 if (!p_packet || !p_network)
10307 p_linfo = &p_network->
linfo;
10316 "ERROR: %s(): invalid buffer_size of network\n", __func__);
10319 buffer_size += data_size;
10321 data_size = buffer_size;
10339 "%s(): free current p_packet, p_packet->buffer_size=%u\n",
10344 __func__, buffer_size);
10383 if (!p_ctx || bitrate < NI_MIN_BITRATE || bitrate >
NI_MAX_BITRATE)
10386 __func__, bitrate);
10395 "Warning: %s(): bitrate %d overwriting current one %d\n",
10422 int32_t intra_period)
10424 if (!p_ctx || intra_period < 0 || intra_period > 1024)
10427 __func__, intra_period);
10436 "Warning: %s(): intraPeriod %d overwriting current one %d\n",
10567 int32_t ltr_interval)
10624 if (!p_ctx || framerate_num <= 0 || framerate_denom <= 0)
10627 "ERROR: %s(): invalid framerate passed in (%d/%d)\n", __func__,
10628 framerate_num, framerate_denom);
10632 if ((framerate_num % framerate_denom) != 0)
10634 uint32_t numUnitsInTick = 1000;
10635 framerate_num = framerate_num / framerate_denom;
10636 framerate_denom = numUnitsInTick + 1;
10637 framerate_num += 1;
10638 framerate_num *= numUnitsInTick;
10641 framerate_num = framerate_num / framerate_denom;
10642 framerate_denom = 1;
10645 if (((framerate_num + framerate_denom - 1) / framerate_denom) >
10649 "ERROR: %s(): invalid framerate passed in (%d/%d)\n", __func__,
10660 "Warning: %s(): framerate (%d/%d) overwriting current "
10662 __func__, framerate_num, framerate_denom,
10691 int32_t bitrate, framerate_num, framerate_denom;
10692 uint32_t maxFrameSize = (uint32_t)max_frame_size / 2000;
10693 uint32_t min_maxFrameSize;
10697 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_session_config pointer\n",
10706 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): max_frame_size is valid only when lowDelay mode is enabled\n",
10707 __func__, max_frame_size);
10720 framerate_num = (int32_t) api_param->
fps_number;
10724 min_maxFrameSize = (((uint32_t)bitrate / framerate_num * framerate_denom) / 8) / 2000;
10726 if (maxFrameSize < min_maxFrameSize)
10729 __func__, max_frame_size);
10742 "Warning: %s(): max_frame_size %d overwriting current one %d\n",
10766 int32_t minQpI, maxQpI, maxDeltaQp, minQpPB, maxQpPB;
10768 if (!p_ctx || !p_min_max_qp)
10770 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_min_max_qp pointer\n",
10775 minQpI = p_min_max_qp->
minQpI;
10776 maxQpI = p_min_max_qp->
maxQpI;
10778 minQpPB = p_min_max_qp->
minQpPB;
10779 maxQpPB = p_min_max_qp->
maxQpPB;
10781 if (minQpI > maxQpI || minQpPB > maxQpPB ||
10782 maxQpI > 51 || minQpI < 0 || maxQpPB > 51 || minQpPB < 0)
10785 __func__, minQpI, maxQpI, maxDeltaQp, minQpPB, maxQpPB);
10820 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_session_config pointer\n",
10829 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): reconfigure crf value %d is valid only in CRF mode\n",
10834 if (crf < 0 || crf > 51)
10836 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): crf value %d is invalid (valid range in [0..51])\n",
10848 "Warning: %s(): crf reconfig value %d overwriting current reconfig_crf %d\n",
10877 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_session_config pointer\n",
10886 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): reconfigure crf value %f is valid only in CRF mode\n",
10891 if (crf < 0.0 || crf > 51.0)
10893 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): crf value %f is invalid (valid range in [0..51])\n",
10905 "Warning: %s(): crf reconfig value %d overwriting current "
10906 "reconfig_crf %d, reconfig_crf_decimal %d\n", __func__,
10931 int32_t vbvMaxRate, int32_t vbvBufferSize)
10936 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_session_config pointer\n",
10940 if ((vbvBufferSize < 10 && vbvBufferSize != 0) || vbvBufferSize > 3000)
10943 __func__, vbvBufferSize);
10947 if (api_param->
bitrate > 0 && vbvMaxRate > 0 && vbvMaxRate < api_param->bitrate) {
10949 vbvMaxRate, api_param->
bitrate);
10952 if (vbvBufferSize == 0 && vbvMaxRate > 0) {
10954 "vbvBufferSize is 0, force vbvMaxRate to 0\n",
10983 int32_t bitrate, framerate_num, framerate_denom;
10984 uint32_t min_maxFrameSize, maxFrameSize;
10988 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_session_config pointer\n",
10997 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): max_frame_size_ratio is valid only when lowDelay mode is enabled\n",
10998 __func__, max_frame_size_ratio);
11002 if (max_frame_size_ratio < 1) {
11004 max_frame_size_ratio);
11017 framerate_num = (int32_t) api_param->
fps_number;
11021 min_maxFrameSize = (((uint32_t)bitrate / framerate_num * framerate_denom) / 8) / 2000;
11032 "Warning: %s(): max_frame_size %d overwriting current one %d\n",
11060 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: %s(): invalid ni_session_context_t or p_session_config pointer\n",
11069 ni_log2(p_ctx,
NI_LOG_ERROR,
"%s():not support to reconfig slice_arg when slice_mode disable.\n",
11080 int max_num_ctu_mb_row = (api_param->
source_height + ctu_mb_size - 1) / ctu_mb_size;
11081 if (sliceArg < 1 || sliceArg > max_num_ctu_mb_row)
11119 int ret, is_semi_planar;
11125 if (p_ctx == NULL || p_frame == NULL || p_frame->
p_data[3] == NULL)
11172 uexp.
fn = p_ctx->
fn;
11183 *p_surface = hwdesc;
11213 int is_semi_planar;
11219 if (p_ctx == NULL || p_frame == NULL || p_frame->
p_data[3] == NULL)
11251 *p_surface = hwdesc;
11280 struct pollfd pfds[1] = {0};
11283 if (p_upl_ctx == NULL || p_frame == NULL)
11289 if (p_frame->
p_data[3] == NULL)
11298 pfds[0].events = POLLIN;
11299 pfds[0].revents = 0;
11301 ret = poll(pfds, 1, -1);
11317 "%s: failed to attach dmabuf read fence errno %s\n", __func__,
11343 if ((p_upl_ctx == NULL) || (p_frame == NULL))
11346 p_upl_ctx, p_frame);
11352 if (p_surface == NULL)
11385 uint8_t *p_data, uint32_t len,
11392 if (p_upl_ctx == NULL || p_data == NULL || p_hwframe == NULL)
11398 if (p_hwframe->
p_data[3] == NULL)
11415 "%s: Failed to request dmabuf rendering errno %d\n", __func__,
11440 uint8_t *p_data, uint32_t
len,
11444 char bar4_name[128];
11459 snprintf(bar4_name, 128,
11460 "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/resource4",
11463 bar4_fd = open(bar4_name, O_RDWR | O_SYNC);
11470 bar4_name, errmsg);
11474 if (fstat(bar4_fd, &stat) != 0)
11483 bar4_mm = mmap(NULL, stat.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, bar4_fd, 0);
11485 if (bar4_mm == MAP_FAILED)
11495 memcpy(bar4_mm + offset, p_data, len);
11497 munmap(bar4_mm, 0);
11519 if (p_frame == NULL)
11526 if (p_surface == NULL)
11552 unsigned int offset;
11571 uexp.
fn = p_ctx->
fn;
11606 int width,
int height,
11607 int bit_depth,
int src_endian,
11613 if (p_enc_ctx == NULL || p_enc_params == NULL)
11619 if (!(bit_depth == 8) && !(bit_depth == 10))
11651 alignedw = ((width + 1) / 2) * 2;
11653 (alignedw - width) / 2 * 2;
11666 alignedh = ((height + 1) / 2) * 2;
11668 (alignedh - height) / 2 * 2;
11693 int width,
int height,
11696 if (p_upl_ctx == NULL)
11702 switch (pixel_format)
11733 p_upl_ctx->
isP2P = isP2P;
11758 int bytes_read = 0;
11774 bytes_read += (rx_size - (int)p_ctx->
meta_size);
11779 }
else if (rx_size != 0)
11808 if (p_frame == NULL)
11816 if (p_surface == NULL)
11844 int width,
int height,
int bit_depth_factor,
ni_device_type_t device_type)
11854 ni_log2(p_ctx,
NI_LOG_ERROR,
"Error: %s function not supported on device with FW API version < 5.4\n", __func__);
11865 resolution.
width = width;
11866 resolution.
height = height;
11878 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: Config sequence change not supported when spatialLayers > 1\n");
11891 ni_log2(p_ctx,
NI_LOG_DEBUG,
"%s: resolution change config - width %d height %d bit_depth_factor %d "
11892 "luma_linesize %d chroma_linesize %d\n", __func__,
11896 switch (device_type)
11907 ni_log2(p_ctx,
NI_LOG_ERROR,
"ERROR: Config sequence change not supported for device type: %d", device_type);
11925 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
11928 if ((NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_dev_info))
11939 "ERROR: %s function not supported on device with FW API version < 6.h\n",
11953 memset(buffer, 0, size);
12005 "ERROR: %s function not supported on device with FW API version < 6.O\n",
12019 memset(buffer, 0, size);
12048 void *p_buffer = NULL;
12050 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
12052 if ((NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_dev_ns_vf))
12063 "ERROR: %s function not supported on device with FW API version < 6.m\n",
12076 memset(p_buffer, 0, size);
12090 p_dev_ns_vf->
vf_id = p_dev_ns_vf_data->
vf_id;
12091 p_dev_ns_vf->
ns_id = p_dev_ns_vf_data->
ns_id;
12101 void *p_buffer = NULL;
12103 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
12105 if ((NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_dev_temp))
12116 "ERROR: %s function not supported on device with FW API version < 6rC\n",
12129 memset(p_buffer, 0, size);
12146 ni_log(
NI_LOG_DEBUG,
"%s(): current composite temperature %d on board temperature %d on die temperature %d\n",
12156 void *p_buffer = NULL;
12158 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
12160 if ((NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_dev_extra_info))
12171 "ERROR: %s function not supported on device with FW API version < 6rC\n",
12184 memset(p_buffer, 0, size);
12207 p_dev_extra_info->
fw_flavour = (uint8_t)
'-';
12231 ni_log(
NI_LOG_DEBUG,
"%s(): current composite temperature %d on board temperature %d "
12232 "on die temperature %d power consumption %d current consumption %d\n",
12260 bool is_ext_buf =
true;
12261 if (*p_log_buffer == NULL)
12269 is_ext_buf =
false;
12272 if(*p_log_buffer != NULL){
12300 uint32_t ctu, i, j;
12304 int importanceLevelCentre = p_param->
roi_demo_mode == 1 ? 40 : 10;
12305 int importanceLevelRest = p_param->
roi_demo_mode == 1 ? 10 : 40;
12310 uint32_t block_size, max_cu_size, customMapSize;
12314 uint32_t roiMapBlockUnitSize;
12315 uint32_t entryPerMb;
12321 linesize_aligned = (linesize_aligned / 8) * 8;
12322 height_aligned = (height_aligned / 8) * 8;
12328 ((linesize_aligned + max_cu_size - 1) & (~(max_cu_size - 1))) *
12329 ((height_aligned + max_cu_size - 1) & (~(max_cu_size - 1))) /
12333 customMapSize = ((block_size + 63) & (~63));
12349 ((linesize_aligned + max_cu_size - 1) & (~(max_cu_size - 1))) /
12350 roiMapBlockUnitSize;
12352 ((height_aligned + max_cu_size - 1) & (~(max_cu_size - 1))) /
12353 roiMapBlockUnitSize;
12354 numMbs = mbWidth * mbHeight;
12358 entryPerMb = (roiMapBlockUnitSize / 8) * (roiMapBlockUnitSize / 8);
12360 for (i = 0; i < numMbs; i++)
12362 bool bIsCenter = (i % mbWidth > mbWidth / 3) && (i % mbWidth < mbWidth * 2 / 3);
12363 for (j = 0; j < entryPerMb; j++)
12373 p_enc_ctx->
roi_map[i * entryPerMb + j]
12376 bIsCenter ? importanceLevelCentre : importanceLevelRest;
12380 p_enc_ctx->
roi_len = customMapSize;
12383 (sumQp + (numMbs >> 1)) / numMbs;
12391 uint32_t mbWidth = (linesize_aligned + 16 - 1) >> 4;
12393 uint32_t mbHeight = (height_aligned + 16 - 1) >> 4;
12394 uint32_t numMbs = mbWidth * mbHeight;
12395 uint32_t customMapSize =
12405 for (i = 0; i < numMbs; i++)
12407 if ((i % mbWidth > mbWidth / 3) && (i % mbWidth < mbWidth * 2 / 3))
12417 p_enc_ctx->
roi_len = customMapSize;
12419 (sumQp + (numMbs >> 1)) / numMbs;
12427 uint32_t ctuWidth = (linesize_aligned + 64 - 1) >> 6;
12429 uint32_t ctuHeight = (height_aligned + 64 - 1) >> 6;
12431 uint32_t subCtuWidth = ctuWidth * 2;
12433 uint32_t subCtuHeight = ctuHeight * 2;
12434 uint32_t numSubCtus = subCtuWidth * subCtuHeight;
12441 for (i = 0; i < numSubCtus; i++)
12443 if ((i % subCtuWidth > subCtuWidth / 3) &&
12444 (i % subCtuWidth < subCtuWidth * 2 / 3))
12460 for (i = 0; i < ctuHeight; i++)
12463 for (j = 0; j < ctuWidth; j++, ptr += 2)
12465 ctu = (i * ctuWidth + j);
12469 *(ptr + subCtuWidth);
12471 *(ptr + subCtuWidth + 1);
12481 (sumQp + (numSubCtus >> 1)) / numSubCtus;
12511 *((int32_t *)aux_data->
data) =
12533 int32_t intraprd = *((int32_t *)aux_data->
data) =
12536 "xcoder_send_frame: frame #%lu reconf "
12537 "intraPeriod %d\n",
12571 "xcoder_send_frame: frame #%lu reconf "
12572 "vui colorDescPresent %d colorPrimaries %d "
12573 "colorTrc %d colorSpace %d aspectRatioWidth %d "
12574 "aspectRatioHeight %d videoFullRange %d\n",
12605 "xcoder_send_frame: frame #%lu metadata "
12606 "use_cur_src_as_long_term_pic %d use_long_term_ref "
12646 *((int32_t *)aux_data->
data) =
12649 "xcoder_send_frame: frame #%lu reconf "
12650 "ltrInterval %d\n",
12667 *((int32_t *)aux_data->
data) =
12670 "xcoder_send_frame: frame #%lu reconf "
12671 "invalidFrameNum %d\n",
12697 "xcoder_send_frame: frame #%lu reconf "
12698 "framerate (%d/%d)\n",
12712 *((int32_t *)aux_data->
data) =
12715 "xcoder_send_frame: frame #%lu reconf "
12716 "maxFrameSize %d\n",
12731 *((int32_t *)aux_data->
data) =
12734 "xcoder_send_frame: frame #%lu reconf "
12752 *((
float *)aux_data->
data) = crf;
12754 "xcoder_send_frame: frame #%lu reconf "
12766 if ((vbvBufferSize < 10 && vbvBufferSize != 0) || vbvBufferSize > 3000)
12769 __func__, vbvBufferSize);
12772 if (p_param->
bitrate > 0 && vbvMaxRate > 0 && vbvMaxRate < p_param->bitrate) {
12774 vbvMaxRate, p_param->
bitrate);
12777 if (vbvBufferSize == 0 && vbvMaxRate > 0) {
12779 "vbvBufferSize is 0, force vbvMaxRate to 0\n",
12789 *((int32_t *)aux_data->
data) = vbvMaxRate;
12795 *((int32_t *)aux_data->
data) = vbvBufferSize;
12797 "xcoder_send_frame: frame #%lu reconfig vbvMaxRate %d vbvBufferSize "
12798 "%d by frame aux data\n",
12799 p_enc_ctx->
frame_num, vbvMaxRate, vbvBufferSize);
12808 if (maxFrameSizeRatio < 1) {
12810 maxFrameSizeRatio);
12819 int32_t bitrate, framerate_num, framerate_denom;
12820 uint32_t min_maxFrameSize, maxFrameSize;
12830 framerate_num = (int32_t) p_param->
fps_number;
12834 min_maxFrameSize = ((uint32_t)bitrate / framerate_num * framerate_denom) / 8;
12837 *((int32_t *)aux_data->
data) = maxFrameSize;
12839 "xcoder_send_frame: frame #%lu reconf "
12840 "maxFrameSizeRatio %d maxFrameSize %d\n",
12841 p_enc_ctx->
frame_num, maxFrameSizeRatio, maxFrameSize);
12854 *((int16_t *)aux_data->
data) =
12857 "xcoder_send_frame: frame #%lu reconf "
12871 "xcoder_send_frame: frame #%lu force IDR frame\n",
12886 "xcoder_send_frame: frame #%lu API reconfig BR %d\n",
12902 "xcoder_send_frame: frame #%lu API reconfig intraPeriod %d\n",
12931 "xcoder_send_frame: frame #%lu reconf "
12932 "vui colorDescPresent %d colorPrimaries %d "
12933 "colorTrc %d colorSpace %d aspectRatioWidth %d "
12934 "aspectRatioHeight %d videoFullRange %d\n",
12951 if ((retval =
ni_set_ltr(p_enc_ctx, <r))) {
12955 "xcoder_send_frame(): frame #%lu API set LTR\n",
12974 "%s(): frame %d minQpI %d maxQpI %d maxDeltaQp %d minQpPB %d maxQpPB %d\n",
12989 "xcoder_send_frame(): frame #%lu API set LTR interval %d\n",
13004 "xcoder_send_frame(): frame #%lu API set frame ref invalid "
13023 "xcoder_send_frame: frame #%lu API reconfig framerate "
13040 "xcoder_send_frame: frame #%lu API reconfig maxFrameSize %d\n",
13055 "xcoder_send_frame: frame #%lu API reconfig crf %d\n",
13071 "xcoder_send_frame: frame #%lu API reconfig crf %f\n",
13086 "xcoder_send_frame: frame #%lu API reconfig vbvMaxRate %d vbvBufferSize %d\n",
13103 "xcoder_send_frame: frame #%lu reconf maxFrameSizeRatio %d\n",
13117 "xcoder_send_frame: frame #%lu API reconfig sliceArg %d\n",
13135static int ni_tolower(
int c)
13137 if (c >=
'A' && c <=
'Z')
13147 c1 = ni_tolower(*a++);
13148 c2 = ni_tolower(*b++);
13149 }
while (c1 && c1 == c2);
13301 "g%drefPic%d specified without g%drefPic%dUsed specified!\n",
13319#ifndef DEPRECATION_AS_ERROR
13333 uint64_t ui64DestAddr,
13334 uint32_t ui32FrameSize)
13339 (void) ui64DestAddr;
13340 (void) ui32FrameSize;
13365 uint64_t ui64DestAddr, uint32_t ui32FrameSize)
13369 if ((pSession == NULL) || (source == NULL))
13385 ni_log2(pSession,
NI_LOG_ERROR,
"%s(): Can't DMA to destination (%d)\n", __func__, retval);
13413 if ((pSession == NULL) || (dmaAddrs == NULL) || (pDstFrame == NULL))
13422 "%s: FW doesn't support this operation\n", __func__);
13431 "%s(): Can't DMA from source (%d)\n", __func__, retval);
13470 switch (device_type)
13478 ni_log2(p_ctx,
NI_LOG_ERROR,
"Error: %s function not supported on device with FW API version < 5.4\n", __func__);
13490 if (video_width < NI_MIN_WIDTH || video_width >
NI_MAX_WIDTH ||
13491 video_height < NI_MIN_HEIGHT || video_height >
NI_MAX_HEIGHT)
13494 __func__, video_width, video_height);
13497 resolution.
width = video_width;
13498 resolution.
height = video_height;
13514 ni_log(
NI_LOG_ERROR,
"Failed to reconfig config the encoder session (status = %d)\n", retval);
13530 __func__, device_type);
13549 int ret = 0, i = 0;
13550 if (!p_session_ctx || !p_param || !p_ppu_config)
13557 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s: Warning ignore ppu reconfig before last config done!\n", __func__);
13566 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s: not supported on device with FW API version < 6sF\n", __func__);
13573 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s(): only supported for h264 and h265 decoder\n", __func__);
13578 if (p_dec_input_param->
hwframes != 1)
13585 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s(): not supported when disable_adaptive_buffers is disabled\n", __func__);
13588 if (p_dec_input_param->
mcmode)
13590 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s(): not supported when MulticoreJointMode is enabled\n", __func__);
13596 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s(): Error reconfig ppu1 while ppu1 is not enabled\n", __func__);
13602 ni_log2(p_session_ctx,
NI_LOG_ERROR,
"%s(): Error reconfig ppu2 while ppu2 is not enabled\n", __func__);
13615 "out of range\n", __func__, i, p_ppu_config->
ppu_w[i], p_ppu_config->
ppu_h[i]);
13619 if ((p_ppu_config->
ppu_w[i] & 1) || (p_ppu_config->
ppu_h[i] & 1))
13622 __func__, i, p_ppu_config->
ppu_w[i], p_ppu_config->
ppu_h[i]);
#define NI_MAX_FILTER_POOL_SIZE
#define NI_XCODER_REVISION_API_MAJOR_VER_IDX
#define NI_MAX_NUM_SW_FRAME_DATA_POINTERS
#define NI_MAX_NUM_DATA_POINTERS
#define NI_INVALID_IO_SIZE
#define NI_APP_ENC_FRAME_META_DATA_SIZE
#define NI_MAX_NUM_OF_DECODER_OUTPUTS
#define NI_MAX_UPLOAD_INSTANCE_FRAMEPOOL
@ NI_SCALER_OPCODE_OVERLAY
@ NI_SCALER_OPCODE_WATERMARK
#define NI_MEM_PAGE_ALIGNMENT
#define TOTAL_CPU_LOG_BUFFER_SIZE
#define NI_FW_META_DATA_SZ
@ NI_RETCODE_ERROR_LOCK_DOWN_DEVICE
@ NI_RETCODE_PARAM_WARNING_DEPRECATED
@ NI_RETCODE_PARAM_ERROR_HEIGHT_TOO_BIG
@ NI_RETCODE_PARAM_ERROR_ZERO
@ NI_RETCODE_ERROR_PERMISSION_DENIED
@ NI_RETCODE_ERROR_INVALID_SESSION
@ NI_RETCODE_ERROR_UNSUPPORTED_FW_VERSION
@ NI_RETCODE_ERROR_GET_DEVICE_POOL
@ NI_RETCODE_ERROR_UNLOCK_DEVICE
@ NI_RETCODE_PARAM_INVALID_NAME
@ NI_RETCODE_PARAM_ERROR_AREA_TOO_BIG
@ NI_RETCODE_PARAM_ERROR_HEIGHT_TOO_SMALL
@ NI_RETCODE_ERROR_INVALID_HANDLE
@ NI_RETCODE_PARAM_ERROR_TOO_BIG
@ NI_RETCODE_PARAM_INVALID_VALUE
@ NI_RETCODE_PARAM_ERROR_WIDTH_TOO_BIG
@ NI_RETCODE_ERROR_NVME_CMD_FAILED
@ NI_RETCODE_ERROR_MEM_ALOC
@ NI_RETCODE_ERROR_UNSUPPORTED_FEATURE
@ NI_RETCODE_PARAM_ERROR_OOR
@ NI_RETCODE_PARAM_ERROR_WIDTH_TOO_SMALL
@ NI_RETCODE_INVALID_PARAM
@ NI_RETCODE_PARAM_ERROR_TOO_SMALL
@ NI_RETCODE_ERROR_OPEN_DEVICE
#define NI_MAX_PPU_PARAM_EXPR_CHAR
#define IS_XCODER_DEVICE_TYPE(t)
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)
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
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.
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...
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.
const char *const g_xcoder_log_names[NI_XCODER_LOG_NAMES_ARRAY_LEN]
void ni_gop_params_check_set(ni_xcoder_params_t *p_param, char *value)
Set custom gop and prepare to check if success.
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.
#define COMPARE(STR1, STR2, STR3)
ni_retcode_t ni_ai_config_hvsplus(ni_session_context_t *p_ctx, ni_network_data_t *p_network)
configure a hvsplus filter
NI_DEPRECATED ni_device_handle_t ni_device_open(const char *p_dev, uint32_t *p_max_io_size_out)
Open device and return device device_handle if successful.
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.
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...
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,...
void ni_frame_wipe_aux_data(ni_frame_t *frame)
Free and remove all auxiliary data from the frame.
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...
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.
ni_retcode_t ni_reconfig_intraprd(ni_session_context_t *p_ctx, int32_t intra_period)
Reconfigure intraPeriod dynamically during encoding.
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.
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.
ni_retcode_t ni_frame_buffer_alloc_pixfmt(ni_frame_t *p_frame, 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...
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.
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...
ni_retcode_t ni_frame_buffer_free(ni_frame_t *p_frame)
Free frame buffer that was previously allocated with either ni_frame_buffer_alloc or ni_encoder_frame...
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.
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.
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...
void ni_device_session_context_free(ni_session_context_t *p_ctx)
Free previously allocated session context.
int ni_device_session_hwdl(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data, niFrameSurface1_t *hwdesc)
Reads YUV data from hw descriptor stored location on device.
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.
int ni_strcasecmp(const char *a, const char *b)
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...
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
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.
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.
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.
ni_retcode_t ni_device_session_close(ni_session_context_t *p_ctx, int eos_recieved, ni_device_type_t device_type)
Close device session that was previously opened by calling ni_device_session_open() If device_type is...
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...
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...
ni_event_handle_t ni_create_event(void)
Create event and return event handle if successful (Windows only)
ni_retcode_t ni_parse_customize_qpoffset_file(const char *customize_file, int8_t qp_map[][NI_CUSTOMIZE_ROI_QP_NUM])
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.
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.
ni_retcode_t ni_packet_buffer_free(ni_packet_t *p_packet)
Free packet buffer that was previously allocated with ni_packet_buffer_alloc.
int ni_device_session_hwup(ni_session_context_t *p_ctx, ni_session_data_io_t *p_src_data, niFrameSurface1_t *hwdesc)
Sends raw YUV input to uploader instance and retrieves a HW descriptor to represent it.
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.
ni_retcode_t ni_hwframe_p2p_buffer_recycle(ni_frame_t *p_frame)
Recycle hw P2P frames.
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.
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.
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 function. Copies YUV data from the software frame to the hardware P2P frame on t...
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 ...
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...
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.
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
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.
ni_retcode_t ni_hwframe_buffer_recycle2(niFrameSurface1_t *surface)
Recycle a frame buffer on card, only hwframe descriptor is needed.
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 ...
ni_retcode_t ni_hwframe_buffer_recycle(niFrameSurface1_t *surface, int32_t device_handle)
Recycle a frame buffer on card.
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.
ni_session_context_t * ni_device_session_context_alloc_init(void)
Allocate and initialize a new ni_session_context_t struct.
ni_retcode_t ni_reconfig_max_frame_size(ni_session_context_t *p_ctx, int32_t max_frame_size)
Reconfigure maxFrameSize dynamically during encoding.
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.
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...
bool ni_gop_params_check(ni_xcoder_params_t *p_param)
Check custom gop params set.
int ni_device_session_acquire(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
Acquire a P2P frame buffer from the hwupload session.
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.
ni_retcode_t ni_set_ltr_interval(ni_session_context_t *p_ctx, int32_t ltr_interval)
Set Long Term Reference interval.
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.
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 outgoing frame format for the uploader.
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.
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.
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.
ni_retcode_t ni_device_session_context_init(ni_session_context_t *p_ctx)
Initialize already allocated session context to a known state.
ni_retcode_t ni_force_idr_frame_type(ni_session_context_t *p_ctx)
Force next frame to be IDR frame during encoding.
ni_retcode_t ni_reconfig_framerate(ni_session_context_t *p_ctx, ni_framerate_t *framerate)
Reconfigure framerate dynamically during encoding.
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...
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...
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.
ni_retcode_t ni_reconfig_crf(ni_session_context_t *p_ctx, int32_t crf)
Reconfigure crf value dynamically during encoding.
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...
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 ...
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.
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.
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.
const char *const g_xcoder_preset_names[NI_XCODER_PRESET_NAMES_ARRAY_LEN]
void ni_close_event(ni_event_handle_t event_handle)
Close event and release resources (Windows only)
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.
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.
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.
ni_retcode_t ni_device_config_frame(ni_session_context_t *p_ctx, ni_frame_config_t *p_cfg)
Configure the 2D engine to work based on provided parameters.
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)
int ni_device_session_acquire_for_read(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
Acquire a P2P frame buffer from the hwupload session for P2P read.
ni_retcode_t ni_reconfig_crf2(ni_session_context_t *p_ctx, float crf)
Reconfigure crf float point value dynamically during encoding.
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.
int32_t ni_get_dma_buf_file_descriptor(const ni_frame_t *p_frame)
Get the DMA buffer file descriptor from the P2P frame.
ni_retcode_t ni_set_demo_roi_map(ni_session_context_t *p_enc_ctx)
Set up hard coded demo ROI map.
ni_retcode_t ni_set_frame_ref_invalid(ni_session_context_t *p_ctx, int32_t frame_num)
Set frame reference invalidation.
void ni_device_close(ni_device_handle_t device_handle)
Close device and release resources.
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.
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.
int ni_device_session_init_framepool(ni_session_context_t *p_ctx, uint32_t pool_size, uint32_t pool)
Sends frame pool setup info to device.
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.
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.
ni_retcode_t ni_frame_buffer_alloc_hwenc(ni_frame_t *p_frame, int video_width, int video_height, int extra_len)
Allocate memory for the hwDescriptor buffer based on provided parameters taking into account pic size...
ni_retcode_t ni_decoder_frame_buffer_alloc(ni_buf_pool_t *p_pool, ni_frame_t *p_frame, 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...
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 ...
ni_retcode_t ni_reconfig_slice_arg(ni_session_context_t *p_ctx, int16_t sliceArg)
Reconfigure sliceArg dynamically during encoding.
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 ...
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.
ni_retcode_t ni_parse_reconf_file(const char *reconf_file, int hash_map[][NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE])
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.
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,...
ni_device_handle_t ni_device_open2(const char *p_dev, ni_device_mode_t mode)
Open device and return device device_handle if successful.
ni_retcode_t ni_encoder_frame_zerocopy_adjust(ni_session_context_t *p_enc_ctx, ni_frame_t *p_frame, int video_height, const int linesize[], const uint8_t *data[], int buf_size0, int buf_size1, int buf_size2, uint8_t *buf_data0, uint8_t *buf_data1, uint8_t *buf_data2)
Check if the frame data transferred is within a frame boundary and adjust with offset if it doesn't....
ni_retcode_t ni_packet_buffer_alloc(ni_packet_t *p_packet, int packet_size)
Allocate memory for the packet buffer based on provided packet size.
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...
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.
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 ...
void ni_device_session_context_clear(ni_session_context_t *p_ctx)
Clear already allocated session context.
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)
Configure the 2D engine to work based on provided parameters.
ni_retcode_t ni_packet_buffer_free_av1(ni_packet_t *p_packet)
Free packet buffer that was previously allocated with ni_packet_buffer_alloc for AV1 packets merge.
ni_retcode_t ni_reconfig_vui(ni_session_context_t *p_ctx, ni_vui_hrd_t *vui)
Reconfigure VUI HRD dynamically during encoding.
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.
ni_retcode_t ni_reconfig_bitrate(ni_session_context_t *p_ctx, int32_t bitrate)
Reconfigure bitrate dynamically during encoding.
ni_retcode_t ni_encoder_frame_buffer_alloc(ni_frame_t *p_frame, 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 ...
#define GBRWLPARSE(OUT1, OUT2, OFF, IDX)
ni_retcode_t ni_p2p_send(ni_session_context_t *pSession, niFrameSurface1_t *source, uint64_t ui64DestAddr, uint32_t ui32FrameSize)
Initiate P2P transfer (P2P write)
int ni_device_session_write(ni_session_context_t *p_ctx, ni_session_data_io_t *p_data, ni_device_type_t device_type)
Sends data to the device If device_type is NI_DEVICE_TYPE_DECODER sends data packet to decoder If dev...
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.
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.
ni_retcode_t ni_decoder_frame_buffer_free(ni_frame_t *p_frame)
Free decoder frame buffer that was previously allocated with ni_decoder_frame_buffer_alloc,...
Public definitions for operating NETINT video processing devices for video processing.
#define NI_PARAM_AV1_MIN_WIDTH
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC1_USED
#define NI_ENC_PARAM_PASS1_QP
#define NI_ENC_PARAM_PSNR_INTERVAL
#define NI_ENC_PARAM_RDO_QUANT
#define NI_DEC_PARAM_CROP_PARAM_1
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC2
@ SESSION_RUN_STATE_NORMAL
@ SESSION_RUN_STATE_SEQ_CHANGE_DRAINING
@ SESSION_RUN_STATE_FLUSHING
struct _ni_scaler_multi_drawbox_params_t ni_scaler_multi_drawbox_params_t
#define NI_PARAM_MIN_WIDTH
#define NI_DEC_PARAM_DISABLE_REORDER
#define NI_ENC_PARAM_GOP_SIZE
#define NI_ENC_PARAM_DECODING_REFRESH_TYPE
#define NI_ENC_PARAM_INTRA_REFRESH_MODE
#define NI_MIN_CU_SIZE_MODE
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC0
#define NI_ENC_PARAM_DISABLE_AV1_TIMING_INFO
#define NI_DEC_PARAM_SCALE_0
#define NI_PARAM_MAX_HEIGHT
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC2_USED
#define AV_CODEC_DEFAULT_BITRATE
#define NI_ENC_PARAM_GOP_PRESET_IDX
#define NI_ENC_PARAM_MAX_FRAME_SIZE_BITS_LOW_DELAY
#define NI_FRAME_BIG_ENDIAN
#define NI_ENC_PARAM_ENABLE_2PASS_GOP
#define NI_DEC_PARAM_ENABLE_CPU_AFFINITY
#define NI_DEC_PARAM_SCALE_0_LONG_SHORT_ADAPT
#define NI_ENC_PARAM_FORCED_HEADER_ENABLE
#define NI_DEFAULT_CU_SIZE_MODE
#define NI_ENC_PARAM_STATIC_MMAP_THRESHOLD
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC0
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO
@ XCODER_TEST_RECONF_VBV_API
@ XCODER_TEST_RECONF_FRAMERATE_API
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP_API
@ XCODER_TEST_RECONF_FRAMERATE
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE
@ XCODER_TEST_RECONF_CRF_FLOAT
@ XCODER_TEST_RECONF_LTR_INTERVAL_API
@ XCODER_TEST_RECONF_SLICE_ARG
@ XCODER_TEST_RECONF_VUI_HRD
@ XCODER_TEST_RECONF_LTR_INTERVAL
@ XCODER_TEST_RECONF_LTR_API
@ XCODER_TEST_RECONF_INTRAPRD
@ XCODER_TEST_RECONF_SLICE_ARG_API
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP
@ XCODER_TEST_CRF_FLOAT_API
@ XCODER_TEST_RECONF_VUI_HRD_API
@ XCODER_TEST_FORCE_IDR_FRAME
@ XCODER_TEST_RECONF_BR_API
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE_API
@ XCODER_TEST_RECONF_LONG_TERM_REF
@ XCODER_TEST_RECONF_MAX_FRAME_SIZE_RATIO_API
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP_REDUNDANT
@ XCODER_TEST_INVALID_REF_FRAME_API
@ XCODER_TEST_INVALID_REF_FRAME
@ XCODER_TEST_RECONF_INTRAPRD_API
@ XCODER_TEST_RECONF_RC_MIN_MAX_QP_API_REDUNDANT
#define NI_ENC_PARAM_TUNE_BFRAME_VISUAL
#define NI_ENC_PARAM_USE_RECOMMENDED_ENC_PARAMS
#define NI_ENC_PARAM_TEMPORAL_LAYERS_ENABLE
#define NI_MAX_USE_RECOMMENDED_ENC_PARAMS
#define NI_XCODER_LOG_NAME_WARN
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC1_USED
#define NI_BEST_MODEL_LOAD_STR
#define NI_ENC_PARAM_CUSTOMIZE_ROI_QP_MAP
#define NI_ENC_PARAM_CONF_WIN_RIGHT
union _ni_enc_avc_roi_custom_map ni_enc_avc_roi_custom_map_t
encoder AVC ROI custom map (1 MB = 8bits)
#define NI_BITRATE_RECONFIG_FILE_MAX_LINES
Max number of lines supported for the bitrate reconfig file.
#define NI_DEC_PARAM_ENABLE_FOLLOW_IFRAME
#define NI_ENC_PARAM_CONF_WIN_LEFT
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC1_USED
#define NI_ENC_PARAM_LTR_REF_INTERVAL
#define NI_MIN_MAX_NUM_MERGE
#define NI_ENC_PARAM_CONSTANT_RATE_FACTOR_MAX
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC1
#define NI_ENC_PARAM_ROI_DEMO_MODE
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PICS
#define NI_ENC_PARAM_PREFERRED_TRANSFER_CHARACTERISTICS
#define NI_ENC_PARAM_CPLX_DECAY
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC2
#define NI_MIN_DYNAMIC_MERGE
#define NI_ENC_PARAM_MAX_DELTA_QP
#define NI_ENC_PARAM_QCOMP
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC3_USED
#define NI_DEC_PARAM_ENABLE_PPU_SCALE_ADAPT
#define NI_XCODER_LOG_NAMES_ARRAY_LEN
#define NI_MAX_RESOLUTION_LINESIZE
#define NI_ENC_GOP_PARAMS_G5_PIC_TYPE
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC0
#define NI_ENC_PARAM_ENABLE_CU_LEVEL_RATE_CONTROL
#define NI_ENC_PARAM_DOLBY_VISION_PROFILE
#define NI_ENC_PARAM_LTR_NEXT_INTERVAL
#define NI_DEC_PARAM_SCALE_1_ROUND
#define NI_XCODER_PRESET_NAME_MEDIUM
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PICS
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC0_USED
#define NI_ENC_PARAM_MIN_FRAMES_DELAY
#define NI_ENC_GOP_PARAMS_G3_TEMPORAL_ID
#define NI_DEC_PARAM_SCALE_0_RES_CEIL
#define NI_ENC_PARAM_MULTICORE_JOINT_MODE
#define NI_ENC_PARAM_VERTICAL_OFFSET
#define NI_ENC_PARAM_ENABLE_RATE_CONTROL
#define NI_ENC_PARAM_VIDEO_FULL_RANGE_FLAG
#define NI_ENC_PARAM_HORIZONTAL_OFFSET
#define NI_DEC_PARAM_ENABLE_ALL_SEI_PASSTHRU
#define NI_MAX_INTRA_QP_DELTA
struct _niFrameSurface1 niFrameSurface1_t
#define NI_DEC_PARAM_SCALE_1_LONG_SHORT_ADAPT
#define NI_ENC_PARAM_MAX_CONSUTIVE_SKIP_FRAME_NUMBER
#define NI_ENC_GOP_PARAMS_G7_POC_OFFSET
#define NI_MIN_FRAME_SIZE
#define NI_ENC_PARAM_ADAPTIVE_CUTREE
#define NI_DEC_PARAM_DISABLE_ADAPTIVE_BUFFERS
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC1
#define NI_ENC_PARAM_COLOR_PRIMARY
#define NI_DEC_PARAM_SEMI_PLANAR_1
#define NI_ENC_GOP_PARAMS_G6_PIC_TYPE
@ NI_PIXEL_PLANAR_FORMAT_SEMIPLANAR
@ NI_PIXEL_PLANAR_FORMAT_TILED4X4
@ NI_PIXEL_PLANAR_FORMAT_PLANAR
#define NI_ENC_PARAM_DISABLE_ADAPTIVE_BUFFERS
#define NI_ENC_PARAM_SAR_DENOM
#define NI_ENC_PARAM_ADAPTIVE_LAMDA_MODE
#define NI_VPU_ALIGN16(_x)
#define NI_ENC_PARAM_MOTION_CONSTRAINED_MODE
#define NI_ENC_REPEAT_HEADERS_ALL_I_FRAMES
#define NI_ENC_GOP_PARAMS_G4_QP_OFFSET
#define NI_ENC_GOP_PARAMS_G7_QP_OFFSET
#define NI_DEC_PARAM_ENABLE_OUT_1
#define NI_ENC_PARAM_HVSPLUS_LEVEL
#define NI_MIN_KEEP_ALIVE_TIMEOUT
#define NI_XCODER_LOG_NAME_FULL
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC2_USED
#define NI_ENC_GOP_PARAMS_G2_QP_OFFSET
#define NI_PARAM_AV1_MAX_HEIGHT
#define NI_ENC_PARAM_ALLOCATE_STRAEGY
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC1_USED
#define NI_DEC_PARAM_ENABLE_LOW_DELAY_CHECK
#define NI_XCODER_LOG_NAME_INFO
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC0_USED
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC3
#define NI_SCALER_FLAG_PC
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC2
#define NI_DEC_PARAM_SCALE_2_RES_CEIL
#define NI_PARAM_AV1_MIN_HEIGHT
#define NI_ENC_PARAM_ADAPTIVE_CRF_MODE
#define NI_ENC_PARAM_INTRA_REFRESH_MIN_PERIOD
#define NI_ENC_PARAM_SKIP_FRAME_ENABLE
#define NI_VPU_ALIGN128(_x)
#define NI_ENC_PARAM_VBV_MAXRAE
#define NI_ENC_PARAM_ENABLE_MB_LEVEL_RC
#define NI_ENC_PARAM_MIN_QP
#define NI_MAX_RESOLUTION_RGBA_WIDTH
#define NI_DEC_PARAM_FORCE_8BIT_1
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC3
#define NI_VPU_ALIGN32(_x)
#define NI_ENC_PARAM_RECONF_FILE
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC2
#define NI_ENC_PARAM_LOG_LEVEL
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC3_USED
#define NI_ENC_GOP_PARAMS_G6_TEMPORAL_ID
#define NI_ENC_GOP_PARAMS_G5_TEMPORAL_ID
#define NI_ENC_PARAM_FORCE_BFRAME_QPFACTOR
#define NI_ENC_PARAM_MAX_NUM_MERGE
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC0
#define NI_XCODER_PRESET_NAME_FAST
#define NI_ENC_ENABLE_SSIM
#define NI_CUSTOMIZE_ROI_QP_NUM
Max number of entries per line supported for the qp number.
#define NI_ENC_GOP_PARAMS_G1_QP_OFFSET
#define NI_ENC_PARAM_AV1_OP_LEVEL
#define NI_PARAM_MIN_HEIGHT
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC3
#define NI_DEC_PARAM_SCALE_1
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC1
#define NI_ENC_GOP_PARAMS_G5_POC_OFFSET
#define NI_ENC_PARAM_VBV_BUFFER_SIZE
#define NI_ENC_GOP_PARAMS_G3_POC_OFFSET
#define NI_ENC_GOP_PARAMS_G2_POC_OFFSET
#define NI_ENC_PARAM_BITRATE_WINDOW
#define NI_XCODER_PRESET_NAME_SLOWER
#define NI_ENC_PARAM_ENABLE_CPU_AFFINITY
#define NI_ENC_PARAM_CHROMA_QP_OFFSET
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC0_USED
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC0_USED
#define NI_ENC_GOP_PARAMS_G4_TEMPORAL_ID
#define NI_ENC_GOP_PARAMS_CUSTOM_GOP_SIZE
#define NI_MAX_FRAME_SIZE
#define NI_ENC_GOP_PARAMS_G3_PIC_TYPE
#define NI_DEC_PARAM_MAX_EXTRA_HW_FRAME_CNT
#define NI_ENC_PARAM_PADDING
@ NI_DEC_CROP_MODE_MANUAL
#define NI_ENC_PARAM_ENABLE_ACQUIRE_LIMIT
#define NI_ENC_RC_QP_DELTA_RANGE
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC1_USED
#define NI_DEC_PARAM_SEMI_PLANAR_2
#define NI_PARAM_AV1_MAX_WIDTH
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC3
#define NI_ENC_PARAM_PRESET
#define NI_EC_POLICY_LIMITED_ERROR
#define NI_ENC_PARAM_ROI_ENABLE
@ NI_XCODER_READ_DESC_STATE
@ NI_XCODER_GENERAL_STATE
@ NI_FRAME_AUX_DATA_BITRATE
@ NI_FRAME_AUX_DATA_SLICE_ARG
@ NI_FRAME_AUX_DATA_CRF_FLOAT
@ NI_FRAME_AUX_DATA_MAX_MIN_QP
@ NI_FRAME_AUX_DATA_FRAMERATE
@ NI_FRAME_AUX_DATA_LTR_INTERVAL
@ NI_FRAME_AUX_DATA_VBV_MAX_RATE
@ NI_FRAME_AUX_DATA_INTRAPRD
@ NI_FRAME_AUX_DATA_MAX_FRAME_SIZE
@ NI_FRAME_AUX_DATA_INVALID_REF_FRAME
@ NI_FRAME_AUX_DATA_LONG_TERM_REF
@ NI_FRAME_AUX_DATA_VBV_BUFFER_SIZE
#define NI_MAX_RESOLUTION_WIDTH
#define NI_DEC_PARAM_ENABLE_CUSTOM_SEI_PASSTHRU
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC2_USED
#define NI_ENC_PARAM_IP_RATIO
#define NI_DEC_PARAM_CROP_PARAM_2
#define NI_EC_POLICY_TOLERANT
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC3_USED
#define NI_FRAME_LITTLE_ENDIAN
#define NI_ENC_PARAM_ENABLE_AUD
#define NI_ENC_PARAM_INTRA_REFRESH_ARG
#define NI_ENC_PARAM_DISABLE_BFRAME_RDOQ
#define NI_ENC_PARAM_HVS_QP_SCALE
#define NI_ENC_PARAM_GDR_DURATION
#define NI_EC_ERR_THRESHOLD_DEFAULT
#define NI_ENC_PARAM_CONSTANT_RATE_FACTOR
#define NI_ENC_PARAM_NO_HW_MULTIPASS_SUPPORT
#define NI_MAX_DECODING_REFRESH_TYPE
#define NI_ENC_PARAM_FORCE_FRAME_TYPE
#define NI_ENC_PARAM_JPEG_QLEVEL
#define NI_MIN_CUSTOM_SEI_PASSTHRU
@ QOS_OP_CONFIG_REC_OP_CODE
#define NI_ENC_GOP_PARAMS_G6_POC_OFFSET
union _ni_enc_hevc_roi_custom_map ni_enc_hevc_roi_custom_map_t
encoder HEVC ROI custom map (1 CTU = 64bits)
#define NI_ENC_PARAM_HVS_BASE_MB_COMPLEXITY
#define NI_ENC_PARAM_TRANS_RATE
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PICS
#define NI_ENC_PARAM_ENABLE_DYNAMIC_32X32_MERGE
#define NI_ENC_GOP_PARAMS_G0_PIC_TYPE
#define NI_ENC_PARAM_ENABLE_HVS_QP
#define NI_DEC_PARAM_SCALE_1_RES_CEIL
#define NI_ENC_PARAM_ENABLE_TIMECODE
#define NI_ENC_PARAM_ENTROPY_CODING_MODE
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC3
#define NI_MAX_MAX_NUM_MERGE
#define NI_ENC_GOP_PARAMS_G7_TEMPORAL_ID
#define NI_ENC_PARAM_INTRA_QP
#define NI_ENC_PARAM_SLICE_MODE
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC0_USED
#define NI_DEC_PARAM_FORCE_8BIT_2
#define NI_DISABLE_USR_DATA_SEI_PASSTHRU
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC0
#define NI_ENC_PARAM_ENABLE_DYNAMIC_8X8_MERGE
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC2_USED
#define NI_ENC_REPEAT_HEADERS_FIRST_IDR
#define NI_ENC_PARAM_RECONF_DEMO_MODE
#define NI_ENC_GOP_PARAMS_G0_QP_OFFSET
#define NI_ENC_PARAM_STILL_IMAGE_DETECT_LEVEL
#define NI_PARAM_AV1_ALIGN_WIDTH_HEIGHT
#define NI_XCODER_PRESET_NAME_SLOW
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC1
#define NI_ENC_NEW_RC_ENABLE
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC2
#define NI_EC_POLICY_IGNORE
#define NI_DEC_PARAM_ENABLE_ADVANCED_EC
#define NI_ENC_PARAM_BASE_LAYER_ONLY
#define NI_DEC_PARAM_ENABLE_OUT_2
#define NI_ENC_PARAM_CRF_MAX_IFRAME_ENABLE
#define NI_UPLOADER_FLAG_LM
#define NI_PARAM_AV1_MAX_AREA
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC1
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC1_USED
#define NI_ENC_PARAM_MAX_FRAME_SIZE_BYTES_LOW_DELAY
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC3_USED
#define NI_CUSTOMIZE_ROI_QPOFFSET_LEVEL
Max number of lines supported for qpoffset level.
#define NI_INVALID_SESSION_ID
enum _ni_frame_aux_data_type ni_aux_data_type_t
#define NI_DEC_PARAM_EC_POLICY
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC1_USED
#define NI_ENC_PARAM_FRAME_RATE_DENOM
#define NI_ENC_PARAM_MAX_QP
#define NI_ENC_PARAM_ENABLE_VFR
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC3_USED
struct _ni_scaler_multi_watermark_params_t ni_scaler_multi_watermark_params_t
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC3_USED
#define NI_DEC_PARAM_ERROR_THRESHOLD
#define NI_ENC_PARAM_ENABLE_HVS_QP_SCALE
#define NI_ENC_GOP_PARAMS_G6_QP_OFFSET
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC0_USED
#define NI_MAX_RESOLUTION_AREA
#define NI_VPU_ALIGN4096(_x)
#define NI_ENC_PARAM_AI_ENHANCE_LEVEL
#define NI_ENC_PARAM_CACHE_ROI
#define NI_ENC_PARAM_AV1_ERROR_RESILIENT_MODE
#define NI_SCALER_FLAG_P2
#define NI_ENC_PARAM_ENABLE_AI_ENHANCE
#define NI_MAX_CUSTOM_SEI_PASSTHRU
enum _ni_codec_format ni_codec_format_t
This is an enumeration for supported codec formats.
#define NI_ENC_PARAM_GOP_LOW_DELAY
#define NI_ENC_GOP_PARAMS_G0_NUM_REF_PIC2_USED
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC0
#define NI_ENC_PARAM_LOW_DELAY
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC2
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PICS
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC0
#define NI_ENC_PARAM_PAST_FRAME_MAX_INTRA_RATIO
#define NI_ENC_PARAM_BITRATE_MODE
#define NI_ENC_PARAM_ENABLE_8X8_TRANSFORM
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PICS
#define NI_XCODER_LOG_NAME_NONE
#define NI_ENC_PARAM_CONF_WIN_TOP
#define NI_ENC_PARAM_TOL_RC_INTER
#define NI_ENC_PARAM_MAX_FRAME_SIZE_LOW_DELAY
#define NI_ENC_PARAM_ENABLE_IP_RATIO
#define NI_MAX_DYNAMIC_MERGE
#define NI_ENC_BLOCK_RC_SIZE
#define NI_DEC_PARAM_CROP_PARAM_0
#define NI_NUM_OF_PIXELS_1080P
#define NI_DEC_PARAM_SCALE_2
#define NI_ENC_PARAM_ENABLE_ALL_SEI_PASSTHRU
#define NI_ENC_PARAM_ENABLE_AI_HVSPLUS
#define NI_ENC_PARAM_VBV_BUFFER_REENCODE
#define NI_DEC_PARAM_SVC_T_DECODING_LAYER
#define NI_MIN_GOP_PRESET_IDX
#define NI_DEC_PARAM_LOW_DELAY
#define NI_DEC_PARAM_FORCE_LOW_DELAY
#define NI_DEC_PARAM_DDR_PRIORITY_MODE
#define NI_ENC_PARAM_NO_MBTREE
#define NI_ENC_PARAM_LEVEL
#define NI_DEC_PARAM_MULTICORE_JOINT_MODE
#define NI_ENC_GOP_PARAMS_G7_PIC_TYPE
#define NI_ENC_GOP_PARAMS_G1_POC_OFFSET
#define NI_ENC_PARAM_COLOR_SPACE
#define NI_MIN_INTRA_QP_DELTA
#define NI_ENC_CTB_ROW_QP_STEP
#define MAX_CHAR_IN_DEVICE_NAME
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PIC3_USED
#define NI_ENC_GOP_PARAMS_G3_QP_OFFSET
#define NI_ENC_PARAM_VBV_MINRATE
#define NI_ENC_PARAM_CU_SIZE_MODE
#define NI_ENC_PARAM_TOL_RC_INTRA
#define NI_ENC_GOP_PARAMS_G1_PIC_TYPE
#define NI_ENC_PARAM_STATISTIC_OUTPUT_LEVEL
#define NI_ENC_PARAM_USE_LOW_DELAY_POC_TYPE
#define NI_MIN_DECODING_REFRESH_TYPE
#define NI_DEC_PARAM_PKT_PTS_UNCHANGE
#define NI_ENC_PARAM_INTRA_REFRESH_RESET
#define NI_ENC_PARAM_LONG_TERM_REFERENCE_INTERVAL
#define NI_ENC_PARAM_SPATIAL_LAYERS
#define NI_EC_POLICY_BEST_EFFORT_OUT_DC
#define NI_ENC_PARAM_PB_RATIO
#define NI_DEC_PARAM_CROP_MODE_2
#define NI_ENC_GOP_PARAMS_G0_TEMPORAL_ID
#define NI_ENC_PARAM_SPATIAL_LAYER_BITRATE
#define NI_ENC_PARAM_ENABLE_DYNAMIC_16X16_MERGE
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC1_USED
#define NI_ENC_PARAM_CROP_WIDTH
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC1
#define NI_ENC_GOP_PARAMS_G1_NUM_REF_PICS
#define NI_ENC_PARAM_CROP_HEIGHT
#define NI_MIN_RESOLUTION_WIDTH_SCALER
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC0
#define NI_ENC_PARAM_GET_PSNR_MODE
#define NI_XCODER_PRESET_NAME_FASTER
#define NI_ENC_PARAM_RDO_LEVEL
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PICS
#define NI_EC_POLICY_SKIP
#define NI_ENC_PARAM_CTB_RC_MODE
#define NI_MAX_SPATIAL_LAYERS
#define NI_ENC_PARAM_TOTAL_CUTREE_DEPTH
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC0_USED
#define NI_ENC_PARAM_LOOK_AHEAD_DEPTH
#define NI_ENC_PARAM_SLICE_ARG
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC2_USED
#define NI_ENC_PARAM_BITRATE
#define NI_ENC_GOP_PARAMS_G0_POC_OFFSET
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC3
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC0_USED
#define NI_ENC_PARAM_CONF_WIN_BOTTOM
#define NI_ENC_GOP_PARAMS_G2_PIC_TYPE
#define NI_ENC_PARAM_LINK_FRAME_MAX_INTRA_RATIO
#define NI_ENC_PARAM_INTRA_QP_DELTA
#define NI_DEC_PARAM_CROP_MODE_1
#define NI_ENC_GOP_PARAMS_G4_POC_OFFSET
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC3_USED
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC2_USED
#define NI_ENC_PARAM_SAR_NUM
#define NI_XCODER_PRESET_NAME_VERYFAST
#define NI_ENC_PARAM_GEN_HDRS
#define NI_ENC_PARAM_INTRA_MB_REFRESH_ARG
#define NI_ENC_GOP_PARAMS_G5_NUM_REF_PIC1
#define NI_DEC_PARAM_REDUCE_DPB_DELAY
#define NI_ENC_PARAM_IFRAME_SIZE_RATIO
#define NI_ENC_PARAM_MASTER_DISPLAY
#define NI_ENC_PARAM_PRE_INTRA_HANDLING
#define NI_ENC_PARAM_LONG_TERM_REFERENCE_COUNT
#define NI_MAX_ASPECTRATIO
#define NI_ENC_PARAM_SPATIAL_LAYERS_REF_BASE_LAYER
#define NI_ENC_PARAM_ENABLE_PIC_SKIP
#define NI_MAX_KEEP_ALIVE_TIMEOUT
#define NI_DEC_PARAM_FORCE_8BIT_0
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PICS
#define NI_ENC_PARAM_SCENE_CHANG_DETECT_LEVEL
#define NI_PARAM_MAX_WIDTH
#define NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE
#define NI_DEFAULT_KEEP_ALIVE_TIMEOUT
#define NI_ENC_PARAM_ZEROCOPY_MODE
#define NI_ENC_PARAM_COLOR_TRANSFER_CHARACTERISTIC
#define NI_ENC_PARAM_LTR_REF_QPOFFSET
#define NI_KEEP_ALIVE_TIMEOUT
#define NI_MAX_CU_SIZE_MODE
#define NI_ENABLE_USR_DATA_SEI_PASSTHRU
#define NI_ENC_GOP_PARAMS_G4_NUM_REF_PIC1
#define NI_ENC_GOP_PARAMS_G6_NUM_REF_PIC2
#define NI_ENC_GOP_PARAMS_G7_NUM_REF_PIC2
#define NI_DEC_PARAM_SAVE_PKT
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC3
#define NI_DEC_PARAM_SCALE_2_ROUND
#define NI_SCALER_FLAG_IO
@ NI_ENC_MEM_ALLOCATE_STRATEGY_INVALID_MAX
@ NI_ENC_MEM_ALLOCATE_STRATEGY_INVALID_MIN
#define NI_DEC_PARAM_SEMI_PLANAR_0
#define NI_DEC_PARAM_SCALE_2_LONG_SHORT_ADAPT
#define NI_XCODER_PRESET_NAMES_ARRAY_LEN
#define NI_MAX_NUM_AUX_DATA_PER_FRAME
#define NI_ENC_GOP_PARAMS_G1_TEMPORAL_ID
#define NI_EC_POLICY_DEFAULT
#define NI_XCODER_PRESET_NAME_VERYSLOW
#define NI_ENC_PARAM_LONG_TERM_REFERENCE_ENABLE
#define NI_MAX_RESOLUTION_HEIGHT
#define NI_EC_POLICY_BEST_EFFORT
enum _ni_device_mode ni_device_mode_t
Device access mode enumeration.
#define NI_ENC_PARAM_INTRA_COMPENSATE_MODE
#define NI_ENC_PARAM_PROFILE
#define NI_ENC_PARAM_CU_TREE_FACTOR
#define NI_DEC_PARAM_ENABLE_USR_DATA_SEI_PASSTHRU
#define NI_ENC_PARAM_ENABLE_FILLER
#define NI_VPU_ALIGN64(_x)
#define NI_BEST_REAL_LOAD_STR
#define NI_ENC_PARAM_LTR_FIRST_GAP
#define NI_ENC_PARAM_INTRA_MB_REFRESH_MODE
#define NI_DEC_PARAM_MIN_PACKETS_DELAY
#define NI_ENC_GOP_PARAMS_G4_PIC_TYPE
#define NI_ENC_PARAM_FRAME_RATE
#define NI_ENC_GOP_PARAMS_G3_NUM_REF_PIC3
#define NI_ENC_GOP_PARAMS_G5_QP_OFFSET
#define NI_DEC_PARAM_SKIP_PTS_GUESS
#define NI_XCODER_LOG_NAME_DEBUG
#define NI_ENC_PARAM_GET_RECONSTRUCTED_MODE
#define NI_ENC_PARAM_ENABLE_COMPENSATE_QP
#define NI_ENC_GOP_PARAMS_G2_TEMPORAL_ID
#define NI_ENC_PARAM_DDR_PRIORITY_MODE
#define NI_MIN_USE_RECOMMENDED_ENC_PARAMS
#define NI_DEC_PARAM_CROP_MODE_0
#define NI_DEC_PARAM_ENABLE_PPU_SCALE_LIMIT
#define NI_ENC_PARAM_FORCE_PIC_QP_DEMO_MODE
#define NI_ENC_PARAM_CUSTOM_MIN_COEFF_DIV
#define NI_DEC_PARAM_SCALE_0_ROUND
#define NI_ENC_INLOOP_DS_RATIO
#define NI_ENC_PARAM_HIGH_TIER
#define NI_VPU_ALIGN8(_x)
#define NI_XCODER_LOG_NAME_ERROR
#define NI_ENC_PARAM_INTRA_PERIOD
#define NI_ENC_PARAM_HRD_ENABLE
#define NI_INVALID_SVCT_DECODING_LAYER
#define NI_DEC_PARAM_SURVIVE_STREAM_ERR
#define NI_ENC_GOP_PARAMS_G2_NUM_REF_PIC2_USED
#define NI_DEC_PARAM_SKIP_EXTRA_HEADERS
#define NI_ENC_PARAM_CONSTANT_RATE_FACTOR_FLOAT
#define NI_MAX_GOP_PRESET_IDX
#define NI_ENC_PARAM_MAX_CLL
#define NI_ENC_PARAM_AVCC_HVCC
#define NI_ENC_PARAM_RC_INIT_DELAY
#define NI_VPU_CEIL(_data, _align)
#define NI_ENC_PARAM_ENABLE_SMOOTH_CRF
#define NI_ENC_PARAM_CUSTOMIZE_ROI_QP_LEVEL
#define NI_ENC_PARAM_PPS_INIT_QP
#define NI_ENC_PARAM_SKIP_FRAME_INTERVAL
ni_retcode_t ni_encoder_session_open(ni_session_context_t *p_ctx)
Open a xcoder encoder instance.
ni_retcode_t ni_ai_alloc_hwframe(ni_session_context_t *p_ctx, int width, int height, int options, int pool_size, int frame_index)
ni_retcode_t ni_config_instance_set_decoder_ppu_params(ni_session_context_t *p_ctx, void *p_dec_ppu_config, int buffer_size)
Send a p_config command to configure decoding parameters.
ni_retcode_t ni_get_memory_offset(ni_session_context_t *p_ctx, const niFrameSurface1_t *hwdesc, uint32_t *p_offset)
Get an address offset from a hw descriptor.
ni_retcode_t ni_scaler_config_frame(ni_session_context_t *p_ctx, ni_frame_config_t *p_cfg)
config a frame in the scaler
ni_retcode_t ni_scaler_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 frames in the scaler
ni_retcode_t ni_decoder_session_copy_internal(ni_session_context_t *src_p_ctx, ni_session_context_t *dst_p_ctx)
Copy a xcoder decoder worker thread info.
int ni_hwupload_session_write(ni_session_context_t *p_ctx, ni_frame_t *p_frame, niFrameSurface1_t *hwdesc)
Send a YUV p_frame to upload session.
ni_retcode_t ni_encoder_session_sequence_change(ni_session_context_t *p_ctx, ni_resolution_t *p_resolution)
Send sequnce change to a xcoder encoder instance.
int ni_decoder_session_write(ni_session_context_t *p_ctx, ni_packet_t *p_packet)
Send a video p_packet to decoder.
ni_retcode_t ni_decoder_session_close(ni_session_context_t *p_ctx, int eos_recieved)
Close a xcoder decoder instance.
void ni_populate_device_capability_struct(ni_device_capability_t *p_cap, void *p_data, ni_device_handle_t device_handle, bool device_in_ctxt)
Get info from received xcoder capability.
ni_retcode_t ni_hwupload_session_query_buffer_avail(ni_session_context_t *p_ctx)
Query and acquire buffer from xcoder upload instance.
ni_retcode_t ni_scaler_session_close(ni_session_context_t *p_ctx, int eos_received)
close a scaler session
ni_retcode_t ni_ai_session_write(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
ni_retcode_t ni_config_instance_hvsplus(ni_session_context_t *p_ctx)
ni_retcode_t ni_scaler_session_query_buffer_avail(ni_session_context_t *p_ctx)
Query and acquire buffer from xcoder scaler instance.
ni_retcode_t ni_encoder_session_close(ni_session_context_t *p_ctx, int eos_recieved)
Close a xcoder encoder instance.
ni_retcode_t ni_ai_session_query_metrics(ni_session_context_t *p_ctx, ni_network_perf_metrics_t *p_metrics)
ni_retcode_t ni_encoder_session_send_eos(ni_session_context_t *p_ctx)
Flush encoder output.
ni_retcode_t ni_config_read_inout_layers(ni_session_context_t *p_ctx, ni_network_data_t *p_network)
int ni_decoder_session_read(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
Retrieve a YUV p_frame from decoder.
ni_retcode_t ni_encoder_metadata_buffer_alloc(ni_frame_t *p_frame, int extra_len)
Allocate memory for the metadata header and auxillary data for encoder input data.
ni_retcode_t ni_ai_session_read(ni_session_context_t *p_ctx, ni_packet_t *p_packet)
ni_retcode_t ni_hwframe_clone(ni_session_context_t *p_ctx, ni_frameclone_desc_t *p_frameclone_desc)
Copy a src hw frame to a dst hw frame.
int ni_xcoder_session_query_detail(ni_session_context_t *p_ctx, ni_device_type_t device_type, void *detail_data, int ver)
Query current xcoder status.
ni_retcode_t ni_ai_alloc_dst_frame(ni_session_context_t *p_ctx, niFrameSurface1_t *p_out_surface)
ni_retcode_t ni_config_instance_set_uploader_params(ni_session_context_t *p_ctx, uint32_t pool_size, uint32_t pool)
Send a p_config command to configure uploading parameters.
ni_retcode_t ni_decoder_session_open(ni_session_context_t *p_ctx)
Open a xcoder decoder instance.
ni_retcode_t ni_encoder_start_buffer_alloc(ni_frame_t *p_frame)
Allocate memory for the non-4k-aligned part at the start of YUV data for encoder input data.
ni_retcode_t ni_scaler_session_read_hwdesc(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
read a hardware descriptor from a scaler session
ni_retcode_t ni_uploader_session_close(ni_session_context_t *p_ctx)
Close an xcoder upload instance.
ni_retcode_t ni_scaler_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)
allocate a frame in the scaler
ni_retcode_t ni_decoder_session_read_desc(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
Retrieve a hw desc p_frame from decoder.
void * ni_session_keep_alive_thread(void *arguments)
decoder keep alive thread function triggers every 1 second
ni_retcode_t ni_recv_from_target(ni_session_context_t *p_ctx, const ni_p2p_sgl_t *dmaAddrs, ni_frame_t *pDstFrame)
ni_retcode_t ni_device_config_ns_qos(ni_device_handle_t device_handle, uint32_t key, uint32_t value)
Send namespace num / Opmode and SRIOv index/value to the device with specified logic block address.
ni_retcode_t ni_config_instance_network_binary(ni_session_context_t *p_ctx, void *nb_data, uint32_t nb_size)
int ni_hwupload_session_read_hwdesc(ni_session_context_t *p_ctx, niFrameSurface1_t *hwdesc)
Retrieve a HW descriptor of uploaded frame.
int ni_xcoder_session_query(ni_session_context_t *p_ctx, ni_device_type_t device_type)
Query current xcoder status.
ni_retcode_t ni_config_instance_set_scaler_params(ni_session_context_t *p_ctx, ni_scaler_params_t *p_params)
Send a p_config command to configure scaling parameters.
ni_retcode_t ni_device_get_ddr_configuration(ni_session_context_t *p_ctx)
Get DDR configuration of Quadra device.
ni_retcode_t ni_ai_session_read_hwdesc(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
read a hardware descriptor from a scaler session
ni_retcode_t ni_send_to_target(ni_session_context_t *p_ctx, niFrameSurface1_t *source, uint64_t ui64DestAddr, uint32_t ui32FrameSize)
ni_retcode_t ni_decoder_session_send_eos(ni_session_context_t *p_ctx)
Send end of stream signal to the decoder.
int ni_encoder_session_read(ni_session_context_t *p_ctx, ni_packet_t *p_packet)
ni_retcode_t ni_uploader_session_open(ni_session_context_t *p_ctx)
Open a xcoder upload instance.
ni_retcode_t ni_ai_session_open(ni_session_context_t *p_ctx)
ni_retcode_t ni_clear_instance_buf(niFrameSurface1_t *surface)
clear a particular xcoder instance buffer/data
ni_retcode_t ni_ai_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)
ni_retcode_t ni_ai_session_close(ni_session_context_t *p_ctx, int eos_recieved)
int lower_pixel_rate(const ni_load_query_t *pQuery, uint32_t ui32CurrentLowest)
int ni_hwdownload_session_read(ni_session_context_t *p_ctx, ni_frame_t *p_frame, niFrameSurface1_t *hwdesc)
Retrieve a YUV p_frame from decoder.
ni_retcode_t ni_decoder_session_flush(ni_session_context_t *p_ctx)
Flush decoder output.
ni_retcode_t ni_dump_log_all_cores(ni_session_context_t *p_ctx, void *p_data, bool gen_log_file)
int ni_scaler_session_open(ni_session_context_t *p_ctx)
Open a xcoder scaler instance.
int ni_encoder_session_write(ni_session_context_t *p_ctx, ni_frame_t *p_frame)
Send a YUV p_frame to encoder.
int ni_hwdownload_by_frame_idx(niFrameSurface1_t *hwdesc, ni_frame_t *p_frame, int is_auto_dl)
Retrieve a YUV p_frame by frame index.
Private definitions used by ni_device_api.c for video processing tasks.
struct _ni_log_fl_fw_versions ni_log_fl_fw_versions_t
struct _ni_instance_mgr_general_status ni_instance_mgr_general_status_t
#define NI_AI_HW_ALIGN_SIZE
#define NI_VERSION_CHARACTER_COUNT
ni_lat_meas_q_t * ni_lat_meas_q_create(int capacity)
Create a latency measurement queue object of a given capacity.
void ni_lat_meas_q_destroy(ni_lat_meas_q_t *frame_time_q)
Destroy a latency measurement queue object.
Utility definitions for measuring frame/packet processing time in NETINT video processing devices.
void ni_log2(const void *p_context, ni_log_level_t level, const char *fmt,...)
print log message and additional information using ni_log_callback,
void ni_log(ni_log_level_t level, const char *fmt,...)
print log message using ni_log_callback
int32_t ni_nvme_send_read_cmd(ni_device_handle_t handle, ni_event_handle_t event_handle, void *p_data, uint32_t data_len, uint32_t lba)
Compose an io read command.
int32_t ni_nvme_send_write_cmd(ni_device_handle_t handle, ni_event_handle_t event_handle, void *p_data, uint32_t data_len, uint32_t lba)
Compose a io write command.
Private definitions for interfacing with NETINT video processing devices over NVMe.
#define QUERY_GET_NVME_STATUS_R
#define QUERY_GET_EXTTRA_INFO_R
#define CONFIG_INSTANCE_SetScalerDrawBoxPara_W(sid, instance)
#define QUERY_GET_NS_VF_R
#define QUERY_GET_TEMPERATURE_R
#define IDENTIFY_DEVICE_R
#define QUERY_GET_VERSIONS_R
#define NI_DATA_BUFFER_LEN
#define NI_NVME_IDENTITY_CMD_DATA_SZ
#define CONFIG_INSTANCE_SetScalerWatermarkPara_W(sid, instance)
Definitions related to NETINT P2P kernel driver interface.
#define NETINT_IOCTL_ATTACH_RFENCE
#define NETINT_IOCTL_EXPORT_DMABUF
@ NI_DMABUF_WRITE_TO_DEVICE
#define NETINT_IOCTL_SIGNAL_RFENCE
#define NETINT_IOCTL_ISSUE_REQ
int ni_rsrc_unlock(int device_type, ni_lock_handle_t lock)
unlock a file lock
NI_DEPRECATED bool g_device_in_ctxt
ni_device_context_t * ni_rsrc_allocate_simple_direct(ni_device_type_t device_type, int guid)
Allocate resources for decoding/encoding, by designating explicitly the device to use....
int ni_rsrc_lock_and_open(int device_type, ni_lock_handle_t *lock)
lock a file lock and open a session on a device
void ni_rsrc_free_device_context(ni_device_context_t *p_device_context)
Free previously allocated device context.
int ni_rsrc_get_device_by_block_name(const char *blk_name, ni_device_type_t device_type)
Get GUID of the device by block device name and type.
void ni_rsrc_free_device_pool(ni_device_pool_t *p_device_pool)
Free all resources taken by the device pool.
NI_DEPRECATED ni_device_handle_t g_dev_handle
Public definitions for managing NETINT video processing devices.
struct _ni_device_extra_info ni_device_extra_info_t
struct _ni_device_vf_ns_id ni_device_vf_ns_id_t
LIB_API ni_device_context_t * ni_rsrc_get_device_context(ni_device_type_t type, int guid)
Allocates and returns a pointer to ni_device_context_t struct based on provided device_type and guid....
struct _ni_device_temp ni_device_temp_t
LIB_API ni_device_pool_t * ni_rsrc_get_device_pool(void)
Create and return the allocated ni_device_pool_t struct.
Private definitions used by ni_rsrc_api.cpp for management of NETINT video processing devices.
void ni_rsrc_update_record(ni_device_context_t *p_device_context, ni_session_context_t *p_session_ctx)
int ni_pthread_cond_init(ni_pthread_cond_t *cond, const ni_pthread_condattr_t *attr)
initialize condition variables
int ni_pthread_mutex_lock(ni_pthread_mutex_t *mutex)
thread mutex lock
int ni_pthread_cond_destroy(ni_pthread_cond_t *cond)
destroy condition variables
int32_t ni_parse_name(const char *arg, const char *const *names, bool *b_error)
Parse name.
ni_retcode_t ni_strncpy(char *dest, size_t dmax, const char *src, size_t slen)
int ni_posix_memalign(void **memptr, size_t alignment, size_t size)
Allocate aligned memory.
int ni_pthread_create(ni_pthread_t *thread, const ni_pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
create a new thread
ni_retcode_t ni_strncat(char *dest, size_t dmax, const char *src, size_t slen)
ni_buf_t * ni_buf_pool_get_buffer(ni_buf_pool_t *p_buffer_pool)
ni_retcode_t ni_strerror(char *dest, size_t dmax, int errnum)
int ni_pthread_mutex_destroy(ni_pthread_mutex_t *mutex)
destory a mutex
ni_retcode_t ni_strcat(char *dest, size_t dmax, const char *src)
void ni_get_hw_yuv420p_dim(int width, int height, int factor, int is_semiplanar, int plane_stride[NI_MAX_NUM_DATA_POINTERS], int plane_height[NI_MAX_NUM_DATA_POINTERS])
Get dimension information of Netint HW YUV420p frame to be sent to encoder for encoding....
char * ni_strtok(char *s, const char *delim, char **saveptr)
ni_retcode_t ni_fopen(FILE **fp, const char *filename, const char *mode)
ni_retcode_t ni_strcpy(char *dest, size_t dmax, const char *src)
uint32_t ni_ai_network_layer_size(ni_network_layer_params_t *p_param)
void ni_usleep(int64_t usec)
void ni_buf_pool_return_buffer(ni_buf_t *buf, ni_buf_pool_t *p_buffer_pool)
uint64_t ni_gettime_ns(void)
int ni_pthread_join(ni_pthread_t thread, void **value_ptr)
join with a terminated thread
void ni_get_frame_dim(int width, int height, ni_pix_fmt_t pix_fmt, int plane_stride[NI_MAX_NUM_DATA_POINTERS], int plane_height[NI_MAX_NUM_DATA_POINTERS])
Get dimension information of frame to be sent to encoder for encoding. Caller usually retrieves this ...
int ni_pthread_mutex_unlock(ni_pthread_mutex_t *mutex)
thread mutex unlock
int ni_sprintf(char *dest, size_t dmax, const char *fmt,...)
int ni_pthread_mutex_init(ni_pthread_mutex_t *mutex)
initialize a mutex
uint32_t ni_decode_power_measurement(uint32_t current_data, const uint8_t *serial_number)
decode the raw current obtained and determine power
int ni_cmp_fw_api_ver(const char ver1[], const char ver2[])
Compare two 3 character strings containing a FW API version. Handle comparision when FW API version f...
#define ni_aligned_free(p_memptr)
#define ni_memfree(p_memptr)
struct _ni_buf_pool_t * pool
ni_gop_params_t pic_param[NI_MAX_GOP_NUM]
uint8_t serial_number[20]
ni_device_info_t * p_device_info
char dev_name[NI_MAX_DEVICE_NAME_LEN]
char blk_name[NI_MAX_DEVICE_NAME_LEN]
uint8_t fl_ver_last_ran[8]
uint8_t fw_rev_nor_flash[8]
uint8_t fl_ver_nor_flash[8]
ni_device_queue_t * p_device_queue
int32_t xcoders[NI_DEVICE_TYPE_XCODER_MAX][NI_MAX_DEVICE_CNT]
uint32_t xcoder_cnt[NI_DEVICE_TYPE_XCODER_MAX]
int enable_dynamic_16x16_merge
int scene_change_detect_level
int linkFrameMaxIntraRatio
int intra_mb_refresh_mode
int preferred_transfer_characteristics
int motionConstrainedMode
int decoding_refresh_type
int enable_dynamic_32x32_merge
ni_custom_gop_params_t custom_gop_params
struct _ni_encoder_cfg_params::@16 rc
int enable_dynamic_8x8_merge
int av1_error_resilient_mode
int spatialLayerBitrate[NI_MAX_SPATIAL_LAYERS]
int crf_max_iframe_enable
float forceBframeQpfactor
int temporal_layers_enable
int pastFrameMaxIntraRatio
int av1OpLevel[NI_MAX_SPATIAL_LAYERS]
int spatial_layers_ref_base_layer
int long_term_ref_interval
int still_image_detect_level
int statistic_output_level
int enable_cu_level_rate_control
bool enable_all_sei_passthru
int max_consecutive_skip_num
int use_recommend_enc_params
int customize_roi_qp_level
bool disable_adaptive_buffers
This is a data structure for encoding parameters that have changed.
uint8_t inconsecutive_transfer
uint32_t data_len[NI_MAX_NUM_DATA_POINTERS]
ni_codec_format_t src_codec
uint32_t start_len[NI_MAX_NUM_DATA_POINTERS]
uint32_t start_buffer_size
uint8_t separate_metadata
uint32_t metadata_buffer_size
uint8_t * p_data[NI_MAX_NUM_DATA_POINTERS]
ni_pic_type_t ni_pict_type
uint16_t hor_adjust_offset
ni_aux_data_t * aux_data[NI_MAX_NUM_AUX_DATA_PER_FRAME]
uint8_t * p_metadata_buffer
ni_gop_rps_t rps[NI_MAX_REF_PIC]
uint8_t fw_share_mem_usage
uint32_t fw_share_mem_usage
uint32_t total_pixel_load
uint8_t nor_flash_fw_revision[NI_VERSION_CHARACTER_COUNT]
uint8_t last_ran_fl_version[NI_VERSION_CHARACTER_COUNT]
uint8_t nor_flash_fl_version[NI_VERSION_CHARACTER_COUNT]
uint8_t use_cur_src_as_long_term_pic
uint8_t use_long_term_ref
ni_network_layer_offset_t * inset
ni_network_layer_info_t linfo
ni_network_layer_offset_t * outset
ni_network_layer_params_t * in_param
ni_network_layer_params_t * out_param
uint32_t av1_data_len[MAX_AV1_ENCODER_GOP_NUM]
uint8_t * av1_p_buffer[MAX_AV1_ENCODER_GOP_NUM]
uint8_t * av1_p_data[MAX_AV1_ENCODER_GOP_NUM]
uint32_t av1_buffer_size[MAX_AV1_ENCODER_GOP_NUM]
uint16_t ppu_h[NI_MAX_NUM_OF_DECODER_OUTPUTS]
uint16_t ppu_w[NI_MAX_NUM_OF_DECODER_OUTPUTS]
char blk_xcoder_name[MAX_CHAR_IN_DEVICE_NAME]
int16_t reconfig_slice_arg
ni_pthread_cond_t low_delay_sync_cond
ni_event_handle_t thread_event_handle
int reconfig_vbv_max_rate
ni_thread_arg_struct_t * keep_alive_thread_args
uint64_t ppu_reconfig_pkt_pos
uint32_t keep_alive_timeout
int32_t ltr_frame_ref_invalid
char blk_dev_name[NI_MAX_DEVICE_NAME_LEN]
ni_device_handle_t sender_handle
ni_device_handle_t device_handle
ni_load_query_t load_query
ni_pthread_mutex_t * pext_mutex
uint32_t actual_video_width
uint32_t force_low_delay_cnt
int reconfig_intra_period
volatile uint64_t last_access_time
ni_enc_avc_roi_custom_map_t * avc_roi_map
void * p_master_display_meta_data
char dev_xcoder_name[MAX_CHAR_IN_DEVICE_NAME]
ni_pthread_t keep_alive_thread
ni_event_handle_t event_handle
ni_input_frame input_frame_fifo[120]
encoder:calculate PSNR start
ni_framerate_t last_framerate
int reconfig_vbv_buffer_size
uint32_t meta_size
Params used in VFR mode Done///.
ni_device_handle_t blk_io_handle
uint32_t max_nvme_io_size
ni_enc_hevc_roi_custom_map_t * hevc_roi_map
ni_long_term_ref_t ltr_to_set
int enable_low_delay_check
ni_session_run_state_t session_run_state
ni_encoder_change_params_t * enc_change_params
ni_pthread_mutex_t low_delay_sync_mutex
uint64_t session_timestamp
ni_enc_quad_roi_custom_map * roi_map
int16_t buffered_frame_index
ni_region_of_interest_t * av_rois
uint32_t active_video_width
uint32_t active_video_height
uint8_t * hevc_sub_ctu_roi_buf
ni_frame_pool_type_t pool_type
union _ni_session_data_io::@19 data
ni_event_handle_t thread_event_handle
ni_pthread_mutex_t * p_mutex
uint32_t keep_alive_timeout
ni_device_handle_t device_handle
uint64_t session_timestamp
volatile uint64_t * plast_access_time
int32_t aspectRatioHeight
int force_pic_qp_demo_mode
ni_encoder_cfg_params_t cfg_enc_params
int8_t customize_roi_qp_map[NI_CUSTOMIZE_ROI_QPOFFSET_LEVEL][NI_CUSTOMIZE_ROI_QP_NUM]
ni_ddr_priority_mode_t ddr_priority_mode
ni_frame_t * p_first_frame
ni_decoder_input_params_t dec_input_params
int use_low_delay_poc_type
int color_transfer_characteristic
int video_full_range_flag
int reconf_hash[NI_BITRATE_RECONFIG_FILE_MAX_LINES][NI_BITRATE_RECONFIG_FILE_MAX_ENTRIES_PER_LINE]
encoder AVC ROI custom map (1 MB = 8bits)
struct _ni_enc_avc_roi_custom_map::@5 field
encoder HEVC ROI custom map (1 CTU = 64bits)
struct _ni_enc_hevc_roi_custom_map::@4 field
encoder AVC ROI custom map (1 MB = 8bits)
struct _ni_enc_quad_roi_custom_map::@6 field