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

📄 global.h

📁 H.264编码解码器源码(c语言).zip
💻 H
📖 第 1 页 / 共 3 页
字号:
  float distortion_u;  float distortion_v;} Picture;Picture *top_pic;Picture *bottom_pic;Picture *frame_pic;unsigned int toprefpoc[MAX_NO_POC_FRAMES];unsigned int bottomrefpoc[MAX_NO_POC_FRAMES];typedef struct{  // Size info  int x_size, y_framesize, y_fieldsize;    char *yf, *uf, *vf;                    //!< frame representation  char *yt, *ut, *vt;                    //!< top field  char *yb, *ub, *vb;                    //!< bottom field} Sourceframe;// global picture format dependend buffers, mem allocation in image.cbyte   **imgY_org_frm;           //!< Reference luma imagebyte  ***imgUV_org_frm;          //!< Reference croma imageint   ***tmp_mv_frm;             //!< motion vector bufferint    **refFrArr_frm;           //!< Array for reference frames of each blockbyte   **imgY_org;           //!< Reference luma imagebyte  ***imgUV_org;          //!< Reference croma image//int    **refFrArr;           //!< Array for reference frames of each blockbyte  ***mref;               //!< 1/4 pix lumabyte  ***mref_w;               //!< 1/4 pix luma for weighted prediction MEbyte ****mcef;               //!< pix chromaint    **img4Y_tmp;          //!< for quarter pel interpolationint   ***tmp_mv;             //!< motion vector bufferint   **moving_block;           //!< stationary block bufferint   **moving_block_frm;       //!< stationary block buffer - frameint   **moving_block_top;       //!< stationary block buffer - fieldint   **moving_block_bot;       //!< stationary block buffer - fieldint    **refFrArr;           //!< Array for reference frames of each block
pic_parameter_set_rbsp_t *active_pps;
seq_parameter_set_rbsp_t *active_sps;
// B pictures// motion vector : forward, backward, directint  ***tmp_fwMV;int  ***tmp_bwMV;int  ***tmp_fwMV_top;   //!< For MB level field/frame coding toolsint  ***tmp_fwMV_bot;   //!< For MB level field/frame coding toolsint  ***tmp_bwMV_top;   //!< For MB level field/frame coding toolsint  ***tmp_bwMV_bot;   //!< For MB level field/frame coding toolsint  **field_mb;      //!< For MB level field/frame coding toolsint  mb_adaptive;     //!< For MB level field/frame coding toolsint  MBPairIsField;     //!< For MB level field/frame coding toolsint  WriteFrameFieldMBInHeader; //! For MB level field/frame coding toolsint  ***dfMV;int  ***dbMV;int   **fw_refFrArr;int   **bw_refFrArr;pel_t **Refbuf11_w;           // for weighted reference frame buffer//Weighted predictionint ***wp_weight;  // weight in [list][index][component] orderint ***wp_offset;  // offset in [list][index][component] orderint ****wbp_weight;  // weight in [list][fwd_index][bwd_idx][component] orderint **weight;      // weight in [refbuf][component] order, because JM currently uses one list for fwd and bwd ref picsint **offset;      // offset in [refbuf][component] order, because JM currently uses one list for fwd and bwd ref picsint luma_log_weight_denom;int chroma_log_weight_denom;int wp_luma_round;int wp_chroma_round;// 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_com;               //!< Encoded luma imagesbyte  ***imgUV_com;              //!< Encoded croma imagespel_t **Refbuf11_fld_w;            //!< 1/1th pel (full pel) reference frame bufferint    **refFrArr_top;           //!< Array for reference frames of each blockint    **refFrArr_bot;           //!< Array for reference frames of each block// global picture format dependend buffers, mem allocation in image.c (field picture)byte  ***mref_fld_w;               //!< 1/4 pix luma for wpbyte ***mref_mbfld_w;        //!< For MB level field/frame coding tools for wp// global picture format dependend buffers, mem allocation in image.c (frame buffer)byte  ***mref_frm_w;               //!< 1/4 pix luma// B pictures// motion vector : forward, backward, directint   **fw_refFrArr_top;int   **bw_refFrArr_top;int   **fw_refFrArr_bot;int   **bw_refFrArr_bot;int   ***tmp_mv_top;             //!< motion vector bufferint   ***tmp_mv_bot;             //!< motion vector buffer// int   ***tmp_mv_top_save;    //!< motion vector buffer for MB level field/frame coding tools// int   ***tmp_mv_bot_save;    //!< motion vector buffer for MB level field/frame coding toolsint   **fwdir_refFrArr;         //!< direct mode forward reference bufferint   **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;pel_t **Refbuf11_frm_w;            //!< 1/1th pel (full pel) reference frame bufferint    **refFrArr_frm;           //!< Array for reference frames of each blockint   direct_mode;int   TopFieldIsSkipped, TopFrameIsSkipped; //!< Flag to prevent bottom MB in a field MB pair to be skipped                 //!< if the top MB is skipped// B pictures// motion vector : forward, backward, directint   **fw_refFrArr_frm;int   **bw_refFrArr_frm;// Buffers for rd optimization with packet losses, Dim. Kontopodisbyte **pixel_map;   //!< Shows the latest reference frame that is reliable for each pixelbyte **refresh_map; //!< Stores the new values for pixel_map  int intras;         //!< Counts the intra updates in each frame.int  Bframe_ctr, frame_no, nextP_tr_fld, nextP_tr_frm;int  tot_time;#define ET_SIZE 300      //!< size of error text bufferchar errortext[ET_SIZE]; //!< buffer for error message for exit with error()int    **abp_type_FrArr;      //!< Array for abp_type of each blockint    **abp_type_FrArr_top;int    **abp_type_FrArr_bot;//! Info for the "decoders-in-the-encoder" used for rdoptimization with packet lossestypedef struct{  int  **resY;             //!< Residue of Luminance  byte ***decY;            //!< Decoded values at the simulated decoders  byte ****decref;         //!< Reference frames of the simulated decoders  byte ***decY_best;       //!< Decoded frames for the best mode for all decoders  byte **RefBlock;  byte **status_map;  byte **dec_mb_mode;} Decoders;extern Decoders *decs;//! SNRParameterstypedef 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 parameterstypedef struct{  int no_frames;                //!< number of frames to be encoded  int no_fields;                //!< number of fields 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 num_reference_frames;     /*!< number of reference frames to be used*/  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 slice_mode;               //!< Indicate what algorithm to use for setting slices  int slice_argument;           //!< Argument to the specified slice algorithm  int UseConstrainedIntraPred;  //!< 0: Inter MB pixels are allowed for intra prediction 1: Not allowed  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];            //!< H.26L compressed output bitstream  char ReconFile[100];          //!< Reconstructed Pictures  char TraceFile[100];          //!< Trace Outputs  int intra_period;             //!< Random Access period though intra  // B pictures  int successive_Bframe;        //!< number of B frames that will be used  int qpB;                      //!< QP of B frames  int direct_type;              //!< Direct Mode type to be used (1: Temporal, 0: Spatial)  // SP Pictures  int sp_periodicity;           //!< The periodicity of SP-pictures  int qpsp;                     //!< SP Picture QP for prediction error  int qpsp_pred;                //!< SP Picture QP for predicted block  int WeightedPrediction;        //!< Weighted prediciton for P frames (0: not used, 1: explicit)  int WeightedBiprediction;      //!< Weighted prediciton for B frames (0: not used, 1: explicit, 2: implicit)  int StoredBPictures;           //!< Stored (Reference) B pictures replace P pictures (0: not used, 1: used)  int explicit_B_prediction;     //!< explicite B prediction  // Jill get rid of eventually  // Introduced by TOM  int symbol_mode;              //!< Specifies the mode the symbols are mapped on bits  int of_mode;                  //!< Specifies the mode of the output file  int partition_mode;           //!< Specifies the mode of data partitioning  int SequenceHeaderType;  int TRModulus;  int PicIdModulus;  int InterSearch16x16;  int InterSearch16x8;  int InterSearch8x16;  int InterSearch8x8;  int InterSearch8x4;  int InterSearch4x8;  int InterSearch4x4;  char PictureTypeSequence[MAXPICTURETYPESEQUENCELEN];#ifdef _FULL_SEARCH_RANGE_  int full_search;#endif#ifdef _ADAPT_LAST_GROUP_  int last_frame;#endif#ifdef _CHANGE_QP_  int qpN2, qpB2, qp2start;#endif  int rdopt;#ifdef _ADDITIONAL_REFERENCE_FRAME_  int add_ref_frame;#endif#ifdef _LEAKYBUCKET_  int NumberLeakyBuckets;  char LeakyBucketRateFile[100];  char LeakyBucketParamFile[100];#endif  int InterlaceCodingOption;  int LossRateA;              //! assumed loss probablility of partition A (or full slice), in per cent, used for loss-aware R/D optimization  int LossRateB;              //! assumed loss probablility of partition B, in per cent, used for loss-aware R/D   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 FmoType;                  //! Type pf FMO MBAmap description, see CD doc  char FmoConfigFileName[100];  //! Filename for config info fot type 0, 2  int LFSendParameters;  int LFDisableIdc;  int LFAlphaC0Offset;  int LFBetaOffset;  int SparePictureOption;  int SPDetectionThreshold;  int SPPercentageThreshold;  // JVT-D095, JVT-D097  int num_slice_groups_minus1; //! "FmoNumSliceGroups" in encoder.cfg, same as FmoNumSliceGroups, which should be erased later  int mb_allocation_map_type; //! "FmoType" in encoder.cfg, same as FmoType, FmoType should be erased latter  int top_left_mb; //! "FmoTopLeftMB"  in encoder.cfg  int bottom_right_mb; //! "FmoBottomRightMB" in encoder.cfg  int slice_group_change_direction; //! "FmoChangeDirection" in encoder.cfg  int slice_group_change_rate_minus1; //! "FmoChangeRate" in encoder.cfg  // End JVT-D095, JVT-D097  int redundant_slice_flag; //! whether redundant slices exist,  JVT-D101  int pic_order_cnt_type;   // POC200301  int context_init_method;  int model_number;} InputParameters;//! ImageParameterstypedef 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 structure;               //!< picture structure  int num_reference_frames;    //!< number of reference frames to be used  int qp;                      //!< quant for the current frame  int qpsp;                    //!< quant for the prediction frame of SP-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_x;                    //!< current MB horizontal  int mb_y;                    //!< current MB vertical  int mb_x_save;               //!< horizontal position of the last written MB  int mb_y_save;               //!< vertical position of the last written MB  int block_x;                 //!< current block horizontal  int block_y;                 //!< current block vertical  int subblock_x;              //!< current subblock horizontal  int subblock_y;              //!< current subblock vertical  int is_intra_block;  int is_v_block;  int pix_x;                   //!< current pixel horizontal  int pix_y;                   //!< current pixel vertical  int mb_y_upd;  int mb_y_intra;              //!< which GOB to intra code  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)  // 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 ****cofAC;               //!< AC coefficients [8x8block][4x4block][level/run][scan_pos]  int ***cofDC;                //!< DC coefficients [yuv][level/run][scan_pos]  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;                                  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  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***** abp_all_dmv;        //!< replaces local all_dmv for forward interpolative prediction  int***** abp_all_dmv_top;  int***** abp_all_dmv_bot;  int num_ref_idx_l0_active;  int num_ref_idx_l1_active;  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 update_stats;     //!< For MB level field/frame -- update stats flag  int field_mode;     //!< For MB level field/frame -- field mode on flag  int top_field;      //!< For MB level field/frame -- top field flag  int buf_cycle;  int i16offset;

⌨️ 快捷键说明

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