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

📄 global.h

📁 JM 11.0 KTA 2.1 Source Code
💻 H
📖 第 1 页 / 共 3 页
字号:
  unsigned int dc_pred_value_luma;            //!< luma value for DC prediction (depends on luma pel bit depth)
  unsigned int dc_pred_value_chroma;          //!< chroma value for DC prediction (depends on chroma pel bit depth)
  int max_imgpel_value;                       //!< max value that one luma picture element (pixel) can take (depends on pic_unit_bitdepth)
  int max_imgpel_value_uv;                    //!< max value that one chroma picture element (pixel) can take (depends on pic_unit_bitdepth)
  int Transform8x8Mode;        
  int profile_idc;              
  int yuv_format;
  int lossless_qpprime_flag;
  int num_blk8x8_uv;
  int num_cdc_coeff;
  int mb_cr_size_x;
  int mb_cr_size_y;
  
  int idr_psnr_number;
  int psnr_number;
  
  time_t ltime_start;               // for time measurement
  time_t ltime_end;                 // for time measurement
  
  // Residue Color Transform
  int residue_transform_flag;
#ifdef ADAPTIVE_QUANTIZATION
  int slice_fractional_quant_flag;
  int slice_mqm_signaling_flag;
  int slice_modeling_qm_param0;
  int slice_modeling_qm_param1;
#endif
#ifdef WIN32
  struct _timeb tstruct_start;
  struct _timeb tstruct_end;
#else
  struct timeb tstruct_start;
  struct timeb tstruct_end;
#endif
  
  // picture error concealment
#ifdef ADAPTIVE_FILTER
  int UseAdaptiveFilter;
  int AdaptiveFilterFlag;
#endif
#ifdef DIRECTIONAL_FILTER
  int ImpType;
#endif
#ifdef USE_INTRA_MDDT
  int UseIntraMDDT; 
#endif
#ifdef USE_HP_FILTER    
  int use_high_precision_flag;
#endif
  int last_ref_pic_poc;
  int ref_poc_gap;
  int poc_gap;
  int conceal_mode;
  int earlier_missing_poc;
  unsigned int frame_to_conceal;
  int IDR_concealment_flag;
  int conceal_slice_type;
  
  // random access point decoding
  int recovery_point;           
  int recovery_point_found;
  int recovery_frame_cnt;
  int recovery_frame_num;
  int recovery_poc;
  
#ifdef  INTERNAL_BIT_DEPTH_INCREASE
  int BitDepthIncrease;
  int BitDepthIncreaseChroma;
#endif
  
#ifdef SWITCHED_FILTERS
  int filterFrame[16];                          // Filter selection computed on the sequence
  int filterSequence[16];                       // Filter selection computed on current frame
  int subpelOffset_list0[16];                   // Sub-pel offsets for Frame0 in List0
  int subpelOffset_list1[16];                   // Sub-pel offsets for Frame0 in List1
  int imgOffset_list0[16];                      // Image offset for frames in List0
  int imgOffset_list1[16];                      // Image offset for frames in List1
  int filterParam;
#endif

#ifdef USE_INTRA_MDDT
  byte scanOrder4x4[9][16][2];
  byte scanOrder8x8[9][64][2];
  int  scanStats4x4[9][16];
  int  scanStats8x8[9][64];
  int  update4x4[9];
  int  update8x8[9];
  int  update4x4Count[9];
  int  update8x8Count[9];
  int  update4x4Thres[9];
  int  update8x8Thres[9];
  
  int  cof16x16[16][16];
  byte scanOrder16x16[4][256][2];
#endif 

#ifdef USE_POST_FILTER
  Bitstream *filterbitstream;
#endif

} ImageParameters;

extern ImageParameters *img;
extern struct snr_par  *snr;

// signal to noise ratio parameters
struct snr_par
{
  int   frame_ctr;
  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
  float sse_y;                                 //!< SSE Y
  float sse_u;                                 //!< SSE U
  float sse_v;                                 //!< SSE V
  float msse_y;                                //!< Average SSE Y
  float msse_u;                                //!< Average SSE U
  float msse_v;                                //!< Average SSE V
};

int tot_time;

// input parameters from configuration file
struct inp_par
{
  char infile[100];                       //!< H.264 inputfile
  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 ref_offset;
  int poc_scale;
  int write_uv;
  
#ifdef _LEAKYBUCKET_
  unsigned long R_decoder;                //!< Decoder Rate in HRD Model
  unsigned long B_decoder;                //!< Decoder Buffer size in HRD model
  unsigned long F_decoder;                //!< Decoder Initial buffer fullness in HRD model
  char LeakyBucketParamFile[100];         //!< LeakyBucketParamFile
#endif
  
  // picture error concealment
  int conceal_mode;
  int ref_poc_gap;
  int poc_gap;
  
#ifdef  INTERNAL_BIT_DEPTH_INCREASE
  int output_bitdepth;
#endif
};

extern struct inp_par *input;

typedef struct pix_pos
{
  int available;
  int mb_addr;
  int x;
  int y;
  int pos_x;
  int pos_y;
} PixelPos;

typedef struct old_slice_par
{
  unsigned field_pic_flag;
  unsigned bottom_field_flag;
  unsigned frame_num;
  int nal_ref_idc;
  unsigned pic_oder_cnt_lsb;
  int delta_pic_oder_cnt_bottom;
  int delta_pic_order_cnt[2];
  int idr_flag;
  int idr_pic_id;
  int pps_id;
} OldSliceParams;

extern OldSliceParams old_slice;

// files
int p_out;                    //!< file descriptor to output YUV file
//FILE *p_out2;                    //!< pointer to debug output YUV file
int p_ref;                    //!< pointer to input original reference YUV file file

FILE *p_log;                    //!< SNR file

#if TRACE
FILE *p_trace;
#endif

// Residue Color Transform
int mprRGB[3][16][16];
int rec_res[3][16][16];

// Redundant slices
int previous_frame_num;          //!< frame number of previous slice
int ref_flag[17];                //!< 0: i-th previous frame is incorrect 
//!< non-zero: i-th previous frame is correct
int Is_primary_correct;          //!< if primary frame is correct, 0: incorrect
int Is_redundant_correct;        //!< if redundant frame is correct, 0:incorrect
int redundant_slice_ref_idx;     //!< reference index of redundant slice
void Error_tracking(void);       

// 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 init(struct img_par *img);

void malloc_slice(struct inp_par *inp, struct img_par *img);
void free_slice(struct inp_par *inp, struct img_par *img);

int  decode_one_frame(struct img_par *img,struct inp_par *inp, struct snr_par *snr);
void init_picture(struct img_par *img, struct inp_par *inp);
void exit_picture();

int  read_new_slice();
void decode_one_slice(struct img_par *img,struct inp_par *inp);

void start_macroblock(struct img_par *img,struct inp_par *inp, int CurrentMBInScanOrder);
int  read_one_macroblock(struct img_par *img,struct inp_par *inp);
void read_ipred_modes(struct img_par *img,struct inp_par *inp);
int  decode_one_macroblock(struct img_par *img,struct inp_par *inp);
#ifdef ADAPTIVE_FILTER
int  decode_one_macroblock_sepAIF(struct img_par *img,struct inp_par *inp); 
#endif
int  exit_macroblock(struct img_par *img,struct inp_par *inp, int eos_bit);
void decode_ipcm_mb(struct img_par *img);


void readMotionInfoFromNAL (struct img_par *img,struct inp_par *inp);
void readCBPandCoeffsFromNAL(struct img_par *img,struct inp_par *inp);
void readIPCMcoeffsFromNAL(struct img_par *img, struct inp_par *inp, struct datapartition *dP);

void readLumaCoeff8x8_CABAC (struct img_par *img,struct inp_par *inp, int b8);
void itrans8x8(struct img_par *img, int ioff, int joff);

void copyblock_sp(struct img_par *img,int block_x,int block_y);
void itrans_sp_chroma(struct img_par *img,int ll);
void itrans(struct img_par *img,int ioff,int joff,int i0,int j0, int chroma);
void itrans_sp(struct img_par *img,int ioff,int joff,int i0,int j0);
int  intrapred(struct img_par *img,int ioff,int joff,int i4,int j4);
void itrans_2(struct img_par *img);
int  intrapred_luma_16x16(struct img_par *img,int predmode);
void intrapred_chroma(struct img_par *img, int uv);
int  sign(int a , int b);

// SLICE function pointers
int  (*nal_startcode_follows) ();

// NAL functions TML/CABAC bitstream
int  uvlc_startcode_follows();
int  cabac_startcode_follows();
void free_Partition(Bitstream *currStream);

// ErrorConcealment
void reset_ec_flags();

void error(char *text, int code);
int  is_new_picture();
void init_old_slice();

// dynamic mem allocation
int  init_global_buffers();
void free_global_buffers();

void frame_postprocessing(struct img_par *img, struct inp_par *inp);
void field_postprocessing(struct img_par *img, struct inp_par *inp);
int  bottom_field_picture(struct img_par *img,struct inp_par *inp);
void decode_slice(struct img_par *img,struct inp_par *inp, int current_header);

int RBSPtoSODB(byte *streamBuffer, int last_byte_pos);
int EBSPtoRBSP(byte *streamBuffer, int end_bytepos, int begin_bytepos);

// For MB level frame/field coding
void init_super_macroblock(struct img_par *img,struct inp_par *inp);
void exit_super_macroblock(struct img_par *img,struct inp_par *inp);
int  decode_super_macroblock(struct img_par *img,struct inp_par *inp);
void decode_one_Copy_topMB(struct img_par *img,struct inp_par *inp);

void SetOneRefMV(struct img_par* img);
int peekSyntaxElement_UVLC(SyntaxElement *sym, struct img_par *img, struct inp_par *inp, struct datapartition *dP);

void fill_wp_params(struct img_par *img);

void reset_wp_params(struct img_par *img);

void FreePartition (DataPartition *dp, int n);
DataPartition *AllocPartition();

void tracebits2(const char *trace_str, int len, int info);

void init_decoding_engine_IPCM(struct img_par *img);
void readIPCMBytes_CABAC(SyntaxElement *sym, Bitstream *currStream);

unsigned CeilLog2( unsigned uiVal);

// For Q-matrix
void AssignQuantParam(pic_parameter_set_rbsp_t* pps, seq_parameter_set_rbsp_t* sps);
void CalculateQuantParam(void);
void CalculateQuant8Param(void);

void SetMotionVectorPredictor (struct img_par  *img,
                               short           *pmv_x,
                               short           *pmv_y,
                               char            ref_frame,
                               byte            list,
                               char            ***refPic,
                               short           ****tmp_mv,
                               int             block_x,
                               int             block_y,
                               int             blockshape_x,
                               int             blockshape_y);

#ifdef DIRECTIONAL_FILTER
int FILTCOEF_BITS;
#endif

#ifdef USE_INTRA_MDDT
void precompute_all_inner_product16x16();
void precompute_all_inner_product8x8();
void itransklt16x16_sep_fast(struct img_par *img,int ipredmode);
void itrans8x8klt_sep_fast(struct img_par *img, int ioff, int joff, int ipmode);
void itransklt_sep(struct img_par *img,int ioff,int joff,int i0,int j0, int ipredmode);

void updateScanOrder(int first);
void normalizeScanStats();
#endif 
#endif


⌨️ 快捷键说明

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