📄 global.h
字号:
int LossRateC; //!< assumed loss probablility of partition C, in per cent, used for loss-aware R/D
int NoOfDecoders;
int RestrictRef;
int NumFramesInELSubSeq;
int NumFrameIn2ndIGOP;
int RandomIntraMBRefresh; //!< Number of pseudo-random intra-MBs per picture
int LFSendParameters;
int LFDisableIdc;
int LFAlphaC0Offset;
int LFBetaOffset;
int SparePictureOption;
int SPDetectionThreshold;
int SPPercentageThreshold;
// FMO
char SliceGroupConfigFileName[FILE_NAME_SIZE]; //!< Filename for config info fot type 0, 2, 6
int num_slice_groups_minus1; //!< "FmoNumSliceGroups" in encoder.cfg, same as FmoNumSliceGroups, which should be erased later
int slice_group_map_type;
int *top_left; //!< top_left and bottom_right store values indicating foregrounds
int *bottom_right;
byte *slice_group_id; //!< slice_group_id is for slice group type being 6
int *run_length_minus1; //!< run_length_minus1 is for slice group type being 0
int slice_group_change_direction_flag;
int slice_group_change_rate_minus1;
int slice_group_change_cycle;
int redundant_slice_flag; //! whether redundant slices exist, JVT-D101
int pic_order_cnt_type; // POC200301
int context_init_method;
int model_number;
int Transform8x8Mode;
int ReportFrameStats;
int DisplayEncParams;
int Verbose;
//! Rate Control on JVT standard
int RCEnable;
int bit_rate;
int SeinitialQP;
int basicunit;
int channel_type;
int ScalingMatrixPresentFlag;
int ScalingListPresentFlag[8];
// FastME enable
int FMEnable;
// Fidelity Range Extensions
int BitDepthLuma;
int BitDepthChroma;
int img_height_cr;
int img_width_cr;
int rgb_input_flag;
int cb_qp_index_offset;
int cr_qp_index_offset;
// Lossless Coding
int lossless_qpprime_y_zero_flag;
//Residue Color Transform
int residue_transform_flag;
// Lambda Params
int UseExplicitLambdaParams;
double LambdaWeight[6];
char QOffsetMatrixFile[FILE_NAME_SIZE]; //!< Quantization Offset matrix cfg file
int OffsetMatrixPresentFlag; //!< Enable Explicit Quantization Offset Matrices
int AdaptiveRounding; //!< Adaptive Rounding parameter based on JVT-N011
int AdaptRndPeriod; //!< Set period for adaptive rounding of JVT-N011 in MBs
int AdaptRndChroma;
int AdaptRndWFactor[2][5]; //!< Weighting factors based on reference indicator and slice type
// Fast Mode Decision
int EarlySkipEnable;
int SelectiveIntraEnable;
int DisposableP;
int DispPQPOffset;
} InputParameters;
//! ImageParameters
typedef struct
{
int number; //!< current image number to be encoded
int pn; //!< picture number
int LevelIndex; //!< mapped level idc
int current_mb_nr;
int total_number_mb;
int current_slice_nr;
int type;
int structure; //!< picture structure
int num_ref_frames; //!< number of reference frames to be used
int max_num_references; //!< maximum number of reference pictures that may occur
int qp; //!< quant for the current frame
int qpsp; //!< quant for the prediction frame of SP-frame
float framerate;
int width; //!< Number of pels
int width_cr; //!< Number of pels chroma
int height; //!< Number of lines
int height_cr; //!< Number of lines chroma
int height_cr_frame; //!< Number of lines chroma frame
int subblock_x; //!< current subblock horizontal
int subblock_y; //!< current subblock vertical
int is_intra_block;
int is_v_block;
int mb_y_upd;
int mb_y_intra; //!< which GOB to intra code
int block_c_x; //!< current block chroma vertical
char **ipredmode; //!< intra prediction mode
char **ipredmode8x8; //!< help storage for 8x8 modes, inserted by YV
int cod_counter; //!< Current count of number of skipped macroblocks in a row
int ***nz_coeff; //!< number of coefficients per block (CAVLC)
int mb_x; //!< current MB horizontal
int mb_y; //!< current MB vertical
int block_x; //!< current block horizontal
int block_y; //!< current block vertical
int pix_x; //!< current pixel horizontal
int pix_y; //!< current pixel vertical
int pix_c_x; //!< current pixel chroma horizontal
int pix_c_y; //!< current pixel chroma vertical
int opix_x; //!< current original picture pixel horizontal
int opix_y; //!< current original picture pixel vertical
int opix_c_x; //!< current original picture pixel chroma horizontal
int opix_c_y; //!< current original picture pixel chroma vertical
// some temporal buffers
imgpel mprr[9][16][16]; //!< all 9 prediction modes? // enlarged from 4 to 16 for ABT (is that neccessary?)
imgpel mprr_2[5][16][16]; //!< all 4 new intra prediction modes
imgpel mprr_3[9][8][8]; //!< all 9 prediction modes for 8x8 transformation
imgpel mprr_c[2][4][16][16]; //!< chroma intra prediction modes
imgpel mpr[16][16]; //!< current best prediction mode
int m7[16][16]; //!< the diff pixel values between orginal image and prediction
int ****cofAC; //!< AC coefficients [8x8block][4x4block][level/run][scan_pos]
int ***cofDC; //!< DC coefficients [yuv][level/run][scan_pos]
int fadjust4x4[4][16][16]; //!< Transform coefficients for 4x4 luma. Excludes DC for I16x16
int fadjust8x8[3][16][16]; //!< Transform coefficients for 8x8 luma
int fadjust4x4Cr[4][2][16][16]; //!< Transform coefficients for 4x4 chroma. Excludes DC chroma.
int fadjust8x8Cr[1][2][16][16]; //!< Transform coefficients for 4x4 chroma within 8x8 inter blocks.
Picture *currentPicture; //!< The coded picture currently in the works (typically frame_pic, top_pic, or bottom_pic)
Slice *currentSlice; //!< pointer to current Slice data struct
Macroblock *mb_data; //!< array containing all MBs of a whole frame
SyntaxElement MB_SyntaxElements[MAX_SYMBOLS_PER_MB]; //!< temporal storage for all chosen syntax elements of one MB
int *quad; //!< Array containing square values,used for snr computation */ /* Values are limited to 5000 for pixel differences over 70 (sqr(5000)).
int *intra_block;
int tr;
int fld_type; //!< top or bottom field
unsigned int fld_flag;
unsigned int rd_pass;
int direct_intraP_ref[4][4];
int pstruct_next_P;
int imgtr_next_P_frm;
int imgtr_last_P_frm;
int imgtr_next_P_fld;
int imgtr_last_P_fld;
// B pictures
double b_interval;
int p_interval;
int b_frame_to_code;
int fw_mb_mode;
int bw_mb_mode;
short****** pred_mv; //!< motion vector predictors for all block types and all reference frames
short****** all_mv; //!< replaces local all_mv
short****** bipred_mv1; //!< Biprediction MVs
short****** bipred_mv2; //!< Biprediction MVs
short bi_pred_me[MAXMODE];
int LFDisableIdc;
int LFAlphaC0Offset;
int LFBetaOffset;
int direct_spatial_mv_pred_flag; //!< Direct Mode type to be used (0: Temporal, 1: Spatial)
int num_ref_idx_l0_active;
int num_ref_idx_l1_active;
int field_mode; //!< For MB level field/frame -- field mode on flag
int top_field; //!< For MB level field/frame -- top field flag
int mvscale[6][MAX_REFERENCE_PICTURES];
int buf_cycle;
int i16offset;
int layer; //!< which layer this picture belonged to
int old_layer; //!< old layer number
int NoResidueDirect;
int AdaptiveRounding; //!< Adaptive Rounding parameter based on JVT-N011
int redundant_pic_cnt; // JVT-D101
int MbaffFrameFlag; //!< indicates frame with mb aff coding
//the following should probably go in sequence parameters
// unsigned int log2_max_frame_num_minus4;
unsigned int pic_order_cnt_type;
// for poc mode 0, POC200301
// unsigned int log2_max_pic_order_cnt_lsb_minus4;
// for poc mode 1, POC200301
unsigned int delta_pic_order_always_zero_flag;
int offset_for_non_ref_pic;
int offset_for_top_to_bottom_field;
unsigned int num_ref_frames_in_pic_order_cnt_cycle;
int offset_for_ref_frame[1]; // MAX_LENGTH_POC_CYCLE in decoder
// POC200301
//the following is for slice header syntax elements of poc
// for poc mode 0.
unsigned int pic_order_cnt_lsb;
int delta_pic_order_cnt_bottom;
// for poc mode 1.
int delta_pic_order_cnt[2];
// POC200301
unsigned int field_picture;
signed int toppoc; //!< poc for this frame or field
signed int bottompoc; //!< for completeness - poc of bottom field of a frame (always = poc+1)
signed int framepoc; //!< min (toppoc, bottompoc)
signed int ThisPOC; //!< current picture POC
unsigned int frame_num; //!< frame_num for this frame
unsigned PicWidthInMbs;
unsigned PicHeightInMapUnits;
unsigned FrameHeightInMbs;
unsigned PicHeightInMbs;
unsigned PicSizeInMbs;
unsigned FrameSizeInMbs;
//the following should probably go in picture parameters
unsigned int pic_order_present_flag; // ????????
//the following are sent in the slice header
// int delta_pic_order_cnt[2];
int nal_reference_idc;
int adaptive_ref_pic_buffering_flag;
int no_output_of_prior_pics_flag;
int long_term_reference_flag;
DecRefPicMarking_t *dec_ref_pic_marking_buffer;
int model_number;
/*rate control*/
int NumberofHeaderBits;
int NumberofTextureBits;
int NumberofBasicUnitHeaderBits;
int NumberofBasicUnitTextureBits;
double TotalMADBasicUnit;
int NumberofMBTextureBits;
int NumberofMBHeaderBits;
int NumberofCodedBFrame;
int NumberofCodedPFrame;
int NumberofGOP;
int TotalQpforPPicture;
int NumberofPPicture;
double *MADofMB;
int BasicUnitQP;
int TopFieldFlag;
int FieldControl;
int FieldFrame;
int Frame_Total_Number_MB;
int IFLAG;
int NumberofCodedMacroBlocks;
int BasicUnit;
int write_macroblock;
int bot_MB;
int write_macroblock_frame;
int DeblockCall;
int last_pic_bottom_field;
int last_has_mmco_5;
int pre_frame_num;
int slice_group_change_cycle;
int pic_unit_size_on_disk;
int bitdepth_luma;
int bitdepth_chroma;
int bitdepth_luma_qp_scale;
int bitdepth_chroma_qp_scale;
int bitdepth_lambda_scale;
// Lagrangian Parameters
double **lambda_md; //!< Mode decision Lambda
double **lambda_me; //!< Motion Estimation Lambda
int **lambda_mf; //!< Integer formatted Motion Estimation Lambda
unsigned int dc_pred_value; //!< value for DC prediction (depends on pel bit depth)
int max_imgpel_value; //!< max value that one picture element (pixel) can take (depends on pic_unit_bitdepth)
int max_imgpel_value_uv;
int num_blk8x8_uv;
int num_cdc_coeff;
int yuv_format;
int lossless_qpprime_flag;
int mb_cr_size_x;
int mb_cr_size_y;
int chroma_qp_offset[2]; //!< offset for qp for chroma [0-Cb, 1-Cr]
// Residue Color Transform
int residue_transform_flag;
int auto_crop_right;
int auto_crop_bottom;
short checkref;
int last_valid_reference;
int bytes_in_picture;
} ImageParameters;
#define NUM_PIC_TYPE 5
//!< statistics
typedef struct
{
int quant0; //!< quant for the first frame
int quant1; //!< average quant for the remaining frames
float bitr; //!< bit rate for current frame, used only for output til terminal
float bitrate; //!< average bit rate for the sequence except first frame
int bit_ctr; //!< counter for bit usage
int bit_ctr_n; //!< bit usage for the current frame
int bit_slice; //!< number of bits in current slice
int bit_ctr_emulationprevention; //!< stored bits needed to prevent start code emulation
int b8_mode_0_use[NUM_PIC_TYPE][2];
int mode_use_transform_8x8[NUM_PIC_TYPE][MAXMODE];
int mode_use_transform_4x4[NUM_PIC_TYPE][MAXMODE];
int intra_chroma_mode[4];
// B pictures
int successive_Bframe;
int *mode_use_Bframe;
int *bit_use_mode_Bframe;
int bit_ctr_I;
int bit_ctr_P;
int bit_ctr_B;
float bitrate_I;
float bitrate_P;
float bitrate_B;
int mode_use [NUM_PIC_TYPE][MAXMODE]; //!< Macroblock mode usage for Intra frames
int bit_use_mode [NUM_PIC_TYPE][MAXMODE]; //!< statistics of bit usage
int bit_use_stuffingBits[NUM_PIC_TYPE];
int bit_use_mb_type [NUM_PIC_TYPE];
int bit_use_header [NUM_PIC_TYPE];
int tmp_bit_use_cbp [NUM_PIC_TYPE];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -