sei.c File Reference

implementation of SEI related functions More...

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

Include dependency graph for sei.c:

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


Detailed Description

implementation of SEI related functions

sei.c

Author:
(s)

Definition in file sei.c.


Function Documentation

void AppendTmpbits2Buf ( Bitstream *  dest,
Bitstream *  source 
)

copy the bits from one bitstream buffer to another one

Parameters:
dest pointer to the dest bitstream buffer
source pointer to the source bitstream buffer
Output
the content of the dest bitstream is changed.

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.

Output
the spare picture payload is available in *seiSparePicturePayload* the syntax elements in the loop (see FCD), excluding the two elements at the beginning.

Definition at line 376 of file sei.c.

void clear_sei_message ( int  id  ) 

empty the sei message buffer

Parameters:
id 0, if this is the normal packet
1, if this is a aggregation packet
Output
the content of the sei message is cleared and ready for storing new messages

Definition at line 239 of file sei.c.

References sei_struct::available, MAXRTPPAYLOADLEN, and sei_struct::payloadSize.

Referenced by PrepareAggregationSEIMessage().

void ClearSubseqInfoPayload ( int  currLayer  ) 

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.

Parameters:
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
Output
bitstream: the composed spare picture payload are ready to put into the sei_message.

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().

Here is the call graph for this function:

Boolean CompressSpareMBMap ( unsigned char **  map_sp,
Bitstream *  bitstream 
)

test if the compressed spare mb map will occupy less mem and fill the payload buffer.

Parameters:
map_sp in which the spare picture information are stored.
bitstream pointer to a buffer to save the payload
Returns:
TRUE: If it is compressed version,
FALSE: If it is not compressed.

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().

Here is the call graph for this function:

void finalize_sei_message ( int  id  ) 

write rbsp_trailing_bits to the sei message

Parameters:
id 0, if this is the normal packet
1, if this is a aggregation packet
Output
the content of the sei message is updated and ready for packetisation

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.

Input
seiSparePicturePayload.data: points to the payload starting from delta_spare_frame_num. (See FCD)
Output
seiSparePicturePayload.data is updated, pointing to the whole spare picture information: spare_picture( PayloadSize ) (See FCD) Make sure it is byte aligned.

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().

Here is the call graph for this function:

void FinalizeSubseqInfo ( int  currLayer  ) 

void FinalizeSubseqLayerInfo (  ) 

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.

Here is the call graph for this function:

void InitSubseqInfo ( int  currLayer  ) 

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   ) 

void UpdateSubseqInfo ( int  currLayer  ) 

void write_sei_message ( int  id,
byte *  payload,
int  payload_size,
int  payload_type 
)

write one sei payload to the sei message

Parameters:
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
Output
the content of the sei message (sei_message[id]) is updated.

Definition at line 177 of file sei.c.

References sei_struct::data, sei_struct::payloadSize, and SEI_MAX_ELEMENTS.

Referenced by PrepareAggregationSEIMessage().


Variable Documentation

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().


Documentation generated with DoxyGen