31 #elif defined(__linux__) || defined(__APPLE__)
32 #if defined(__linux__)
33 #include <sys/types.h>
36 #include <sys/ioctl.h>
39 #include <sys/ioctl.h>
48 #include <sys/syscall.h>
49 #include <sys/resource.h>
68 #ifdef XCODER_SIGNATURE_FILE
70 #include "../build/xcoder_signature_headers.h"
81 0x00, 0x00, 0x00, 0x01,
100 0x00, 0x00, 0x00, 0x01,
117 0x00, 0x00, 0x00, 0x01,
134 0x00, 0x00, 0x00, 0x01,
153 #define NI_LOGAN_XCODER_FAILURES_MAX 25
156 #define CHECK_ERR_RC(ctx, rc, opcode, type, hw_id, inst_id) \
158 ni_logan_instance_status_info_t err_rc_info = { 0 }; \
159 int err_rc = ni_logan_query_status_info(ctx, type, &err_rc_info, rc, opcode); \
160 rc = err_rc_info.inst_err_no; \
161 if (err_rc_info.sess_err_no || rc) ctx->rc_error_count++; else ctx->rc_error_count = 0; \
162 int tmp_rc = NI_LOGAN_RETCODE_FAILURE; \
163 if (err_rc_info.sess_err_no || ctx->rc_error_count >= NI_LOGAN_XCODER_FAILURES_MAX || \
164 (tmp_rc = ni_logan_nvme_check_error_code(rc, opcode, type, hw_id, inst_id))) { \
165 ni_log(NI_LOG_INFO, "Persistent failures detected, %s() line-%d: session_no 0x%x sess_err_no %u " \
166 "inst_err_no %u rc_error_count: %d\n", __FUNCTION__, __LINE__, *inst_id, \
167 err_rc_info.sess_err_no, err_rc_info.inst_err_no, ctx->rc_error_count); \
173 #define CHECK_ERR_RC2(ctx, rc, info, opcode, type, hw_id, inst_id) \
175 rc = info.inst_err_no; \
176 if (info.sess_err_no || rc) ctx->rc_error_count++; else ctx->rc_error_count = 0; \
177 int tmp_rc = NI_LOGAN_RETCODE_FAILURE; \
178 if (info.sess_err_no || ctx->rc_error_count >= NI_LOGAN_XCODER_FAILURES_MAX || \
179 (tmp_rc = ni_logan_nvme_check_error_code(rc, opcode, type, hw_id, inst_id))) { \
180 ni_log(NI_LOG_INFO, "Persistent failures detected, %s() line-%d: session_no 0x%x sess_err_no %u " \
181 "inst_err_no %u rc_error_count: %d\n", __FUNCTION__, __LINE__, *inst_id, \
182 info.sess_err_no, info.inst_err_no, ctx->rc_error_count); \
187 #elif defined(__linux__) || defined(__APPLE__)
188 static struct stat g_nvme_stat = {0};
190 #ifdef XCODER_SELF_KILL_ERR
191 #define CHECK_ERR_RC(ctx, rc, opcode, type, hw_id, inst_id) \
193 ni_logan_instance_status_info_t err_rc_info = { 0 }; \
194 int err_rc = ni_logan_query_status_info(ctx, type, &err_rc_info, rc, opcode); \
195 rc = err_rc_info.inst_err_no; \
196 if (err_rc_info.sess_err_no || rc) ctx->rc_error_count++; else ctx->rc_error_count = 0; \
197 if (err_rc_info.sess_err_no || ctx->rc_error_count >= NI_LOGAN_XCODER_FAILURES_MAX || \
198 ni_logan_nvme_check_error_code(rc, opcode, type, hw_id, inst_id)) { \
199 ni_log(NI_LOG_INFO, "Terminating due to persistent failures, %s() line-%d: session_no 0x%x " \
200 "sess_err_no %u inst_err_no %u rc_error_count: %d\n", __FUNCTION__, __LINE__, *inst_id, \
201 err_rc_info.sess_err_no, err_rc_info.inst_err_no, ctx->rc_error_count); \
202 kill(getpid(), SIGTERM); \
206 #define CHECK_ERR_RC2(ctx, rc, err_rc_info, opcode, type, hw_id, inst_id) \
208 rc = err_rc_info.inst_err_no; \
209 if (err_rc_info.sess_err_no || rc) ctx->rc_error_count++; else ctx->rc_error_count = 0; \
210 if (err_rc_info.sess_err_no || ctx->rc_error_count >= NI_LOGAN_XCODER_FAILURES_MAX || \
211 ni_logan_nvme_check_error_code(rc, opcode, type, hw_id, inst_id)) { \
212 ni_log(NI_LOG_INFO, "Terminating due to persistent failures, %s() line-%d: session_no 0x%x " \
213 "sess_err_no %u inst_err_no %u rc_error_count: %d\n", __FUNCTION__, __LINE__, *inst_id, \
214 err_rc_info.sess_err_no, err_rc_info.inst_err_no, ctx->rc_error_count); \
215 kill(getpid(), SIGTERM); \
219 #define CHECK_ERR_RC(ctx, rc, opcode, type, hw_id, inst_id) \
221 ni_logan_instance_status_info_t err_rc_info = { 0 }; \
222 int err_rc = ni_logan_query_status_info(ctx, type, &err_rc_info, rc, opcode); \
223 rc = err_rc_info.inst_err_no; \
224 if (err_rc_info.sess_err_no || rc) ctx->rc_error_count++; else ctx->rc_error_count = 0; \
225 int tmp_rc = NI_LOGAN_RETCODE_FAILURE; \
226 if (err_rc_info.sess_err_no || ctx->rc_error_count >= NI_LOGAN_XCODER_FAILURES_MAX || \
227 (tmp_rc = ni_logan_nvme_check_error_code(rc, opcode, type, hw_id, inst_id))) { \
228 ni_log(NI_LOG_INFO, "Persistent failures detected, %s() line-%d: session_no 0x%x sess_err_no %u " \
229 "inst_err_no %u rc_error_count: %d\n", __FUNCTION__, __LINE__, *inst_id, \
230 err_rc_info.sess_err_no, err_rc_info.inst_err_no, ctx->rc_error_count); \
236 #define CHECK_ERR_RC2(ctx, rc, err_rc_info, opcode, type, hw_id, inst_id) \
238 rc = err_rc_info.inst_err_no; \
239 if (err_rc_info.sess_err_no || rc) ctx->rc_error_count++; else ctx->rc_error_count = 0; \
240 int tmp_rc = NI_LOGAN_RETCODE_FAILURE; \
241 if (err_rc_info.sess_err_no || ctx->rc_error_count >= NI_LOGAN_XCODER_FAILURES_MAX || \
242 (tmp_rc = ni_logan_nvme_check_error_code(rc, opcode, type, hw_id, inst_id))) { \
243 ni_log(NI_LOG_INFO, "Persistent failures detected, %s() line-%d: session_no 0x%x sess_err_no %u " \
244 "inst_err_no %u rc_error_count: %d\n", __FUNCTION__, __LINE__, *inst_id, \
245 err_rc_info.sess_err_no, err_rc_info.inst_err_no, ctx->rc_error_count); \
254 #define CHECK_VPU_RECOVERY(ret) \
256 if (NI_LOGAN_RETCODE_NVME_SC_VPU_RECOVERY == ret) { \
257 ni_log(NI_LOG_TRACE, "Error, vpu reset.\n"); \
258 ret = NI_LOGAN_RETCODE_ERROR_VPU_RECOVERY; \
263 static int rotated_array_binary_search(uint64_t *lefts, uint64_t *rights, uint32_t size, uint64_t target)
269 int mid = lo + (hi - lo) / 2;
270 if (lefts[mid] <= target && target < rights[mid])
275 if (rights[mid] == 0)
282 if (rights[lo] <= rights[mid])
284 if (lefts[lo] <= target && target < lefts[mid])
297 if (rights[mid] <= target && target < rights[hi])
321 #elif defined(__linux__) || defined(__APPLE__)
323 char dir_name[128] = { 0 };
324 char file_name[128] = { 0 };
327 struct dirent *stream_folder;
328 int curr_stream_idx = 0;
329 int earliest_stream_idx = 0;
330 int max_exist_idx = 0;
331 time_t earliest_time = 0;
332 struct stat file_stat;
336 if (! p_device_context)
343 flock(p_device_context->
lock, LOCK_EX);
346 if (0 != access(dir_name, F_OK))
348 if (0 != mkdir(dir_name, S_IRWXU | S_IRWXG | S_IRWXO))
359 if (NULL == (dir = opendir(dir_name)))
368 while ((stream_folder = readdir(dir)))
370 if (! strncmp(stream_folder->d_name,
"stream", strlen(
"stream")))
372 curr_stream_idx =
atoi(&(stream_folder->d_name[strlen(
"stream")]));
373 if (curr_stream_idx > 0)
375 if (curr_stream_idx > max_exist_idx)
377 max_exist_idx = curr_stream_idx;
379 if (32 == curr_stream_idx)
390 if (max_exist_idx < 32)
392 curr_stream_idx = max_exist_idx + 1;
398 while ((stream_folder = readdir(dir)))
402 if (! strncmp(stream_folder->d_name,
"stream", strlen(
"stream")))
404 snprintf(file_name,
sizeof(file_name),
"%s/%s/pkt-0001.bin",
405 dir_name, stream_folder->d_name);
407 curr_stream_idx =
atoi(&(stream_folder->d_name[strlen(
"stream")]));
409 if (curr_stream_idx > 0 && 0 == access(file_name, F_OK))
412 if (stat(file_name, &file_stat))
419 if (0 == earliest_stream_idx ||
420 file_stat.st_mtime < earliest_time)
422 earliest_stream_idx = curr_stream_idx;
423 earliest_time = file_stat.st_mtime;
430 curr_stream_idx = earliest_stream_idx;
434 snprintf(file_name,
sizeof(file_name),
"%s/stream%02d/pkt-0001.bin",
435 dir_name, curr_stream_idx);
436 if (utime(file_name, NULL))
445 "%s/stream%02d", dir_name, curr_stream_idx);
466 flock(p_device_context->
lock, LOCK_UN);
469 snprintf(file_name,
sizeof(file_name),
"%s/process_session_id.txt",
472 fp = fopen(file_name,
"wb");
475 char number[64] = {
'\0'};
477 snprintf(number,
sizeof(number),
"proc id: %ld\nsession id: %u\n",
479 fwrite(number, strlen(number), 1, fp);
494 #elif defined(__linux__)
496 char dir_name[128] = { 0 };
497 char file_name[128] = { 0 };
500 struct dirent *stream_folder;
501 int curr_stream_idx = 0;
502 int earliest_stream_idx = 0;
503 int max_exist_idx = 0;
504 time_t earliest_time = 0;
505 struct stat file_stat;
509 if (! p_device_context)
516 flock(p_device_context->
lock, LOCK_EX);
519 if (0 != access(dir_name, F_OK))
521 if (0 != mkdir(dir_name, S_IRWXU | S_IRWXG | S_IRWXO))
532 if (NULL == (dir = opendir(dir_name)))
541 while ((stream_folder = readdir(dir)))
543 if (! strncmp(stream_folder->d_name,
"stream", strlen(
"stream")))
545 curr_stream_idx =
atoi(&(stream_folder->d_name[strlen(
"stream")]));
546 if (curr_stream_idx > 0)
548 if (curr_stream_idx > max_exist_idx)
550 max_exist_idx = curr_stream_idx;
552 if (32 == curr_stream_idx)
563 if (max_exist_idx < 32)
565 curr_stream_idx = max_exist_idx + 1;
571 while ((stream_folder = readdir(dir)))
575 if (! strncmp(stream_folder->d_name,
"stream", strlen(
"stream")))
577 curr_stream_idx =
atoi(&(stream_folder->d_name[strlen(
"stream")]));
578 if (curr_stream_idx > 0)
580 if (0 == earliest_stream_idx ||
581 file_stat.st_mtime < earliest_time)
583 earliest_stream_idx = curr_stream_idx;
584 earliest_time = file_stat.st_mtime;
590 curr_stream_idx = earliest_stream_idx;
596 "%s/stream%02d", dir_name, curr_stream_idx);
620 flock(p_device_context->
lock, LOCK_UN);
635 uint32_t model_load = 0;
636 uint32_t low_delay_mode = 0;
637 void *p_signature = NULL;
638 uint32_t buffer_size = 0;
639 void* p_buffer = NULL;
641 uint32_t ui32LBA = 0;
647 ni_log(
NI_LOG_TRACE,
"ERROR %s(): passed parameters are null!, return\n", __FUNCTION__);
711 "Setting model load with guess of 30fps\n");
767 "%" PRIx64
", hw_id, %d\n", __FUNCTION__,
777 "p_ctx->blk_io_handle=%" PRIx64
", p_ctx->hw_id=%d, "
778 "p_ctx->session_id=%d\n", __FUNCTION__,
787 session_info.
model_load = ni_logan_htonl(model_load);
798 ni_log(
NI_LOG_ERROR,
"ERROR %s(): \"lowDelay\" must be specified in low_delay_mode %d\n",
820 ": %" PRIx64
", hw_id, %d\n", __FUNCTION__,
829 memcpy(p_buffer, &keep_alive_timeout,
sizeof(keep_alive_timeout));
831 __FUNCTION__, keep_alive_timeout);
843 "failed, blk_io_handle: %" PRIx64
", hw_id, %d\n", __FUNCTION__,
850 ", p_ctx->session_id=%d\n", __FUNCTION__,
889 "p_ctx->session_id=%d\n", __FUNCTION__,
894 decoder_dump_dir_open(p_ctx);
915 ni_device_handle_t device_handle,
916 ni_event_handle_t event_handle,
920 uint32_t ui32LBA = 0;
931 if (NI_INVALID_DEVICE_HANDLE == device_handle)
942 __FUNCTION__, (int64_t) device_handle, session_id);
948 __FUNCTION__, (int64_t) device_handle, session_id);
1062 void* p_buffer = NULL;
1063 uint32_t ui32LBA = 0;
1083 ni_log(
NI_LOG_ERROR,
"Decoder_complete_info: session_id 0x%x, total frames input: %u "
1084 "buffered: %u completed: %u output: %u dropped: %u , "
1106 "p_ctx->hw_id=%d, p_ctx->session_id=%d, close_mode=1\n", __FUNCTION__,
1176 uint64_t codec_end_time = tv.tv_sec*1000000ULL + tv.tv_usec;
1193 ni_log(
NI_LOG_INFO,
"Warning Decoder HW[%d] INST[%d]-average usage equals to 0\n",
1198 "total_time:%" PRIu64
" us\n", p_ctx->
frame_num,
1220 uint32_t sent_size = 0;
1221 uint32_t packet_size = 0;
1222 uint32_t write_size_bytes = 0;
1223 uint32_t actual_sent_size = 0;
1224 uint32_t pkt_chunk_count = 0;
1227 int query_retry = 0;
1228 uint32_t ui32LBA = 0;
1229 #ifdef MEASURE_LATENCY
1230 struct timespec logtv;
1231 uint64_t abs_time_ns;
1236 if (!p_ctx || !p_packet)
1250 #ifdef MEASURE_LATENCY
1255 clock_gettime(CLOCK_REALTIME, &logtv);
1256 abs_time_ns = (logtv.tv_sec*1000000000LL+logtv.tv_nsec);
1258 ni_logan_lat_meas_q_add_entry(p_ctx->
frame_time_q, abs_time_ns, p_packet->
dts);
1263 int current_pkt_size = p_packet->
data_len;
1277 "buf size %u < pkt size %u , retry: %d\n", retval,
1286 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1288 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1320 "p_packet->sent_size=%d, p_packet->data_len=%d, "
1321 "p_packet->start_of_stream=%d, p_packet->end_of_stream=%d, "
1322 "p_packet->video_width=%d, p_packet->video_height=%d\n",
1327 uint32_t send_count = 0;
1328 uint8_t* p_data = (uint8_t*)p_packet->
p_data;
1335 p_dec_packet_info->packet_size = packet_size;
1357 p_data, packet_size, ui32LBA);
1377 char dump_file[128] = { 0 };
1378 long curr_pkt_num = ((long)p_ctx->
pkt_num %
1381 snprintf(dump_file,
sizeof(dump_file),
"%s/pkt-%04ld.bin",
1384 FILE *f = fopen(dump_file,
"wb");
1387 fwrite(p_packet->
p_data, sent_size, 1, f);
1467 "%d\n", __FUNCTION__, retval);
1475 "sent_size = %u, available_space = %u, status=%d\n", __FUNCTION__,
1476 p_ctx->
pkt_num, (uint64_t)p_packet->
pos, sent_size,
1483 __FUNCTION__, retval, p_ctx->
status);
1512 pts = reordered_pts;
1526 pts = reordered_pts;
1543 uint64_t frame_offset = 0;
1546 uint8_t* p_data_buffer = (uint8_t*) p_frame->
p_buffer;
1552 int frame_cycle = 0;
1553 uint32_t total_bytes_to_read = 0;
1554 uint32_t read_size_bytes = 0;
1555 uint32_t actual_read_size = 0;
1556 int keep_processing = 1;
1558 int query_retry = 0;
1563 uint32_t ui32LBA = 0;
1564 unsigned int bytes_read_so_far = 0;
1565 int64_t drop_dts = 0;
1566 uint8_t alloc_extra_metadata = 0;
1567 void *p_metadata_buffer = NULL;
1569 #ifdef MEASURE_LATENCY
1570 struct timespec logtv;
1571 uint64_t abs_time_ns;
1576 if (!p_ctx || !p_frame)
1593 p_frame->
data_len[2] + metadata_hdr_size;
1609 retval, query_retry);
1611 if (query_retry >= 1000)
1616 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1618 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1623 total_bytes_to_read = metadata_hdr_size;
1631 ni_log(
NI_LOG_TRACE,
"Info dec query, ready_to_close %u, ready_to_flush %u, ctx status %d,"
1646 ni_log(
NI_LOG_INFO,
"Info eos reached or flush buffers exceeding max retries: is_flushed %u try %d.\n",
1663 " retrying ..\n", query_retry);
1664 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1666 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1684 (query_retry < max_query_retries))
1690 "size %u >= required size %u !\n",
1697 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1699 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1703 else if (p_ctx->
frame_num + decoder_reorder_delay < p_ctx->pkt_num &&
1708 "from the decoder, increase reorder count: %d, received frame_num: "
1709 "%" PRIu64
", sent pkt_num: %" PRIu64
", sending another packet.\n",
1718 "from the decoder, assume dropped, received frame_num: "
1719 "%" PRIu64
", sent pkt_num: %" PRIu64
", pkt_num-frame_num: "
1720 "%d, sending another packet.\n", p_ctx->
frame_num,
1761 "to %ux%u, reorder_delay=%u\n",
1779 #ifdef XCODER_SELF_KILL_ERR
1783 kill(getpid(), SIGTERM);
1799 p_frame->
data_len[2] + metadata_hdr_size;
1800 p_data_buffer = (uint8_t*) p_frame->
p_buffer;
1804 "available: %u\n", p_frame->
buffer_size, total_bytes_to_read,
1835 p_data_buffer = (uint8_t *)p_metadata_buffer;
1836 p_frame->
p_buffer = p_metadata_buffer;
1838 alloc_extra_metadata = 1;
1842 "cr len %d cb len %d hdr %d\n", total_bytes_to_read,
1844 p_frame->
data_len[2], metadata_hdr_size);
1850 "or more than buffer allocated (%u)\n", __FUNCTION__,
1863 p_data_buffer, read_size_bytes, ui32LBA);
1895 total_bytes_to_read = total_bytes_to_read + sei_size;
1898 "sei %d sei_size %d frame_cycle %d\n", __FUNCTION__, retval,
1899 total_bytes_to_read, sei_size, frame_cycle);
1902 bytes_read_so_far = total_bytes_to_read;
1950 if (p_frame->
pts >= p_frame->
dts && p_frame->
pts - p_frame->
dts < 1000)
2000 p_frame->
pts = guess_correct_pts(p_ctx, p_frame->
pts, p_frame->
dts, p_ctx->
last_pts);
2013 "p_frame->end_of_stream=%d p_frame->video_width=%d "
2028 #ifdef MEASURE_LATENCY
2034 clock_gettime(CLOCK_REALTIME, &logtv);
2035 abs_time_ns = (logtv.tv_sec*1000000000LL+logtv.tv_nsec);
2040 ni_logan_lat_meas_q_check_latency(p_ctx->
frame_time_q, abs_time_ns, p_frame->
dts),
2050 ni_log(
NI_LOG_ERROR,
"ni_logan_decoder_session_read(): bad exit, retval = %d\n",retval);
2051 void* p_buffer = NULL;
2052 void* p_debug_data_buffer = NULL;
2055 uint32_t debug_dataLen;
2063 memset(p_buffer, 0, dataLen);
2078 ni_log(
NI_LOG_ERROR,
"DEBUG INFO(): Core[%d][%d] ErrInst 0x%x, PktTotal %d, PktSize 0x%x, BufAddr 0x%x, WrPtr 0x%x, RdPtr 0x%x, Size %d\n",
2102 char dump_info_file[128] = { 0 };
2103 char dump_data_file[128] = { 0 };
2104 char dump_info[256] = { 0 };
2111 localtime_s(&cur_tm, (time_t*)&tv.tv_sec);
2113 localtime_r((time_t*)&tv.tv_sec, &cur_tm);
2116 decoder_dump_dir_create(p_ctx);
2118 snprintf(cur_date,20,
"%d-%02d-%02d", cur_tm.tm_year+1900,cur_tm.tm_mon+1,cur_tm.tm_mday);
2119 snprintf(cur_time,20,
"%02d_%02d_%02d", cur_tm.tm_hour,cur_tm.tm_min,cur_tm.tm_sec);
2123 snprintf(dump_info_file,
sizeof(dump_info_file),
"%s/%s_%s_%u_%u_%u_DEBUG_INFO.txt",
2130 FILE *fp_info = fopen(dump_info_file,
"wb");
2137 snprintf(dump_info,
sizeof(dump_info),
"DEBUG INFO(): Core[%d][%d] ErrInst 0x%x, PktTotal %d, PktSize 0x%x, BufAddr 0x%x, WrPtr 0x%x, RdPtr 0x%x, Size %d\n",
2150 fwrite(dump_info, strlen(dump_info), 1, fp_info);
2156 snprintf(dump_data_file,
sizeof(dump_data_file),
"%s/%s_%s_%u_%u_%u_DEBUG_DATA.bin",
2163 FILE *fp_data = fopen(dump_data_file,
"wb");
2172 memset(p_buffer, 0, dataLen);
2188 ni_logan_instance_debugInfo.ui8DataPktSeqNum,
2189 ni_logan_instance_debugInfo.ui8DataPktSeqTotal - 1);
2193 memset(p_debug_data_buffer, 0, debug_dataLen);
2208 fwrite(p_debug_data_buffer, debug_dataLen, 1, fp_data);
2226 if (alloc_extra_metadata && p_metadata_buffer)
2276 "active_contexts %d temperature %d\n", __FUNCTION__,
2295 uint32_t buffer_size = 0;
2296 void *p_signature = NULL;
2298 uint32_t model_load = 0;
2300 void* p_buffer = NULL;
2302 int query_retry = 0;
2303 uint32_t ui32LBA = 0;
2325 for (c = 0; c < 20; c++)
2426 "%" PRIx64
", hw_id, %d\n", __FUNCTION__,
2436 "blk_io_handle=%" PRIx64
", p_ctx->hw_id=%d, p_ctx->session_id=%d\n",
2449 session_info.
model_load = ni_logan_htonl(model_load);
2450 #ifdef ENCODER_SYNC_QUERY
2479 "%" PRIx64
", hw_id, %d\n", __FUNCTION__,
2489 memcpy(p_buffer, &keep_alive_timeout,
sizeof(keep_alive_timeout));
2491 __FUNCTION__, keep_alive_timeout);
2503 "failed blk_io_handle: %" PRIx64
", hw_id, %d\n", __FUNCTION__,
2514 ni_log(
NI_LOG_DEBUG,
"Warning: ni_logan_config_instance_set_encoder_params() vpu recovery\n");
2519 ni_log(
NI_LOG_ERROR,
"ERROR: calling ni_logan_config_instance_set_encoder_params(): p_ctx->device_handle="
2520 "%" PRIx64
", p_ctx->hw_id=%d, p_ctx->session_id=%d\n",
2567 "inst_err_no %u inst_info.wr_buf_avail_size %d retry ..\n",
2581 "p_ctx->hw_id=%d, p_ctx->session_id=%d\n", __FUNCTION__,
2652 void* p_buffer = NULL;
2653 uint32_t ui32LBA = 0;
2673 ni_log(
NI_LOG_ERROR,
"Encoder_complete_info: session_id 0x%x, total frames input: %u "
2674 "buffered: %u completed: %u output: %u dropped: %u , "
2696 "p_ctx->session_id=%d, close_mode=1\n", __FUNCTION__,
2765 uint64_t codec_end_time = tv.tv_sec*1000000ULL + tv.tv_usec;
2777 ni_log(
NI_LOG_INFO,
"Warning Encoder HW[%d] INST[%d]-average usage equals to 0\n",
2806 uint32_t send_count = 0;
2808 uint32_t tx_size = 0, aligned_tx_size = 0;
2809 uint32_t sent_size = 0;
2810 uint32_t frame_size_bytes = 0;
2815 #ifdef MEASURE_LATENCY
2816 struct timespec logtv;
2817 uint64_t abs_time_ns;
2822 if (!p_ctx || !p_frame)
2838 #ifdef MEASURE_LATENCY
2843 clock_gettime(CLOCK_REALTIME, &logtv);
2844 abs_time_ns = (logtv.tv_sec*1000000000LL+logtv.tv_nsec);
2846 ni_logan_lat_meas_q_add_entry(p_ctx->
frame_time_q, abs_time_ns, p_frame->
dts);
2870 ni_log(
NI_LOG_TRACE,
"ERROR: passed video_height and video_width are not valid! return\n");
2902 "available buf size %u < frame size %u !\n", send_count, retval,
2914 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
2916 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
2964 "frame->force_key_frame %d force frame_num %" PRIu64
" type to %d"
2965 "p_param->intra_refresh_reset %d\n", __FUNCTION__,
2985 ni_log(
NI_LOG_TRACE,
"%s(): %d.%d p_ctx->frame_num=%" PRIu64
", p_frame->start_of_stream=%u, end_of_stream=%u, "
2986 "video_width=%u, video_height=%u, pts=0x%08x 0x%08x, dts=0x%08x 0x%08x, sei_len=%u, roi size=%u "
2987 "avg_qp=%u reconf_len=%u force_pic_qp=%u force_headers=%u frame_force_type_enable=%u frame_force_type=%u "
2988 "force_pic_qp_enable=%u force_pic_qp_i/p/b=%u use_cur_src_as_long_term_pic %u use_long_term_ref %u\n",
2992 (uint32_t)((p_frame->
pts >> 32) & 0xFFFFFFFF),
2993 (uint32_t)(p_frame->
pts & 0xFFFFFFFF),
2994 (uint32_t)((p_frame->
dts >> 32) & 0xFFFFFFFF),
2995 (uint32_t)(p_frame->
dts & 0xFFFFFFFF),
3042 ni_log(
NI_LOG_ERROR,
"ERROR %s(): ni_logan_timestamp_register() for dts returned: %d\n", __FUNCTION__, retval);
3045 if (isseparate_metadata)
3049 uint32_t ui32LBA_MetaData =
3052 "%s: separate_metadata case: "
3053 "p_data = %p, p_buffer = %p, "
3054 "p_data_len[3] = %u, extra_data_len = %u, "
3055 "p_ctx->frame_num = %" PRIu64
", ui32LBA_MetaData = 0x%x, ui32LBA = 0x%x\n",
3069 p_frame->
p_data[3], sent_size,
3083 "%s: separate_metadata case: "
3084 "p_data[0] = %p, data_len[0] = %x, "
3085 "p_data[1] = %p, data_len[1] = %x, "
3086 "p_data[2] = %p, data_len[2] = %x, "
3087 "p_ctx->frame_num = %" PRIu64
", LBA = 0x%x\n",
3100 p_frame->
p_data[0], sent_size,
3117 "p_ctx->frame_num = %"PRIu64
", LBA = 0x%x\n", __FUNCTION__,
3119 sent_size = frame_size_bytes;
3126 p_frame->
p_buffer, sent_size, ui32LBA);
3138 size = frame_size_bytes;
3157 uint32_t actual_read_size = 0, chunk_size, end_of_pkt;
3158 uint32_t actual_read_size_aligned = 0;
3159 int reading_partial_pkt = 0;
3160 uint32_t to_read_size = 0;
3162 uint32_t query_return_size = 0;
3163 uint8_t* p_data = NULL;
3165 uint32_t ui32LBA = 0;
3166 uint32_t query_retry = 0;
3171 #ifdef MEASURE_LATENCY
3172 struct timespec logtv;
3173 uint64_t abs_time_ns;
3178 if (!p_ctx || !p_packet || !p_packet->
p_data)
3210 "frame_num=%"PRIu64
", pkt_num=%"PRIu64
" reading_partial_pkt %d\n",
3212 p_ctx->
pkt_num, reading_partial_pkt);
3248 "latency mode %d, buf_full %d eos sent %d, frame_num %"PRIu64
" "
3249 ">= %"PRIu64
" pkt_num, retry limit exceeded and exit encoder "
3264 " %d, reading_partial_pkt %d, frame_num %"PRIu64
" >= %"PRIu64
" "
3265 "pkt_num, keep querying.\n",
3270 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
3272 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
3301 if ((to_read_size + actual_read_size_aligned) > p_packet->
buffer_size)
3305 to_read_size + actual_read_size_aligned, p_packet->
buffer_size);
3311 (uint8_t *)p_packet->
p_data + actual_read_size_aligned,
3312 to_read_size, ui32LBA);
3325 actual_read_size_aligned);
3338 if (0 == actual_read_size)
3344 memmove((uint8_t *)p_packet->
p_data + actual_read_size,
3345 (uint8_t*)p_packet->
p_data + actual_read_size_aligned +
3347 actual_read_size += chunk_size;
3350 actual_read_size_aligned = actual_read_size;
3358 __FUNCTION__, chunk_size, actual_read_size, actual_read_size_aligned,
3363 reading_partial_pkt = 1;
3364 goto enc_read_query;
3367 p_packet->
data_len = actual_read_size;
3394 "video_width=%d, video_height=%d, dts=0x%08x 0x%08x, pts=0x%08x 0x%08x, "
3395 "type=%u, avg_frame_qp=%u\n", __FUNCTION__, p_ctx->
hw_id,
3398 (uint32_t)((p_packet->
dts >> 32) & 0xFFFFFFFF),
3399 (uint32_t)(p_packet->
dts & 0xFFFFFFFF),
3400 (uint32_t)((p_packet->
pts >> 32) & 0xFFFFFFFF),
3401 (uint32_t)(p_packet->
pts & 0xFFFFFFFF), p_packet->
frame_type,
3405 __FUNCTION__, p_packet->
data_len, size);
3407 if (p_ctx->
pkt_num % 500 == 0)
3416 #ifdef MEASURE_LATENCY
3422 clock_gettime(CLOCK_REALTIME, &logtv);
3423 abs_time_ns = (logtv.tv_sec*1000000000LL+logtv.tv_nsec);
3428 ni_logan_lat_meas_q_check_latency(p_ctx->
frame_time_q, abs_time_ns, p_packet->
dts),
3473 "active_contexts %d temperature %d\n", __FUNCTION__,
3500 void* p_buffer = NULL;
3502 uint32_t ui32LBA = 0;
3508 if (!p_ctx || !p_gen_status)
3533 memset(p_buffer, 0, dataLen);
3573 void* p_buffer = NULL;
3575 uint32_t ui32LBA = 0;
3581 if (!p_ctx || !p_stream_info)
3612 memset(p_buffer, 0, dataLen);
3659 void* p_buffer = NULL;
3660 uint32_t ui32LBA = 0;
3666 if (!p_ctx || !p_status_info)
3697 memset(p_buffer, 0, dataLen);
3741 "query timestamp:%" PRIu64
", sess_err_no:%d\n",
3779 "completed: %u output: %u dropped: %u ,inst_errors: %u\n",
3821 void* p_buffer = NULL;
3823 uint32_t ui32LBA = 0;
3830 if (!p_ctx || !p_inst_buf_info)
3883 memset(p_buffer, 0, dataLen);
3927 uint32_t ui32LBA = 0;
3928 void * p_buffer = NULL;
3929 uint32_t buffer_size = 0;
3957 memset(p_buffer, 0, buffer_size);
4017 uint32_t ui32LBA = 0;
4073 uint32_t ui32LBA = 0;
4128 uint32_t ui32LBA = 0;
4178 void* p_encoder_config = NULL;
4182 uint32_t ui32LBA = 0;
4207 memset(p_encoder_config, 0, buffer_size);
4231 snprintf(&str_vui[i * 3], 4,
"%.2x ", p_cfg->
ui8VuiRbsp[i]);
4266 p_encoder_config, buffer_size, ui32LBA);
4273 ni_log(
NI_LOG_TRACE,
"ERROR: ni_logan_nvme_send_write_cmd failed: blk_io_handle: %" PRIx64
", "
4279 ni_log(
NI_LOG_TRACE,
"ERROR: ni_logan_encoder_session_close failed: blk_io_handle: %" PRIx64
", "
4296 static int find_sei(uint32_t sei_header,
4299 uint32_t *pSeiOffset,
4304 if ( (!pEntry) || (!pSeiOffset) || (!pSeiSize) )
4309 if (sei_header & (1 << type))
4311 *pSeiOffset = pEntry[type].
offset;
4312 *pSeiSize = pEntry[type].
size;
4314 __FUNCTION__, type, *pSeiOffset, *pSeiSize);
4322 static int find_prefix_suffix_t35(uint32_t sei_header,
4326 uint32_t *pCcOffset,
4332 if (!pEntry || !pCcOffset || !pCcSize)
4343 if (sei_header & (1 << type))
4345 ptr = (uint8_t*) pEntry + pEntry[type].offset;
4352 *pCcOffset = pEntry[type].
offset;
4353 *pCcSize = pEntry[type].
size;
4354 ni_log(
NI_LOG_TRACE,
"%s: close Caption SEI found in T.35 type %d, offset: %u size: %u\n",
4355 __FUNCTION__, type, *pCcOffset, *pCcSize);
4364 *pCcOffset = pEntry[type].
offset;
4365 *pCcSize = pEntry[type].
size;
4367 __FUNCTION__, type, *pCcOffset, *pCcSize);
4376 static int find_t35_sei(uint32_t sei_header,
4379 uint32_t *pCcOffset,
4384 if ( (!pEntry) || (!pCcOffset) || (!pCcSize) )
4389 *pCcOffset = *pCcSize = 0;
4392 if (find_prefix_suffix_t35(sei_header, t35_type, pEntry,
4394 pCcOffset, pCcSize) ||
4395 find_prefix_suffix_t35(sei_header, t35_type, pEntry,
4397 pCcOffset, pCcSize) ||
4398 find_prefix_suffix_t35(sei_header, t35_type, pEntry,
4400 pCcOffset, pCcSize) ||
4401 find_prefix_suffix_t35(sei_header, t35_type, pEntry,
4403 pCcOffset, pCcSize) ||
4404 find_prefix_suffix_t35(sei_header, t35_type, pEntry,
4406 pCcOffset, pCcSize) ||
4407 find_prefix_suffix_t35(sei_header, t35_type, pEntry,
4426 uint32_t rx_size = read_length;
4428 if (!p_frame || !p_frame_offset)
4434 uint8_t* p_buf = (uint8_t*) p_frame->
p_buffer;
4436 *p_frame_offset = 0;
4439 unsigned int video_data_size = p_frame->
data_len[0] + p_frame->
data_len[1] + \
4440 p_frame->data_len[2] + ((is_hw_frame) ? p_frame->
data_len[3] : 0);
4442 __FUNCTION__, rx_size, video_data_size, metadata_size);
4446 if (rx_size == metadata_size)
4448 video_data_size = 0;
4451 if (rx_size > video_data_size)
4457 rx_size -= metadata_size;
4468 "cropBottom=%u, cropTop=%u, frame_offset=%" PRIu64
", pic=%ux%u %dbits, pict_type=%d, "
4469 "crop=%ux%u, sei header: 0x%0x number %u size %u \n", __FUNCTION__,
4490 uint32_t ui32CCOffset = 0, ui32CCSize = 0;
4497 &ui32CCOffset, &ui32CCSize))
4501 video_data_size + metadata_size + ui32CCOffset;
4514 &ui32CCOffset, &ui32CCSize))
4518 ptr = (uint8_t*)pEntry + ui32CCOffset;
4521 ui32CCSize = (ptr[8] & 0x1F) * 3;
4527 + ui32CCOffset + 10;
4532 "size %u meta size %u off %u + 10\n", __FUNCTION__,
4534 metadata_size, ui32CCOffset);
4543 &ui32CCOffset, &ui32CCSize))
4547 video_data_size + metadata_size + ui32CCOffset;
4572 &ui32CCOffset, &ui32CCSize))
4576 video_data_size + metadata_size + ui32CCOffset;
4588 &ui32CCOffset, &ui32CCSize) ||
4591 &ui32CCOffset, &ui32CCSize))
4595 video_data_size + metadata_size + ui32CCOffset;
4598 ui32CCSize, ui32CCOffset);
4604 p_frame->
vui_len = ui32CCSize;
4605 p_frame->
vui_offset = video_data_size + metadata_size + ui32CCOffset;
4614 &ui32CCOffset, &ui32CCSize))
4618 video_data_size + metadata_size + ui32CCOffset;
4623 "bytes\n", *((uint8_t*)pEntry + ui32CCOffset), ui32CCSize);
4661 int i, total_modules;
4664 if ( (!p_cap) || (!p_data) )
4708 if (total_modules >= 1)
4723 if (total_modules >= 2)
4738 if (total_modules >= 3)
4753 if (total_modules >= 4)
4798 static uint32_t presetGopSize[] = {
4809 static uint32_t presetGopKeyFrameFactor[] = {
4836 if ( (!p_ctx) || (!p_cfg) || (!p_src) )
5125 "for profile 3 (extended) or 1 (baseline)\n");
5213 if (p_src->
crf >= 0)
5229 " hvsQPEnable=1, hvsQPScale=2, maxDeltaQP=51.\n",
5361 for (i = 0; i < 8; i++)
5482 if (!p_ctx || !p_config)
5735 uint32_t max_err_len)
5740 if ( (!p_ctx) || (!p_cfg) || (!p_src) || (!p_param_err) )
5747 memset(p_param_err, 0, max_err_len);
5751 strncpy(p_param_err,
"Invalid frame_rate of 0 value", max_err_len);
5758 strncpy(p_param_err,
"Invalid i32bitRate: smaller than or equal to frame rate", max_err_len);
5765 strncpy(p_param_err,
"Invalid i32bitRate: too big", max_err_len);
5772 strncpy(p_param_err,
"Invalid i32bitRate of 0 value", max_err_len);
5779 strncpy(p_param_err,
"Invalid Picture Width: too small", max_err_len);
5786 strncpy(p_param_err,
"Invalid Picture Width: too big", max_err_len);
5793 strncpy(p_param_err,
"Invalid Picture Height: too small", max_err_len);
5800 strncpy(p_param_err,
"Invalid Picture Height: too big", max_err_len);
5810 strncpy(p_param_err,
"Invalid cannot disable timing_info and "
5811 "enable hrd at the same time", max_err_len);
5817 int32_t num_mb_or_ctu_row = (p_src->
source_height + 16 - 1) / 16;
5818 int32_t num_mb_or_ctu_col = (p_src->
source_width + 16 - 1) / 16;
5822 num_mb_or_ctu_col = (p_src->
source_width + 64 - 1) / 64;
5828 strncpy(p_param_err,
"Invalid intraRefreshMode: 4 not supported for AVC",
5835 strncpy(p_param_err,
"Invalid crf not supported for AVC",
5843 strncpy(p_param_err,
"Invalid intraRefreshArg: should be greater than 0",
5850 strncpy(p_param_err,
"Invalid intraRefreshArg: should not be greater than "
5851 "number of MB/CTU of height when intraRefreshMode=1", max_err_len);
5857 strncpy(p_param_err,
"Invalid intraRefreshArg: should not be greater than "
5858 "number of MB/CTU of width when intraRefreshMode=2", max_err_len);
5864 num_mb_or_ctu_row * num_mb_or_ctu_col))
5866 strncpy(p_param_err,
"Invalid intraRefreshArg: should not be greater than "
5867 "number of MB/CTU of frame when intraRefreshMode=3/4", max_err_len);
5873 strncpy(p_param_err,
"Error: lossless coding should be disabled when "
5874 "intraRefreshMode=4", max_err_len);
5880 strncpy(p_param_err,
"Error: ROI should be disabled when "
5881 "intraRefreshMode=4", max_err_len);
5891 strncpy(p_param_err,
"Invalid profile: must be 5 (high10)",
5900 strncpy(p_param_err,
"Invalid profile: must be 1 (baseline), 2 (main),"
5901 " 3 (extended), 4 (high), or 5 (high10)", max_err_len);
5912 strncpy(p_param_err,
"Invalid gopPresetIdx for H.264 baseline profile:"
5913 " must be 1, 2, 6, 9 or 0 (custom with no B frames)", max_err_len);
5924 strncpy(p_param_err,
"H.264 baseline profile: custom GOP can not "
5925 "have B frames", max_err_len);
5935 int32_t numMbs = ((p_cfg->
i32picWidth + 16 - 1) >> 4) *
5940 strncpy(p_param_err,
"Invalid avcSliceArg: must be between 1 and number"
5941 " of 16x16 pixel MBs in a frame", max_err_len);
5948 int32_t numMbs = ((p_cfg->
i32picWidth + 16 - 1) >> 4) *
5953 strncpy(p_param_err,
"Invalid sliceArg: must be between 1 and number"
5954 " of 16x16 pixel MBs in a frame", max_err_len);
5965 strncpy(p_param_err,
"Invalid profile: must be 2 (main10)",
5974 strncpy(p_param_err,
"Invalid profile: must be 1 (main) or 2 (main10)",
5984 int32_t numCtus = ((p_cfg->
i32picWidth + 64 - 1) >> 6) *
5989 strncpy(p_param_err,
"Invalid sliceArg: must be between 1 and number"
5990 " of 64x64 pixel CTUs in a frame", max_err_len);
5997 strncpy(p_param_err,
"Invalid forceFrameType: out of range",
6005 strncpy(p_param_err,
"Invalid forcedHeaderEnable: out of range",
6014 strncpy(p_param_err,
"Invalid decoding_refresh_type: out of range", max_err_len);
6022 snprintf(p_param_err, max_err_len,
"Invalid gop_preset_index: out of range");
6031 strncpy(p_param_err,
"Invalid custom GOP paramaters: custom_gop_size too small", max_err_len);
6038 strncpy(p_param_err,
"Invalid custom GOP paramaters: custom_gop_size too big", max_err_len);
6047 strncpy(p_param_err,
"Invalid use_recommend_enc_params: out of range", max_err_len);
6065 strncpy(p_param_err,
"Invalid max_num_merge: out of range", max_err_len);
6079 strncpy(p_param_err,
"Invalid intra_qp: out of range", max_err_len);
6087 strncpy(p_param_err,
"Invalid enable_mb_level_rc: out of range", max_err_len);
6097 strncpy(p_param_err,
"Invalid min_qp: out of range", max_err_len);
6105 strncpy(p_param_err,
"Invalid max_qp: out of range", max_err_len);
6114 strncpy(p_param_err,
"Invalid enable_cu_level_rate_control: out of range", max_err_len);
6124 strncpy(p_param_err,
"Invalid enable_hvs_qp: out of range", max_err_len);
6134 strncpy(p_param_err,
"Invalid max_delta_qp: out of range", max_err_len);
6140 if ( p_cfg->
niParamT408.enable_hvs_qp_scale != 1 &&
6143 snprintf(p_param_err, max_err_len,
6144 "Invalid enable_hvs_qp_scale: out of range");
6153 snprintf(p_param_err, max_err_len,
"Invalid hvs_qp_scale: out of range");
6163 strncpy(p_param_err,
"Invalid i32vbvBufferSize: out of range", max_err_len);
6179 strncpy(p_param_err,
"Error: intra_period and gop_preset_index are "
6180 "incompatible", max_err_len);
6219 ni_log(
NI_LOG_TRACE,
"ERROR: %s() unknown value for niParamT408.decoding_refresh_type: %d\n",
6276 uint32_t max_err_len)
6279 int32_t low_delay = 0;
6280 int32_t intra_period_gop_step_size;
6283 if (!p_param || !p_src || !p_param_err)
6291 memset(p_param_err, 0, max_err_len);
6326 strncpy(p_param_err,
"GOP size must be 1 or frames must be in sequence "
6327 "when lowDelay is enabled", max_err_len);
6334 intra_period_gop_step_size = 1;
6351 strncpy(p_param_err,
"Invalid intra_period and gop_preset_index: gop structure is larger than intra period",
6357 if (((!low_delay) && (p_param->
intra_period != 0) && ((p_param->
intra_period % intra_period_gop_step_size) != 0)) ||
6360 strncpy(p_param_err,
"Invalid intra_period and gop_preset_index: intra period is not a multiple of gop structure size",
6367 if (((!low_delay) && (p_param->
intra_period != 0) && ((p_param->
intra_period % intra_period_gop_step_size) == 1) &&
6372 strncpy(p_param_err,
"Invalid decoding_refresh_type: not support decoding refresh type I p_frame for closed gop structure",
6387 strncpy(p_param_err,
"Invalid custom gop parameters: poc_offset larger"
6388 " than GOP size", max_err_len);
6395 strncpy(p_param_err,
"Invalid custom gop parameters: temporal_id larger than 7", max_err_len);
6402 strncpy(p_param_err,
"Invalid custom gop parameters: temporal_id is zero or negative", max_err_len);
6407 if (min_poc > temp_poc[i])
6409 min_poc = temp_poc[i];
6417 if (temp_poc[j] == min_poc)
6426 strncpy(p_param_err,
"Invalid custom gop parameters: poc_offset is invalid", max_err_len);
6443 if (((p_param->
cu_size_mode & 0x1) == 0) && ((align_8_width_flag != 0) || (align_8_height_flag != 0)))
6445 strncpy(p_param_err,
"Invalid use_recommend_enc_params and cu_size_mode: picture width and height must be "
6446 "aligned with 8 pixels when enable CU8x8 of cu_size_mode. Recommend to set cu_size_mode |= 0x1 (CU8x8)",
6452 ((align_16_width_flag != 0) || (align_16_height_flag != 0)))
6454 strncpy(p_param_err,
"Invalid use_recommend_enc_params and cu_size_mode: picture width and height must be "
6455 "aligned with 16 pixels when enable CU16x16 of cu_size_mode. Recommend to set cu_size_mode |= 0x2 (CU16x16)",
6461 ((p_param->
cu_size_mode & 0x4) == 0) && ((align_32_width_flag != 0) || (align_32_height_flag != 0)))
6463 strncpy(p_param_err,
"Invalid use_recommend_enc_params and cu_size_mode: picture width and height must be "
6464 "aligned with 32 pixels when enable CU32x32 of cu_size_mode. Recommend to set cu_size_mode |= 0x4 (CU32x32)",
6474 strncpy(p_param_err,
"Invalid conf_win_top: out of range", max_err_len);
6480 strncpy(p_param_err,
"Invalid conf_win_top: not multiple of 2", max_err_len);
6487 strncpy(p_param_err,
"Invalid conf_win_bottom: out of range", max_err_len);
6493 strncpy(p_param_err,
"Invalid conf_win_bottom: not multiple of 2", max_err_len);
6500 strncpy(p_param_err,
"Invalid conf_win_left: out of range", max_err_len);
6506 strncpy(p_param_err,
"Invalid conf_win_left: not multiple of 2", max_err_len);
6513 strncpy(p_param_err,
"Invalid conf_win_right: out of range", max_err_len);
6519 strncpy(p_param_err,
"Invalid conf_win_right: not multiple of 2", max_err_len);
6530 uint32_t max_err_len)
6535 if (!p_cfg || !p_param_err)
6543 memset(p_param_err, 0, max_err_len);
6547 strncpy(p_param_err,
"Invalid roiEnable: out of range", max_err_len);
6557 strncpy(p_param_err,
"Invalid min_qp(P/B) and max_qp(P/B): min_qp cannot be larger than max_qp", max_err_len);
6578 if (!p_codec_params)
6719 struct sched_param sched_param;
6724 sigfillset(&signal);
6725 ni_logan_pthread_sigmask(SIG_BLOCK, &signal, NULL);
6732 if (((sched_param.sched_priority = sched_get_priority_max(SCHED_RR)) == -1) ||
6733 sched_setscheduler(syscall(SYS_gettid), SCHED_RR, &sched_param) < 0)
6736 __FUNCTION__, strerror(errno));
6737 if (setpriority(PRIO_PROCESS, 0, -20) != 0)
6740 __FUNCTION__, strerror(errno));
6744 #elif defined(_WIN32)
6749 if (SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL) == 0)
6752 __FUNCTION__, GetLastError());
6788 endtime += interval;
6825 void * p_buffer = NULL;
6826 uint32_t ui32LBA = 0;
6827 uint32_t model_load = 0;
6828 uint32_t low_delay_mode = 0;
6829 uint32_t buffer_size = 0;
6892 ni_log(
NI_LOG_ERROR,
"ERROR %s(): alloc decoder packet info buffer failed\n", __FUNCTION__);
6922 "p_ctx->hw_id=%d, p_ctx->session_id=%d\n", __FUNCTION__,
6931 session_info.
model_load = ni_logan_htonl(model_load);
6946 ": %" PRIx64
" hw_id %d\n", __FUNCTION__,
6969 " p_ctx->session_id=%d\n", __FUNCTION__, (int64_t)p_ctx->
device_handle,
6983 char *dom, *bus, *dev, *fnc;
6986 p_ctx->
netint_fd = open(
"/dev/netint", O_RDWR);
6997 if (stat(block_dev, &bstat) < 0)
7004 if ((bstat.st_mode & S_IFMT) != S_IFBLK)
7011 ret = snprintf(syspath,
sizeof(syspath) - 1,
"/sys/block/%s/device/address", block_dev + 5);
7012 syspath[ret] =
'\0';
7013 fp = fopen(syspath,
"r");
7016 number[0] = block_dev[9];
7017 if(
'0' <= block_dev[10] && block_dev[10] <=
'9')
7019 number[1] = block_dev[10];
7024 ret = snprintf(syspath,
sizeof(syspath) - 1,
"/sys/block/%s/device/nvme%s/address", block_dev + 5, number);
7025 syspath[ret] =
'\0';
7026 fp = fopen(syspath,
"r");
7035 if (fgets(line, 256, fp) == NULL)
7046 p_ctx->
domain = strtoul(line, &dom, 16);
7056 p_ctx->
bus = strtoul(dom + 1, &bus, 16);
7066 p_ctx->
dev = strtoul(bus + 1, &dev, 16);
7076 p_ctx->
fn = strtoul(dev + 1, &fnc, 16);
7086 p_ctx->
dev, p_ctx->
fn);
7090 #ifdef XCODER_DUMP_ENABLED
7091 char dump_file[256] = { 0 };
7093 snprintf(dump_file,
sizeof dump_file,
"%s%d%s",
"decoder_in_id", p_ctx->
session_id,
".264");
7094 p_ctx->
p_dump[0] = fopen(dump_file,
"wb");
7097 snprintf(dump_file,
sizeof dump_file,
"%s%d%s",
"decoder_out_id", p_ctx->
session_id,
".yuv");
7098 p_ctx->
p_dump[1] = fopen(dump_file,
"wb");
7125 if (!src_p_ctx || !dst_p_ctx)
7155 uint32_t tx_size = 0, aligned_tx_size = 0;
7156 uint32_t sent_size = 0;
7157 uint32_t frame_size_bytes = 0;
7162 if (!p_ctx || !p_frame)
7178 __FUNCTION__, frame_size_bytes, 0);
7190 "buf size %u < frame size %u !\n", retval,
7197 "size %u >= frame size %u !\n",
7218 p_dec_packet_info->
packet_size = frame_size_bytes;
7236 "p_ctx->frame_num=%" PRIu64
", LBA=0x%x, Session ID=%d\n",
7239 sent_size = frame_size_bytes;
7246 p_frame->
p_buffer, sent_size, ui32LBA);
7258 size = frame_size_bytes;
7260 #ifdef XCODER_DUMP_DATA
7261 char dump_file[128];
7262 snprintf(dump_file,
sizeof(dump_file),
"%ld-%u-hwup-fme/fme-%04ld.yuv",
7265 FILE *f = fopen(dump_file,
"wb");
7299 if (!p_ctx || !hwdesc)
7368 ni_device_handle_t device_handle,
7369 ni_event_handle_t event_handle)
7371 void* p_buffer = NULL;
7373 uint32_t dataLen = 0;
7374 uint32_t ui32LBA = 0;
7377 __FUNCTION__, device_handle);
7432 if ((!p_serial_num) || (!p_data))
7445 memset(p_serial_num->
ai8Sn, 0,
sizeof(p_serial_num->
ai8Sn));
7446 memcpy(p_serial_num->
ai8Sn, p_id_data->
ai8Sn,
sizeof(p_serial_num->
ai8Sn));
7471 uint64_t frame_offset = 0;
7474 uint8_t* p_data_buffer = (uint8_t*)p_frame->
p_buffer;
7480 int frame_cycle = 0;
7481 uint32_t total_bytes_to_read = 0;
7482 uint32_t total_yuv_met_size = 0;
7483 uint32_t read_size_bytes = 0;
7484 uint32_t actual_read_size = 0;
7485 int keep_processing = 1;
7487 int query_retry = 0;
7488 uint32_t ui32LBA = 0;
7489 int64_t drop_dts = 0;
7493 if (!p_ctx || !p_frame)
7509 total_bytes_to_read = p_frame->data_len[3] + metadata_hdr_size;
7510 total_yuv_met_size = p_frame->data_len[0] + p_frame->data_len[1] + p_frame->data_len[2] + metadata_hdr_size;
7511 ni_log(
NI_LOG_TRACE,
"Total bytes to read %d total_yuv_met_size %d \n", total_bytes_to_read, total_yuv_met_size);
7521 buf_info.rd_buf_avail_size);
7526 retval, query_retry);
7528 if (query_retry >= 1000)
7533 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
7535 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
7541 total_bytes_to_read = metadata_hdr_size;
7544 else if (buf_info.rd_buf_avail_size < total_yuv_met_size)
7549 ni_log(
NI_LOG_TRACE,
"Info dec query, ready_to_close %u, ready_to_flush %u, query eos\n",
7557 if (data.is_flushed ||
7563 ni_log(
NI_LOG_INFO,
"Info eos reached or flush buffers exceeding max retries: is_flushed %u try %d.\n",
7564 data.is_flushed, query_retry);
7568 p_frame->end_of_stream = 1;
7580 " retrying ..\n", query_retry);
7581 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
7583 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
7589 "eos %u nb try %d\n", p_frame->end_of_stream, query_retry);
7594 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
7596 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
7626 "%ux%u frame-rate %u is_flushed %u\n",
7627 data.picture_width, data.picture_height,
7628 data.transfer_frame_stride, data.transfer_frame_height,
7629 data.frame_rate, data.is_flushed);
7651 total_bytes_to_read = p_frame->data_len[3] + metadata_hdr_size;
7653 p_data_buffer = (uint8_t*)p_frame->p_buffer;
7657 "available: %u\n", p_frame->buffer_size, total_bytes_to_read,
7658 buf_info.rd_buf_avail_size);
7663 unsigned int bytes_read_so_far = 0;
7666 "cr len %d cb len %d hwdes len %d hdr %d\n", total_bytes_to_read,
7668 p_frame->data_len[2], p_frame->data_len[3], metadata_hdr_size);
7682 if (total_bytes_to_read == metadata_hdr_size)
7692 if (buf_info.rd_buf_avail_size < total_bytes_to_read)
7695 __FUNCTION__, buf_info.rd_buf_avail_size, total_bytes_to_read);
7699 read_size_bytes = buf_info.rd_buf_avail_size;
7707 p_data_buffer, read_size_bytes, ui32LBA);
7722 + p_frame->data_len[0] + p_frame->data_len[1]
7723 + p_frame->data_len[2] + p_frame->data_len[3]);
7725 if (buf_info.rd_buf_avail_size != metadata_hdr_size)
7731 + p_frame->data_len[1] + p_frame->data_len[2]);
7750 "ses_id=%d\n", __FUNCTION__, sei_size, p_data3->
device_handle,
7753 "bit_depth(in meta)=%d\n", __FUNCTION__, p_data3->
i8FrameIdx,
7759 ni_log(
NI_LOG_TRACE,
"%s: sequence change first frame, set seq_change\n", __FUNCTION__);
7765 total_bytes_to_read = total_bytes_to_read + sei_size;
7768 "sei %d sei_size %d frame_cycle %d\n", __FUNCTION__, retval,
7769 total_bytes_to_read, sei_size, frame_cycle);
7775 bytes_read_so_far = total_bytes_to_read;
7781 if (!p_frame->bit_depth)
7788 if (rx_size > 0 && total_bytes_to_read != metadata_hdr_size)
7820 if (p_frame->pts >= p_frame->dts && p_frame->pts - p_frame->dts < 1000)
7870 p_frame->pts = guess_correct_pts(p_ctx, p_frame->pts, p_frame->dts, p_ctx->
last_pts);
7881 #ifdef XCODER_DUMP_ENABLED
7882 fwrite(p_frame->data[0], rx_size, 1, p_ctx->
p_dump[1]);
7886 ni_log(
NI_LOG_TRACE,
"%s(): p_frame->start_of_stream=%d, p_frame->end_of_stream=%d, "
7887 "p_frame->video_width=%d, p_frame->""video_height=%d\n", __FUNCTION__,
7888 p_frame->start_of_stream, p_frame->end_of_stream,
7889 p_frame->video_width, p_frame->video_height);
7891 p_frame->data_len[0], p_frame->data_len[1], p_frame->data_len[2]);
7933 uint64_t frame_offset = 0;
7936 uint8_t* p_data_buffer = (uint8_t*)p_frame->
p_buffer;
7941 uint32_t total_bytes_to_read = 0;
7942 uint32_t read_size_bytes = 0;
7943 uint32_t actual_read_size = 0;
7944 int keep_processing = 1;
7946 int query_retry = 0;
7947 uint32_t ui32LBA = 0;
7948 unsigned int bytes_read_so_far = 0;
7952 if (!p_ctx || !p_frame)
7967 if (!p_frame->p_data[i])
7975 if (0 == p_frame->data_len[0])
7982 total_bytes_to_read = p_frame->data_len[0] + p_frame->data_len[1] + p_frame->data_len[2];
7985 "cr len %d cb len %d hdr %d\n", __FUNCTION__, total_bytes_to_read,
7987 p_frame->data_len[2], metadata_hdr_size);
7993 hwdesc->i8FrameIdx);
7999 read_size_bytes = total_bytes_to_read;
8008 int64_t handle = (((int64_t) hwdesc->device_handle_ext) << 32) | hwdesc->device_handle;
8010 p_data_buffer, read_size_bytes, ui32LBA);
8013 p_data_buffer, read_size_bytes, ui32LBA);
8027 "sei %d sei_size %d\n", __FUNCTION__, retval, total_bytes_to_read, sei_size);
8030 ni_log(
NI_LOG_TRACE,
"%s total_bytes_to_read %d ylen %d cr len %d cb len %d data0 0x%x data_end 0x%x idx %d\n", \
8031 __FUNCTION__, total_bytes_to_read, p_frame->data_len[0],
8032 p_frame->data_len[1], p_frame->data_len[2], p_data_buffer[0],
8033 p_data_buffer[total_bytes_to_read-1], total_bytes_to_read -1);
8035 bytes_read_so_far = total_bytes_to_read;
8044 "p_frame->end_of_stream=%d, p_frame->video_width=%d, "
8045 "p_frame->video_height=%d\n", __FUNCTION__, p_frame->start_of_stream,
8046 p_frame->end_of_stream, p_frame->video_width, p_frame->video_height);
8047 ni_log(
NI_LOG_TRACE,
"%s(): p_ctx->frame_num%ld, p_frame->data_len[0/1/2]=%d/%d/%d\n",
8048 __FUNCTION__, p_ctx->
frame_num, p_frame->data_len[0],
8049 p_frame->data_len[1], p_frame->data_len[2]);
8087 uint32_t pool_size, uint32_t p2p_pool)
8092 uint32_t ui32LBA = 0;
8118 memset((
void *)p_init_frames_param, 0, buffer_size);
8123 p_init_frames_param->
pool_size = ni_logan_ntohs(pool_size);
8124 p_init_frames_param->
p2p_pool = ni_logan_ntohs(p2p_pool);
8127 __FUNCTION__, p_init_frames_param->
width, p_init_frames_param->
height,
8133 p_init_frames_param, buffer_size, ui32LBA);
8161 struct sched_param sched_param;
8176 if (((sched_param.sched_priority = sched_get_priority_max(SCHED_RR)) == -1) ||
8177 sched_setscheduler(syscall(SYS_gettid), SCHED_RR, &sched_param) < 0)
8180 __FUNCTION__, strerror(errno));
8181 if (setpriority(PRIO_PROCESS, 0, -20) != 0)
8184 __FUNCTION__, strerror(errno));
8203 unsigned int *p_offset,
unsigned int hwaddress)
8211 *p_offset = hwaddress - 0xD0000000;
8235 FILE *p_file = NULL;
8237 if (!p_ctx || !p_data)
8240 __func__, __LINE__, p_ctx, p_data);
8244 memset(p_data, 0, data_len);
8245 *(uint8_t *)p_data = 0x55;
8252 ni_log(
NI_LOG_ERROR,
"ERROR ni_dump_logs(): nvme read command failed, blk_io_handle:"
8256 else if (gen_log_file)
8259 char filename[32] =
"nvme_slot_";
8260 bool pcie_id_name =
false;
8261 char devFilePath[1024] = {0};
8263 char devFDPath[1024] = {0};
8264 char pcie[64] = {0};
8265 char domain[5] = {0}, slot[3] = {0}, dev[3] = {0}, func[2] = {0};
8267 snprintf(devFDPath,
sizeof(devFDPath),
"/proc/self/fd/%d", p_ctx->
blk_io_handle);
8268 ssize_t len = readlink(devFDPath, devFilePath,
sizeof(devFilePath)-1);
8270 devFilePath[len] =
'\0';
8272 if (strstr(devFilePath,
"/dev/nvme") != NULL)
8275 if (strlen(pcie) > 0 && strlen(slot) > 0 && strlen(domain) > 0)
8277 strcat(filename, slot);
8278 pcie_id_name =
true;
8284 ni_log(
NI_LOG_INFO,
"%s:():%d: For dev %d can't look up PCI domain and slot info. Defaulting to slot=hw_id\n",
8287 snprintf(num, 4,
"%d", p_ctx->
hw_id);
8288 strcat(filename, num);
8290 strcat(filename,
".log");
8293 p_file = fopen(filename,
"wb");
8297 if (fwrite((uint8_t *)p_data ,
8298 data_len, 1, p_file) != 1)
8301 __func__, __LINE__, data_len);
8316 __func__, __LINE__, filename);
NETINT audio/video related utility functions.
#define NI_LOGAN_MAX_1080P_FPS
@ NI_LOGAN_RETCODE_PARAM_ERROR_MN_QP
@ NI_LOGAN_RETCODE_ERROR_INVALID_HANDLE
@ NI_LOGAN_RETCODE_NVME_SC_VPU_GENERAL_ERROR
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_R
@ NI_LOGAN_RETCODE_ERROR_INVALID_SESSION
@ NI_LOGAN_RETCODE_PARAM_ERROR_FRATE
@ NI_LOGAN_RETCODE_PARAM_INVALID_VALUE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_TOP
@ NI_LOGAN_RETCODE_PARAM_ERROR_USR_RMD_ENC_PARAM
@ NI_LOGAN_RETCODE_PARAM_ERROR_GOP_PRESET
@ NI_LOGAN_RETCODE_PARAM_ERROR_RCENABLE
@ NI_LOGAN_RETCODE_DEFAULT_SESSION_ERR_NO
@ NI_LOGAN_RETCODE_PARAM_GOP_INTRA_INCOMPATIBLE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_L
@ NI_LOGAN_RETCODE_NVME_SC_REQUEST_IN_PROGRESS
@ NI_LOGAN_RETCODE_ERROR_RESOURCE_UNAVAILABLE
@ NI_LOGAN_RETCODE_PARAM_ERROR_MX_QP
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSIZE_MODE_8X8_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSIZE_MODE_16X16_EN
@ NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED
@ NI_LOGAN_RETCODE_INVALID_PARAM
@ NI_LOGAN_RETCODE_ERROR_MEM_ALOC
@ NI_LOGAN_RETCODE_PARAM_ERROR_PIC_HEIGHT
@ NI_LOGAN_RETCODE_PARAM_ERROR_INTRA_PERIOD
@ NI_LOGAN_RETCODE_ERROR_VPU_RECOVERY
@ NI_LOGAN_RETCODE_PARAM_ERROR_BRATE
@ NI_LOGAN_RETCODE_PARAM_ERROR_RCINITDELAY
@ NI_LOGAN_RETCODE_PARAM_ERROR_MAXNUMMERGE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_BOT
@ NI_LOGAN_RETCODE_PARAM_ERROR_HVS_QP_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSTOM_GOP
@ NI_LOGAN_RETCODE_SUCCESS
@ NI_LOGAN_RETCODE_NVME_SC_WRITE_BUFFER_FULL
@ NI_LOGAN_RETCODE_FAILURE
@ NI_LOGAN_RETCODE_NVME_SC_VPU_RECOVERY
@ NI_LOGAN_RETCODE_PARAM_ERROR_PIC_WIDTH
@ NI_LOGAN_RETCODE_PARAM_ERROR_MX_DELTA_QP
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSIZE_MODE_32X32_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_HVS_QP_SCL
@ NI_LOGAN_RETCODE_PARAM_ERROR_INTRA_QP
@ NI_LOGAN_RETCODE_PARAM_ERROR_DECODING_REFRESH_TYPE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CU_LVL_RC_EN
@ NI_LOGAN_RETCODE_NVME_SC_VPU_RSRC_INSUFFICIENT
struct _ni_logan_instance_status_info ni_logan_instance_status_info_t
#define NI_LOGAN_APP_ENC_FRAME_META_DATA_SIZE
#define NI_LOGAN_MAX_NUM_DATA_POINTERS
#define NI_LOGAN_MAX_CONTEXTS_PER_HW_INSTANCE
#define ni_logan_assert(expression)
#define NI_LOGAN_CPU_LOG_BUFFER_SIZE
#define NI_LOGAN_MAX_FORCE_FRAME_TABLE_SIZE
#define NI_LOGAN_MEM_PAGE_ALIGNMENT
#define NETINT_PCI_VENDOR_ID
@ NI_LOGAN_DEVICE_TYPE_UPLOAD
@ NI_LOGAN_DEVICE_TYPE_ENCODER
@ NI_LOGAN_DEVICE_TYPE_DECODER
#define NI_LOGAN_FW_META_DATA_SZ
@ NI_LOGAN_DECODE_BUFFERS_FLUSHING
@ NI_LOGAN_DECODE_FLUSH_BUFFER_OFF
#define NI_LOGAN_MAX_DEVICES_PER_HW_INSTANCE
ni_logan_retcode_t ni_logan_decoder_frame_buffer_alloc(ni_logan_buf_pool_t *p_pool, ni_logan_frame_t *p_frame, int alloc_mem, int video_width, int video_height, int alignment, int factor)
Allocate memory for decoder frame buffer based on provided parameters; the memory is retrieved from a...
ni_logan_retcode_t ni_logan_decoder_frame_buffer_free(ni_logan_frame_t *p_frame)
Free decoder frame buffer that was previously allocated with ni_logan_decoder_frame_buffer_alloc,...
void ni_logan_device_session_context_init(ni_logan_session_context_t *p_ctx)
Initialize already allocated session context to a known state.
void ni_logan_device_session_context_clear(ni_logan_session_context_t *p_ctx)
Clear already allocated session context to all zeros.
ni_logan_retcode_t ni_logan_device_handle_map_SN(ni_device_handle_t device_handle, ni_logan_serial_num_t *p_serial_num)
Queries device Serial number.
ni_logan_retcode_t ni_logan_frame_buffer_alloc(ni_logan_frame_t *p_frame, int video_width, int video_height, int alignment, int metadata_flag, int factor, int hw_frame_count)
Allocate preliminary memory for the frame buffer for encoding based on provided parameters....
ni_event_handle_t ni_logan_create_event(void)
Create event and returnes event handle if successful.
Main NETINT device API header file provides the ability to communicate with NI T-408 type hardware tr...
#define NI_LOGAN_DEFAULT_CU_SIZE_MODE
#define NI_LOGAN_MAX_INTRA_QP
#define NI_LOGAN_DEFAULT_INTRA_QP
#define NI_LOGAN_RETRY_INTERVAL_200US
#define NI_LOGAN_MIN_MAX_DELTA_QP
struct _ni_logan_hwframe_surface ni_logan_hwframe_surface_t
#define NI_CC_SEI_TRAILER_LEN
#define NI_HDR10P_SEI_BYTE2
#define NI_LOGAN_MAX_GOP_PRESET_IDX
#define NI_LOGAN_MAX_VUI_SIZE
#define NI_HDR10P_SEI_BYTE6
#define NI_LOGAN_PARAM_MAX_HEIGHT
#define NI_LOGAN_MAX_ENC_SESSION_OPEN_QUERY_RETRIES
@ NI_LOGAN_CODEC_HW_UPLOAD
@ NI_LOGAN_CODEC_HW_ENABLE
@ NI_LOGAN_CODEC_HW_DOWNLOAD
#define NI_CC_SEI_HDR_H264_LEN
#define NI_HDR10P_SEI_BYTE0
#define NI_LOGAN_MIN_INTRA_QP
#define NI_LOGAN_PARAM_MAX_WIDTH
ni_logan_h265_sei_user_data_type_t
@ NI_LOGAN_H265_USERDATA_FLAG_UNREGISTERED_SUF
@ NI_LOGAN_H265_USERDATA_FLAG_ITU_T_T35_SUF_1
@ NI_LOGAN_H265_USERDATA_FLAG_MASTERING_COLOR_VOL
@ NI_LOGAN_H265_USERDATA_FLAG_VUI
@ NI_LOGAN_H265_USERDATA_FLAG_ITU_T_T35_SUF_2
@ NI_LOGAN_H265_USERDATA_FLAG_UNREGISTERED_PRE
@ NI_LOGAN_H265_USERDATA_FLAG_ITU_T_T35_PRE_2
@ NI_LOGAN_H265_USERDATA_FLAG_ALTERNATIVE_TRANSFER_CHARACTERISTICS
@ NI_LOGAN_H265_USERDATA_FLAG_ITU_T_T35_SUF
@ NI_LOGAN_H265_USERDATA_FLAG_ITU_T_T35_PRE_1
@ NI_LOGAN_H265_USERDATA_FLAG_ITU_T_T35_PRE
@ NI_LOGAN_H265_USER_DATA_FLAG_CONTENT_LIGHT_LEVEL_INFO
#define NI_LOGAN_MAX_ENC_SESSION_READ_QUERY_RETRIES
#define NI_LOGAN_MAX_SESSION_CLOSE_RETRIES
#define NI_LOGAN_MAX_DEC_SESSION_READ_QUERY_EOS_RETRIES
#define NI_LOGAN_SESSION_CLOSE_RETRY_INTERVAL_US
#define NI_LOGAN_RETRY_INTERVAL_100US
#define NI_LOGAN_ENC_SESSION_OPEN_RETRY_INTERVAL_US
#define NI_HDR10P_SEI_HDR_H264_LEN
#define NI_LOGAN_ENC_REPEAT_HEADERS_ALL_I_FRAMES
#define NI_LOGAN_PARAM_MIN_WIDTH
#define NI_HDR10P_SEI_BYTE1
#define NI_LOGAN_MAX_DEC_SESSION_READ_QUERY_RETRIES
#define NI_LOGAN_NOPTS_VALUE
#define NI_LOGAN_MAX_MAX_DELTA_QP
#define NI_HDR10P_SEI_HDR_HEVC_LEN
#define NI_LOGAN_MAX_ENC_SESSION_WRITE_QUERY_RETRIES
#define NI_HDR10P_SEI_BYTE5
#define NI_LOGAN_MAX_GOP_NUM
@ LOGAN_SESSION_RUN_STATE_SEQ_CHANGE_DRAINING
@ LOGAN_SESSION_RUN_STATE_NORMAL
#define NI_LOGAN_MAX_DEC_SESSION_WRITE_QUERY_RETRIES
#define NI_LOGAN_DEFAULT_MAX_DELTA_QP
#define NI_HDR10P_SEI_BYTE3
#define NI_LOGAN_ENC_REPEAT_HEADERS_ALL_KEY_FRAMES
@ NI_LOGAN_CODEC_FORMAT_H265
@ NI_LOGAN_CODEC_FORMAT_H264
#define NI_LOGAN_INVALID_SESSION_ID
#define NI_LOGAN_PARAM_MIN_HEIGHT
#define NI_HDR10P_SEI_BYTE4
#define NI_CC_SEI_HDR_HEVC_LEN
#define NI_LOGAN_MIN_GOP_PRESET_IDX
ni_logan_retcode_t ni_logan_decoder_session_query(ni_logan_session_context_t *p_ctx)
Query current decoder status.
ni_logan_retcode_t ni_logan_encoder_session_close(ni_logan_session_context_t *p_ctx, int eos_recieved)
Close a xcoder encoder instance.
ni_logan_retcode_t ni_logan_check_ratecontrol_params(ni_logan_encoder_config_t *p_cfg, char *p_param_err, uint32_t max_err_len)
check the range of rate control parameters
int ni_logan_encoder_session_read(ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
Retrieve an encoded packet from encoder.
ni_logan_retcode_t ni_logan_query_stream_info(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_mgr_stream_info_t *p_stream_info, bool is_hw)
Query a particular xcoder instance to get Stream Info data.
ni_logan_retcode_t ni_logan_config_instance_set_encoder_params(ni_logan_session_context_t *p_ctx)
Send a p_config command to configure encoding parameters.
_ni_logan_t35_sei_mesg_type
@ NI_LOGAN_T35_SEI_HDR10_PLUS
@ NI_LOGAN_T35_SEI_CLOSED_CAPTION
ni_logan_retcode_t ni_logan_get_memory_offset(ni_logan_session_context_t *p_ctx, const ni_logan_hwframe_surface_t *hwdesc, unsigned int *p_offset, unsigned int hwaddress)
Get an address offset from a hw descriptor.
ni_logan_retcode_t ni_logan_config_instance_sos(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
Send a p_config command for Start Of Stream.
void ni_logan_params_print(void *const p_codec_params, ni_logan_device_type_t device_type)
Print xcoder user configurations.
ni_logan_retcode_t ni_logan_query_status_info(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_status_info_t *p_status_info, int rc, int opcode)
Query a particular xcoder instance to get status Info data.
int ni_logan_hwupload_session_write(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Send a YUV to hardware, hardware will store it.
int ni_logan_encoder_session_query(ni_logan_session_context_t *p_ctx)
Query current encoder status.
ni_logan_retcode_t ni_logan_validate_custom_template(ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_cfg, ni_logan_encoder_params_t *p_src, char *p_param_err, uint32_t max_err_len)
Perform validation on custom parameters (Rev. B)
ni_logan_retcode_t ni_logan_config_instance_rw(ni_logan_session_context_t *p_ctx, ni_logan_inst_config_rw_type_t rw_type, uint8_t enable, uint8_t hw_action, uint16_t frame_id)
Configure the read/write pipe for a session Use HW frame index to read/write the YUV from/to HW.
int ni_logan_decoder_session_write(ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
Send a video p_packet to decoder.
ni_logan_retcode_t ni_logan_clear_instance_buf(ni_logan_hwframe_surface_t *surface, ni_device_handle_t device_handle, ni_event_handle_t event_handle)
clear a particular xcoder instance buffer/data The device handle is got from decoder or uploader,...
ni_logan_retcode_t ni_logan_encoder_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder encoder instance.
ni_logan_retcode_t ni_logan_encoder_session_flush(ni_logan_session_context_t *p_ctx)
Flush encoder output.
void ni_logan_set_default_template(ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_config)
Setup and initialize all xcoder configuration to default (Rev. B)
int ni_logan_hwdownload_session_read(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame, ni_logan_hwframe_surface_t *hwdesc)
Retrieve a YUV through HW descriptor from decoder.
void ni_logan_populate_serial_number(ni_logan_serial_num_t *p_serial_num, void *p_data)
Get Card Serial Number from received Nvme Indentify info.
int ni_logan_hwupload_session_read_hwdesc(ni_logan_session_context_t *p_ctx, ni_logan_hwframe_surface_t *hwdesc, unsigned int *hwaddress)
Retrieve a HW descriptor of uploaded frame The HW descriptor will contain the YUV frame index,...
ni_logan_retcode_t ni_logan_query_instance_buf_info(ni_logan_session_context_t *p_ctx, ni_logan_instance_buf_info_rw_type_t rw_type, ni_logan_device_type_t device_type, ni_logan_instance_buf_info_t *p_inst_buf_info, bool is_hw)
Query a particular xcoder instance to get buffer/data Info data.
ni_logan_retcode_t ni_logan_dump_logs(ni_logan_session_context_t *p_ctx, void *p_data, bool gen_log_file)
Dump firmware logs.
int ni_logan_create_frame(ni_logan_frame_t *p_frame, uint32_t read_length, uint64_t *p_frame_offset, bool is_hw_frame)
Get info from received p_frame.
ni_logan_retcode_t ni_logan_uplosader_session_close(ni_logan_session_context_t *p_ctx)
Close an xcoder upload instance.
ni_logan_retcode_t ni_logan_hwupload_init_framepool(ni_logan_session_context_t *p_ctx, uint32_t pool_size, uint32_t p2p_pool)
Setup framepool for hwupload. Uses decoder framepool.
ni_logan_retcode_t ni_logan_decoder_session_copy_internal(ni_logan_session_context_t *src_p_ctx, ni_logan_session_context_t *dst_p_ctx)
Copy a xcoder decoder card info and create worker thread.
ni_logan_retcode_t ni_logan_send_session_keep_alive(uint32_t session_id, ni_device_handle_t device_handle, ni_event_handle_t event_handle, void *p_data)
send a keep alive message to firmware
void ni_logan_change_priority(void)
Set up schedule priority. First try to run with RR mode. If fails, try to set nice value....
void * ni_logan_session_keep_alive_thread(void *arguments)
decoder keep alive thread function triggers every 1 second
#define CHECK_VPU_RECOVERY(ret)
ni_logan_retcode_t ni_logan_decoder_session_close(ni_logan_session_context_t *p_ctx, int eos_recieved)
Close a xcoder decoder instance.
enum _ni_logan_t35_sei_mesg_type ni_logan_t35_sei_mesg_type_t
void ni_logan_populate_device_capability_struct(ni_logan_device_capability_t *p_cap, void *p_data)
Get info from received xcoder capability.
ni_logan_retcode_t ni_logan_decoder_session_flush_buffers(ni_logan_session_context_t *p_ctx)
Flush decoder output.
int ni_logan_query_general_status(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_mgr_general_status_t *p_gen_status)
Query a particular xcoder instance to get GeneralStatus data.
ni_logan_retcode_t ni_logan_check_common_params(ni_logan_t408_config_t *p_param, ni_logan_encoder_params_t *p_src, char *p_param_err, uint32_t max_err_len)
check the range of common parameters
ni_logan_retcode_t ni_logan_config_instance_eos(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
Send a p_config command for End Of Stream.
ni_logan_retcode_t ni_logan_decoder_session_flush(ni_logan_session_context_t *p_ctx)
Flush decoder output.
ni_logan_retcode_t ni_logan_decoder_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder decoder instance.
ni_logan_retcode_t ni_logan_uploader_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder uploader instance.
int ni_logan_decoder_session_read(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Retrieve a YUV p_frame from decoder.
ni_logan_retcode_t ni_logan_config_instance_flush(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
Send a p_config command for Flush Of Stream.
int ni_logan_encoder_session_write(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Send a YUV p_frame to encoder.
void ni_logan_set_custom_template(ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_cfg, ni_logan_encoder_params_t *p_src)
Setup all xcoder configurations with custom parameters (Rev. B)
ni_logan_retcode_t ni_logan_decoder_session_read_desc(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Retrieve a hw desc p_frame from decoder When yuvbypass enabled, this is used for decoder to read hard...
Private definitions used by main ni_device_api_logan file.
struct _ni_logan_inst_config_rw ni_logan_inst_config_rw_t
ni_logan_inst_config_rw_type_t
struct _ni_logan_metadata_enc_bstream ni_logan_metadata_enc_bstream_t
struct _ni_logan_instance_debugInfo ni_logan_instance_debugInfo_t
@ ni_logan_xcoder_general_error
@ ni_logan_xcoder_resource_insufficient
@ ni_logan_xcoder_resource_recovery
@ ni_logan_xcoder_request_success
@ ni_logan_xcoder_request_pending
struct _ni_logan_instance_buf_info ni_logan_instance_buf_info_t
struct _ni_logan_instance_mgr_general_status ni_logan_instance_mgr_general_status_t
ni_logan_instance_buf_info_rw_type_t
@ INST_BUF_INFO_R_ACQUIRE
@ INST_BUF_INFO_RW_UPLOAD
struct _ni_logan_encoder_config_t ni_logan_encoder_config_t
struct _ni_logan_instance_mgr_stream_info ni_logan_instance_mgr_stream_info_t
void ni_log(ni_log_level_t level, const char *fmt,...)
print log message using ni_log_callback
int32_t ni_logan_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.
int32_t ni_logan_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 a io read command.
Definitions related to working with NI T-408 over NVME interface.
#define WRITE_INSTANCE_W(hw, sid, instance)
@ nvme_admin_cmd_xcoder_config
@ nvme_admin_cmd_xcoder_query
#define QUERY_INSTANCE_DEBUG_DATA_R(sid, instance)
#define CONFIG_INSTANCE_SetEOS_W(sid, instance)
#define CONFIG_INSTANCE_InitFramePool_W(sid, instance)
#define QUERY_INSTANCE_UPLOAD_ID_R(hw, sid, instance)
#define NI_LOGAN_NO_CHECK_TS_NVME_CMD_OP
#define CLOSE_SESSION_R(sid, instance)
#define QUERY_GENERAL_GET_STATUS_R(instance)
#define CONFIG_INSTANCE_SetFlush_W(sid, instance)
#define GET_CPU_LOGS_IN_4K
#define WRITE_METADATA_W(hw, sid, instance)
#define OPEN_GET_SID_R(hw, instance)
#define CONFIG_INSTANCE_FrameIdx_W(sid, instance)
#define QUERY_INSTANCE_RBUFF_SIZE_R(hw, sid, instance)
#define QUERY_INSTANCE_STREAM_INFO_R(hw, sid, instance)
#define CONFIG_SESSION_KeepAlive_W(sid)
#define QUERY_INSTANCE_CUR_STATUS_INFO_R(sid, instance)
#define OPEN_SESSION_W(hw, sid, instance)
#define QUERY_INSTANCE_ACQUIRE_BUF(hw, sid, instance)
#define CONFIG_SESSION_KeepAliveTimeout_W(sid)
#define CONFIG_INSTANCE_SetEncPara_W(sid, instance)
#define CONFIG_INSTANCE_SetPktSize_W(hw, sid, instance)
#define READ_INSTANCE_R(hw, sid, instance)
#define QUERY_INSTANCE_DEBUG_INFO_R(sid, instance)
#define CONFIG_SESSION_Write_W(sid)
#define CONFIG_INSTANCE_RecycleBuf_W(sid, instance)
#define CONFIG_INSTANCE_SetSOS_W(hw, sid, instance)
#define QUERY_INSTANCE_WBUFF_SIZE_R(hw, sid, instance)
#define NI_LOGAN_DATA_BUFFER_LEN
ni_logan_device_context_t * ni_logan_rsrc_get_device_context(ni_logan_device_type_t device_type, int guid)
Allocates and returns a pointer to ni_logan_device_context_t struct based on provided device_type and...
void ni_logan_rsrc_free_device_context(ni_logan_device_context_t *p_device_context)
Free previously allocated device context.
Exported definitions related to resource management of NI T-408 devices.
Private definitions related to resource management of NI T-408 devices.
void ni_logan_get_dev_pcie_addr(char *device_name, char *pcie, char *domain, char *slot, char *dev, char *func)
get PCIe address information from device name
void ni_logan_timestamp_scan_cleanup(ni_logan_timestamp_table_t *pts_list, ni_logan_timestamp_table_t *dts_list, ni_logan_queue_buffer_pool_t *p_buffer_pool)
Timestamp queue clean up.
int32_t ni_logan_dec_fme_buffer_pool_initialize(ni_logan_session_context_t *p_ctx, int32_t number_of_buffers, int width, int height, int height_align, int factor)
decoder frame buffer pool init & free
int32_t ni_logan_posix_memalign(void **pp_memptr, size_t alignment, size_t size)
ni_logan_retcode_t ni_logan_queue_free(ni_logan_queue_t *p_queue, ni_logan_queue_buffer_pool_t *p_buffer_pool)
Free xcoder queue.
void ni_logan_buffer_pool_free(ni_logan_queue_buffer_pool_t *p_buffer_pool)
free buffer memory pool
uint64_t ni_logan_gettime_ns(void)
ni_logan_retcode_t ni_logan_timestamp_register(ni_logan_queue_buffer_pool_t *p_buffer_pool, ni_logan_timestamp_table_t *p_table, int64_t timestamp, uint64_t data_info)
Register timestamp in timestamp/frameoffset table.
void ni_logan_usleep(int64_t usec)
ni_logan_retcode_t ni_logan_timestamp_init(ni_logan_session_context_t *p_ctx, ni_logan_timestamp_table_t **pp_table, const char *name)
Initialize timestamp handling.
void ni_logan_dec_fme_buffer_pool_free(ni_logan_buf_pool_t *p_buffer_pool)
free decoder frame buffer pool
void ni_logan_overwrite_specified_pos(uint8_t *buf, int pos, int value)
overwrite the 32 bits of integer value at bit position pos
int32_t ni_logan_gettimeofday(struct timeval *p_tp, void *p_tzp)
ni_logan_retcode_t ni_logan_timestamp_get_with_threshold(ni_logan_timestamp_table_t *p_table, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_logan_queue_buffer_pool_t *p_buffer_pool)
Retrieve timestamp from table based on frame offset info with respect to threshold.
Exported utility routines definition.
#define LOGAN_XCODER_MAX_ENC_PIC_WIDTH
#define NI_LOGAN_DEC_FRAME_BUF_POOL_SIZE_INIT
#define LOGAN_XCODER_MAX_ENC_PIC_HEIGHT
#define LOGAN_XCODER_MIN_ENC_PIC_WIDTH
#define ni_logan_aligned_free(p_memptr)
#define LOGAN_XCODER_MIN_ENC_PIC_HEIGHT
#define LOGAN_XCODER_MAX_NUM_TEMPORAL_LAYER
#define NI_LOGAN_VPU_FREQ
#define LOGAN_XCODER_FRAME_OFFSET_DIFF_THRES
payload format of HDR SEI content light level info
uint16_t max_content_light_level
uint16_t max_pic_average_light_level
ni_logan_gop_params_t pic_param[NI_LOGAN_MAX_GOP_NUM]
decoded payload format of HDR SEI mastering display colour volume
uint32_t min_display_mastering_luminance
uint32_t max_display_mastering_luminance
uint32_t display_primaries_y[3]
uint32_t display_primaries_x[3]
ni_logan_decoder_input_params_t dec_input_params
uint32_t set_high_priority
uint8_t h265_encoders_cnt
uint8_t h264_encoders_cnt
uint8_t fw_commit_time[26]
uint8_t fw_commit_hash[41]
uint8_t fw_branch_name[256]
uint8_t h265_decoders_cnt
uint8_t h264_decoders_cnt
ni_logan_hw_capability_t xcoder_devices[NI_LOGAN_MAX_DEVICES_PER_HW_INSTANCE]
int32_t i32userMinDeltaQp
int32_t i32userMaxDeltaQp
uint8_t ui8VuiRbsp[NI_LOGAN_MAX_VUI_SIZE]
uint32_t ui32minIntraRefreshCycle
uint8_t ui8lowLatencyMode
uint8_t ui8explicitRefListEnable
uint8_t ui8CrfPbRatioFraction
uint32_t ui32VuiDataSizeBytes
uint32_t ui32VuiDataSizeBits
uint32_t ui32sourceEndian
uint32_t ui32fillerEnable
uint8_t ui8CrfIpRatioFraction
ni_logan_t408_config_t niParamT408
uint8_t ui8bitstreamFormat
ni_logan_encoder_input_params_t enc_input_params
uint8_t ui8VuiRbsp[NI_LOGAN_MAX_VUI_SIZE]
uint32_t ui32minIntraRefreshCycle
uint32_t ui32VuiDataSizeBytes
int use_low_delay_poc_type
uint32_t ui32VuiDataSizeBits
int enable_vui_info_passthru
uint32_t pos_num_units_in_tick
uint32_t set_high_priority
uint32_t EncoderReadSyncQuery
unsigned int sei_hdr_mastering_display_color_vol_offset
unsigned int sei_hdr_content_light_level_info_offset
uint8_t separate_metadata
unsigned int sei_hdr_plus_len
uint32_t data_len[NI_LOGAN_MAX_NUM_DATA_POINTERS]
unsigned int sei_hdr_plus_offset
unsigned int extra_data_len
unsigned int sei_total_len
unsigned int sei_cc_offset
unsigned int sei_user_data_unreg_len
ni_logan_pic_type_t ni_logan_pict_type
uint8_t use_cur_src_as_long_term_pic
ni_logan_codec_format_t src_codec
unsigned int sei_hdr_content_light_level_info_len
void * p_data[NI_LOGAN_MAX_NUM_DATA_POINTERS]
unsigned int sei_hdr_mastering_display_color_vol_len
unsigned int sei_user_data_unreg_offset
uint8_t use_long_term_ref
unsigned int sei_alt_transfer_characteristics_len
unsigned int sei_alt_transfer_characteristics_offset
uint16_t min_video_height
uint16_t max_video_height
uint8_t max_number_of_contexts
int32_t device_handle_ext
uint16_t bit_depth_factor
uint16_t ui16WriteFrameId
union _ni_logan_inst_config_rw::@5 uHWAccessField
ni_logan_instance_upload_ret_hwdesc_t hw_inst_ind
uint8_t ui8DataPktSeqTotal
uint32_t ui32VpuInstError
uint8_t active_sub_instances_cnt
uint8_t process_load_percent
uint8_t composite_temperature
uint8_t fw_video_mem_usage
uint16_t transfer_frame_height
uint16_t transfer_frame_stride
uint32_t rd_buf_avail_size
uint32_t wr_buf_avail_size
uint32_t frames_completed
uint32_t fw_video_mem_usage
uint8_t hw2_video_profile
uint8_t xcoder_num_h264_decoder_hw
uint8_t xcoder_num_h264_encoder_hw
uint8_t fw_commit_time[26]
uint8_t xcoder_num_h265_decoder_hw
uint8_t fw_commit_hash[41]
uint8_t fw_branch_name[256]
uint8_t hw0_video_profile
uint8_t hw3_video_profile
uint8_t xcoder_num_h265_encoder_hw
uint8_t hw1_video_profile
ni_logan_all_custom_sei_t * p_all_custom_sei
uint8_t itu_t_t35_hdr10p_sei_hdr_hevc[NI_HDR10P_SEI_HDR_HEVC_LEN]
int64_t pts_offsets[NI_LOGAN_FIFO_SZ]
ni_logan_load_query_t load_query
ni_event_handle_t thread_event_handle
uint16_t decoder_reorder_delay
uint64_t prev_read_frame_time
uint32_t set_high_priority
uint32_t keep_alive_timeout
uint32_t active_bit_depth
uint64_t codec_total_ticks
ni_logan_serial_num_t d_serial_number
uint32_t ui32timing_scale
ni_device_handle_t sender_handle
ni_device_handle_t device_handle
uint64_t pkt_offsets_index_min[NI_LOGAN_FIFO_SZ]
ni_logan_lat_meas_q_t * frame_time_q
int pts_correction_num_faulty_dts
ni_device_handle_t auto_dl_handle
uint64_t pkt_offsets_index[NI_LOGAN_FIFO_SZ]
uint8_t sei_trailer[NI_CC_SEI_TRAILER_LEN]
uint64_t codec_start_time
int flags_array[NI_LOGAN_FIFO_SZ]
uint8_t itu_t_t35_cc_sei_hdr_hevc[NI_CC_SEI_HDR_HEVC_LEN]
ni_logan_session_run_state_t session_run_state
uint8_t itu_t_t35_cc_sei_hdr_h264[NI_CC_SEI_HDR_H264_LEN]
ni_event_handle_t event_handle
char blk_xcoder_name[LOGAN_MAX_CHAR_IN_DEVICE_NAME]
ni_device_handle_t blk_io_handle
ni_logan_queue_buffer_pool_t * buffer_pool
uint64_t force_frame_pkt_num
int64_t pts_correction_last_dts
uint32_t max_nvme_io_size
uint8_t composite_temperature
char stream_dir_name[128]
uint64_t frame_pkt_offset
Params used in VFR mode Done///.
void * p_dec_packet_inf_buf
uint32_t ui32num_unit_in_tick
ni_logan_buf_pool_t * dec_fme_buf_pool
int64_t pts_correction_last_pts
int64_t force_frame_pts_table[NI_LOGAN_MAX_FORCE_FRAME_TABLE_SIZE]
uint64_t session_timestamp
uint8_t itu_t_t35_hdr10p_sei_hdr_h264[NI_HDR10P_SEI_HDR_H264_LEN]
int64_t last_dts_interval
uint64_t decoder_drop_frame_num
ni_logan_instance_status_info_t session_stats
uint32_t active_video_width
uint32_t active_video_height
ni_logan_all_custom_sei_t * pkt_custom_sei[NI_LOGAN_FIFO_SZ]
uint32_t decoder_last_drop_frame_num
int pts_correction_num_faulty_pts
char dev_xcoder_name[LOGAN_MAX_CHAR_IN_DEVICE_NAME]
ni_logan_serial_num_t e_serial_number
uint32_t required_buf_size
int32_t lambdaScalingEnable
int32_t constIntraPredFlag
int32_t pu08IntraAngleDeltaRate
uint32_t strongIntraSmoothEnable
int32_t cu16InterDeltaRate
int32_t pu16IntraDcDeltaRate
int32_t enable_cu_level_rate_control
int32_t intra_mb_refresh_arg
int32_t cu08MergeDeltaRate
int32_t intra_mb_refresh_mode
int32_t independSliceMode
int32_t dependSliceModeArg
int32_t use_recommend_enc_params
int32_t fixedBitRatio[NI_LOGAN_MAX_GOP_NUM]
int32_t pu08IntraDcDeltaRate
int32_t decoding_refresh_type
int32_t independSliceModeArg
int32_t enable_mb_level_rc
uint32_t monochromeEnable
int32_t lfCrossSliceBoundaryEnable
uint32_t forcedHeaderEnable
uint32_t customLambdaEnable
int32_t pu04IntraDcDeltaRate
int32_t pu04IntraAngleDeltaRate
int32_t cu32InterDeltaRate
int32_t pu16IntraAngleDeltaRate
int32_t pu08IntraPlanarDeltaRate
uint32_t nrNoiseEstEnable
int32_t scalingListEnable
int32_t pu16IntraPlanarDeltaRate
uint32_t numTicksPocDiffOne
int32_t pu04IntraPlanarDeltaRate
int32_t enable_transform_8x8
int32_t entropy_coding_mode
int32_t cu32MergeDeltaRate
int32_t cu16MergeDeltaRate
uint32_t weightPredEnable
int32_t pu32IntraAngleDeltaRate
int32_t cu16IntraDeltaRate
int32_t cu08IntraDeltaRate
int32_t cu08InterDeltaRate
int32_t cu32IntraDeltaRate
int32_t pu32IntraDcDeltaRate
ni_logan_custom_gop_params_t custom_gop_params
int32_t pu32IntraPlanarDeltaRate
ni_event_handle_t thread_event_handle
uint32_t keep_alive_timeout
ni_device_handle_t device_handle
uint64_t session_timestamp