#include <time.h>
#include <limits.h>
#include "global.h"
#include "contributors.h"
#include "nal.h"
#include "mbuffer.h"
#include "parset.h"
#include "vlc.h"
#include "q_matrix.h"

Go to the source code of this file.
Functions | |
| static int | IdentifyProfile (InputParameters *p_Inp) |
| static int | IdentifyLevel (InputParameters *p_Inp) |
| static int | GenerateVUI_parameters_rbsp (seq_parameter_set_rbsp_t *sps, Bitstream *bitstream) |
| void | GenerateParameterSets (ImageParameters *p_Img, InputParameters *p_Inp) |
| void | FreeParameterSets (ImageParameters *p_Img) |
| NALU_t * | GenerateSeq_parameter_set_NALU (ImageParameters *p_Img) |
| NALU_t * | GeneratePic_parameter_set_NALU (ImageParameters *p_Img, InputParameters *p_Inp, int PPS_id) |
| void | GenerateSequenceParameterSet (seq_parameter_set_rbsp_t *sps, ImageParameters *p_Img, InputParameters *p_Inp, int SPS_id) |
| void | GeneratePictureParameterSet (pic_parameter_set_rbsp_t *pps, seq_parameter_set_rbsp_t *sps, ImageParameters *p_Img, InputParameters *p_Inp, 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 (ImageParameters *p_Img, seq_parameter_set_rbsp_t *sps, byte *rbsp) |
| int | GeneratePic_parameter_set_rbsp (ImageParameters *p_Img, InputParameters *p_Inp, pic_parameter_set_rbsp_t *pps, byte *rbsp) |
| NALU_t * | GenerateSEImessage_NALU (InputParameters *p_Inp) |
| int | GenerateSEImessage_rbsp (InputParameters *p_Inp, int id, byte *rbsp) |
| int | WriteHRDParameters (seq_parameter_set_rbsp_t *sps, Bitstream *bitstream) |
| void | GenerateVUIParameters (seq_parameter_set_rbsp_t *sps, InputParameters *p_Inp) |
Variables | |
| static const byte | ZZ_SCAN [16] |
| static const byte | ZZ_SCAN8 [64] |
Definition in file parset.c.
| void FreeParameterSets | ( | ImageParameters * | p_Img | ) |
frees global parameter sets active_sps and active_pps
Definition at line 116 of file parset.c.
References FreePPS(), and FreeSPS().
Referenced by free_encoder_memory().

| void GenerateParameterSets | ( | ImageParameters * | p_Img, | |
| InputParameters * | p_Inp | |||
| ) |
generates a sequence and picture parameter set and stores these in global active_sps and active_pps
Definition at line 57 of file parset.c.
References AllocPPS(), AllocSPS(), GeneratePictureParameterSet(), GenerateSequenceParameterSet(), inp_par_enc::WeightedBiprediction, and inp_par_enc::WeightedPrediction.
Referenced by init_encoder().

| NALU_t* GeneratePic_parameter_set_NALU | ( | ImageParameters * | p_Img, | |
| InputParameters * | p_Inp, | |||
| int | PPS_id | |||
| ) |
NALU_t *GeneratePic_parameter_set_NALU (ImageParameters *p_Img, InputParameters *p_Inp, int PPS_id);.
Definition at line 176 of file parset.c.
References AllocNALU(), GeneratePic_parameter_set_rbsp(), RBSPtoNALU(), and nalu_t::startcodeprefix_len.
Referenced by write_PPS().

| int GeneratePic_parameter_set_rbsp | ( | ImageParameters * | p_Img, | |
| InputParameters * | p_Inp, | |||
| pic_parameter_set_rbsp_t * | pps, | |||
| byte * | rbsp | |||
| ) |
int GeneratePic_parameter_set_rbsp (ImageParameters *p_Img, InputParameters *p_Inp, pic_parameter_set_rbsp_t *pps, char *rbsp);
| p_Img | picture parameter structure | |
| p_Inp | InputParameters | |
| pps | picture parameter structure | |
| rbsp | buffer to be filled with the rbsp, size should be at least MAXIMUMPARSETRBSPSIZE |
Definition at line 722 of file parset.c.
References Bitstream::bits_to_go, Bitstream::byte_pos, IdentifyProfile(), no_mem_exit(), Scaling_List(), se_v(), SODBtoRBSP(), Bitstream::streamBuffer, u_1(), u_v(), and ue_v().
Referenced by GeneratePic_parameter_set_NALU().

| void GeneratePictureParameterSet | ( | pic_parameter_set_rbsp_t * | pps, | |
| seq_parameter_set_rbsp_t * | sps, | |||
| ImageParameters * | p_Img, | |||
| InputParameters * | p_Inp, | |||
| int | PPS_id, | |||
| int | WeightedPrediction, | |||
| int | WeightedBiprediction, | |||
| int | cb_qp_index_offset, | |||
| int | cr_qp_index_offset | |||
| ) |
GeneratePictureParameterSet: Generates a Picture Parameter Set structure.
Following set the parameter for different slice group types
| pps | Picture Parameter Set to be filled | |
| sps | used Sequence Parameter Set | |
| p_Img | the image pointer | |
| p_Inp | Input configuration parameters | |
| 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 376 of file parset.c.
References FREXT_CAVLC444, FREXT_Hi10P, FREXT_Hi422, FREXT_Hi444, FREXT_HP, IdentifyProfile(), no_mem_exit(), inp_par_enc::num_slice_groups_minus1, inp_par_enc::output, inp_par_enc::run_length_minus1, inp_par_enc::slice_group_id, inp_par_enc::symbol_mode, inp_par_enc::top_left, inp_par_enc::UseConstrainedIntraPred, and YUV444.
Referenced by GenerateParameterSets().

| NALU_t* GenerateSEImessage_NALU | ( | InputParameters * | p_Inp | ) |
Function body for SEI message NALU generation.
Definition at line 989 of file parset.c.
References AllocNALU(), GenerateSEImessage_rbsp(), RBSPtoNALU(), and nalu_t::startcodeprefix_len.
Referenced by rewrite_paramsets(), and start_sequence().

| int GenerateSEImessage_rbsp | ( | InputParameters * | p_Inp, | |
| int | id, | |||
| byte * | rbsp | |||
| ) |
int GenerateSEImessage_rbsp (int, bufferingperiod_information_struct*, char*)
Definition at line 1016 of file parset.c.
References Bitstream::bits_to_go, Bitstream::byte_pos, no_mem_exit(), SODBtoRBSP(), Bitstream::streamBuffer, and u_v().
Referenced by GenerateSEImessage_NALU().

| NALU_t* GenerateSeq_parameter_set_NALU | ( | ImageParameters * | p_Img | ) |
int GenerateSeq_parameter_set_NALU (ImageParameters *p_Img);
| p_Img | ImageParameters structure |
Definition at line 146 of file parset.c.
References AllocNALU(), GenerateSeq_parameter_set_rbsp(), RBSPtoNALU(), and nalu_t::startcodeprefix_len.
Referenced by rewrite_paramsets(), and start_sequence().

| int GenerateSeq_parameter_set_rbsp | ( | ImageParameters * | p_Img, | |
| seq_parameter_set_rbsp_t * | sps, | |||
| byte * | rbsp | |||
| ) |
int GenerateSeq_parameter_set_rbsp (ImageParameters *p_Img, seq_parameter_set_rbsp_t *sps, char *rbsp);
| p_Img | Image parameters structure | |
| sps | sequence parameter structure | |
| rbsp | buffer to be filled with the rbsp, size should be at least MAXIMUMPARSETRBSPSIZE |
Definition at line 592 of file parset.c.
References Bitstream::bits_to_go, Bitstream::byte_pos, GenerateVUI_parameters_rbsp(), no_mem_exit(), Scaling_List(), se_v(), SODBtoRBSP(), Bitstream::streamBuffer, u_1(), u_v(), ue_v(), and YUV444.
Referenced by GenerateSeq_parameter_set_NALU().

| void GenerateSequenceParameterSet | ( | seq_parameter_set_rbsp_t * | sps, | |
| ImageParameters * | p_Img, | |||
| InputParameters * | p_Inp, | |||
| int | SPS_id | |||
| ) |
GenerateSequenceParameterSet: extracts info from global variables and generates sequence parameter set structure.
| sps | Sequence Parameter Set to be filled | |
| p_Img | ImageParameters for encoding | |
| p_Inp | InputParameters | |
| SPS_id | SPS ID |
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
| sps | Sequence Parameter Set to be filled | |
| p_Img | ImageParameters for encoding | |
| p_Inp | Input configuration parameters | |
| SPS_id | SPS ID |
Definition at line 213 of file parset.c.
References inp_par_enc::directInferenceFlag, error(), FREXT_CAVLC444, FREXT_Hi10P, FREXT_Hi422, FREXT_Hi444, FREXT_HP, GenerateVUIParameters(), IdentifyLevel(), IdentifyProfile(), inp_par_enc::IntraProfile, inp_par_enc::MbInterlace, inp_par_enc::num_ref_frames, inp_par_enc::output, inp_par_enc::pic_order_cnt_type, inp_par_enc::PicInterlace, and YUV444.
Referenced by GenerateParameterSets().

| static int GenerateVUI_parameters_rbsp | ( | seq_parameter_set_rbsp_t * | sps, | |
| Bitstream * | bitstream | |||
| ) | [static] |
Function body for VUI Parameter generation (to be done).
Definition at line 894 of file parset.c.
References u_1(), u_v(), ue_v(), and WriteHRDParameters().
Referenced by GenerateSeq_parameter_set_rbsp().

| void GenerateVUIParameters | ( | seq_parameter_set_rbsp_t * | sps, | |
| InputParameters * | p_Inp | |||
| ) |
void GenerateVUIParameters(seq_parameter_set_rbsp_t *sps, InputParameters *p_Inp)
Definition at line 1129 of file parset.c.
References inp_par_enc::output, and YUV444.
Referenced by GenerateSequenceParameterSet().
| int IdentifyLevel | ( | InputParameters * | p_Inp | ) | [static] |
Returns the Level.
Definition at line 879 of file parset.c.
References inp_par_enc::LevelIDC.
Referenced by GenerateSequenceParameterSet().
| int IdentifyProfile | ( | InputParameters * | p_Inp | ) | [static] |
Returns the Profile.
Definition at line 861 of file parset.c.
References inp_par_enc::ProfileIDC.
Referenced by GeneratePic_parameter_set_rbsp(), GeneratePictureParameterSet(), and GenerateSequenceParameterSet().
| int Scaling_List | ( | short * | scalingListinput, | |
| short * | scalingList, | |||
| int | sizeOfScalingList, | |||
| short * | UseDefaultScalingMatrix, | |||
| Bitstream * | bitstream | |||
| ) |
syntax for scaling list matrix values
| 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 |
Definition at line 539 of file parset.c.
References se_v().
Referenced by GeneratePic_parameter_set_rbsp(), and GenerateSeq_parameter_set_rbsp().

| int WriteHRDParameters | ( | seq_parameter_set_rbsp_t * | sps, | |
| Bitstream * | bitstream | |||
| ) |
int WriteHRDParameters((seq_parameter_set_rbsp_t *sps, Bitstream *bitstream)
Definition at line 1090 of file parset.c.
References u_1(), u_v(), and ue_v().
Referenced by GenerateVUI_parameters_rbsp().

const byte ZZ_SCAN[16] [static] |
const byte ZZ_SCAN8[64] [static] |
Initial value:
{ 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63
}