![]() |
libxcoder
5.2.0
|
Utility definitions. More...
Go to the source code of this file.
Data Structures | |
struct | _ni_err_rc_txt_entry |
struct | tensor_rsrc |
struct | SHA256CTX |
Macros | |
#define | _EPSILON 1e-8 |
#define | SHA256_BLOCK_SIZE 32 |
#define | ROTLEFT(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) |
#define | ROTRIGHT(a, b) (((a) >> (b)) | ((a) << (32 - (b)))) |
#define | CH(x, y, z) (((x) & (y)) ^ (~(x) & (z))) |
#define | MAJ(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
#define | EP0(x) (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22)) |
#define | EP1(x) (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25)) |
#define | SIG0(x) (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3)) |
#define | SIG1(x) (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10)) |
Typedefs | |
typedef struct _ni_err_rc_txt_entry | ni_err_rc_txt_entry_t |
typedef struct SHA256CTX | SHA256CTX |
Functions | |
int32_t | ni_gettimeofday (struct timeval *p_tp, void *p_tzp) |
Get time for logs with microsecond timestamps. More... | |
uint32_t | ni_round_up (uint32_t number_to_round, uint32_t multiple) |
int | ni_posix_memalign (void **memptr, size_t alignment, size_t size) |
Allocate aligned memory. More... | |
void | ni_usleep (int64_t usec) |
char * | ni_strtok (char *s, const char *delim, char **saveptr) |
ni_buf_t * | ni_buf_pool_expand (ni_buf_pool_t *pool) |
ni_buf_t * | ni_buf_pool_get_buffer (ni_buf_pool_t *p_buffer_pool) |
void | ni_buf_pool_return_buffer (ni_buf_t *buf, ni_buf_pool_t *p_buffer_pool) |
ni_buf_t * | ni_buf_pool_allocate_buffer (ni_buf_pool_t *p_buffer_pool, int buffer_size) |
int32_t | ni_dec_fme_buffer_pool_initialize (ni_session_context_t *p_ctx, int32_t number_of_buffers, int width, int height, int height_align, int factor) |
void | ni_dec_fme_buffer_pool_free (ni_buf_pool_t *p_buffer_pool) |
void | ni_buffer_pool_free (ni_queue_buffer_pool_t *p_buffer_pool) |
ni_queue_node_t * | ni_buffer_pool_allocate_buffer (ni_queue_buffer_pool_t *p_buffer_pool) |
int32_t | ni_buffer_pool_initialize (ni_session_context_t *p_ctx, int32_t number_of_buffers) |
ni_queue_node_t * | ni_buffer_pool_expand (ni_queue_buffer_pool_t *pool) |
ni_queue_node_t * | ni_buffer_pool_get_queue_buffer (ni_queue_buffer_pool_t *p_buffer_pool) |
void | ni_buffer_pool_return_buffer (ni_queue_node_t *buf, ni_queue_buffer_pool_t *p_buffer_pool) |
int32_t | ni_get_frame_index (uint32_t *value) |
Get xcoder instance id. More... | |
ni_retcode_t | ni_find_blk_name (const char *p_dev, char *p_out_buf, int out_buf_len) |
Find NVMe name space block from device name If none is found, assume nvme multi-pathing is disabled and return /dev/nvmeXn1. More... | |
ni_retcode_t | ni_check_dev_name (const char *p_dev) |
check dev name More... | |
ni_retcode_t | ni_timestamp_init (ni_session_context_t *p_ctx, ni_timestamp_table_t **pp_table, const char *name) |
Initialize timestamp handling. More... | |
ni_retcode_t | ni_timestamp_done (ni_timestamp_table_t *p_table, ni_queue_buffer_pool_t *p_buffer_pool) |
Clean up timestamp handling. More... | |
ni_retcode_t | ni_timestamp_register (ni_queue_buffer_pool_t *p_buffer_pool, ni_timestamp_table_t *p_table, int64_t timestamp, uint64_t data_info) |
Register timestamp in timestamp/frameoffset table. More... | |
ni_retcode_t | ni_timestamp_get (ni_timestamp_table_t *p_table, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool) |
Retrieve timestamp from table based on frameoffset info. More... | |
ni_retcode_t | ni_timestamp_get_with_threshold (ni_timestamp_table_t *p_table, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool) |
void | ni_timestamp_scan_cleanup (ni_timestamp_table_t *pts_list, ni_timestamp_table_t *dts_list, ni_queue_buffer_pool_t *p_buffer_pool) |
ni_retcode_t | ni_timestamp_get_v2 (ni_timestamp_table_t *p_table, uint64_t frame_offset, int64_t *p_timestamp, int32_t threshold, ni_queue_buffer_pool_t *p_buffer_pool) |
Retrieve timestamp from table based on frameoffset info. More... | |
ni_retcode_t | ni_queue_init (ni_session_context_t *p_ctx, ni_queue_t *p_queue, const char *name) |
Initialize xcoder queue. More... | |
ni_retcode_t | ni_queue_push (ni_queue_buffer_pool_t *p_buffer_pool, ni_queue_t *p_queue, uint64_t frame_info, int64_t timestamp) |
Push into xcoder queue. More... | |
ni_retcode_t | ni_queue_pop (ni_queue_t *p_queue, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool) |
Pop from the xcoder queue. More... | |
ni_retcode_t | ni_queue_pop_threshold (ni_queue_t *p_queue, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool) |
ni_retcode_t | ni_queue_free (ni_queue_t *p_queue, ni_queue_buffer_pool_t *p_buffer_pool) |
Free xcoder queue. More... | |
ni_retcode_t | ni_queue_print (ni_queue_t *p_queue) |
Print xcoder queue info. More... | |
int32_t | ni_atobool (const char *p_str, bool *b_error) |
Convert string to boolean. More... | |
int32_t | ni_atoi (const char *p_str, bool *b_error) |
Convert string to integer. More... | |
double | ni_atof (const char *p_str, bool *b_error) |
Convert string to floating. More... | |
int32_t | ni_parse_name (const char *arg, const char *const *names, bool *b_error) |
Parse name. More... | |
uint64_t | ni_get_utime (void) |
Get system time for log. More... | |
uint64_t | ni_gettime_ns (void) |
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. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. More... | |
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 info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take alignment requirements into account. More... | |
void | ni_get_min_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 info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take into account both min resolution and alignment requirements. More... | |
void | ni_copy_plane_data (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, int is_semiplanar, int conf_win_right, int dst_stride[NI_MAX_NUM_DATA_POINTERS], int dst_height[NI_MAX_NUM_DATA_POINTERS], int src_stride[NI_MAX_NUM_DATA_POINTERS], int src_height[NI_MAX_NUM_DATA_POINTERS], int i) |
Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More... | |
void | ni_copy_hw_yuv420p (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, int is_semiplanar, int conf_win_right, int dst_stride[NI_MAX_NUM_DATA_POINTERS], int dst_height[NI_MAX_NUM_DATA_POINTERS], int src_stride[NI_MAX_NUM_DATA_POINTERS], int src_height[NI_MAX_NUM_DATA_POINTERS]) |
Copy YUV data to Netint HW YUV420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More... | |
void | ni_copy_frame_data (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, ni_pix_fmt_t pix_fmt, int conf_win_right, int dst_stride[NI_MAX_NUM_DATA_POINTERS], int dst_height[NI_MAX_NUM_DATA_POINTERS], int src_stride[NI_MAX_NUM_DATA_POINTERS], int src_height[NI_MAX_NUM_DATA_POINTERS]) |
Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More... | |
void | ni_copy_yuv_444p_to_420p (uint8_t *p_dst0[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_dst1[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, int mode) |
Copy yuv444p data to yuv420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More... | |
int | ni_insert_emulation_prevent_bytes (uint8_t *buf, int size) |
Insert emulation prevention byte(s) as needed into the data buffer. More... | |
int | ni_remove_emulation_prevent_bytes (uint8_t *buf, int size) |
Remove emulation prevention byte(s) as needed from the data buffer. More... | |
ni_retcode_t | ni_network_layer_convert_output (float *dst, uint32_t dst_len, ni_packet_t *p_packet, ni_network_data_t *p_network, uint32_t layer) |
ni_retcode_t | ni_network_layer_convert_tensor (uint8_t *dst, uint32_t dst_len, const char *tensor_file, ni_network_layer_params_t *p_param) |
ni_retcode_t | ni_network_convert_tensor_to_data (uint8_t *dst, uint32_t dst_len, float *src, uint32_t src_len, ni_network_layer_params_t *p_param) |
ni_retcode_t | ni_network_convert_data_to_tensor (float *dst, uint32_t dst_len, uint8_t *src, uint32_t src_len, ni_network_layer_params_t *p_param) |
uint32_t | ni_ai_network_layer_size (ni_network_layer_params_t *p_param) |
uint32_t | ni_ai_network_layer_dims (ni_network_layer_params_t *p_param) |
void | ni_SHA256Transform (SHA256CTX *psCtx, const uint8_t aui8Data[]) |
void | ni_SHA256Init (SHA256CTX *psCtx) |
void | ni_SHA256Update (SHA256CTX *psCtx, const uint8_t aui8Data[], size_t ui32Length) |
void | ni_SHA256Final (SHA256CTX *psCtx, uint8_t aui8Hash[]) |
void | ni_calculate_sha256 (const uint8_t aui8Data[], size_t ui32DataLength, uint8_t aui8Hash[]) |
void | ni_copy_hw_descriptors (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS]) |
Copy Descriptor data to Netint HW descriptor frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. Only necessary when metadata size in source is insufficient. More... | |
char * | ni_get_libxcoder_api_ver (void) |
Get libxcoder API version. More... | |
NI_DEPRECATED char * | ni_get_compat_fw_api_ver (void) |
Get FW API version libxcoder is compatible with. Deprecated in favour of ni_fmt_fw_api_ver_str(&NI_XCODER_REVISION[NI_XCODER_REVISION_API_MAJOR_VER_IDX], &char_buf[0]); More... | |
void | ni_fmt_fw_api_ver_str (const char ver_str[], char fmt_str[]) |
Get formatted FW API version string from unformatted FW API version string. More... | |
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 format length changed from 2 to 3. More... | |
char * | ni_get_libxcoder_release_ver (void) |
Get libxcoder SW release version. More... | |
const char * | ni_get_rc_txt (ni_retcode_t rc) |
Get text string for the provided error. More... | |
int | ni_param_get_key_value (char *p_str, char *key, char *value) |
retrieve key and value from 'key=value' pair More... | |
int | ni_retrieve_xcoder_params (char xcoderParams[], ni_xcoder_params_t *params, ni_session_context_t *ctx) |
retrieve encoder config parameter values from –xcoder-params More... | |
int | ni_retrieve_xcoder_gop (char xcoderGop[], ni_xcoder_params_t *params, ni_session_context_t *ctx) |
Retrieve custom gop config values from –xcoder-gop. More... | |
int | ni_retrieve_decoder_params (char xcoderParams[], ni_xcoder_params_t *params, ni_session_context_t *ctx) |
retrieve decoder config parameter values from –decoder-params More... | |
int | ni_pthread_mutex_init (ni_pthread_mutex_t *mutex) |
initialize a mutex More... | |
int | ni_pthread_mutex_destroy (ni_pthread_mutex_t *mutex) |
destory a mutex More... | |
int | ni_pthread_mutex_lock (ni_pthread_mutex_t *mutex) |
thread mutex lock More... | |
int | ni_pthread_mutex_unlock (ni_pthread_mutex_t *mutex) |
thread mutex unlock More... | |
int | ni_pthread_create (ni_pthread_t *thread, const ni_pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) |
create a new thread More... | |
int | ni_pthread_join (ni_pthread_t thread, void **value_ptr) |
join with a terminated thread More... | |
int | ni_pthread_cond_init (ni_pthread_cond_t *cond, const ni_pthread_condattr_t *attr) |
initialize condition variables More... | |
int | ni_pthread_cond_destroy (ni_pthread_cond_t *cond) |
destroy condition variables More... | |
int | ni_pthread_cond_broadcast (ni_pthread_cond_t *cond) |
broadcast a condition More... | |
int | ni_pthread_cond_wait (ni_pthread_cond_t *cond, ni_pthread_mutex_t *mutex) |
wait on a condition More... | |
int | ni_pthread_cond_signal (ni_pthread_cond_t *cond) |
signal a condition More... | |
int | ni_pthread_cond_timedwait (ni_pthread_cond_t *cond, ni_pthread_mutex_t *mutex, const struct timespec *abstime) |
wait on a condition More... | |
int | ni_pthread_sigmask (int how, const ni_sigset_t *set, ni_sigset_t *oldset) |
examine and change mask of blocked signals More... | |
const char * | ni_ai_errno_to_str (int rc) |
return error string according to error code from firmware More... | |
uint32_t | ni_decode_power_measurement (uint32_t current_data, const uint8_t *serial_number) |
decode the raw current obtained and determine power More... | |
ni_retcode_t | ni_quadra_card_identify_precheck (const char *p_dev) |
precheck a device can be read by ni_device_capability_query() INFO OR ERROR logs will not be printed in this function More... | |
#define _EPSILON 1e-8 |
#define MAJ | ( | x, | |
y, | |||
z | |||
) | (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
#define ROTLEFT | ( | a, | |
b | |||
) | (((a) << (b)) | ((a) >> (32 - (b)))) |
#define ROTRIGHT | ( | a, | |
b | |||
) | (((a) >> (b)) | ((a) << (32 - (b)))) |
typedef struct _ni_err_rc_txt_entry ni_err_rc_txt_entry_t |
const char* ni_ai_errno_to_str | ( | int | rc | ) |
uint32_t ni_ai_network_layer_dims | ( | ni_network_layer_params_t * | p_param | ) |
uint32_t ni_ai_network_layer_size | ( | ni_network_layer_params_t * | p_param | ) |
int32_t ni_atobool | ( | const char * | p_str, |
bool * | b_error | ||
) |
double ni_atof | ( | const char * | p_str, |
bool * | b_error | ||
) |
int32_t ni_atoi | ( | const char * | p_str, |
bool * | b_error | ||
) |
ni_buf_t* ni_buf_pool_allocate_buffer | ( | ni_buf_pool_t * | p_buffer_pool, |
int | buffer_size | ||
) |
ni_buf_t* ni_buf_pool_expand | ( | ni_buf_pool_t * | pool | ) |
ni_buf_t* ni_buf_pool_get_buffer | ( | ni_buf_pool_t * | p_buffer_pool | ) |
void ni_buf_pool_return_buffer | ( | ni_buf_t * | buf, |
ni_buf_pool_t * | p_buffer_pool | ||
) |
ni_queue_node_t* ni_buffer_pool_allocate_buffer | ( | ni_queue_buffer_pool_t * | p_buffer_pool | ) |
ni_queue_node_t* ni_buffer_pool_expand | ( | ni_queue_buffer_pool_t * | pool | ) |
void ni_buffer_pool_free | ( | ni_queue_buffer_pool_t * | p_buffer_pool | ) |
ni_queue_node_t* ni_buffer_pool_get_queue_buffer | ( | ni_queue_buffer_pool_t * | p_buffer_pool | ) |
int32_t ni_buffer_pool_initialize | ( | ni_session_context_t * | p_ctx, |
int32_t | number_of_buffers | ||
) |
void ni_buffer_pool_return_buffer | ( | ni_queue_node_t * | buf, |
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
void ni_calculate_sha256 | ( | const uint8_t | aui8Data[], |
size_t | ui32DataLength, | ||
uint8_t | aui8Hash[] | ||
) |
ni_retcode_t ni_check_dev_name | ( | const char * | p_dev | ) |
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 format length changed from 2 to 3.
[in] | ver1 | pointer to string containing FW API. Only up to 3 characters will be read |
[in] | ver2 | pointer to string containing FW API. Only up to 3 characters will be read |
void ni_copy_frame_data | ( | uint8_t * | p_dst[NI_MAX_NUM_DATA_POINTERS], |
uint8_t * | p_src[NI_MAX_NUM_DATA_POINTERS], | ||
int | frame_width, | ||
int | frame_height, | ||
int | factor, | ||
ni_pix_fmt_t | pix_fmt, | ||
int | conf_win_right, | ||
int | dst_stride[NI_MAX_NUM_DATA_POINTERS], | ||
int | dst_height[NI_MAX_NUM_DATA_POINTERS], | ||
int | src_stride[NI_MAX_NUM_DATA_POINTERS], | ||
int | src_height[NI_MAX_NUM_DATA_POINTERS] | ||
) |
Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.
[out] | p_dst | pointers to which data is copied |
[in] | p_src | pointers from which data is copied |
[in] | width | source frame width |
[in] | height | source frame height |
[in] | factor | 1 for 8 bit, 2 for 10 bit |
[in] | pix_fmt | pixel format to distinguish between planar types and/or components |
[in] | conf_win_right | right offset of conformance window |
[in] | dst_stride | size (in bytes) of each plane width in destination |
[in] | dst_height | size of each plane height in destination |
[in] | src_stride | size (in bytes) of each plane width in source |
[in] | src_height | size of each plane height in source |
void ni_copy_hw_descriptors | ( | uint8_t * | p_dst[NI_MAX_NUM_DATA_POINTERS], |
uint8_t * | p_src[NI_MAX_NUM_DATA_POINTERS] | ||
) |
Copy Descriptor data to Netint HW descriptor frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. Only necessary when metadata size in source is insufficient.
[out] | p_dst | pointers of Y/Cb/Cr to which data is copied |
[in] | p_src | pointers of Y/Cb/Cr from which data is copied |
void ni_copy_hw_yuv420p | ( | uint8_t * | p_dst[NI_MAX_NUM_DATA_POINTERS], |
uint8_t * | p_src[NI_MAX_NUM_DATA_POINTERS], | ||
int | frame_width, | ||
int | frame_height, | ||
int | factor, | ||
int | is_semiplanar, | ||
int | conf_win_right, | ||
int | dst_stride[NI_MAX_NUM_DATA_POINTERS], | ||
int | dst_height[NI_MAX_NUM_DATA_POINTERS], | ||
int | src_stride[NI_MAX_NUM_DATA_POINTERS], | ||
int | src_height[NI_MAX_NUM_DATA_POINTERS] | ||
) |
Copy YUV data to Netint HW YUV420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.
[out] | p_dst | pointers of Y/Cb/Cr to which data is copied |
[in] | p_src | pointers of Y/Cb/Cr from which data is copied |
[in] | width | source YUV frame width |
[in] | height | source YUV frame height |
[in] | factor | 1 for 8 bit, 2 for 10 bit |
[in] | is_semiplanar | non-0 for semiplanar frame, 0 otherwise |
[in] | conf_win_right | right offset of conformance window |
[in] | dst_stride | size (in bytes) of each plane width in destination |
[in] | dst_height | size of each plane height in destination |
[in] | src_stride | size (in bytes) of each plane width in source |
[in] | src_height | size of each plane height in source |
void ni_copy_plane_data | ( | uint8_t * | p_dst[NI_MAX_NUM_DATA_POINTERS], |
uint8_t * | p_src[NI_MAX_NUM_DATA_POINTERS], | ||
int | frame_width, | ||
int | frame_height, | ||
int | factor, | ||
int | is_semiplanar, | ||
int | conf_win_right, | ||
int | dst_stride[NI_MAX_NUM_DATA_POINTERS], | ||
int | dst_height[NI_MAX_NUM_DATA_POINTERS], | ||
int | src_stride[NI_MAX_NUM_DATA_POINTERS], | ||
int | src_height[NI_MAX_NUM_DATA_POINTERS], | ||
int | i | ||
) |
Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.
[out] | p_dst | pointers to which data is copied |
[in] | p_src | pointers from which data is copied |
[in] | width | source frame width |
[in] | height | source frame height |
[in] | factor | 1 for 8 bit, 2 for 10 bit |
[in] | is_semiplanar | non-0 for semiplanar frame, 0 otherwise |
[in] | conf_win_right | right offset of conformance window |
[in] | dst_stride | size (in bytes) of each plane width in destination |
[in] | dst_height | size of each plane height in destination |
[in] | src_stride | size (in bytes) of each plane width in source |
[in] | src_height | size of each plane height in source |
[in] | i | index to plane to be copied |
void ni_copy_yuv_444p_to_420p | ( | uint8_t * | p_dst0[NI_MAX_NUM_DATA_POINTERS], |
uint8_t * | p_dst1[NI_MAX_NUM_DATA_POINTERS], | ||
uint8_t * | p_src[NI_MAX_NUM_DATA_POINTERS], | ||
int | frame_width, | ||
int | frame_height, | ||
int | factor, | ||
int | mode | ||
) |
Copy yuv444p data to yuv420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.
[out] | p_dst0 | pointers of Y/Cb/Cr as yuv420p output0 |
[out] | p_dst1 | pointers of Y/Cb/Cr as yuv420p output1 |
[in] | p_src | pointers of Y/Cb/Cr as yuv444p intput |
[in] | width | source YUV frame width |
[in] | height | source YUV frame height |
[in] | factor | 1 for 8 bit, 2 for 10 bit |
[in] | mode | 0 for out0 is Y+1/2V, with the original input as the out0, 1/4V copy to data[1] 1/4V copy to data[2] out1 is U+1/2V, U copy to data[0], 1/4V copy to data[1], 1/4V copy to data[2] mode 1 for out0 is Y+1/2u+1/2v, with the original input as the output0, 1/4U copy to data[1] 1/4V copy to data[2] out1 is (1/2U+1/2V)+1/4U+1/4V, 1/2U & 1/2V copy to data[0], 1/4U copy to data[1], 1/4V copy to data[2] |
void ni_dec_fme_buffer_pool_free | ( | ni_buf_pool_t * | p_buffer_pool | ) |
int32_t ni_dec_fme_buffer_pool_initialize | ( | ni_session_context_t * | p_ctx, |
int32_t | number_of_buffers, | ||
int | width, | ||
int | height, | ||
int | height_align, | ||
int | factor | ||
) |
uint32_t ni_decode_power_measurement | ( | uint32_t | current_data, |
const uint8_t * | serial_number | ||
) |
ni_retcode_t ni_find_blk_name | ( | const char * | p_dev, |
char * | p_out_buf, | ||
int | out_buf_len | ||
) |
Find NVMe name space block from device name If none is found, assume nvme multi-pathing is disabled and return /dev/nvmeXn1.
[in] | p_dev | Device name represented as c string. ex: "/dev/nvme0" |
[in] | out_buf | Output buffer to put NVMe name space block. Must be at least length 21 |
void ni_fmt_fw_api_ver_str | ( | const char | ver_str[], |
char | fmt_str[] | ||
) |
Get formatted FW API version string from unformatted FW API version string.
[in] | ver_str | pointer to string containing FW API. Only up to 3 characters will be read |
[out] | fmt_str | pointer to string buffer of at least size 5 to output formated version string to |
NI_DEPRECATED char* ni_get_compat_fw_api_ver | ( | void | ) |
Get FW API version libxcoder is compatible with. Deprecated in favour of ni_fmt_fw_api_ver_str(&NI_XCODER_REVISION[NI_XCODER_REVISION_API_MAJOR_VER_IDX], &char_buf[0]);
Get FW API version libxcoder is compatible with.
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 info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take alignment requirements into account.
[in] | width | source frame width |
[in] | height | source frame height |
[in] | pix_fmt | ni pixel format |
[out] | plane_stride | size (in bytes) of each plane width |
[out] | plane_height | size of each plane height |
int32_t ni_get_frame_index | ( | uint32_t * | value | ) |
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. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation.
[in] | width | source YUV frame width |
[in] | height | source YUV frame height |
[in] | factor | 1 for 8 bit, 2 for 10 bit |
[in] | is_semiplanar | 1 for semiplanar frame, 0 otherwise |
[out] | plane_stride | size (in bytes) of each plane width |
[out] | plane_height | size of each plane height |
char* ni_get_libxcoder_api_ver | ( | void | ) |
char* ni_get_libxcoder_release_ver | ( | void | ) |
void ni_get_min_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 info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take into account both min resolution and alignment requirements.
[in] | width | source frame width |
[in] | height | source frame height |
[in] | pix_fmt | ni pixel format |
[out] | plane_stride | size (in bytes) of each plane width |
[out] | plane_height | size of each plane height |
const char* ni_get_rc_txt | ( | ni_retcode_t | rc | ) |
uint64_t ni_get_utime | ( | void | ) |
int32_t ni_gettimeofday | ( | struct timeval * | p_tp, |
void * | p_tzp | ||
) |
int ni_insert_emulation_prevent_bytes | ( | uint8_t * | buf, |
int | size | ||
) |
Insert emulation prevention byte(s) as needed into the data buffer.
buf | data buffer to be worked on - new byte(s) will be inserted size number of bytes starting from buf to check |
Note: caller MUST ensure for newly inserted bytes, buf has enough free space starting from buf + size
ni_retcode_t ni_network_convert_data_to_tensor | ( | float * | dst, |
uint32_t | dst_len, | ||
uint8_t * | src, | ||
uint32_t | src_len, | ||
ni_network_layer_params_t * | p_param | ||
) |
ni_retcode_t ni_network_convert_tensor_to_data | ( | uint8_t * | dst, |
uint32_t | dst_len, | ||
float * | src, | ||
uint32_t | src_len, | ||
ni_network_layer_params_t * | p_param | ||
) |
ni_retcode_t ni_network_layer_convert_output | ( | float * | dst, |
uint32_t | dst_len, | ||
ni_packet_t * | p_packet, | ||
ni_network_data_t * | p_network, | ||
uint32_t | layer | ||
) |
ni_retcode_t ni_network_layer_convert_tensor | ( | uint8_t * | dst, |
uint32_t | dst_len, | ||
const char * | tensor_file, | ||
ni_network_layer_params_t * | p_param | ||
) |
int ni_param_get_key_value | ( | char * | p_str, |
char * | key, | ||
char * | value | ||
) |
int32_t ni_parse_name | ( | const char * | arg, |
const char *const * | names, | ||
bool * | b_error | ||
) |
int ni_posix_memalign | ( | void ** | memptr, |
size_t | alignment, | ||
size_t | size | ||
) |
Allocate aligned memory.
[in/out] | memptr The address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of sizeof(void *). If size is 0, then the value placed is either NULL, or a unique pointer value that can later be successfully passed to free. | |
[in] | alignment | The alignment value of the allocated value. |
[in] | size | The allocated memory size. |
int ni_pthread_cond_broadcast | ( | ni_pthread_cond_t * | cond | ) |
int ni_pthread_cond_destroy | ( | ni_pthread_cond_t * | cond | ) |
int ni_pthread_cond_init | ( | ni_pthread_cond_t * | cond, |
const ni_pthread_condattr_t * | attr | ||
) |
int ni_pthread_cond_signal | ( | ni_pthread_cond_t * | cond | ) |
int ni_pthread_cond_timedwait | ( | ni_pthread_cond_t * | cond, |
ni_pthread_mutex_t * | mutex, | ||
const struct timespec * | abstime | ||
) |
int ni_pthread_cond_wait | ( | ni_pthread_cond_t * | cond, |
ni_pthread_mutex_t * | mutex | ||
) |
int ni_pthread_create | ( | ni_pthread_t * | thread, |
const ni_pthread_attr_t * | attr, | ||
void *(*)(void *) | start_routine, | ||
void * | arg | ||
) |
int ni_pthread_join | ( | ni_pthread_t | thread, |
void ** | value_ptr | ||
) |
int ni_pthread_mutex_destroy | ( | ni_pthread_mutex_t * | mutex | ) |
int ni_pthread_mutex_init | ( | ni_pthread_mutex_t * | mutex | ) |
int ni_pthread_mutex_lock | ( | ni_pthread_mutex_t * | mutex | ) |
int ni_pthread_mutex_unlock | ( | ni_pthread_mutex_t * | mutex | ) |
int ni_pthread_sigmask | ( | int | how, |
const ni_sigset_t * | set, | ||
ni_sigset_t * | oldset | ||
) |
examine and change mask of blocked signals
[in] | how | behavior of this call, can be value of SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK |
[in] | set | current value of the signal mask. If NULL, the mask keeps unchanged. |
[in] | old_set | previous value of the signal mask, can be NULL. |
ni_retcode_t ni_quadra_card_identify_precheck | ( | const char * | p_dev | ) |
precheck a device can be read by ni_device_capability_query() INFO OR ERROR logs will not be printed in this function
[in] | p_dev | device path string. eg: "/dev/nvme1n2" |
returns NI_RETCODE_SUCCESS when
ni_retcode_t ni_queue_free | ( | ni_queue_t * | p_queue, |
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_queue_init | ( | ni_session_context_t * | p_ctx, |
ni_queue_t * | p_queue, | ||
const char * | name | ||
) |
ni_retcode_t ni_queue_pop | ( | ni_queue_t * | p_queue, |
uint64_t | frame_info, | ||
int64_t * | p_timestamp, | ||
int32_t | threshold, | ||
int32_t | print, | ||
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_queue_pop_threshold | ( | ni_queue_t * | p_queue, |
uint64_t | frame_info, | ||
int64_t * | p_timestamp, | ||
int32_t | threshold, | ||
int32_t | print, | ||
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_queue_print | ( | ni_queue_t * | p_queue | ) |
ni_retcode_t ni_queue_push | ( | ni_queue_buffer_pool_t * | p_buffer_pool, |
ni_queue_t * | p_queue, | ||
uint64_t | frame_info, | ||
int64_t | timestamp | ||
) |
int ni_remove_emulation_prevent_bytes | ( | uint8_t * | buf, |
int | size | ||
) |
Remove emulation prevention byte(s) as needed from the data buffer.
buf | data buffer to be worked on - emu prevent byte(s) will be removed from. size number of bytes starting from buf to check |
Note: buf will be modified if emu prevent byte(s) found and removed.
int ni_retrieve_decoder_params | ( | char | xcoderParams[], |
ni_xcoder_params_t * | params, | ||
ni_session_context_t * | ctx | ||
) |
retrieve decoder config parameter values from –decoder-params
Retrieve decoder config parameter values from –decoder-params.
[in] | xcoderParams | pointer to string containing xcoder params |
[out] | params | pointer to xcoder params to fill out |
[out] | ctx | pointer to session context |
int ni_retrieve_xcoder_gop | ( | char | xcoderGop[], |
ni_xcoder_params_t * | params, | ||
ni_session_context_t * | ctx | ||
) |
int ni_retrieve_xcoder_params | ( | char | xcoderParams[], |
ni_xcoder_params_t * | params, | ||
ni_session_context_t * | ctx | ||
) |
retrieve encoder config parameter values from –xcoder-params
Retrieve encoder config parameter values from –xcoder-params.
[in] | xcoderParams | pointer to string containing xcoder params |
[out] | params | pointer to xcoder params to fill out |
[out] | ctx | pointer to session context |
uint32_t ni_round_up | ( | uint32_t | number_to_round, |
uint32_t | multiple | ||
) |
void ni_SHA256Final | ( | SHA256CTX * | psCtx, |
uint8_t | aui8Hash[] | ||
) |
void ni_SHA256Transform | ( | SHA256CTX * | psCtx, |
const uint8_t | aui8Data[] | ||
) |
void ni_SHA256Update | ( | SHA256CTX * | psCtx, |
const uint8_t | aui8Data[], | ||
size_t | ui32Length | ||
) |
char* ni_strtok | ( | char * | s, |
const char * | delim, | ||
char ** | saveptr | ||
) |
ni_retcode_t ni_timestamp_done | ( | ni_timestamp_table_t * | p_table, |
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_timestamp_get | ( | ni_timestamp_table_t * | p_table, |
uint64_t | frame_info, | ||
int64_t * | p_timestamp, | ||
int32_t | threshold, | ||
int32_t | print, | ||
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_timestamp_get_v2 | ( | ni_timestamp_table_t * | p_table, |
uint64_t | frame_offset, | ||
int64_t * | p_timestamp, | ||
int32_t | threshold, | ||
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_timestamp_get_with_threshold | ( | ni_timestamp_table_t * | p_table, |
uint64_t | frame_info, | ||
int64_t * | p_timestamp, | ||
int32_t | threshold, | ||
int32_t | print, | ||
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |
ni_retcode_t ni_timestamp_init | ( | ni_session_context_t * | p_ctx, |
ni_timestamp_table_t ** | pp_table, | ||
const char * | name | ||
) |
ni_retcode_t ni_timestamp_register | ( | ni_queue_buffer_pool_t * | p_buffer_pool, |
ni_timestamp_table_t * | p_table, | ||
int64_t | timestamp, | ||
uint64_t | data_info | ||
) |
void ni_timestamp_scan_cleanup | ( | ni_timestamp_table_t * | pts_list, |
ni_timestamp_table_t * | dts_list, | ||
ni_queue_buffer_pool_t * | p_buffer_pool | ||
) |