📄 global_define.h
字号:
/*!
***************************************************************************
* \file
* global.h
*
* \brief
* global variables and structures.
*
*
* \date
* 01. Apr 2005
***************************************************************************
*/
#ifndef _GLOBAL__DEFINE_H_
#define _GLOBAL_DEFINE_H_
#include <stdio.h> //!< for FILE
#include "defines.h"
#include "global.h"
//typedef unsigned char byte; //!< 8 bit unsigned
//typedef int INT32; //!< 32 bit signed
//typedef unsigned int UINT32; //!< 32 bit unsigned
// global picture format dependend buffers, mem allocation in decod.c ******************
int **refFrArr; //!< Array for reference frames of each block
byte **imgY; //!< array for the decoded luma component
byte ***imgUV; //!< array for the chroma component
byte **imgY_ref; //!< reference frame find snr
byte ***imgUV_ref;
/*
**********************************************************************
* AVSM Decoder Trace Definition
**********************************************************************
*/
#if TRACE
byte MB_Y[16][16];
byte MB_UV[2][8][8];
int MB_H_coeff_Y[16][16];
int MB_H_coeff_UV[2][8][8];
int MB_IDCT_Y[16][16];
int MB_IDCT_UV[2][8][8];
int MB_IQ_Y[16][16];
int MB_IQ_UV[2][8][8];
int MB_intrapred_Y[16][16];
int MB_intrapred_UV[2][8][8];
int MB_interpred_Y[16][16];
int MB_interpred_UV[2][8][8]; //!<all above defined for trace printout
int MB_ipredmode_Y[4][4]; // not for decoding process
int MB_ipredmode_UV[2][2];
FILE *p_trace;
char se_type[30];
decoder_trace_t *dec_trace;
#endif
//cbzhu 12-15
#ifdef _ISOLATED_REGION_
int iREGenable;
int iREGrate;
int **iREGmap;
int iREGstate;
#endif
int nb_references;
int first_mb_nr_in_slice;
#define ET_SIZE 300 //!< size of error text buffer
char errortext[ET_SIZE]; //!< buffer for error message for exit with error()
//WJP FOR SLICE
int Slice_Enable;
int Position_of_Slice_in_Picbuff[1700];
//WJP END
#define MAX_SLICE_NR 128
#define SVA_STREAM_BUF_SIZE 1024
seq_parameter_set *sps,*sps_buf[16]; //!<SPS
pic_parameter_set *pps,*pps_buf[128]; //!<PPS
picture_header *picture_header_rbsp; //!Picture Header
NALU_t *nalu;
struct inp_par *input; //!< input parameters from input configuration file
struct snr_par *snr; //!< statistics
struct img_par *pgImage; //!< image parameters
Bitstream *currStream;
Macroblock *mb_data;
Macroblock *pgcurrMB;
StatParameter *stat_parameter;
int tot_time; //!< decoding lasting time statistics
// 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
FILE *reffile; //<! Refence YUV
#if ERR_REPORT
FILE *p_err;
#endif
/*!
**********************************************************************
* P r o t o t y p e s f o r g lo b a l f u n c t i o n
**********************************************************************
*/
void init_decoder(char *config_file); //!< AVS-M Decoder Initialization
void read_configfile(char *config_filename); //!< Decoding Parameter readin and mapping
void release_decoder();
void DeblockFrame(byte **imgY , byte ***imgUV );
void report_picture(int time_pic);
void report_seq(struct snr_par *snr);
void find_snr(struct snr_par *snr, FILE *p_ref);
//void init();
int GetAnnexbNALU();
void CloseAnnexbFile();
void OpenAnnexbFile(char *fn);
void DecodeTrailingBits(Bitstream *bitstream);
void DecodeTrailingBits1(Bitstream *bitstream,int bitstream_length); //!< temporary
int NALUtoRBSP (NALU_t *nalu);
int EBSPtoRBSP(byte *streamBuffer, int end_bytepos, int begin_bytepos);
int decode_one_picture(struct snr_par *snr);
void init_frame();
void write_frame(FILE *p_out);
void decode_picture_data();
void decode_slice_header();
void decode_slice_data();
void start_macroblock();
int read_one_macroblock();
int decode_one_macroblock();
//int sign(int a , int b);
Bitstream *AllocBitstream();
// Direct interpolation
void get_block(int x_pos, int y_pos, int block[4][4], unsigned char **ref_pic);//,unsigned char **ref_pic);
void CheckAvailabilityOfNeighbors();
// error printout
void error(char *text, int code);
// dynamic mem allocation
int init_global_buffers();
void free_global_buffers();
void Update_Picture_Buffers();
void FreeBitstream();
#if TRACE
/* trace out bitstream parseting statistics -- zhan ma */
void tracebits(const char *trace_str, //!< tracing information, char array describing the symbol
int len, //!< length of syntax element in bits
int info, //!< infoword of syntax element
int value1);
void tracebits2(const char *trace_str, int len, int info);
void tracebits3(const char *trace_str, int len, int info, int value1);
void trace_frame(FILE* p_trace,int img_width,int img_height,byte **img_luma, byte ***img_chroma);
void trace_mb_data(Macroblock *curMb);
void trace_mboverhead(Macroblock *curMb);
#endif
/* Error Handle Function Prototype -- Zhan Ma */
void CheckNALUValid(unsigned char nalu_header,FILE *error_file);
void CheckSPSValid(seq_parameter_set *SeqParaSet);
void CheckPPSValid(pic_parameter_set *PicParaSet);
void CheckHCoeffValid(int MbNr,int b8, int b4, int HCoeff);
void CheckDCTCoeffValid(int MbNr,int b8, int b4, int DCTCoeff);
void CheckQCoeffValid(int MbNr,int b8, int b4, int QCoeff);
void CheckPictureHeaderValid(picture_header *p,NALU_t *nalu);
void CheckMbOverHeadValid(Macroblock *curMb);
void CheckSliceHeaderValid(int first_mb_in_slice,int delta_qp);
void CheckBitstreamStatus(FILE *error_file);
/************************************************/
/* Sequence_header() */
//int aspect_ratio_information;
//int frame_rate_code;
//int bit_rate_value;
//int bbv_buffer_size;
//int profile_id;
//int level_id;
int horizontal_size;
int vertical_size;
//int sample_precision;
//int frame_rate_code;
//int bit_rate;
//int low_delay;
//int bit_rate_lower;
//int bit_rate_upper;
/* I_pictures_header() */
//int progressive_frame;
int fixed_picture_qp_flag;
int fixed_slice_qp_flag; // zhan ma 0714
int previous_qp; // zhan ma 0714
int picture_qp; // zhan ma 0714
//int slice_qp;
//int p_pic_type; //zhangnan
int picture_reference_flag;
int next_slice;
//int time_code_flag;
//int time_code;
//int loop_filter_disable;
//int loop_filter_parameter_flag;
int alpha_ci_offset;
int cp_offset;
int loopfilter_qp_offset;//WJP FOR DEBLOCK
//int bby_delay;
//int hour;
//int minute;
//int sec;
//int frame_offset;
//int bbv_check_times;
/* Pb_picture_header() */
//int picture_coding_type;
//int bbv_delay;
byte **reference_frame[3][3]; //[refnum][yuv][height][width]
byte ***current_frame;//[yuv][height][width]
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -