libxcoder  3.5.1
ni_av_codec_logan.h File Reference

NETINT audio/video related utility functions. More...

Go to the source code of this file.

Data Structures

struct  _ni_mastering_display_metadata
 
struct  _ni_content_light_level
 
struct  _ni_hdr_plus_percentile
 
struct  _ni_hdr_plus_color_transform_params
 
struct  _ni_dynamic_hdr_plus
 

Macros

#define NI_NUM_PIXEL_ASPECT_RATIO   17
 
#define NI_LOGAN_NAL_VPS_BIT   (0x01)
 
#define NI_LOGAN_NAL_SPS_BIT   (0x01<<1)
 
#define NI_LOGAN_NAL_PPS_BIT   (0x01<<2)
 
#define NI_LOGAN_GENERATE_ALL_NAL_HEADER_BIT   (0x01<<3)
 

Typedefs

typedef enum _ni_h264_sei_type_t ni_h264_sei_type_t
 
typedef enum _ni_h264_sei_pic_struct_t ni_h264_sei_pic_struct_t
 
typedef enum _ni_color_range_struct_t ni_color_range_struct_t
 
typedef enum _ni_color_primaries ni_color_primaries_t
 
typedef enum _ni_color_transfer_characteristic ni_color_transfer_characteristic_t
 
typedef enum _ni_color_space ni_color_space_t
 
typedef struct _ni_mastering_display_metadata ni_mastering_display_metadata_t
 
typedef struct _ni_content_light_level ni_content_light_level_t
 
typedef enum _ni_hdr_plus_overlap_process_option ni_hdr_plus_overlap_process_option_t
 
typedef struct _ni_hdr_plus_percentile ni_hdr_plus_percentile_t
 
typedef struct _ni_hdr_plus_color_transform_params ni_hdr_plus_color_transform_params_t
 
typedef struct _ni_dynamic_hdr_plus ni_dynamic_hdr_plus_t
 
typedef enum _ni_logan_h264_nalu_type ni_logan_h264_nalu_type_t
 
typedef enum _ni_logan_hevc_nalu_type ni_logan_hevc_nalu_type_t
 

Enumerations

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 = 4 , NI_H264_SEI_TYPE_USER_DATA_UNREGISTERED = 5 , NI_H264_SEI_TYPE_RECOVERY_POINT = 6 , 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 = 137 , 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_range_struct_t { NI_COL_RANGE_UNSPECIFIED = 0 , NI_COL_RANGE_MPEG = 1 , NI_COL_RANGE_JPEG = 2 , NI_COL_RANGE_NB }
 
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 = 4 , NI_COL_TRC_GAMMA28 = 5 , NI_COL_TRC_SMPTE170M = 6 , NI_COL_TRC_SMPTE240M = 7 ,
  NI_COL_TRC_LINEAR = 8 , NI_COL_TRC_LOG = 9 , NI_COL_TRC_LOG_SQRT = 10 , 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 = 16 , 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 = 18 , NI_COL_TRC_NB
}
 
enum  _ni_color_space {
  NI_COL_SPC_RGB = 0 , NI_COL_SPC_BT709 = 1 , NI_COL_SPC_UNSPECIFIED = 2 , NI_COL_SPC_RESERVED = 3 ,
  NI_COL_SPC_FCC = 4 , NI_COL_SPC_BT470BG = 5 , NI_COL_SPC_SMPTE170M = 6 , NI_COL_SPC_SMPTE240M = 7 ,
  NI_COL_SPC_YCGCO = 8 , 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 = 12 , NI_COL_SPC_CHROMA_DERIVED_CL = 13 , 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 }
 
enum  _ni_logan_h264_nalu_type {
  NI_LOGAN_H264_NAL_UNSPECIFIED = 0 , NI_LOGAN_H264_NAL_SLICE = 1 , NI_LOGAN_H264_NAL_DPA = 2 , NI_LOGAN_H264_NAL_DPB = 3 ,
  NI_LOGAN_H264_NAL_DPC = 4 , NI_LOGAN_H264_NAL_IDR_SLICE = 5 , NI_LOGAN_H264_NAL_SEI = 6 , NI_LOGAN_H264_NAL_SPS = 7 ,
  NI_LOGAN_H264_NAL_PPS = 8 , NI_LOGAN_H264_NAL_AUD = 9 , NI_LOGAN_H264_NAL_END_SEQUENCE = 10 , NI_LOGAN_H264_NAL_END_STREAM = 11 ,
  NI_LOGAN_H264_NAL_FILLER_DATA = 12 , NI_LOGAN_H264_NAL_SPS_EXT = 13 , NI_LOGAN_H264_NAL_PREFIX = 14 , NI_LOGAN_H264_NAL_SUB_SPS = 15 ,
  NI_LOGAN_H264_NAL_DPS = 16 , NI_LOGAN_H264_NAL_RESERVED17 = 17 , NI_LOGAN_H264_NAL_RESERVED18 = 18 , NI_LOGAN_H264_NAL_AUXILIARY_SLICE = 19 ,
  NI_LOGAN_H264_NAL_EXTEN_SLICE = 20 , NI_LOGAN_H264_NAL_DEPTH_EXTEN_SLICE = 21 , NI_LOGAN_H264_NAL_RESERVED22 = 22 , NI_LOGAN_H264_NAL_RESERVED23 = 23 ,
  NI_LOGAN_H264_NAL_UNSPECIFIED24 = 24 , NI_LOGAN_H264_NAL_UNSPECIFIED25 = 25 , NI_LOGAN_H264_NAL_UNSPECIFIED26 = 26 , NI_LOGAN_H264_NAL_UNSPECIFIED27 = 27 ,
  NI_LOGAN_H264_NAL_UNSPECIFIED28 = 28 , NI_LOGAN_H264_NAL_UNSPECIFIED29 = 29 , NI_LOGAN_H264_NAL_UNSPECIFIED30 = 30 , NI_LOGAN_H264_NAL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= 63
}
 

Functions

LIB_API int ni_logan_should_send_sei_with_frame (ni_logan_session_context_t *p_enc_ctx, ni_logan_pic_type_t pic_type, ni_logan_encoder_params_t *p_param)
 Whether SEI should be sent together with this frame to encoder. More...
 
LIB_API void ni_logan_set_vui (ni_logan_encoder_params_t *p_param, ni_logan_session_context_t *p_ctx, ni_color_primaries_t color_primaries, ni_color_transfer_characteristic_t color_trc, ni_color_space_t color_space, int video_full_range_flag, int sar_num, int sar_den, ni_logan_codec_format_t codec_format)
 Set SPS VUI part of encoded stream header. More...
 
LIB_API uint32_t ni_logan_enc_buffering_period_sei (ni_logan_encoder_params_t *p_param, ni_logan_session_context_t *p_ctx, uint32_t frame_idx, int buf_len, uint8_t *p_buf)
 Buffered period sei. More...
 
LIB_API uint32_t ni_logan_enc_buffering_custom_sei (void *p_data, ni_logan_session_context_t *p_ctx, uint32_t index)
 Buffered customer sei. More...
 
LIB_API uint32_t ni_logan_enc_pic_timing_sei2 (ni_logan_encoder_params_t *p_param, ni_logan_session_context_t *p_ctx, int is_i_or_idr, int is_idr, uint32_t frame_idx, int buf_len, uint8_t *p_buf)
 Generate pic timing sei2. More...
 
LIB_API void ni_logan_dec_retrieve_aux_data (ni_logan_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. More...
 
LIB_API void ni_logan_enc_init_aux_params (ni_logan_session_data_io_t *p_api_fme)
 Initialize auxiliary data that should be sent together with this frame to encoder based on the auxiliary data of the decoded frame. More...
 
LIB_API void ni_logan_enc_prep_aux_data (ni_logan_session_context_t *p_enc_ctx, ni_logan_frame_t *p_enc_frame, ni_logan_frame_t *p_dec_frame, ni_logan_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. More...
 
LIB_API void ni_logan_enc_copy_aux_data (ni_logan_session_context_t *p_enc_ctx, ni_logan_frame_t *p_enc_frame, ni_logan_frame_t *p_dec_frame, ni_logan_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)
 Copy auxiliary data that should be sent together with this frame to encoder. More...
 
LIB_API const uint8_t * ni_logan_find_start_code (const uint8_t *p, const uint8_t *end, uint32_t *state)
 Find the next start code. More...
 
LIB_API int ni_logan_enc_fill_reconfig_params (ni_logan_encoder_params_t *p_param, ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_api_fme, int reconfigCount)
 Fill reconfig params. More...
 
LIB_API int ni_logan_detect_custom_sei (const uint8_t *data, int size, ni_logan_session_context_t *p_api_ctx, ni_logan_decoder_params_t *p_api_param, ni_logan_packet_t *p_packet)
 detect custom SEI payload data in Packet data, custom SEI has two meanings: a. the SEI type is not in the standard protocol, which is added by customes, for example SEI type 100, note that custom SEI is not user data unregistered SEI. b. the SEI NAL location does not conform to protocol. It's after VCL NALs. So there are cases to handle here: case a: enable custom_sei, detext custom SEIs before VCL. case b: enable custom_sei and enable_check_packet, detect custom SEIs before VCL, and all SEIs after VCL. all of these SEIs are passthroughed in the same places after encoding. More...
 
LIB_API void ni_logan_enc_reconfig_vfr (ni_logan_session_context_t *p_session_ctx, ni_logan_encoder_params_t *p_encoder_params, ni_logan_frame_t *ni_frame, int64_t pts, uint32_t timebase)
 Fill reconfig vfr. More...
 
LIB_API void ni_logan_reset_vui (ni_logan_encoder_params_t *p_param, ni_aux_data_t *aux_data, ni_logan_codec_format_t codec_format)
 Reset vui info from decoder. More...
 
LIB_API int ni_logan_enc_fill_reconfig_vui (ni_logan_encoder_params_t *p_param, ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_api_fme, int reconfigCount, ni_aux_data_t *aux_data)
 Fill reconfig vui. More...
 

Detailed Description

NETINT audio/video related utility functions.


Copyright (C) 2018 NETINT Technologies.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.


Definition in file ni_av_codec_logan.h.

Macro Definition Documentation

◆ NI_LOGAN_GENERATE_ALL_NAL_HEADER_BIT

#define NI_LOGAN_GENERATE_ALL_NAL_HEADER_BIT   (0x01<<3)

Definition at line 424 of file ni_av_codec_logan.h.

◆ NI_LOGAN_NAL_PPS_BIT

#define NI_LOGAN_NAL_PPS_BIT   (0x01<<2)

Definition at line 423 of file ni_av_codec_logan.h.

◆ NI_LOGAN_NAL_SPS_BIT

#define NI_LOGAN_NAL_SPS_BIT   (0x01<<1)

Definition at line 422 of file ni_av_codec_logan.h.

◆ NI_LOGAN_NAL_VPS_BIT

#define NI_LOGAN_NAL_VPS_BIT   (0x01)

Definition at line 421 of file ni_av_codec_logan.h.

◆ NI_NUM_PIXEL_ASPECT_RATIO

#define NI_NUM_PIXEL_ASPECT_RATIO   17

Definition at line 34 of file ni_av_codec_logan.h.

Typedef Documentation

◆ ni_color_primaries_t

◆ ni_color_range_struct_t

MPEG vs JPEG YUV range.

◆ ni_color_space_t

YUV colorspace type. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.3.

◆ ni_color_transfer_characteristic_t

◆ ni_content_light_level_t

◆ ni_dynamic_hdr_plus_t

◆ ni_h264_sei_pic_struct_t

◆ ni_h264_sei_type_t

◆ ni_hdr_plus_color_transform_params_t

◆ ni_hdr_plus_overlap_process_option_t

◆ ni_hdr_plus_percentile_t

◆ ni_logan_h264_nalu_type_t

◆ ni_logan_hevc_nalu_type_t

Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802

◆ ni_mastering_display_metadata_t

Enumeration Type Documentation

◆ _ni_color_primaries

Enumerator
NI_COL_PRI_RESERVED0 
NI_COL_PRI_BT709 
NI_COL_PRI_UNSPECIFIED 
NI_COL_PRI_RESERVED 
NI_COL_PRI_BT470M 
NI_COL_PRI_BT470BG 
NI_COL_PRI_SMPTE170M 
NI_COL_PRI_SMPTE240M 
NI_COL_PRI_FILM 
NI_COL_PRI_BT2020 
NI_COL_PRI_SMPTE428 
NI_COL_PRI_SMPTEST428_1 
NI_COL_PRI_SMPTE431 
NI_COL_PRI_SMPTE432 
NI_COL_PRI_JEDEC_P22 
NI_COL_PRI_NB 

Definition at line 100 of file ni_av_codec_logan.h.

◆ _ni_color_range_struct_t

MPEG vs JPEG YUV range.

Enumerator
NI_COL_RANGE_UNSPECIFIED 
NI_COL_RANGE_MPEG 

the normal 219*2^(n-8) "MPEG" YUV ranges

NI_COL_RANGE_JPEG 

the normal 2^n-1 "JPEG" YUV ranges

NI_COL_RANGE_NB 

Not part of ABI.

Definition at line 89 of file ni_av_codec_logan.h.

◆ _ni_color_space

YUV colorspace type. These values match the ones defined by ISO/IEC 23001-8_2013 § 7.3.

Enumerator
NI_COL_SPC_RGB 
NI_COL_SPC_BT709 
NI_COL_SPC_UNSPECIFIED 
NI_COL_SPC_RESERVED 
NI_COL_SPC_FCC 
NI_COL_SPC_BT470BG 
NI_COL_SPC_SMPTE170M 
NI_COL_SPC_SMPTE240M 
NI_COL_SPC_YCGCO 
NI_COL_SPC_YCOCG 
NI_COL_SPC_BT2020_NCL 
NI_COL_SPC_BT2020_CL 
NI_COL_SPC_SMPTE2085 
NI_COL_SPC_CHROMA_DERIVED_NCL 
NI_COL_SPC_CHROMA_DERIVED_CL 
NI_COL_SPC_ICTCP 
NI_COL_SPC_NB 

Definition at line 154 of file ni_av_codec_logan.h.

◆ _ni_color_transfer_characteristic

Enumerator
NI_COL_TRC_RESERVED0 
NI_COL_TRC_BT709 
NI_COL_TRC_UNSPECIFIED 
NI_COL_TRC_RESERVED 
NI_COL_TRC_GAMMA22 
NI_COL_TRC_GAMMA28 
NI_COL_TRC_SMPTE170M 
NI_COL_TRC_SMPTE240M 
NI_COL_TRC_LINEAR 
NI_COL_TRC_LOG 
NI_COL_TRC_LOG_SQRT 
NI_COL_TRC_IEC61966_2_4 
NI_COL_TRC_BT1361_ECG 
NI_COL_TRC_IEC61966_2_1 
NI_COL_TRC_BT2020_10 
NI_COL_TRC_BT2020_12 
NI_COL_TRC_SMPTE2084 
NI_COL_TRC_SMPTEST2084 
NI_COL_TRC_SMPTE428 
NI_COL_TRC_SMPTEST428_1 
NI_COL_TRC_ARIB_STD_B67 
NI_COL_TRC_NB 

Definition at line 124 of file ni_av_codec_logan.h.

◆ _ni_h264_sei_pic_struct_t

Enumerator
NI_H264_SEI_PIC_STRUCT_FRAME 
NI_H264_SEI_PIC_STRUCT_TOP_FIELD 
NI_H264_SEI_PIC_STRUCT_BOTTOM_FIELD 
NI_H264_SEI_PIC_STRUCT_TOP_BOTTOM 
NI_H264_SEI_PIC_STRUCT_BOTTOM_TOP 
NI_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP 
NI_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM 
NI_H264_SEI_PIC_STRUCT_FRAME_DOUBLING 
NI_H264_SEI_PIC_STRUCT_FRAME_TRIPLING 

Definition at line 73 of file ni_av_codec_logan.h.

◆ _ni_h264_sei_type_t

Enumerator
NI_H264_SEI_TYPE_BUFFERING_PERIOD 
NI_H264_SEI_TYPE_PIC_TIMING 
NI_H264_SEI_TYPE_PAN_SCAN_RECT 
NI_H264_SEI_TYPE_FILLER_PAYLOAD 
NI_H264_SEI_TYPE_USER_DATA_REGISTERED 
NI_H264_SEI_TYPE_USER_DATA_UNREGISTERED 
NI_H264_SEI_TYPE_RECOVERY_POINT 
NI_H264_SEI_TYPE_FRAME_PACKING 
NI_H264_SEI_TYPE_DISPLAY_ORIENTATION 
NI_H264_SEI_TYPE_GREEN_METADATA 
NI_H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME 
NI_H264_SEI_TYPE_ALTERNATIVE_TRANSFER 

Definition at line 56 of file ni_av_codec_logan.h.

◆ _ni_hdr_plus_overlap_process_option

Enumerator
NI_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING 
NI_HDR_PLUS_OVERLAP_PROCESS_LAYERING 

Definition at line 209 of file ni_av_codec_logan.h.

◆ _ni_logan_h264_nalu_type

Enumerator
NI_LOGAN_H264_NAL_UNSPECIFIED 
NI_LOGAN_H264_NAL_SLICE 
NI_LOGAN_H264_NAL_DPA 
NI_LOGAN_H264_NAL_DPB 
NI_LOGAN_H264_NAL_DPC 
NI_LOGAN_H264_NAL_IDR_SLICE 
NI_LOGAN_H264_NAL_SEI 
NI_LOGAN_H264_NAL_SPS 
NI_LOGAN_H264_NAL_PPS 
NI_LOGAN_H264_NAL_AUD 
NI_LOGAN_H264_NAL_END_SEQUENCE 
NI_LOGAN_H264_NAL_END_STREAM 
NI_LOGAN_H264_NAL_FILLER_DATA 
NI_LOGAN_H264_NAL_SPS_EXT 
NI_LOGAN_H264_NAL_PREFIX 
NI_LOGAN_H264_NAL_SUB_SPS 
NI_LOGAN_H264_NAL_DPS 
NI_LOGAN_H264_NAL_RESERVED17 
NI_LOGAN_H264_NAL_RESERVED18 
NI_LOGAN_H264_NAL_AUXILIARY_SLICE 
NI_LOGAN_H264_NAL_EXTEN_SLICE 
NI_LOGAN_H264_NAL_DEPTH_EXTEN_SLICE 
NI_LOGAN_H264_NAL_RESERVED22 
NI_LOGAN_H264_NAL_RESERVED23 
NI_LOGAN_H264_NAL_UNSPECIFIED24 
NI_LOGAN_H264_NAL_UNSPECIFIED25 
NI_LOGAN_H264_NAL_UNSPECIFIED26 
NI_LOGAN_H264_NAL_UNSPECIFIED27 
NI_LOGAN_H264_NAL_UNSPECIFIED28 
NI_LOGAN_H264_NAL_UNSPECIFIED29 
NI_LOGAN_H264_NAL_UNSPECIFIED30 
NI_LOGAN_H264_NAL_UNSPECIFIED31 

Definition at line 430 of file ni_av_codec_logan.h.

◆ _ni_logan_hevc_nalu_type

Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802

Enumerator
NI_LOGAN_HEVC_NAL_TRAIL_N 
NI_LOGAN_HEVC_NAL_TRAIL_R 
NI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EVC_NAL_SEI_SUFFIX 
NI_LOGAN_HEVC_NAL_RSV_NVCL41 
NI_LOGAN_HEVC_NAL_RSV_NVCL42 
NI_LOGAN_HEVC_NAL_RSV_NVCL43 
NI_LOGAN_HEVC_NAL_RSV_NVCL44 
NI_LOGAN_HEVC_NAL_RSV_NVCL45 
NI_LOGAN_HEVC_NAL_RSV_NVCL46 
NI_LOGAN_HEVC_NAL_RSV_NVCL47 
NI_LOGAN_HEVC_NAL_UNSPEC48 
NI_LOGAN_HEVC_NAL_UNSPEC49 
NI_LOGAN_HEVC_NAL_UNSPEC50 
NI_LOGAN_HEVC_NAL_UNSPEC51 
NI_LOGAN_HEVC_NAL_UNSPEC52 
NI_LOGAN_HEVC_NAL_UNSPEC53 
NI_LOGAN_HEVC_NAL_UNSPEC54 
NI_LOGAN_HEVC_NAL_UNSPEC55 
NI_LOGAN_HEVC_NAL_UNSPEC56 
NI_LOGAN_HEVC_NAL_UNSPEC57 
NI_LOGAN_HEVC_NAL_UNSPEC58 
NI_LOGAN_HEVC_NAL_UNSPEC59 
NI_LOGAN_HEVC_NAL_UNSPEC60 
NI_LOGAN_HEVC_NAL_UNSPEC61 
NI_LOGAN_HEVC_NAL_UNSPEC62 
NI_LOGAN_HEVC_NAL_UNSPEC63 

Definition at line 470 of file ni_av_codec_logan.h.

Function Documentation

◆ ni_logan_dec_retrieve_aux_data()

LIB_API void ni_logan_dec_retrieve_aux_data ( ni_logan_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.


Parameters
[in/out]frame that is returned by decoder
Returns
NONE

Definition at line 1405 of file ni_av_codec_logan.c.

◆ ni_logan_detect_custom_sei()

LIB_API int ni_logan_detect_custom_sei ( const uint8_t *  data,
int  size,
ni_logan_session_context_t p_api_ctx,
ni_logan_decoder_params_t p_api_param,
ni_logan_packet_t p_packet 
)

detect custom SEI payload data in Packet data, custom SEI has two meanings: a. the SEI type is not in the standard protocol, which is added by customes, for example SEI type 100, note that custom SEI is not user data unregistered SEI. b. the SEI NAL location does not conform to protocol. It's after VCL NALs. So there are cases to handle here: case a: enable custom_sei, detext custom SEIs before VCL. case b: enable custom_sei and enable_check_packet, detect custom SEIs before VCL, and all SEIs after VCL. all of these SEIs are passthroughed in the same places after encoding.


Parameters
uint8_t*data - packet data
intsize - pkt data size
ni_logan_session_context_t*p_api_ctx - Netint session context
ni_logan_decoder_params_t*api_param - Netint xcoder params
ni_logan_packet_t*p_packet - netint internal packet
Returns
- 0 on success or not detect correct custom sei, non-0 on failure

Definition at line 3511 of file ni_av_codec_logan.c.

◆ ni_logan_enc_buffering_custom_sei()

LIB_API uint32_t ni_logan_enc_buffering_custom_sei ( void *  p_data,
ni_logan_session_context_t p_ctx,
uint32_t  index 
)

Buffered customer sei.


Parameters
[in]p_datainput side data of customer sei
[out]p_ctxsession context, update its pkt_custom_sei.
[in]indexfifo index
Returns
success return NI_LOGAN_RETCODE_SUCCESS failure return < 0

Definition at line 1170 of file ni_av_codec_logan.c.

◆ ni_logan_enc_buffering_period_sei()

LIB_API uint32_t ni_logan_enc_buffering_period_sei ( ni_logan_encoder_params_t p_param,
ni_logan_session_context_t p_ctx,
uint32_t  frame_idx,
int  buf_len,
uint8_t *  p_buf 
)

Buffered period sei.


Parameters
[in/out]p_param encoder parameters, its GOP information will be updated.
[in]p_ctxsession context, use its HRD parameters (hrd_params).
[in]frame_idxframe index
[in]buf_lenoutput buffer length
[out]p_bufoutput sei buffer.
Returns
put_bit_byte_size

Definition at line 1052 of file ni_av_codec_logan.c.

◆ ni_logan_enc_copy_aux_data()

LIB_API void ni_logan_enc_copy_aux_data ( ni_logan_session_context_t p_enc_ctx,
ni_logan_frame_t p_enc_frame,
ni_logan_frame_t p_dec_frame,
ni_logan_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 
)

Copy auxiliary data that should be sent together with this frame to encoder.


Parameters
[in]p_enc_ctxencoder session context
[out]p_enc_frameframe to be sent to encoder
[in]p_dec_frameframe returned by decoder
[in]codec_formatH.264 or H.265
[in]mdcv_dataSEI for HDR mastering display color volume info
[in]cll_dataSEI for HDR content light level info
[in]cc_dataSEI for close caption
[in]udu_dataSEI for User data unregistered
[in]hdrp_dataSEI for HDR10+
Returns
NONE

Parameters
[in]p_enc_ctxencoder session context
[out]p_enc_frameframe to be sent to encoder
[in]p_dec_frameframe returned by decoder
[in]mdcv_dataSEI for HDR mastering display color volume info
[in]cll_dataSEI for HDR content light level info
[in]cc_dataSEI for close caption
[in]udu_dataSEI for User data unregistered
[in]hdrp_dataSEI for HDR10+
Returns
NONE

Definition at line 2948 of file ni_av_codec_logan.c.

◆ ni_logan_enc_fill_reconfig_params()

LIB_API int ni_logan_enc_fill_reconfig_params ( ni_logan_encoder_params_t p_param,
ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_api_fme,
int  reconfigCount 
)

Fill reconfig params.


Parameters
[in]p_paramencoder parameters.
[in/out]p_ctx session context, its enc_change_params may be updated.
[in/out]p_api_fme extra_data_len and reconf_len may be updated
[in]reconfigCountreconfig count, may be updated.
Returns
reconfigCount on success < 0 on failure, NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 3084 of file ni_av_codec_logan.c.

◆ ni_logan_enc_fill_reconfig_vui()

LIB_API int ni_logan_enc_fill_reconfig_vui ( ni_logan_encoder_params_t p_param,
ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_api_fme,
int  reconfigCount,
ni_aux_data_t aux_data 
)

Fill reconfig vui.


Parameters
[in]p_paramencoder parameters.
[in/out]p_ctx session context, its enc_change_params may be updated.
[in/out]p_api_fme extra_data_len and reconf_len may be updated
[in]reconfigCountreconfig count, may be updated.
[in]aux_dataaux_data may be updated
Returns
reconfigCount on success < 0 on failure, NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 3290 of file ni_av_codec_logan.c.

◆ ni_logan_enc_init_aux_params()

LIB_API void ni_logan_enc_init_aux_params ( ni_logan_session_data_io_t p_api_fme)

Initialize auxiliary data that should be sent together with this frame to encoder based on the auxiliary data of the decoded frame.


Parameters
[in/out]ni_logan_session_data_io_t session data
Returns
NONE

Definition at line 2084 of file ni_av_codec_logan.c.

◆ ni_logan_enc_pic_timing_sei2()

LIB_API uint32_t ni_logan_enc_pic_timing_sei2 ( ni_logan_encoder_params_t p_param,
ni_logan_session_context_t p_ctx,
int  is_i_or_idr,
int  is_idr,
uint32_t  frame_idx,
int  buf_len,
uint8_t *  p_buf 
)

Generate pic timing sei2.


Parameters
[in/out]p_param encoder parameters, its GOP information will be updated.
[in/out]p_ctx session context, its HRD parameters (hrd_params) may be updated.
[in]is_i_or_idrTrue if it is i or idr packet.
[in]is_idrTrue if it is idr packet.
[in]frame_idxframe index
[in]buf_lenoutput buffer length
[out]p_bufoutput sei buffer.
Returns
length of pci timing sei2

Definition at line 1297 of file ni_av_codec_logan.c.

◆ ni_logan_enc_prep_aux_data()

LIB_API void ni_logan_enc_prep_aux_data ( ni_logan_session_context_t p_enc_ctx,
ni_logan_frame_t p_enc_frame,
ni_logan_frame_t p_dec_frame,
ni_logan_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.


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_frameframe to be sent to encoder
[in]p_dec_frameframe that is returned by decoder
[in]codec_formatH.264 or H.265
[in]should_send_sei_with_frameif need to send a certain type of SEI with this frame
[out]mdcv_dataSEI for HDR mastering display color volume info
[out]cll_dataSEI for HDR content light level info
[out]cc_dataSEI for close caption
[out]udu_dataSEI for User data unregistered
[out]hdrp_dataSEI 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_frameframe to be sent to encoder
[in]p_dec_frameframe that is returned by decoder
[in]codec_formatH.264 or H.265
[in]should_send_sei_with_frameif need to send a certain type of SEI with this frame
[out]mdcv_dataSEI for HDR mastering display color volume info
[out]cll_dataSEI for HDR content light level info
[out]cc_dataSEI for close caption
[out]udu_dataSEI for User data unregistered
[out]hdrp_dataSEI for HDR10+
Returns
NONE

Definition at line 2132 of file ni_av_codec_logan.c.

◆ ni_logan_enc_reconfig_vfr()

LIB_API void ni_logan_enc_reconfig_vfr ( ni_logan_session_context_t p_session_ctx,
ni_logan_encoder_params_t p_encoder_params,
ni_logan_frame_t ni_frame,
int64_t  pts,
uint32_t  timebase 
)

Fill reconfig vfr.


Parameters
[in/out]p_session_ctx session context, some parameters may be updated.
[in]p_paramencoder parameters.
[in/out]ni_frame aux_data may be updated
[in]ptsframe pts
[in]timebasetimebase
Returns

Definition at line 3716 of file ni_av_codec_logan.c.

◆ ni_logan_find_start_code()

LIB_API const uint8_t* ni_logan_find_start_code ( const uint8_t *  p,
const uint8_t *  end,
uint32_t *  state 
)

Find the next start code.


Parameters
[in]ppointer to buffer start address.
[in]endpointer to buffer end address.
[state]state pointer to nalu type address
Returns
search end address

Definition at line 3341 of file ni_av_codec_logan.c.

◆ ni_logan_reset_vui()

LIB_API void ni_logan_reset_vui ( ni_logan_encoder_params_t p_param,
ni_aux_data_t aux_data,
ni_logan_codec_format_t  codec_format 
)

Reset vui info from decoder.


Parameters
[in]p_paramencoder parameters.
[in]aux_dataaux_data may be updated
[in]codec_formatencoder format
Returns

Definition at line 793 of file ni_av_codec_logan.c.

◆ ni_logan_set_vui()

LIB_API void ni_logan_set_vui ( ni_logan_encoder_params_t p_param,
ni_logan_session_context_t p_ctx,
ni_color_primaries_t  color_primaries,
ni_color_transfer_characteristic_t  color_trc,
ni_color_space_t  color_space,
int  video_full_range_flag,
int  sar_num,
int  sar_den,
ni_logan_codec_format_t  codec_format 
)

Set SPS VUI part of encoded stream header.


Parameters
[in/out]p_param encoder parameters, its VUI data member will be updated.
[out]p_ctxsession context, its HRD parameters (hrd_params) may be updated.
[in]color_primariescolor primaries
[in]color_trccolor transfer characteristic
[in]color_spaceYUV colorspace type
[in]video_full_range_flag
[in]sar_num/sar_densample aspect ration in numerator/denominator
[in]codec_formatH.264 or H.265
Returns
NONE

Definition at line 464 of file ni_av_codec_logan.c.

◆ ni_logan_should_send_sei_with_frame()

LIB_API int ni_logan_should_send_sei_with_frame ( ni_logan_session_context_t p_enc_ctx,
ni_logan_pic_type_t  pic_type,
ni_logan_encoder_params_t p_param 
)

Whether SEI should be sent together with this frame to encoder.


Parameters
[in]p_enc_ctxencoder session context
[in]pic_typeframe type
[in]p_paramencoder parameters
Returns
1 if yes, 0 otherwise

Whether SEI should be sent together with this frame to encoder.


Parameters
[in]p_enc_ctxencoder session context
[in]pic_typeframe type
[in]p_paramencoder parameters
Returns
1 if yes, 0 otherwise

Definition at line 409 of file ni_av_codec_logan.c.