parset.h File Reference

Picture and Sequence Parameter Sets, encoder operations. More...

#include "parsetcommon.h"
#include "nalu.h"
#include "sei.h"

Include dependency graph for parset.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GenerateParameterSets (void)
void FreeParameterSets (void)
NALU_t * GenerateSeq_parameter_set_NALU (void)
NALU_t * GeneratePic_parameter_set_NALU (int)
NALU_t * GenerateSEImessage_NALU ()
void GenerateSequenceParameterSet (seq_parameter_set_rbsp_t *sps, int SPS_id)
void GeneratePictureParameterSet (pic_parameter_set_rbsp_t *pps, seq_parameter_set_rbsp_t *sps, int PPS_id, int WeightedPrediction, int WeightedBiprediction, int cb_qp_index_offset, int cr_qp_index_offset)
int Scaling_List (short *scalingListinput, short *scalingList, int sizeOfScalingList, short *UseDefaultScalingMatrix, Bitstream *bitstream)
int GenerateSeq_parameter_set_rbsp (seq_parameter_set_rbsp_t *sps, byte *buf)
int GeneratePic_parameter_set_rbsp (pic_parameter_set_rbsp_t *pps, byte *buf)
int GenerateSEImessage_rbsp (int id, byte *buf)
void FreeSPS (seq_parameter_set_rbsp_t *sps)
void FreePPS (pic_parameter_set_rbsp_t *pps)
int WriteHRDParameters (seq_parameter_set_rbsp_t *sps, Bitstream *bitstream)
void GenerateVUIParameters (seq_parameter_set_rbsp_t *sps)
pic_parameter_set_rbsp_t * AllocPPS (void)
seq_parameter_set_rbsp_t * AllocSPS (void)


Detailed Description

Picture and Sequence Parameter Sets, encoder operations.

parset.h

Date:
25 November 2002
Author:
Main contributors (see contributors.h for copyright, address and affiliation details)

Definition in file parset.h.


Function Documentation

pic_parameter_set_rbsp_t* AllocPPS (  ) 

Allocates memory for a pps.

Returns:
pointer to a pps

Definition at line 27 of file parsetcommon.c.

Referenced by GenerateParameterSets().

seq_parameter_set_rbsp_t* AllocSPS (  ) 

Allocates memory for am sps.

Returns:
pointer to a sps

Definition at line 47 of file parsetcommon.c.

Referenced by GenerateParameterSets().

void FreeParameterSets ( void   ) 

frees global parameter sets active_sps and active_pps

Returns:
A NALU containing the Sequence ParameterSet

Definition at line 121 of file parset.c.

References FreePPS(), and FreeSPS().

Referenced by free_encoder_memory().

Here is the call graph for this function:

void FreePPS ( pic_parameter_set_rbsp_t *  pps  ) 

Frees a pps.

Parameters:
pps pps to be freed
Returns:
none

Definition at line 70 of file parsetcommon.c.

Referenced by FreeParameterSets().

void FreeSPS ( seq_parameter_set_rbsp_t *  sps  ) 

Frees a sps.

Parameters:
sps sps to be freed
Returns:
none

Definition at line 92 of file parsetcommon.c.

Referenced by FreeParameterSets().

void GenerateParameterSets ( void   ) 

generates a sequence and picture parameter set and stores these in global active_sps and active_pps

Returns:
A NALU containing the Sequence ParameterSet

Definition at line 62 of file parset.c.

References AllocPPS(), AllocSPS(), InputParameters::cb_qp_index_offset, InputParameters::chroma_qp_index_offset, InputParameters::cr_qp_index_offset, InputParameters::GenerateMultiplePPS, GeneratePictureParameterSet(), GenerateSequenceParameterSet(), InputParameters::WeightedBiprediction, and InputParameters::WeightedPrediction.

Referenced by init_encoder().

Here is the call graph for this function:

NALU_t* GeneratePic_parameter_set_NALU ( int  PPS_id  ) 

NALU_t *GeneratePic_parameter_set_NALU (int PPS_id);.

Note:
Uses the global variables through GenerateSequenceParameterSet() and GeneratePictureParameterSet
Returns:
A NALU containing the Picture Parameter Set

Definition at line 180 of file parset.c.

References AllocNALU(), GeneratePic_parameter_set_rbsp(), RBSPtoNALU(), and NALU_t::startcodeprefix_len.

Referenced by write_PPS().

Here is the call graph for this function:

int GeneratePic_parameter_set_rbsp ( pic_parameter_set_rbsp_t *  pps,
byte *  rbsp 
)

int GeneratePic_parameter_set_rbsp (pic_parameter_set_rbsp_t *sps, char *rbsp);

Parameters:
pps picture parameter structure
rbsp buffer to be filled with the rbsp, size should be at least MAXIMUMPARSETRBSPSIZE
Returns:
size of the RBSP in bytes, negative in case of an error
Note:
Picture Parameter VUI function is called, but the function implements an exit (-1)

Definition at line 737 of file parset.c.

References Bitstream::bits_to_go, Bitstream::byte_pos, IdentifyProfile(), no_mem_exit(), ImageParameters::pic_order_present_flag, Scaling_List(), se_v(), SODBtoRBSP(), Bitstream::streamBuffer, u_1(), u_v(), and ue_v().

Referenced by GeneratePic_parameter_set_NALU().

Here is the call graph for this function:

void GeneratePictureParameterSet ( pic_parameter_set_rbsp_t *  pps,
seq_parameter_set_rbsp_t *  sps,
int  PPS_id,
int  WeightedPrediction,
int  WeightedBiprediction,
int  cb_qp_index_offset,
int  cr_qp_index_offset 
)

GeneratePictureParameterSet: Generates a Picture Parameter Set structure.

Regarding the QP The previous software versions coded the absolute QP only in the slice header. This is kept, and the offset in the PPS is coded even if we could save bits by intelligently using this field.

Following set the parameter for different slice group types

Parameters:
pps  Picture Parameter Set to be filled
sps  used Sequence Parameter Set
PPS_id  PPS ID
WeightedPrediction  value of weighted_pred_flag
WeightedBiprediction  value of weighted_bipred_idc
cb_qp_index_offset  value of cb_qp_index_offset
cr_qp_index_offset  value of cr_qp_index_offset

Definition at line 398 of file parset.c.

References ImageParameters::auto_crop_bottom, ImageParameters::auto_crop_right, InputParameters::bottom_right, InputParameters::DFSendParameters, FREXT_CAVLC444, FREXT_Hi10P, FREXT_Hi422, FREXT_Hi444, FREXT_HP, IdentifyProfile(), no_mem_exit(), InputParameters::num_slice_groups_minus1, InputParameters::output, ImageParameters::pic_order_present_flag, InputParameters::redundant_pic_flag, InputParameters::run_length_minus1, InputParameters::ScalingListPresentFlag, InputParameters::ScalingMatrixPresentFlag, InputParameters::slice_group_change_direction_flag, InputParameters::slice_group_change_rate_minus1, InputParameters::slice_group_id, InputParameters::slice_group_map_type, InputParameters::symbol_mode, InputParameters::top_left, InputParameters::Transform8x8Mode, InputParameters::UseConstrainedIntraPred, and YUV444.

Referenced by GenerateParameterSets().

Here is the call graph for this function:

NALU_t* GenerateSEImessage_NALU (  ) 

Function body for SEI message NALU generation.

Returns:
A NALU containing the SEI messages

Definition at line 1002 of file parset.c.

References AllocNALU(), GenerateSEImessage_rbsp(), RBSPtoNALU(), and NALU_t::startcodeprefix_len.

Referenced by rewrite_paramsets(), and start_sequence().

Here is the call graph for this function:

int GenerateSEImessage_rbsp ( int  id,
byte *  rbsp 
)

int GenerateSEImessage_rbsp (int, bufferingperiod_information_struct*, char*)

Returns:
size of the RBSP in bytes, negative in case of an error
Note:

Definition at line 1029 of file parset.c.

References Bitstream::bits_to_go, Bitstream::byte_pos, no_mem_exit(), sei_message, InputParameters::SEIMessageText, SODBtoRBSP(), Bitstream::streamBuffer, and u_v().

Referenced by GenerateSEImessage_NALU().

Here is the call graph for this function:

NALU_t* GenerateSeq_parameter_set_NALU ( void   ) 

int GenerateSeq_parameter_set_NALU (void);

Note:
Uses the global variables through GenerateSequenceParameterSet() and GeneratePictureParameterSet
Returns:
A NALU containing the Sequence ParameterSet

Definition at line 150 of file parset.c.

References AllocNALU(), GenerateSeq_parameter_set_rbsp(), RBSPtoNALU(), and NALU_t::startcodeprefix_len.

Referenced by rewrite_paramsets(), and start_sequence().

Here is the call graph for this function:

int GenerateSeq_parameter_set_rbsp ( seq_parameter_set_rbsp_t *  sps,
byte *  rbsp 
)

int GenerateSeq_parameter_set_rbsp (seq_parameter_set_rbsp_t *sps, char *rbsp);

Parameters:
sps sequence parameter structure
rbsp buffer to be filled with the rbsp, size should be at least MAXIMUMPARSETRBSPSIZE
Returns:
size of the RBSP in bytes
Note:
Sequence Parameter VUI function is called, but the function implements an exit (-1)

Definition at line 612 of file parset.c.

References Bitstream::bits_to_go, Bitstream::byte_pos, GenerateVUI_parameters_rbsp(), ImageParameters::lossless_qpprime_flag, no_mem_exit(), Scaling_List(), se_v(), SODBtoRBSP(), Bitstream::streamBuffer, u_1(), u_v(), ue_v(), YUV444, and ImageParameters::yuv_format.

Referenced by GenerateSeq_parameter_set_NALU().

Here is the call graph for this function:

void GenerateSequenceParameterSet ( seq_parameter_set_rbsp_t *  sps,
int  SPS_id 
)

GenerateSequenceParameterSet: extracts info from global variables and generates sequence parameter set structure.

Function reads all kinds of values from several global variables, including params-> and image-> and fills in the sps. Many values are current hard-coded to defaults.

POC stuff: The following values are hard-coded in init_poc(). Apparently, the poc implementation covers only a subset of the poc functionality. Here, the same subset is implemented. Changes in the POC stuff have also to be reflected here

Parameters:
sps  Sequence Parameter Set to be filled
SPS_id  SPS ID

Definition at line 209 of file parset.c.

References alloc_colocated(), ImageParameters::auto_crop_bottom, ImageParameters::auto_crop_right, ImageParameters::delta_pic_order_always_zero_flag, InputParameters::directInferenceFlag, InputParameters::EnableVUISupport, error(), FREXT_CAVLC444, FREXT_Hi10P, FREXT_Hi422, FREXT_Hi444, FREXT_HP, GenerateVUIParameters(), IdentifyLevel(), IdentifyProfile(), InputParameters::IntraProfile, ImageParameters::lossless_qpprime_flag, InputParameters::LosslessCoding, InputParameters::MbInterlace, InputParameters::num_ref_frames, ImageParameters::num_ref_frames_in_pic_order_cnt_cycle, ImageParameters::offset_for_non_ref_pic, ImageParameters::offset_for_ref_frame, ImageParameters::offset_for_top_to_bottom_field, InputParameters::output, InputParameters::pic_order_cnt_type, InputParameters::PicInterlace, InputParameters::rgb_input_flag, InputParameters::ScalingListPresentFlag, InputParameters::ScalingMatrixPresentFlag, InputParameters::separate_colour_plane_flag, InputParameters::Transform8x8Mode, and YUV444.

Referenced by GenerateParameterSets().

Here is the call graph for this function:

void GenerateVUIParameters ( seq_parameter_set_rbsp_t *  sps  ) 

int Scaling_List ( short *  scalingListinput,
short *  scalingList,
int  sizeOfScalingList,
short *  UseDefaultScalingMatrix,
Bitstream *  bitstream 
)

syntax for scaling list matrix values

Parameters:
scalingListinput input scaling list
scalingList scaling list to be used
sizeOfScalingList size of the scaling list
UseDefaultScalingMatrix usage of default Scaling Matrix
bitstream target bitstream for writing syntax
Returns:
size of the RBSP in bytes

Definition at line 560 of file parset.c.

References se_v().

Referenced by GeneratePic_parameter_set_rbsp(), and GenerateSeq_parameter_set_rbsp().

Here is the call graph for this function:

int WriteHRDParameters ( seq_parameter_set_rbsp_t *  sps,
Bitstream *  bitstream 
)

int WriteHRDParameters((seq_parameter_set_rbsp_t *sps, Bitstream *bitstream)

Returns:
size of the RBSP in bytes, negative in case of an error
Note:

Definition at line 1098 of file parset.c.

References u_1(), u_v(), and ue_v().

Referenced by GenerateVUI_parameters_rbsp().

Here is the call graph for this function:


Documentation generated with DoxyGen