![]() |
libxcoder
5.2.0
|
Private definitions used by ni_quadra_enc_api.c for video processing tasks. More...
#include "ni_quadra_enc_api.h"
#include "ni_device_api.h"
#include "ni_defs.h"
#include "ni_rsrc_api.h"
#include "ni_util.h"
#include "ni_av_codec.h"
Go to the source code of this file.
Macros | |
#define | NI_CODEC_ID_MJPEG 8 |
#define | NI_CODEC_ID_MJPEG 8 |
Functions | |
void | ni_quadra_enc_gop_params_set (ni_quadra_enc_context_t *p_enc_ctx, char *key) |
Set gop_params. More... | |
bool | ni_quadra_enc_gop_params_check (ni_quadra_enc_context_t *p_enc_ctx) |
Check gop_params. More... | |
int | ni_quadra_encoder_xcoder_opts_params_set_value (ni_quadra_enc_context_t *p_enc_ctx, const char *name, const char *value) |
Set value referenced by name in encode parameters structure. More... | |
int | ni_quadra_encoder_xcoder_gop_params_set_value (ni_quadra_enc_context_t *p_enc_ctx, const char *name, const char *value) |
Set value referenced by name in encode parameters structure. More... | |
int | ni_quadra_xcoder_encoder_headers (ni_quadra_enc_context_t *p_enc_ctx) |
int | ni_quadra_setup_encoder (ni_quadra_enc_context_t *p_enc_ctx) |
Initialize init device session_context and init default params including ni_quadra_enc_context_t, ni_session_context_t, ni_xcoder_params_t. More... | |
int | ni_quadra_enc_init (ni_quadra_enc_context_t *p_enc_ctx) |
Initialize malloc device session_context and malloc params including ni_quadra_enc_context_t, ni_session_context_t, ni_xcoder_params_t. More... | |
int | ni_quadra_encode_close (ni_quadra_enc_context_t *p_enc_ctx) |
Close device session_context including ni_quadra_enc_context_t,. More... | |
int | ni_quadra_encode_sequence_change (ni_quadra_enc_context_t *p_enc_ctx, int width, int height, int bit_depth_factor) |
Set encode sequence change. More... | |
int | ni_quadra_encode_session_open (ni_quadra_enc_context_t *p_enc_ctx, int frame_width, int frame_height, const int *frame_linesize, niquadraFrameSurface1_t *p_surface, bool hw_frames_ctx, int frame_queqe, int avctx_flags) |
Set encode session open and set niframe default info. More... | |
int | ni_quadra_encode_send_prepare (ni_quadra_enc_context_t *p_enc_ctx, niquadraFrameSurface1_t *p_surface, int frame_width, int frame_height) |
Prepare a niframe which to send to encoder. More... | |
void | ni_quadra_frame_new_aux_data (ni_quadra_enc_context_t *p_enc_ctx, void *side_data, int data_size, int type) |
Add a new auxiliary data to a frame. More... | |
int | ni_quadra_enc_prep_aux_data (ni_quadra_enc_context_t *p_enc_ctx, void *side_data, int data_size) |
Prepare auxiliary data that should be sent together with this frame to encoder based on the auxiliary data of the decoded frame. More... | |
int | ni_quadra_enc_make_niframe (ni_quadra_enc_context_t *p_enc_ctx, uint8_t **data, uint8_t *nidata, int *linesize, int frame_width, int frame_height, NIFramesContext *nif_src_ctx) |
Copy avframe to niframe. More... | |
int | ni_quadra_enc_send_frame (ni_quadra_enc_context_t *p_enc_ctx) |
Send niframe to do encoder. More... | |
int | ni_quadra_enc_device_session_flush (ni_quadra_enc_context_t *p_enc_ctx) |
Flush encode session context. More... | |
int | ni_quadra_encode_reinit (ni_quadra_enc_context_t *p_enc_ctx, int frame_width, int frame_height, const int *linesize) |
Reinit encode context. More... | |
int | ni_quadra_encode_after_reinit (ni_quadra_enc_context_t *p_enc_ctx) |
Reinit after need to sync context. More... | |
int | ni_quadra_encoder_receive_packet (ni_quadra_enc_context_t *p_enc_ctx) |
Recive packet frome encode. More... | |
int | ni_quadra_enc_get_extra_data (ni_quadra_enc_context_t *p_enc_ctx, uint8_t *p_dst) |
Copy niframe to make avframe. More... | |
int | ni_quadra_encoder_prepare_avpkt (ni_quadra_enc_context_t *p_enc_ctx, int is_pkt, int64_t *pkt_pts, int64_t *pkt_dts, int *pkt_flag) |
Make avpkt from encode. More... | |
void | ni_quadra_set_session_wh (void *session_ctx, int width, int height) |
Set width and height to session context. More... | |
int | ni_quadra_packet_buffer_alloc (ni_quadra_enc_context_t *p_enc_ctx) |
Allocate memory for the packet buffer based on provided packet size. More... | |
int | ni_quadra_get_pkt_info_size (void) |
Get struct ni_pkt_info size. More... | |
void | ni_quadra_get_pkt_info (void *session_ctx, void *data) |
Get ni_pkt_info psnr info. More... | |
Variables | |
uint8_t | mdcv_data [NI_MAX_SEI_DATA] |
uint8_t | cll_data [NI_MAX_SEI_DATA] |
uint8_t | cc_data [NI_MAX_SEI_DATA] |
uint8_t | udu_data [NI_MAX_SEI_DATA] |
uint8_t | hdrp_data [NI_MAX_SEI_DATA] |
Private definitions used by ni_quadra_enc_api.c for video processing tasks.
Definition in file ni_quadra_enc_api.c.
#define NI_CODEC_ID_MJPEG 8 |
#define NI_CODEC_ID_MJPEG 8 |
int ni_quadra_enc_device_session_flush | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Flush encode session context.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 2045 of file ni_quadra_enc_api.c.
int ni_quadra_enc_get_extra_data | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
uint8_t * | p_dst | ||
) |
Copy niframe to make avframe.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | p_dst | Pointer to frame data |
Definition at line 2427 of file ni_quadra_enc_api.c.
bool ni_quadra_enc_gop_params_check | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Check gop_params.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 42 of file ni_quadra_enc_api.c.
void ni_quadra_enc_gop_params_set | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
char * | key | ||
) |
Set gop_params.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
[in/out] | key Pointer params string |
Definition at line 36 of file ni_quadra_enc_api.c.
int ni_quadra_enc_init | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Initialize malloc device session_context and malloc params including ni_quadra_enc_context_t, ni_session_context_t, ni_xcoder_params_t.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 672 of file ni_quadra_enc_api.c.
int ni_quadra_enc_make_niframe | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
uint8_t ** | data, | ||
uint8_t * | nidata, | ||
int * | linesize, | ||
int | frame_width, | ||
int | frame_height, | ||
NIFramesContext * | nif_src_ctx | ||
) |
Copy avframe to niframe.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | data | frame data |
[in] | nidata | frame data[3] |
[in] | linesize | frame linesize |
[in] | frame_width | frame width |
[in] | frame_height | frame height |
[in] | nif_src_ctx | pointer to niquadraFrameSurface1_t |
Definition at line 1752 of file ni_quadra_enc_api.c.
int ni_quadra_enc_prep_aux_data | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
void * | side_data, | ||
int | data_size | ||
) |
Prepare auxiliary data that should be sent together with this frame to encoder based on the auxiliary data of the decoded frame.
[in/out] | Pointer to ni_quadra_enc_context_t | |
[out] | side_data | frame side data |
[in] | data_size | frame side data size |
Definition at line 1551 of file ni_quadra_enc_api.c.
int ni_quadra_enc_send_frame | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Send niframe to do encoder.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 2013 of file ni_quadra_enc_api.c.
int ni_quadra_encode_after_reinit | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Reinit after need to sync context.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 2147 of file ni_quadra_enc_api.c.
int ni_quadra_encode_close | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Close device session_context including ni_quadra_enc_context_t,.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 856 of file ni_quadra_enc_api.c.
int ni_quadra_encode_reinit | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
int | frame_width, | ||
int | frame_height, | ||
const int * | linesize | ||
) |
Reinit encode context.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | linesize | frame linesize |
[in] | frame_width | frame width |
[in] | frame_height | frame height |
Definition at line 2050 of file ni_quadra_enc_api.c.
int ni_quadra_encode_send_prepare | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
niquadraFrameSurface1_t * | p_surface, | ||
int | frame_width, | ||
int | frame_height | ||
) |
Prepare a niframe which to send to encoder.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | p_surface | pointer to niquadraFrameSurface1_t |
[in] | frame_width | frame width |
[in] | frame_height | frame height |
Definition at line 1210 of file ni_quadra_enc_api.c.
int ni_quadra_encode_sequence_change | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
int | width, | ||
int | height, | ||
int | bit_depth_factor | ||
) |
Set encode sequence change.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | width | frame width |
[in] | height | frame height |
[in] | bit_depth_factor | frame bit_depth |
Definition at line 926 of file ni_quadra_enc_api.c.
int ni_quadra_encode_session_open | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
int | frame_width, | ||
int | frame_height, | ||
const int * | frame_linesize, | ||
niquadraFrameSurface1_t * | p_surface, | ||
bool | hw_frames_ctx, | ||
int | frame_queqe, | ||
int | avctx_flags | ||
) |
Set encode session open and set niframe default info.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | frame_width | frame width |
[in] | frame_height | frame height |
[in] | frame_linesize | frame linesize |
[in] | p_surface | pointer to niquadraFrameSurface1_t |
[in] | hw_frames_ctx | frame hw_frames_ctx is exist |
[in] | frame_queqe | frame opaque |
[in] | avctx_flags | avctx flags |
Definition at line 993 of file ni_quadra_enc_api.c.
int ni_quadra_encoder_prepare_avpkt | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
int | is_pkt, | ||
int64_t * | pkt_pts, | ||
int64_t * | pkt_dts, | ||
int * | pkt_flag | ||
) |
Make avpkt from encode.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | is_pkt | Pointer to frame data |
[in] | pkt_pts | Pointer to frame data |
[in] | pkt_dts | Pointer to frame data |
[in] | pkt_flag | Pointer to frame data |
Definition at line 2477 of file ni_quadra_enc_api.c.
int ni_quadra_encoder_receive_packet | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Recive packet frome encode.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 2162 of file ni_quadra_enc_api.c.
int ni_quadra_encoder_xcoder_gop_params_set_value | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
const char * | name, | ||
const char * | value | ||
) |
Set value referenced by name in encode parameters structure.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | name | String represented parameter name to search |
[in] | value | Parameter value to set |
Definition at line 94 of file ni_quadra_enc_api.c.
int ni_quadra_encoder_xcoder_opts_params_set_value | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
const char * | name, | ||
const char * | value | ||
) |
Set value referenced by name in encode parameters structure.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | name | String represented parameter name to search |
[in] | value | Parameter value to set |
Definition at line 48 of file ni_quadra_enc_api.c.
void ni_quadra_frame_new_aux_data | ( | ni_quadra_enc_context_t * | p_enc_ctx, |
void * | side_data, | ||
int | data_size, | ||
int | type | ||
) |
Add a new auxiliary data to a frame.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in/out] | side_data a frame to which the auxiliary data should be added | |
[in] | data_size | size of the added auxiliary data |
[in] | type | type of the added auxiliary data |
Definition at line 1497 of file ni_quadra_enc_api.c.
void ni_quadra_get_pkt_info | ( | void * | session_ctx, |
void * | data | ||
) |
Get ni_pkt_info psnr info.
[in/out] | session_ctx Pointer to ni_session_context_t |
[in/out] | data Pointer void* which has been malloced |
Definition at line 2597 of file ni_quadra_enc_api.c.
int ni_quadra_get_pkt_info_size | ( | void | ) |
Get struct ni_pkt_info size.
[in/out] | void |
Definition at line 2592 of file ni_quadra_enc_api.c.
int ni_quadra_packet_buffer_alloc | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Allocate memory for the packet buffer based on provided packet size.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 2576 of file ni_quadra_enc_api.c.
void ni_quadra_set_session_wh | ( | void * | session_ctx, |
int | width, | ||
int | height | ||
) |
Set width and height to session context.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t | |
[in] | width | frame width |
[in] | height | frame height |
Definition at line 2569 of file ni_quadra_enc_api.c.
int ni_quadra_setup_encoder | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Initialize init device session_context and init default params including ni_quadra_enc_context_t, ni_session_context_t, ni_xcoder_params_t.
[in/out] | p_enc_ctx Pointer to ni_quadra_enc_context_t |
Definition at line 395 of file ni_quadra_enc_api.c.
int ni_quadra_xcoder_encoder_headers | ( | ni_quadra_enc_context_t * | p_enc_ctx | ) |
Definition at line 192 of file ni_quadra_enc_api.c.
uint8_t cc_data[NI_MAX_SEI_DATA] |
Definition at line 1547 of file ni_quadra_enc_api.c.
uint8_t cll_data[NI_MAX_SEI_DATA] |
Definition at line 1546 of file ni_quadra_enc_api.c.
uint8_t hdrp_data[NI_MAX_SEI_DATA] |
Definition at line 1549 of file ni_quadra_enc_api.c.
uint8_t mdcv_data[NI_MAX_SEI_DATA] |
Definition at line 1545 of file ni_quadra_enc_api.c.
uint8_t udu_data[NI_MAX_SEI_DATA] |
Definition at line 1548 of file ni_quadra_enc_api.c.