📄 global.h
字号:
int delta_pic_order_cnt_bottom;
signed int PicDistanceMsb;
unsigned int PrevPicDistanceLsb;
signed int CurrPicDistanceMsb;
unsigned int ThisPOC;
int PicWidthInMbs;
int PicHeightInMbs;
int PicSizeInMbs;
int block8_x,block8_y;
int structure;
int pn;
int buf_used;
int buf_size;
int picture_structure;
int advanced_pred_mode_disable;
int types;
int current_mb_nr_fld;
// !! shenyanfei Weighted Prediction
int slice_weighting_flag ; //cjw 20051219
int lum_scale[4] ;
int lum_shift[4] ;
int chroma_scale[4] ;
int chroma_shift[4] ;
int mb_weighting_flag ; //0 all the MB is weighted, 1 the weighting_prediction is used for each MB
int weighting_prediction ;
int mpr_weight[16][16];
int top_bot; // 0: top field / 1: bottom field / -1: frame / Yulj 2004.07.14
int Bframe_number;
} ImageParameters;
Macroblock *mb_data;
extern ImageParameters *img;
extern Bitstream *currStream;
// signal to noice ratio parameters
struct snr_par
{
float snr_y; //<! current Y SNR
float snr_u; //<! current U SNR
float snr_v; //<! current V SNR
float snr_y1; //<! SNR Y(dB) first frame
float snr_u1; //<! SNR U(dB) first frame
float snr_v1; //<! SNR V(dB) first frame
float snr_ya; //<! Average SNR Y(dB) remaining frames
float snr_ua; //<! Average SNR U(dB) remaining frames
float snr_va; //<! Average SNR V(dB) remaining frames
};
int tot_time;
// input parameters from configuration file
struct inp_par
{
char infile[100]; //<! Telenor AVS input
char outfile[100]; //<! Decoded YUV 4:2:0 output
char reffile[100]; //<! Optional YUV 4:2:0 reference file for SNR measurement
int FileFormat; //<! File format of the Input file, PAR_OF_ANNEXB or PAR_OF_RTP
int buf_cycle; //<! Frame buffer size
int LFParametersFlag; //<! Specifies that loop filter parameters are included in bitstream
};
extern struct inp_par *input;
// files
FILE *p_out; //<! pointer to output YUV file
FILE *p_ref; //<! pointer to input original reference YUV file file
FILE *p_log; //<! SNR file
#if TRACE
FILE *p_trace;
#endif
void read_ipred_block_modes(struct img_par *img,struct inp_par *inp,int b8);
void set_MB_parameters (struct img_par *img,struct inp_par *inp, int mb);
// prototypes
void init_conf(struct inp_par *inp, char *config_filename);
void report(struct inp_par *inp, struct img_par *img, struct snr_par *snr);
void find_snr(struct snr_par *snr,struct img_par *img, FILE *p_ref);
void init(struct img_par *img);
int decode_one_frame(struct img_par *img,struct inp_par *inp, struct snr_par *snr);
void init_frame(struct img_par *img, struct inp_par *inp);
void init_frame_buffer();
void init_top(struct img_par *img, struct inp_par *inp);
void init_bot(struct img_par *img, struct inp_par *inp);
void init_top_buffer();
void init_bot_buffer();
void split_field_top();
void split_field_bot();
void write_frame(struct img_par *img, FILE *p_out);
void write_prev_Pframe(struct img_par *img,FILE *p_out);// B pictures
void copy_Pframe(struct img_par *img);// B pictures
int read_new_slice();
void decode_one_slice(struct img_par *img,struct inp_par *inp);
void picture_data(struct img_par *img,struct inp_par *inp);
void top_field(struct img_par *img,struct inp_par *inp);
void bot_field(struct img_par *img,struct inp_par *inp);
void combine_field(struct img_par *img);
void start_macroblock(struct img_par *img,struct inp_par *inp);
void init_macroblock_Bframe(struct img_par *img);// B pictures
int read_one_macroblock(struct img_par *img,struct inp_par *inp);
int read_one_macroblock_Bframe(struct img_par *img,struct inp_par *inp);// B pictures
int decode_one_macroblock(struct img_par *img,struct inp_par *inp);
int decode_one_macroblock_Bframe(struct img_par *img);// B pictures
int exit_macroblock(struct img_par *img,struct inp_par *inp, int eos_bit);
int sign(int a , int b);
int Header();
void Update_Picture_top_field();
void Update_Picture_bot_field();
void DeblockFrame(ImageParameters *img, byte **imgY, byte ***imgUV);
// Direct interpolation
void get_block(int ref_frame,int x_pos, int y_pos, struct img_par *img, int block[8][8],unsigned char **ref_pic);
void CheckAvailabilityOfNeighbors(struct img_par *img);
void error(char *text, int code);
// dynamic mem allocation
int init_global_buffers(struct inp_par *inp, struct img_par *img);
void free_global_buffers(struct inp_par *inp, struct img_par *img);
void Update_Picture_Buffers();
void frame_postprocessing(struct img_par *img);
void report_frame(struct snr_par *snr,int tmp_time);
#define PAYLOAD_TYPE_IDERP 8
Bitstream *AllocBitstream();
void FreeBitstream();
void tracebits2(const char *trace_str, int len, int info);
int get_direct_mv (int****** mv,int mb_x,int mb_y);
void free_direct_mv (int***** mv,int mb_x,int mb_y);
int *****direct_mv; // only to verify result
//int direct_mv[45][80][4][4][3]; // only to verify result
int ipdirect_x,ipdirect_y;
/* Sequence_header() */
int aspect_ratio_information;
int frame_rate_code;
int bit_rate_value;
int bbv_buffer_size;
//int slice_enable;
int slice_row_nr;
int currentbitoffset;
int currentBytePosition;
int chroma_format;
int profile_id;
int level_id;
int progressive_sequence;
int horizontal_size;
int vertical_size;
int chroma_format;
int sample_precision;
int aspect_ratio_information;
int frame_rate_code;
int bit_rate;
int low_delay;
int bit_rate_lower;
int bit_rate_upper;
//int slice_weighting_flag;
//int mb_weighting_flag;
/* Sequence_display_extension() */
int video_format;
int video_range;
int color_description;
int color_primaries;
int transfer_characteristics;
int matrix_coefficients;
int display_horizontal_size;
int display_vertical_size;
// Zheng Xiaozhen, HiSilicon, 2007.03.21
int FrameNum; // Used to count the current frame number
int eos;
int pre_img_type;
int pre_img_types;
//int pre_str_vec;
int pre_img_tr;
int pre_img_qp;
int pre_tmp_time;
struct snr_par *snr; //!< statistics
//char str_vec[5]; // added by XiaoZhen Zheng, Hilisicon just for output display
/* video edit code */ // M1956 by Grandview 2006.12.12
int vec_flag;
/* Sopyright_extension() header */
int copyright_flag;
int copyright_identifier;
int original_or_copy;
int copyright_number_1;
int copyright_number_2;
int copyright_number_3;
/* I_pictures_header() */
int stream_length_flag;
int stream_length;
int picture_distance;
int picture_decode_order_flag;
int picture_decode_order;
int top_field_first;
int frame_pred_frame_dct;
int repeat_first_field;
int progressive_frame;
int fixed_picture_qp;
int picture_qp;
int time_code_flag;
int time_code;
int skip_mode_flag;
int loop_filter_disable;
int loop_filter_parameter_flag;
int alpha_offset;
int beta_offset;
int bby_delay;
int hour;
int minute;
int sec;
int frame_offset;
int bbv_check_times;
//int slice_weighting_flag;
//int mb_weighting_flag;
int luma_scale;
int luma_shift;
int chroma_scale;
int chroma_shift;
int second_IField; //cjw 20051230
/* Pb_picture_header() */
int picture_coding_type;
int bbv_delay;
int picture_reference_flag;
int dct_adaptive_flag;
float singlefactor;
int marker_bit;
/*picture_display_extension()*/
int frame_centre_horizontal_offset[4];
int frame_centre_vertical_offset[4];
/* slice_header() */
int start_code_prefix;
int img_width;
int slice_vertical_position; //cjw 20060327
int slice_vertical_position_extension;
int slice_start_code;
int fixed_picture_qp;
int fixed_slice_qp;
int slice_qp;
int StartCodePosition;
#define I_PICTURE_START_CODE 0xB3
#define PB_PICTURE_START_CODE 0xB6
#define SLICE_START_CODE_MIN 0x00
#define SLICE_START_CODE_MAX 0xAF
#define USER_DATA_START_CODE 0xB2
#define SEQUENCE_HEADER_CODE 0xB0
#define EXTENSION_START_CODE 0xB5
#define SEQUENCE_END_CODE 0xB1
#define VIDEO_EDIT_CODE 0xB7
#define SEQUENCE_DISPLAY_EXTENSION_ID 2
#define COPYRIGHT_EXTENSION_ID 4
#define CAMERAPARAMETERS_EXTENSION_ID 11
#define PICTURE_DISPLAY_EXTENSION_ID 7
// reference frame buffer
unsigned char **reference_frame[3][3]; //[refnum][yuv][height][width]
unsigned char **reference_field[6][3]; //[refnum][yuv][height/2][width]
unsigned char ***ref[4]; //[refnum(4 for filed)][yuv][height(height/2)][width]
unsigned char ***ref_frm[2]; //[refnum(5 for filed)][yuv][height(height/2)][width]
unsigned char ***ref_fld[5]; //[refnum(5 for filed)][yuv][height(height/2)][width]
unsigned char ***b_ref[2],***f_ref[2];
unsigned char ***b_ref_frm[2],***f_ref_frm[2];
unsigned char ***b_ref_fld[2],***f_ref_fld[2];
unsigned char ***current_frame;//[yuv][height][width]
unsigned char ***current_field;//[yuv][height/2][width]
typedef struct{
int reserved;
int camera_id;
int height_of_image_device;
int focal_length;
int f_number;
int vertical_angle_of_view;
int camera_position_x;
int camera_position_y;
int camera_position_z;
int camera_direction_x;
int camera_direction_y;
int camera_direction_z;
int image_plane_vertical_x;
int image_plane_vertical_y;
int image_plane_vertical_z;
} CameraParamters;
extern CameraParamters *camera;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -