|
| enum | _ni_h264_sei_type_t {
NI_H264_SEI_TYPE_BUFFERING_PERIOD = 0
, NI_H264_SEI_TYPE_PIC_TIMING = 1
, NI_H264_SEI_TYPE_PAN_SCAN_RECT = 2
, NI_H264_SEI_TYPE_FILLER_PAYLOAD = 3
,
NI_H264_SEI_TYPE_USER_DATA_REGISTERED
, NI_H264_SEI_TYPE_USER_DATA_UNREGISTERED = 5
, NI_H264_SEI_TYPE_RECOVERY_POINT
, NI_H264_SEI_TYPE_FRAME_PACKING = 45
,
NI_H264_SEI_TYPE_DISPLAY_ORIENTATION = 47
, NI_H264_SEI_TYPE_GREEN_METADATA = 56
, NI_H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
, NI_H264_SEI_TYPE_ALTERNATIVE_TRANSFER = 147
} |
| |
| enum | _ni_h264_sei_pic_struct_t {
NI_H264_SEI_PIC_STRUCT_FRAME = 0
, NI_H264_SEI_PIC_STRUCT_TOP_FIELD = 1
, NI_H264_SEI_PIC_STRUCT_BOTTOM_FIELD = 2
, NI_H264_SEI_PIC_STRUCT_TOP_BOTTOM = 3
,
NI_H264_SEI_PIC_STRUCT_BOTTOM_TOP = 4
, NI_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5
, NI_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6
, NI_H264_SEI_PIC_STRUCT_FRAME_DOUBLING = 7
,
NI_H264_SEI_PIC_STRUCT_FRAME_TRIPLING = 8
} |
| |
| enum | _ni_color_primaries {
NI_COL_PRI_RESERVED0 = 0
, NI_COL_PRI_BT709 = 1
, NI_COL_PRI_UNSPECIFIED = 2
, NI_COL_PRI_RESERVED = 3
,
NI_COL_PRI_BT470M = 4
, NI_COL_PRI_BT470BG = 5
, NI_COL_PRI_SMPTE170M = 6
, NI_COL_PRI_SMPTE240M = 7
,
NI_COL_PRI_FILM = 8
, NI_COL_PRI_BT2020 = 9
, NI_COL_PRI_SMPTE428 = 10
, NI_COL_PRI_SMPTEST428_1 = NI_COL_PRI_SMPTE428
,
NI_COL_PRI_SMPTE431 = 11
, NI_COL_PRI_SMPTE432 = 12
, NI_COL_PRI_JEDEC_P22 = 22
, NI_COL_PRI_NB
} |
| |
| enum | _ni_color_transfer_characteristic {
NI_COL_TRC_RESERVED0 = 0
, NI_COL_TRC_BT709 = 1
, NI_COL_TRC_UNSPECIFIED = 2
, NI_COL_TRC_RESERVED = 3
,
NI_COL_TRC_GAMMA22
, NI_COL_TRC_GAMMA28 = 5
, NI_COL_TRC_SMPTE170M
, NI_COL_TRC_SMPTE240M = 7
,
NI_COL_TRC_LINEAR = 8
, NI_COL_TRC_LOG
, NI_COL_TRC_LOG_SQRT
, NI_COL_TRC_IEC61966_2_4 = 11
,
NI_COL_TRC_BT1361_ECG = 12
, NI_COL_TRC_IEC61966_2_1 = 13
, NI_COL_TRC_BT2020_10 = 14
, NI_COL_TRC_BT2020_12 = 15
,
NI_COL_TRC_SMPTE2084
, NI_COL_TRC_SMPTEST2084 = NI_COL_TRC_SMPTE2084
, NI_COL_TRC_SMPTE428 = 17
, NI_COL_TRC_SMPTEST428_1 = NI_COL_TRC_SMPTE428
,
NI_COL_TRC_ARIB_STD_B67
, NI_COL_TRC_NB
} |
| |
| enum | _ni_color_space {
NI_COL_SPC_RGB
, NI_COL_SPC_BT709
, NI_COL_SPC_UNSPECIFIED = 2
, NI_COL_SPC_RESERVED = 3
,
NI_COL_SPC_FCC
, NI_COL_SPC_BT470BG
, NI_COL_SPC_SMPTE170M
, NI_COL_SPC_SMPTE240M = 7
,
NI_COL_SPC_YCGCO
, NI_COL_SPC_YCOCG = NI_COL_SPC_YCGCO
, NI_COL_SPC_BT2020_NCL = 9
, NI_COL_SPC_BT2020_CL = 10
,
NI_COL_SPC_SMPTE2085 = 11
, NI_COL_SPC_CHROMA_DERIVED_NCL
, NI_COL_SPC_CHROMA_DERIVED_CL
, NI_COL_SPC_ICTCP = 14
,
NI_COL_SPC_NB
} |
| |
| enum | _ni_hdr_plus_overlap_process_option { NI_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING = 0
, NI_HDR_PLUS_OVERLAP_PROCESS_LAYERING = 1
} |
| |
|
| LIB_API int | ni_should_send_sei_with_frame (ni_session_context_t *p_enc_ctx, ni_pic_type_t pic_type, ni_xcoder_params_t *p_param) |
| | Whether SEI should be sent together with this frame to encoder.
|
| |
| LIB_API void | ni_dec_retrieve_aux_data (ni_frame_t *frame) |
| | Retrieve auxiliary data (close caption, various SEI) associated with this frame that is returned by decoder, convert them to appropriate format and save them in the frame's auxiliary data storage for future use by encoding. Usually they would be sent together with this frame to encoder at encoding.
|
| |
| LIB_API void | ni_enc_prep_aux_data (ni_session_context_t *p_enc_ctx, ni_frame_t *p_enc_frame, ni_frame_t *p_dec_frame, ni_codec_format_t codec_format, int should_send_sei_with_frame, uint8_t *mdcv_data, uint8_t *cll_data, uint8_t *cc_data, uint8_t *udu_data, uint8_t *hdrp_data) |
| | Prepare auxiliary data that should be sent together with this frame to encoder based on the auxiliary data of the decoded frame.
|
| |
| LIB_API void | ni_enc_copy_aux_data (ni_session_context_t *p_enc_ctx, ni_frame_t *p_enc_frame, ni_frame_t *p_dec_frame, ni_codec_format_t codec_format, const uint8_t *mdcv_data, const uint8_t *cll_data, const uint8_t *cc_data, const uint8_t *udu_data, const uint8_t *hdrp_data, int is_hwframe, int is_semiplanar) |
| | Copy auxiliary data that should be sent together with this frame to encoder.
|
| |
| LIB_API int | ni_enc_insert_timecode (ni_session_context_t *p_enc_ctx, ni_frame_t *p_enc_frame, ni_timecode_t *p_timecode) |
| | Insert timecode data into picture timing SEI (H264) or time code SEI (H265)
|
| |
| LIB_API int | ni_enc_write_from_yuv_buffer (ni_session_context_t *p_ctx, ni_frame_t *p_enc_frame, uint8_t *p_yuv_buffer) |
| | Send an input data frame to the encoder with YUV data given in the inputs.
|
| |
| LIB_API int | ni_extract_custom_sei (uint8_t *pkt_data, int pkt_size, long index, ni_packet_t *p_packet, uint8_t sei_type, int vcl_found) |
| | Extract custom sei payload data from pkt_data, and save it to ni_packet_t.
|
| |
| LIB_API int | ni_dec_packet_parse (ni_session_context_t *p_session_ctx, ni_xcoder_params_t *p_param, uint8_t *data, int size, ni_packet_t *p_packet, int low_delay, int codec_format, int pkt_nal_bitmap, int custom_sei_type, int *svct_skip_next_packet, int *is_lone_sei_pkt) |
| | Decode parse packet.
|
| |
| LIB_API int | ni_expand_frame (ni_frame_t *dst, ni_frame_t *src, int dst_stride[], int raw_width, int raw_height, int ni_fmt, int nb_planes) |
| | Expand frame form src frame.
|
| |
| LIB_API int | ni_reconfig_ppu_output (ni_session_context_t *p_session_ctx, ni_xcoder_params_t *p_param, ni_ppu_config_t *ppu_config) |
| | Reset decoder ppu resolution.
|
| |
Audio/video related utility definitions.
Definition in file ni_av_codec.h.
Prepare auxiliary data that should be sent together with this frame to encoder based on the auxiliary data of the decoded frame.
- Parameters
-
| [in/out] | p_enc_ctx encoder session context whose various SEI type header can be updated as the result of this function |
| [out] | p_enc_frame | frame to be sent to encoder |
| [in] | p_dec_frame | frame that is returned by decoder |
| [in] | codec_format | H.264 or H.265 |
| [in] | should_send_sei_with_frame | if need to send a certain type of SEI with this frame |
| [out] | mdcv_data | SEI for HDR mastering display color volume info |
| [out] | cll_data | SEI for HDR content light level info |
| [out] | cc_data | SEI for close caption |
| [out] | udu_data | SEI for User data unregistered |
| [out] | hdrp_data | SEI for HDR10+ |
- Returns
- NONE
Note: Some of the SEI (e.g. HDR) will be updated and stored in encoder context whenever received through decoded frame; they will be sent out with the encoded frame to encoder only when appropriate, i.e. should_send_sei_with_frame is true. When a type of aux data is to be sent, its associated length will be set in the encoder frame.
- Parameters
-
| [in/out] | p_enc_ctx encoder session contextwhose various SEI type header can be updated as the result of this function |
| [out] | p_enc_frame | frame to be sent to encoder |
| [in] | p_dec_frame | frame that is returned by decoder |
| [in] | codec_format | H.264 or H.265 |
| [in] | should_send_sei_with_frame | if need to send a certain type of SEI with this frame |
| [out] | mdcv_data | SEI for HDR mastering display color volume info |
| [out] | cll_data | SEI for HDR content light level info |
| [out] | cc_data | SEI for close caption |
| [out] | udu_data | SEI for User data unregistered |
| [out] | hdrp_data | SEI for HDR10+ |
- Returns
- NONE
Definition at line 857 of file ni_av_codec.c.
Send an input data frame to the encoder with YUV data given in the inputs.
For ideal performance memory should be 4k aligned. If it is not 4K aligned then a temporary 4k aligned memory will be used to copy data to and from when writing and reading. This will negatively impact performance.
Any metadata to be sent with the frame should be attached to p_enc_frame as aux data (e.g. using ni_frame_new_aux_data()).
- Parameters
-
| [in] | p_ctx | Encoder session context |
| [in] | p_enc_frame | Struct holding information about the frame to be sent to the encoder |
| [in] | p_yuv_buffer | Caller allocated buffer holding YUV data for the frame |
- Returns
- On success Total number of bytes written On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_INVALID_SESSION
For ideal performance memory should be 4k aligned. If it is not 4K aligned then a temporary 4k aligned memory will be used to copy data to and from when writing and reading. This will negatively impact performance.
Any metadata to be sent with the frame should be attached to p_enc_frame as aux data (e.g. using ni_frame_new_aux_data()).
- Parameters
-
| [in] | p_ctx | Encoder session context |
| [in] | p_enc_frame | Struct holding information about the frame to be sent to the encoder |
| [in] | p_yuv_buffer | Caller allocated buffer holding YUV data for the frame |
- Returns
- On success Total number of bytes written On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_INVALID_SESSION
Definition at line 2624 of file ni_av_codec.c.
| LIB_API int ni_extract_custom_sei |
( |
uint8_t * |
pkt_data, |
|
|
int |
pkt_size, |
|
|
long |
index, |
|
|
ni_packet_t * |
p_packet, |
|
|
uint8_t |
sei_type, |
|
|
int |
vcl_found |
|
) |
| |
Extract custom sei payload data from pkt_data, and save it to ni_packet_t.
- Parameters
-
| uint8_t | *pkt_data - FFmpeg AVPacket data |
| int | pkt_size - packet size |
| long | index - pkt data index of custom sei first byte after SEI type |
| ni_packet_t | *p_packet - libxcoder internal packet |
| uint8_t | sei_type - type of SEI |
| int | vcl_found - whether got vcl in the pkt data, 1 means got |
- Returns
- - 0 on success, non-0 on failure
- Parameters
-
| uint8_t | *pkt_data - FFmpeg AVPacket data |
| int | pkt_size - packet size |
| long | index - pkt data index of custom sei first byte after SEI type |
| ni_packet_t | *p_packet - libxcoder internal packet |
| uint8_t | sei_type - type of SEI |
| int | vcl_found - whether got vcl in the pkt data, 1 means got |
- Returns
- - 0 on success, non-0 on failure
extract SEI payload size. the first byte after SEI type is the SEI payload size. if the first byte is 255(0xFF), it means the SEI payload size is more than 255. in this case, to get the SEI payload size is to do a summation. the end of SEI size is the first non-0xFF value. for example, 0xFF 0xFF 0x08, the SEI payload size equals to (0xFF+0xFF+0x08).
Definition at line 2943 of file ni_av_codec.c.