#include "global.h"
#include "memalloc.h"
#include "rtp.h"
#include "mbuffer.h"
#include "sei.h"
#include "vlc.h"
#include "header.h"

Go to the source code of this file.
Functions | |
| void | InitSEIMessages () |
| void | CloseSEIMessages () |
| Boolean | HaveAggregationSEI () |
| void | write_sei_message (int id, byte *payload, int payload_size, int payload_type) |
| void | finalize_sei_message (int id) |
| void | clear_sei_message (int id) |
| void | AppendTmpbits2Buf (Bitstream *dest, Bitstream *source) |
| void | InitSparePicture () |
| void | CloseSparePicture () |
| void | CalculateSparePicture () |
| void | ComposeSparePictureMessage (int delta_spare_frame_num, int ref_area_indicator, Bitstream *tmpBitstream) |
| Boolean | CompressSpareMBMap (unsigned char **map_sp, Bitstream *bitstream) |
| void | FinalizeSpareMBMap () |
| void | InitSubseqInfo (int currLayer) |
| void | UpdateSubseqInfo (int currLayer) |
| void | FinalizeSubseqInfo (int currLayer) |
| void | ClearSubseqInfoPayload (int currLayer) |
| void | CloseSubseqInfo (int currLayer) |
| void | InitSubseqLayerInfo () |
| void | CloseSubseqLayerInfo () |
| void | FinalizeSubseqLayerInfo () |
| void | InitSubseqChar () |
| void | ClearSubseqCharPayload () |
| void | UpdateSubseqChar () |
| void | FinalizeSubseqChar () |
| void | CloseSubseqChar () |
| void | InitSceneInformation () |
| void | CloseSceneInformation () |
| void | FinalizeSceneInformation () |
| void | UpdateSceneInformation (Boolean HasSceneInformation, int sceneID, int sceneTransType, int secondSceneID) |
| void | InitPanScanRectInfo () |
| void | ClearPanScanRectInfoPayload () |
| void | UpdatePanScanRectInfo () |
| void | FinalizePanScanRectInfo () |
| void | ClosePanScanRectInfo () |
| void | InitUser_data_unregistered () |
| void | ClearUser_data_unregistered () |
| void | UpdateUser_data_unregistered () |
| void | FinalizeUser_data_unregistered () |
| void | CloseUser_data_unregistered () |
| void | InitUser_data_registered_itu_t_t35 () |
| void | ClearUser_data_registered_itu_t_t35 () |
| void | UpdateUser_data_registered_itu_t_t35 () |
| void | FinalizeUser_data_registered_itu_t_t35 () |
| void | CloseUser_data_registered_itu_t_t35 () |
| void | InitRandomAccess () |
| void | ClearRandomAccess () |
| void | UpdateRandomAccess () |
| void | FinalizeRandomAccess () |
| void | CloseRandomAccess () |
| int | ParseToneMappingConfigFile (tone_mapping_struct *pSeiToneMapping) |
| void | InitToneMapping () |
| void | FinalizeToneMapping () |
| void | UpdateToneMapping () |
| void | ClearToneMapping () |
| void | CloseToneMapping () |
| void | InitPostFilterHints () |
| void | ClearPostFilterHints () |
| void | UpdatePostFilterHints () |
| void | FinalizePostFilterHints () |
| void | ClosePostFilterHints () |
| int | Write_SEI_NALU (int len) |
| void | InitBufferingPeriod () |
| void | ClearBufferingPeriod () |
| void | UpdateBufferingPeriod () |
| void | FinalizeBufferingPeriod () |
| void | CloseBufferingPeriod () |
| void | InitPicTiming () |
| void | ClearPicTiming () |
| void | UpdatePicTiming () |
| void | FinalizePicTiming () |
| void | ClosePicTiming () |
| void | InitDRPMRepetition () |
| void | ClearDRPMRepetition () |
| void | UpdateDRPMRepetition () |
| void | FinalizeDRPMRepetition () |
| void | CloseDRPMRepetition () |
| void | PrepareAggregationSEIMessage (void) |
| void | free_drpm_buffer (DecRefPicMarking_t *pDRPM) |
Variables | |
| Boolean | seiHasTemporal_reference = FALSE |
| Boolean | seiHasClock_timestamp = FALSE |
| Boolean | seiHasPanscan_rect = FALSE |
| Boolean | seiHasHrd_picture = FALSE |
| Boolean | seiHasFiller_payload = FALSE |
| Boolean | seiHasUser_data_registered_itu_t_t35 = FALSE |
| Boolean | seiHasUser_data_unregistered = FALSE |
| Boolean | seiHasRecoveryPoint_info = FALSE |
| Boolean | seiHasRef_pic_buffer_management_repetition = FALSE |
| Boolean | seiHasSpare_picture = FALSE |
| Boolean | seiHasBuffering_period = FALSE |
| Boolean | seiHasPicTiming_info = FALSE |
| Boolean | seiHasSceneInformation = FALSE |
| Boolean | seiHasSubseq_information = FALSE |
| Boolean | seiHasSubseq_layer_characteristics = FALSE |
| Boolean | seiHasSubseq_characteristics = FALSE |
| Boolean | seiHasTone_mapping = FALSE |
| Boolean | seiHasPostFilterHints_info = FALSE |
| Boolean | seiHasDRPMRepetition_info = FALSE |
| sei_struct | sei_message [2] |
| Boolean | seiHasSparePicture = FALSE |
| spare_picture_struct | seiSparePicturePayload |
| Boolean | seiHasSubseqInfo = FALSE |
| subseq_information_struct | seiSubseqInfo [MAX_LAYER_NUMBER] |
| Boolean | seiHasSubseqLayerInfo = FALSE |
| subseq_layer_information_struct | seiSubseqLayerInfo |
| Boolean | seiHasSubseqChar = FALSE |
| subseq_char_information_struct | seiSubseqChar |
| scene_information_struct | seiSceneInformation |
| Boolean | seiHasPanScanRectInfo = FALSE |
| panscanrect_information_struct | seiPanScanRectInfo |
| Boolean | seiHasUser_data_unregistered_info |
| user_data_unregistered_information_struct | seiUser_data_unregistered |
| Boolean | seiHasUser_data_registered_itu_t_t35_info |
| user_data_registered_itu_t_t35_information_struct | seiUser_data_registered_itu_t_t35 |
| recovery_point_information_struct | seiRecoveryPoint |
| tone_mapping_struct | seiToneMapping |
| post_filter_information_struct | seiPostFilterHints |
Definition in file sei.c.
copy the bits from one bitstream buffer to another one
| dest | pointer to the dest bitstream buffer | |
| source | pointer to the source bitstream buffer |
Definition at line 258 of file sei.c.
References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, and Bitstream::streamBuffer.
Referenced by ComposeSparePictureMessage(), and FinalizeSpareMBMap().
| void CalculateSparePicture | ( | ) |
Calculate the spare picture info, save the result in map_sp then compose the spare picture information.
| void clear_sei_message | ( | int | id | ) |
empty the sei message buffer
| id | 0, if this is the normal packet 1, if this is a aggregation packet |
Definition at line 239 of file sei.c.
References sei_struct::available, MAXRTPPAYLOADLEN, and sei_struct::payloadSize.
Referenced by PrepareAggregationSEIMessage().
| void ClearSubseqInfoPayload | ( | int | currLayer | ) |
Clear the payload buffer.
Definition at line 917 of file sei.c.
References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, subseq_information_struct::data, MAXRTPPAYLOADLEN, and subseq_information_struct::payloadSize.
Referenced by PrepareAggregationSEIMessage().
| void CloseSparePicture | ( | ) |
Close the global variables for spare picture information.
Definition at line 353 of file sei.c.
References spare_picture_struct::data, spare_picture_struct::num_spare_pics, Bitstream::streamBuffer, and spare_picture_struct::target_frame_num.
Referenced by InitSparePicture().
| void CloseSubseqInfo | ( | int | currLayer | ) |
Close the global variables for spare picture information.
Definition at line 932 of file sei.c.
References subseq_information_struct::payloadSize, and subseq_information_struct::stored_frame_cnt.
| void ComposeSparePictureMessage | ( | int | delta_spare_frame_num, | |
| int | ref_area_indicator, | |||
| Bitstream * | tmpBitstream | |||
| ) |
compose the spare picture information.
| delta_spare_frame_num | see FCD | |
| ref_area_indicator | Indicate how to represent the spare mb map | |
| tmpBitstream | pointer to a buffer to save the payload |
Definition at line 557 of file sei.c.
References AppendTmpbits2Buf(), spare_picture_struct::data, syntaxelement::mapping, syntaxelement::type, ue_linfo(), syntaxelement::value1, and writeSyntaxElement2Buf_UVLC().

test if the compressed spare mb map will occupy less mem and fill the payload buffer.
| map_sp | in which the spare picture information are stored. | |
| bitstream | pointer to a buffer to save the payload |
Definition at line 587 of file sei.c.
References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, ImageParameters::height, syntaxelement::mapping, Bitstream::streamBuffer, syntaxelement::type, ue_linfo(), syntaxelement::value1, ImageParameters::width, and writeSyntaxElement2Buf_UVLC().

| void finalize_sei_message | ( | int | id | ) |
write rbsp_trailing_bits to the sei message
| id | 0, if this is the normal packet 1, if this is a aggregation packet |
Definition at line 217 of file sei.c.
References sei_struct::available, sei_struct::data, and sei_struct::payloadSize.
Referenced by PrepareAggregationSEIMessage().
| void FinalizeSpareMBMap | ( | ) |
Finalize the spare picture SEI payload. The spare picture paylaod will be ready for encapsulation, and it should be called before current picture packetized.
Definition at line 747 of file sei.c.
References AppendTmpbits2Buf(), Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, spare_picture_struct::data, syntaxelement::mapping, MAXRTPPAYLOADLEN, no_mem_exit(), spare_picture_struct::num_spare_pics, ImageParameters::number, spare_picture_struct::payloadSize, Bitstream::streamBuffer, spare_picture_struct::target_frame_num, syntaxelement::type, ue_linfo(), syntaxelement::value1, and writeSyntaxElement2Buf_UVLC().
Referenced by PrepareAggregationSEIMessage().

| void FinalizeSubseqInfo | ( | int | currLayer | ) |
Finalize subseqence info.
Definition at line 877 of file sei.c.
References syntaxelement::bitpattern, Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, subseq_information_struct::data, subseq_information_struct::last_picture_flag, syntaxelement::len, syntaxelement::mapping, subseq_information_struct::payloadSize, subseq_information_struct::stored_frame_cnt, Bitstream::streamBuffer, subseq_information_struct::subseq_id, subseq_information_struct::subseq_layer_num, syntaxelement::type, ue_linfo(), syntaxelement::value1, writeSyntaxElement2Buf_Fixed(), and writeSyntaxElement2Buf_UVLC().
Referenced by PrepareAggregationSEIMessage().

| void FinalizeSubseqLayerInfo | ( | ) |
Write the data to buffer, which is byte aligned.
Definition at line 989 of file sei.c.
References subseq_layer_information_struct::bit_rate, subseq_layer_information_struct::data, subseq_layer_information_struct::frame_rate, subseq_layer_information_struct::layer_number, and subseq_layer_information_struct::payloadSize.
Referenced by PrepareAggregationSEIMessage().
| void free_drpm_buffer | ( | DecRefPicMarking_t * | pDRPM | ) |
Free dec_ref_pic_marking_bufffer structure.
Definition at line 2696 of file sei.c.
References DecRefPicMarking_s::Next.
| void InitSparePicture | ( | ) |
Init the global variables for spare picture information.
Definition at line 330 of file sei.c.
References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, CloseSparePicture(), spare_picture_struct::data, MAXRTPPAYLOADLEN, no_mem_exit(), spare_picture_struct::num_spare_pics, Bitstream::streamBuffer, and spare_picture_struct::target_frame_num.

| void InitSubseqInfo | ( | int | currLayer | ) |
init subseqence info
Definition at line 818 of file sei.c.
References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, subseq_information_struct::data, subseq_information_struct::last_picture_flag, MAXRTPPAYLOADLEN, no_mem_exit(), subseq_information_struct::payloadSize, subseq_information_struct::stored_frame_cnt, Bitstream::streamBuffer, subseq_information_struct::subseq_id, and subseq_information_struct::subseq_layer_num.

| void InitSubseqLayerInfo | ( | ) |
Init the global variables for spare picture information.
Definition at line 960 of file sei.c.
References subseq_layer_information_struct::bit_rate, subseq_layer_information_struct::frame_rate, and subseq_layer_information_struct::layer_number.
| void PrepareAggregationSEIMessage | ( | void | ) |
Prepare the aggregation sei message.
Definition at line 2565 of file sei.c.
References Bitstream::byte_pos, clear_sei_message(), ClearSubseqInfoPayload(), drpm_repetition_information_struct::data, recovery_point_information_struct::data, pictiming_information_struct::data, post_filter_information_struct::data, user_data_registered_itu_t_t35_information_struct::data, user_data_unregistered_information_struct::data, panscanrect_information_struct::data, subseq_char_information_struct::data, subseq_layer_information_struct::data, subseq_information_struct::data, spare_picture_struct::data, finalize_sei_message(), FinalizeSpareMBMap(), FinalizeSubseqInfo(), FinalizeSubseqLayerInfo(), ImageParameters::layer, ImageParameters::number, drpm_repetition_information_struct::payloadSize, recovery_point_information_struct::payloadSize, pictiming_information_struct::payloadSize, post_filter_information_struct::payloadSize, user_data_registered_itu_t_t35_information_struct::payloadSize, user_data_unregistered_information_struct::payloadSize, panscanrect_information_struct::payloadSize, subseq_char_information_struct::payloadSize, subseq_layer_information_struct::payloadSize, subseq_information_struct::payloadSize, spare_picture_struct::payloadSize, Bitstream::streamBuffer, ImageParameters::type, and write_sei_message().
Referenced by write_non_vcl_nalu().

| void UpdateSubseqInfo | ( | int | currLayer | ) |
update subsequence info
Definition at line 845 of file sei.c.
References ImageParameters::gop_number, subseq_information_struct::last_picture_flag, InputParameters::no_frm_base, ImageParameters::number, InputParameters::NumberBFrames, InputParameters::NumFramesInELSubSeq, subseq_information_struct::stored_frame_cnt, and ImageParameters::type.
Referenced by write_non_vcl_nalu().
| void write_sei_message | ( | int | id, | |
| byte * | payload, | |||
| int | payload_size, | |||
| int | payload_type | |||
| ) |
write one sei payload to the sei message
| id | 0, if this is the normal packet 1, if this is a aggregation packet | |
| payload | a pointer that point to the sei payload. Note that the bitstream should have be byte aligned already. | |
| payload_size | the size of the sei payload | |
| payload_type | the type of the sei payload |
Definition at line 177 of file sei.c.
References sei_struct::data, sei_struct::payloadSize, and SEI_MAX_ELEMENTS.
Referenced by PrepareAggregationSEIMessage().
sei_message[0]: this struct is to store the sei message packetized independently sei_message[1]: this struct is to store the sei message packetized together with slice data
Definition at line 54 of file sei.c.
Referenced by GenerateSEImessage_rbsp().