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

static void InitRandomAccess (SEIParameters *p_SEI)
static void CloseRandomAccess (SEIParameters *p_SEI)
static void InitToneMapping (SEIParameters *p_SEI, InputParameters *p_Inp)
static void CloseToneMapping (SEIParameters *p_SEI)
static void CloseBufferingPeriod (SEIParameters *p_SEI)
static void InitPicTiming (SEIParameters *p_SEI)
static void ClosePicTiming (SEIParameters *p_SEI)
static void InitDRPMRepetition (SEIParameters *p_SEI)
static void CloseDRPMRepetition (SEIParameters *p_SEI)
static void FinalizeDRPMRepetition (ImageParameters *p_Img)
static void InitSparePicture (SEIParameters *p_SEI)
static void CloseSparePicture (SEIParameters *p_SEI)
static void FinalizeSpareMBMap (ImageParameters *p_Img)
static void InitSubseqChar (ImageParameters *p_Img)
static void ClearSubseqCharPayload (SEIParameters *p_SEI)
static void CloseSubseqChar (SEIParameters *p_SEI)
static void InitSubseqLayerInfo (SEIParameters *p_SEI)
static void InitPanScanRectInfo (SEIParameters *p_SEI)
static void ClearPanScanRectInfoPayload (SEIParameters *p_SEI)
static void ClosePanScanRectInfo (SEIParameters *p_SEI)
static void InitUser_data_unregistered (SEIParameters *p_SEI)
static void InitUser_data_registered_itu_t_t35 (SEIParameters *p_SEI)
static void ClearUser_data_unregistered (SEIParameters *p_SEI)
static void CloseUser_data_unregistered (SEIParameters *p_SEI)
static void ClearUser_data_registered_itu_t_t35 (SEIParameters *p_SEI)
static void CloseUser_data_registered_itu_t_t35 (SEIParameters *p_SEI)
static void InitPostFilterHints (SEIParameters *p_SEI)
static void ClearPostFilterHints (SEIParameters *p_SEI)
static void ClosePostFilterHints (SEIParameters *p_SEI)
void init_sei (SEIParameters *p_SEI)
void InitSEIMessages (ImageParameters *p_Img, InputParameters *p_Inp)
void CloseSEIMessages (ImageParameters *p_Img, InputParameters *p_Inp)
Boolean HaveAggregationSEI (ImageParameters *p_Img)
static void write_sei_message (SEIParameters *p_SEI, int id, byte *payload, int payload_size, int payload_type)
static void finalize_sei_message (SEIParameters *p_SEI, int id)
void clear_sei_message (SEIParameters *p_SEI, int id)
void AppendTmpbits2Buf (Bitstream *dest, Bitstream *source)
void CalculateSparePicture ()
void ComposeSparePictureMessage (SEIParameters *p_SEI, int delta_spare_frame_num, int ref_area_indicator, Bitstream *tmpBitstream)
Boolean CompressSpareMBMap (ImageParameters *p_Img, unsigned char **map_sp, Bitstream *bitstream)
void InitSubseqInfo (SEIParameters *p_SEI, int currLayer)
void UpdateSubseqInfo (ImageParameters *p_Img, InputParameters *p_Inp, int currLayer)
static void FinalizeSubseqInfo (SEIParameters *p_SEI, int currLayer)
static void ClearSubseqInfoPayload (SEIParameters *p_SEI, int currLayer)
void CloseSubseqInfo (SEIParameters *p_SEI, int currLayer)
void CloseSubseqLayerInfo ()
static void FinalizeSubseqLayerInfo (SEIParameters *p_SEI)
void UpdateSubseqChar (ImageParameters *p_Img)
static void FinalizeSubseqChar (SEIParameters *p_SEI)
void InitSceneInformation (SEIParameters *p_SEI)
void CloseSceneInformation (SEIParameters *p_SEI)
void FinalizeSceneInformation (SEIParameters *p_SEI)
void UpdateSceneInformation (SEIParameters *p_SEI, Boolean HasSceneInformation, int sceneID, int sceneTransType, int secondSceneID)
void UpdatePanScanRectInfo (SEIParameters *p_SEI)
void FinalizePanScanRectInfo (SEIParameters *p_SEI)
void UpdateUser_data_unregistered (SEIParameters *p_SEI)
static void FinalizeUser_data_unregistered (SEIParameters *p_SEI)
void UpdateUser_data_registered_itu_t_t35 (SEIParameters *p_SEI)
static void FinalizeUser_data_registered_itu_t_t35 (SEIParameters *p_SEI)
void ClearRandomAccess (SEIParameters *p_SEI)
void UpdateRandomAccess (ImageParameters *p_Img)
static void FinalizeRandomAccess (SEIParameters *p_SEI)
static int ParseToneMappingConfigFile (SEIParameters *p_SEI, InputParameters *p_Inp, ToneMappingSEI *pSeiToneMapping)
static void FinalizeToneMapping (ImageParameters *p_Img)
void UpdateToneMapping (SEIParameters *p_SEI)
static void ClearToneMapping (SEIParameters *p_SEI)
void UpdatePostFilterHints (SEIParameters *p_SEI)
static void FinalizePostFilterHints (SEIParameters *p_SEI)
int Write_SEI_NALU (ImageParameters *p_Img, int len)
void InitBufferingPeriod (ImageParameters *p_Img)
void ClearBufferingPeriod (SEIParameters *p_SEI, seq_parameter_set_rbsp_t *active_sps)
void UpdateBufferingPeriod (ImageParameters *p_Img, InputParameters *p_Inp)
static void FinalizeBufferingPeriod (SEIParameters *p_SEI, seq_parameter_set_rbsp_t *active_sps)
void ClearPicTiming (SEIParameters *p_SEI)
void UpdatePicTiming (ImageParameters *p_Img, InputParameters *p_Inp)
static void FinalizePicTiming (ImageParameters *p_Img)
void ClearDRPMRepetition (SEIParameters *p_SEI)
void UpdateDRPMRepetition (SEIParameters *p_SEI)
void PrepareAggregationSEIMessage (ImageParameters *p_Img)
void free_drpm_buffer (DecRefPicMarking_t *pDRPM)


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 301 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 413 of file sei.c.

void clear_sei_message ( SEIParameters *  p_SEI,
int  id 
)

empty the sei message buffer

Parameters:
p_SEI the SEI message to be cleared
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 282 of file sei.c.

References MAXRTPPAYLOADLEN.

Referenced by PrepareAggregationSEIMessage().

static void ClearSubseqInfoPayload ( SEIParameters *  p_SEI,
int  currLayer 
) [static]

Clear the payload buffer.

Definition at line 958 of file sei.c.

References MAXRTPPAYLOADLEN.

Referenced by PrepareAggregationSEIMessage().

static void CloseSparePicture ( SEIParameters *  p_SEI  )  [static]

Close the global variables for spare picture information.

Definition at line 390 of file sei.c.

Referenced by InitSparePicture().

void CloseSubseqInfo ( SEIParameters *  p_SEI,
int  currLayer 
)

Close the global variables for spare picture information.

Definition at line 973 of file sei.c.

void ComposeSparePictureMessage ( SEIParameters *  p_SEI,
int  delta_spare_frame_num,
int  ref_area_indicator,
Bitstream tmpBitstream 
)

compose the spare picture information.

Parameters:
p_SEI SEI message
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 596 of file sei.c.

References AppendTmpbits2Buf(), syntaxelement::type, ue_linfo(), syntaxelement::value1, and writeSyntaxElement2Buf_UVLC().

Here is the call graph for this function:

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

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

Parameters:
p_Img Image parameters for current picture coding
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 628 of file sei.c.

References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, img_par::height, Bitstream::streamBuffer, syntaxelement::type, ue_linfo(), syntaxelement::value1, img_par::width, and writeSyntaxElement2Buf_UVLC().

Here is the call graph for this function:

static void finalize_sei_message ( SEIParameters *  p_SEI,
int  id 
) [static]

write rbsp_trailing_bits to the sei message

Parameters:
p_SEI SEI message
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 258 of file sei.c.

Referenced by PrepareAggregationSEIMessage().

static void FinalizeSpareMBMap ( ImageParameters p_Img  )  [static]

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 788 of file sei.c.

References AppendTmpbits2Buf(), Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, MAXRTPPAYLOADLEN, no_mem_exit(), img_par::number, Bitstream::streamBuffer, syntaxelement::type, ue_linfo(), syntaxelement::value1, and writeSyntaxElement2Buf_UVLC().

Referenced by PrepareAggregationSEIMessage().

Here is the call graph for this function:

static void FinalizeSubseqInfo ( SEIParameters *  p_SEI,
int  currLayer 
) [static]

static void FinalizeSubseqLayerInfo ( SEIParameters *  p_SEI  )  [static]

Write the data to buffer, which is byte aligned.

Definition at line 1027 of file sei.c.

Referenced by PrepareAggregationSEIMessage().

void free_drpm_buffer ( DecRefPicMarking_t pDRPM  ) 

Free dec_ref_pic_marking_bufffer structure.

Definition at line 2729 of file sei.c.

static void InitSparePicture ( SEIParameters *  p_SEI  )  [static]

Init the global variables for spare picture information.

Definition at line 366 of file sei.c.

References CloseSparePicture(), MAXRTPPAYLOADLEN, and no_mem_exit().

Here is the call graph for this function:

void InitSubseqInfo ( SEIParameters *  p_SEI,
int  currLayer 
)

init subseqence info

Definition at line 858 of file sei.c.

References MAXRTPPAYLOADLEN, and no_mem_exit().

Here is the call graph for this function:

static void InitSubseqLayerInfo ( SEIParameters *  p_SEI  )  [static]

Init the global variables for spare picture information.

Definition at line 998 of file sei.c.

void PrepareAggregationSEIMessage ( ImageParameters p_Img  ) 

Prepare the aggregation sei message.

Date:
September 10, 2002
Author:
Dong Tian tian@cs.tut.fi

Definition at line 2597 of file sei.c.

References clear_sei_message(), ClearSubseqInfoPayload(), finalize_sei_message(), FinalizeSpareMBMap(), FinalizeSubseqInfo(), FinalizeSubseqLayerInfo(), img_par::layer, img_par::number, and write_sei_message().

Referenced by write_non_vcl_nalu().

Here is the call graph for this function:

void UpdateSubseqInfo ( ImageParameters p_Img,
InputParameters p_Inp,
int  currLayer 
)

update subsequence info

Definition at line 885 of file sei.c.

References img_par::gop_number, inp_par_enc::no_frm_base, img_par::number, and inp_par_enc::NumberBFrames.

Referenced by write_non_vcl_nalu().

static void write_sei_message ( SEIParameters *  p_SEI,
int  id,
byte payload,
int  payload_size,
int  payload_type 
) [static]

write one sei payload to the sei message

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

Definition at line 216 of file sei.c.

References SEI_MAX_ELEMENTS.

Referenced by PrepareAggregationSEIMessage().


Documentation generated with DoxyGen