⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.h

📁 AVS编解码是学习AVS程序开发的入门资料,可以帮助初学者获得很多的收获.
💻 H
📖 第 1 页 / 共 3 页
字号:
byte ***nextP_imgUV;
pel_t *Refbuf11[4];            //!< 1/1th pel (full pel) reference frame buffer

// global picture format dependend buffers, mem allocation in image.c (field picture)
byte   **imgY_org_top;
byte  ***imgUV_org_top;
byte   **imgY_org_bot;
byte  ***imgUV_org_bot;
byte   **imgY_top;               //!< Encoded luma images
byte  ***imgUV_top;              //!< Encoded croma images
byte   **imgY_bot;               //!< Encoded luma images
byte  ***imgUV_bot;              //!< Encoded croma images
pel_t **Refbuf11_fld;            //!< 1/1th pel (full pel) reference frame buffer
int    **refFrArr_top;           //!< Array for reference frames of each block
int    **refFrArr_bot;           //!< Array for reference frames of each block
byte   **imgY_com;               //!< Encoded luma images
byte  ***imgUV_com;              //!< Encoded croma images
int    **refFrArr_fld;           //!< Array for reference frames of each block
int *parity_fld;


// global picture format dependend buffers, mem allocation in image.c (field picture)
byte  **mref_fld[4];               //!< 1/4 pix luma
byte ***mref_mbfld;        //!< For MB level field/frame coding tools 

// global picture format dependend buffers, mem allocation in image.c (frame buffer)
byte  **mref_frm[2];               //!< 1/4 pix luma //[2:ref_index]
// B pictures
// motion vector : forward, backward, direct
int   **fw_refFrArr_top;
int   **bw_refFrArr_top;
int   **fw_refFrArr_bot;
int   **bw_refFrArr_bot;
int   ***tmp_mv_top;             //!< motion vector buffer
int   ***tmp_mv_bot;             //!< motion vector buffer

int   **fwdir_refFrArr;         //!< direct mode forward reference buffer
int   **bwdir_refFrArr;         //!< direct mode backward reference buffer

// global picture format dependend buffers, mem allocation in image.c (frame buffer)
byte   **imgY_org_frm;
byte  ***imgUV_org_frm;
byte   **imgY_frm;               //!< Encoded luma images
byte  ***imgUV_frm;              //!< Encoded croma images

int    **refFrArr_frm;           //!< Array for reference frames of each block
int   direct_mode;

// B pictures
// motion vector : forward, backward, direct
int   **fw_refFrArr_frm;
int   **bw_refFrArr_frm;

int   **fw_refFrArr_fld;/*lgp*/
int   **bw_refFrArr_fld;/*lgp*/
int   ***tmp_mv_fld;  /*lgp*/           //!< motion vector buffer

int intras;         //!< Counts the intra updates in each frame.

int  Bframe_ctr, frame_no, nextP_tr_frm,nextP_tr;
int  tot_time;
int  tmp_buf_cycle;    // jlzheng 7.21
int  temp_vecperiod;

int bot_field_mb_nr;	// record the relative mb index in the top field,	Xiaozhen Zheng HiSilicon, 20070327

#define ET_SIZE 300      //!< size of error text buffer
char errortext[ET_SIZE]; //!< buffer for error message for exit with error()

//! SNRParameters
typedef struct
{
  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
} SNRParameters;

                             //! all input parameters
typedef struct
{
  int no_frames;                //!< number of frames to be encoded
  int qp0;                      //!< QP of first frame
  int qpN;                      //!< QP of remaining frames
  int jumpd;                    //!< number of frames to skip in input sequence (e.g 2 takes frame 0,3,6,9...)
  int hadamard;                 /*!< 0: 'normal' SAD in 1/3 pixel search.  1: use 4x4 Haphazard transform and '
                                     Sum of absolute transform difference' in 1/3 pixel search                   */
  int search_range;             /*!< search range - integer pel search and 16x16 blocks.  The search window is
                                     generally around the predicted vector. Max vector is 2xmcrange.  For 8x8
                                     and 4x4 block sizes the search range is 1/2 of that for 16x16 blocks.       */
  int no_multpred;              /*!< 1: prediction from the last frame only. 2: prediction from the last or
                                     second last frame etc.  Maximum 5 frames                                    */
  int img_width;                //!< GH: if CUSTOM image format is chosen, use this size
  int img_height;               //!< GH: width and height must be a multiple of 16 pels
  int yuv_format;               //!< GH: YUV format (0=4:0:0, 1=4:2:0, 2=4:2:2, 3=4:4:4,currently only 4:2:0 is supported)
  int color_depth;              //!< GH: YUV color depth per component in bit/pel (currently only 8 bit/pel is supported)
  int intra_upd;                /*!< For error robustness. 0: no special action. 1: One GOB/frame is intra coded
                                     as regular 'update'. 2: One GOB every 2 frames is intra coded etc.
                                     In connection with this intra update, restrictions is put on motion vectors
                                     to prevent errors to propagate from the past                                */
  int blc_size[8][2];           //!< array for different block sizes
  int  infile_header;           //!< If input file has a header set this to the length of the header
  char infile[100];             //!< YUV 4:2:0 input format
  char outfile[100];            //!< AVS compressed output bitstream
  char ReconFile[100];          //!< Reconstructed Pictures
  char TraceFile[100];          //!< Trace Outputs
  int intra_period;             

  // B pictures
  int successive_Bframe;        //!< number of B frames that will be used
  int qpB;                      //!< QP of B frames
  int SequenceHeaderType;

  int InterSearch16x16;
  int InterSearch16x8;
  int InterSearch8x16;
  int InterSearch8x8;

  char PictureTypeSequence[MAXPICTURETYPESEQUENCELEN];

  int rdopt;

  int InterlaceCodingOption;

  //AVS
	int aspect_ratio_information;
	int frame_rate_code;//xfwang  2004.7.28
	//int bit_rate;
	int bit_rate_lower;
	int bit_rate_upper;
	int slice_weighting_flag;
	int mb_weighting_flag;

    int vec_period;
	int seqheader_period;	// Random Access period though sequence header

	int bbv_buffer_size;
	int video_format;
	int color_description;
	int color_primaries;
	int transfer_characteristics;
	int matrix_coefficients;
	int hour;
	int minute;
	int second;
	int frame_offset;
	int profile_id;
	int level_id;
	int progressive_sequence;
	int repeat_first_field;
	int top_field_first;
	int low_delay;
	int chroma_format;
	int sample_precision;
	int video_range;
	int stream_length_flag;
	int picture_decoder_order_flag;
	int frame_pred_frame_dct;
	int progressive_frame;
	int fixed_picture_qp;
	int time_code_flag;
	int display_horizontal_size;
	int display_vertical_size;
	int dct_adaptive_flag;
//  int slice_enable;
  int slice_parameter;
  int slice_row_nr;
	int skip_mode_flag;
	int loop_filter_disable;
	int loop_filter_parameter_flag;
	int alpha_c_offset;
	int beta_offset;
  	//! Rate Control on AVS standard 
	int RCEnable;    
	int bit_rate;
	int SeinitialQP;
	int basicunit;
	int channel_type;
	int frame_rate;
    int stuff_height;
} InputParameters;

//! ImageParameters
typedef struct
{
  int number;                  //!< current image number to be encoded
  int pn;                      //!< picture number
  int lindex;                  //!< next long term index to be used
  int max_lindex;              //!< max long term index 
  int nb_references;
  int current_mb_nr;
  int total_number_mb;
  int current_slice_nr;
  int type;
	int ptype;/*lgp*/
  int types;                   /*!< This is for SP-Pictures, since all the syntax elements for SP-Pictures
                                    are the same as P-pictures, we keep the img->type as P_IMG but indicate
                                    SP-Pictures by img->types */
  int no_multpred;             /*!< 1: prediction from the last frame only.
                                    2: prediction from the last or second last frame etc. */
  int qp;                      //!< quant for the current frame
  int 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 mb_y;                    //!< current MB vertical
  int mb_x;                    //!< current MB horizontal
  int block_y;                 //!< current block vertical
  int block_x;                 //!< current block horizontal
  int pix_y;                   //!< current pixel vertical
  int pix_x;                   //!< current pixel horizontal
  int pix_c_y;                 //!< current pixel chroma vertical
  int block_c_x;               //!< current block chroma vertical
  int pix_c_x;                 //!< current pixel chroma horizontal
  int **ipredmode;             //!< GH ipredmode[90][74];prediction mode for inter frames */ /* fix from ver 4.1
  int cod_counter;             //!< Current count of number of skipped macroblocks in a row
  //int ****nz_coeff;            //!< number of coefficients per block (CAVLC)
  //int ****n_coeff_avs;         //!< number of coefficients per 8x8 block 

  // some temporal buffers
  int mprr[9][16][16];         //!< all 9 prediction modes? // enlarged from 4 to 16 for ABT (is that neccessary?)

  int mprr_2[5][16][16];       //!< all 4 new intra prediction modes
  int mprr_c[2][4][8][8];      //!< new chroma 8x8 intra prediction modes
  int***** mv;                 //!< motion vectors for all block types and all reference frames
  int mpr[16][16];             //!< current best prediction mode
  int m7[16][16];              //!< the diff pixel values between orginal image and prediction

  int ****chromacofAC; /*lgp*/        //!< AC coefficients [uv][4x4block][level/run][scan_pos]
  int ****cofAC;               //!< AC coefficients [8x8block][4x4block][level/run][scan_pos]
  int ***cofDC;                //!< DC coefficients [yuv][level/run][scan_pos]

  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
  SyntaxElement   *MB_SyntaxElements; //!< by oliver 0612
  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;                                
  int direct_intraP_ref[4][4];
  int imgtr_next_P_frm;
  int imgtr_last_P_frm;
  int imgtr_next_P_fld;
  int imgtr_last_P_fld;
	int imgtr_last_prev_P_frm;//Lou 1016
  // B pictures
  int b_interval;
  int p_interval;
  int b_frame_to_code;
  int fw_mb_mode;
  int bw_mb_mode;
  int***** p_fwMV;       //!< for MVDFW
  int***** p_bwMV;       //!< for MVDBW

  int***** all_mv;       //!< replaces local all_mv
  int***** all_bmv;      //!< replaces local all_mv

  int num_ref_pic_active_fwd_minus1;
  int num_ref_pic_active_bwd_minus1;

	/*lgp*/
  int *****mv_fld;     
  int *****p_fwMV_fld; 
  int *****p_bwMV_fld; 
  int *****all_mv_fld; 
  int *****all_bmv_fld;

  int field_mb_y;   // Macroblock number of a field MB
  int field_block_y;  // Vertical block number for the first block of a field MB
  int field_pix_y;    // Co-ordinates of current macroblock in terms of field pixels (luma)
  int field_pix_c_y;  // Co-ordinates of current macroblock in terms of field pixels (chroma)
  int *****mv_top;    //!< For MB level field/frame coding tools
  int *****mv_bot;    //!< For MB level field/frame coding tools
  int *****p_fwMV_top;    //!< For MB level field/frame coding tools
  int *****p_fwMV_bot;    //!< For MB level field/frame coding tools
  int *****p_bwMV_top;    //!< For MB level field/frame coding tools
  int *****p_bwMV_bot;    //!< For MB level field/frame coding tools
  int *****all_mv_top;    //!< For MB level field/frame coding tools
  int *****all_mv_bot;    //!< For MB level field/frame coding tools
  int *****all_bmv_top;   //!< For MB level field/frame coding tools
  int *****all_bmv_bot;   //!< For MB level field/frame coding tools
  int **ipredmode_top;    //!< For MB level field/frame coding tools
  int **ipredmode_bot;    //!< For MB level field/frame coding tools
  int field_mode;     //!< For MB level field/frame -- field mode on flag
  int top_field;      //!< For MB level field/frame -- top field flag
  int auto_crop_right;
  int auto_crop_bottom;
  int buf_cycle;

  unsigned int frame_num;   //frame_num for this frame
  
  //the following are sent in the slice header
	int NoResidueDirect;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -