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

📄 sim.h

📁 H.263的压缩算法
💻 H
📖 第 1 页 / 共 3 页
字号:
int idct(int *coeff,int *block);void FillLumBlock( int x, int y, PictImage *image, MB_Structure *data);void FillChromBlock(int x_curr, int y_curr, PictImage *image,            MB_Structure *data);void FillDiffLumBlock( int x, int y, DiffImage *image, MB_Structure *data);void FillDiffChromBlock(int x_curr, int y_curr, DiffImage *image,            MB_Structure *data);void ReconImage (int i, int j, MB_Structure *data, PictImage *recon);void ReconDiffImage (int i, int j, MB_Structure *data, DiffImage *recon);void CodeOneOrTwo(PictImage *curr, PictImage *B_image, PictImage *prev,           PictImage *prev_recon, int QP, int frameskip, Bits *bits,          Pict *pic, PictImage *B_recon, PictImage *recon);void CodeOneEP(PictImage *curr, PictImage *prev_enhance_image,                    PictImage *prev_enhance_recon, int QP, int frameskip, Bits *bits,                   Pict *pic, PictImage *curr_ref_recon, PictImage *curr_enhance_recon);PictImage *CodeOneIntra(PictImage *curr, int QP, Bits *bits, Pict *pic);void CodeOneEI(PictImage *curr_image, PictImage *pr,                      int QP, Bits *bits, Pict *pic,                     PictImage *recon);void CodeOneTrueB(PictImage *curr, PictImage *B_image, PictImage *prev,           PictImage *pr, int QP, int frameskip, Bits *bits,          Pict *pic, PictImage *B_recon, PictImage *recon);void Dequant(int *qcoeff, int *rcoeff, int QP, int I, int block);void Quant_blk(int *coeff, int *qcoeff, int QP, int Mode, int block);void CountBitsCoeff(int *qcoeff, int I, int CBP, Bits *bits, int ncoeffs);int CodeCoeff(int Mode, int *qcoeff, int block, int ncoeffs);int FindCBP(int *qcoeff, int Mode, int ncoeffs);void CountBitsVectors(MotionVector *MV[7][MBR+1][MBC+2], Bits *bits,               int i, int j, int Mode, int newgob, Pict *pic,               int scalability_prediction_type);void FindPMV(MotionVector *MV[7][MBR+1][MBC+2], int x, int y,              int *p0, int *p1, int block, int newgob, int half_pel);void ZeroBits(Bits *bits);void ZeroRes(Results *res);void ZeroVec(MotionVector *MV);void MarkVec(MotionVector *MV);void CopyVec(MotionVector *MV1, MotionVector *MV2);int EqualVec(MotionVector *MV2, MotionVector *MV1);void AddBits(Bits *total, Bits *bits);void AddRes(Results *total, Results *res, Pict *pic);void AddBitsPicture(Bits *bits);void FindMB(int x, int y, unsigned char *image, int MB[16][16]);MB_Structure *MB_Recon(PictImage *prev_recon, MB_Structure *diff,               int x_curr, int y_curr, MotionVector *MV);MB_Structure *Predict(PictImage *curr, PictImage *prev_recon,              int x_curr, int y_curr, MotionVector *MV);unsigned char *InterpolateImage(unsigned char *image, int w, int h, int RTYPE);void GenerateFrameAndInterpolatedImages(PictImage *in_recon,                                     Pict *pic, unsigned char **out_recon_ipol,                                    PictImage **out_recon,                                   unsigned char **recon_interpolated,                                   PictImage **recon_frame);void MotionEstimatePicture(unsigned char *curr, unsigned char *prev,            unsigned char *next, unsigned char *prev_ipol, unsigned           char *next_ipol, int seek_dist, MotionVector *MV[7][MBR+1][MBC+2],            int gobsync, int estimation_type);void MotionEstimation(unsigned char *curr, unsigned char *prev, int x_curr,              int y_curr, int xoff, int yoff, int seek_dist,               MotionVector *MV[7][MBR+1][MBC+2], int *sad_0,               int estimation_type, int backward_pred, int pmv0, int pmv1);unsigned char *LoadArea(unsigned char *im, int x, int y,         int x_size, int y_size, int lx);int SAD_Macroblock(unsigned char *ii, unsigned char *act_block,           int h_length, int Min_FRAME);int SAD_MB_Bidir(unsigned char *ii, unsigned char *aa, unsigned char *bb,          int width, int min_sofar);int SAD_Block(unsigned char *ii, unsigned char *act_block,              int h_length, int min_sofar);int SAD_MB_integer(int *ii, int *act_block, int h_length, int min_sofar);MB_Structure *Predict_P(PictImage *curr_image, PictImage *prev_image,        unsigned char *prev_ipol,MB_Structure * pred_macroblock,int x_curr, int y_curr,         MotionVector *fr[7][MBR+1][MBC+2], int PB, int RTYPE);MB_Structure *Predict_B(PictImage *curr_image, PictImage *prev_image,        unsigned char *prev_ipol,MB_Structure *pred_macroblock,int x_curr, int y_curr,        MotionVector *MV[7][MBR+1][MBC+2],MotionVector *B_f_MV[7][MBR+1][MBC+2],        MB_Structure *recon_P, int TR,int TRB,int PB, int *im_PB_pred_type);MB_Structure *Predict_True_B(PictImage *curr_image, PictImage *prev_image,        unsigned char *prev_ipol, PictImage *next_image, unsigned char *next_ipol,        MB_Structure *pred_macroblock, int x, int y,        MotionVector *MV[7][MBR+1][MBC+2], MotionVector *Direct_MV[5][MBR][MBC],       	int TRB, int *prediction_type, int *mode, int RTYPE);MB_Structure *Predict_EI( PictImage *curr_image, PictImage *base_recon,                           unsigned char *base_ipol, int x, int y,                          int *prediction_type , int *mode, int RTYPE);MB_Structure *MB_Recon_EI( PictImage *base_recon, unsigned char *base_ipol,                            MB_Structure *diff, int x, int y,                           int prediction_type, int RTYPE);MB_Structure *Predict_EP( PictImage *curr, PictImage *prev_recon, unsigned char *prev_ipol,                          PictImage *next_recon, unsigned char *next_ipol, MB_Structure *pred,                          int x, int y, MotionVector *MV[7][MBR+1][MBC+2],                          int *prediction_type, int *mode, int RTYPE);void Clip(MB_Structure *data);void FindForwLumPredPB(unsigned char *prev_ipol, int x_curr, int y_curr,                MotionVector *fr, int *pred, int TRD, int TRB,                int bdx, int bdy, int bs, int comp);void FindForwLumPredDirectTrueB(unsigned char *prev_ipol, int x_curr, int y_curr,                MotionVector *fr, int *pred, int TRB, int bs, int comp);void FindBackwLumPredDirectTrueB(unsigned char *next_ipol, int x_curr, int y_curr,                MotionVector *fr, int *pred, int TRB, int bs, int comp);void FindBiDirLumPredPB(int *recon_P, MotionVector *fr, int *pred, int TRD,         int TRB, int bdx, int bdy, int nh, int nv);void FindBiDirChrPredPB(MB_Structure *recon_P, int dx, int dy,         MB_Structure *pred);void FindBiDirLimits(int vec, int *start, int *stop, int nhv);void FindBiDirChromaLimits(int vec, int *start, int *stop);void BiDirPredBlock(int xstart, int xstop, int ystart, int ystop,            int xvec, int yvec, int *recon, int *pred, int bl);void DoPredChrom_P(int x_curr, int y_curr, int dx, int dy,           PictImage *curr, PictImage *prev, MB_Structure *prediction,           MB_Structure *pred_error, int rtype);void FindHalfPel(int x, int y, MotionVector *MV, unsigned char *prev,          int *curr, int bs, int comp);void FindPred(int x, int y, MotionVector *fr, unsigned char *prev,               int *pred, int bs, int comp); void FindPredOBMC(int x, int y, MotionVector *MV[5][MBR+1][MBC+2],           unsigned char *prev, int *pred, int comp, int PB);MB_Structure *MB_Recon_P(PictImage *prev_image, unsigned char *prev_ipol,         MB_Structure *diff, int x_curr, int y_curr,          MotionVector *MV[7][MBR+1][MBC+2], int PB, int RTYPE);MB_Structure *MB_Recon_B(PictImage *prev_image, MB_Structure *diff,         unsigned char *prev_ipol,int x_curr, int y_curr,         MotionVector *MV[7][MBR+1][MBC+2],         MB_Structure *recon_P,int TR, int TRB);MB_Structure *MB_Recon_True_B( PictImage *prev_image, unsigned char *prev_ipol,                               MB_Structure *diff, PictImage *next_image,                                unsigned char *next_ipol, int x_curr, int y_curr,                                MotionVector *MV[7][MBR+1][MBC+2],                                MotionVector *Direct_MV[5][MBR][MBC], int TRB,                               int prediction_type, int RTYPE);MB_Structure *MB_Recon_EP( PictImage *prev_recon, unsigned char *prev_ipol,                            MB_Structure *diff, PictImage *next_recon,                            unsigned char *next_ipol, int x_curr, int y_curr,                           MotionVector *MV[7][MBR+1][MBC+2],                           int prediction_type, int RTYPE);MB_Structure *MB_Reconstruct (MB_Structure *diff,MB_Structure *pred);void ReconLumBlock_P(int x, int y, MotionVector *fr,             unsigned char *prev, int *data,int bs,int comp);void ReconChromBlock_P(int x_curr, int y_curr, int dx, int dy,               PictImage *prev, MB_Structure *data, int rtype);void FindChromBlock_P(int x_curr, int y_curr, int dx, int dy,               PictImage *prev, MB_Structure *data, int rtype);void ComputeSNR(PictImage *im1, PictImage *im2, Results *res, int picture_type, int write);     void ZeroMBlock(MB_Structure *data);int CountBitsPicture(Pict *pic);void CountBitsMB( int Mode, int COD, int CBP, int CBPB, Pict *pic,                   Bits *bits, int scalability_prediction_type);void CountBitsScalMB (int Mode, int COD, int CBP, int CBPB, Pict * pic,                      Bits * bits, int scalability_prediction_type,                      int MV_present);int CountBitsSlice(int slice, int quant);int CountBitsGOB(int gob, int quant, Pict *pic);int ChooseMode(unsigned char *curr, int x_pos, int y_pos, int min_SAD);int ModifyMode(int Mode, int dquant, int EPTYPE);int *InterleaveCoeff(int *qp, int *qb, int bs);void MakeEdgeImage(unsigned char *src, unsigned char *dst, int width,           int height, int edge);void UpsampleComponent (unsigned char *base, unsigned char *enhanced,                        int horiz, int vert);PictImage *UpsampleReferenceLayerPicture(PictImage *base_image);void BitPrint(int length, int val, char *bit);/* Rate Control Variables */int FrameUpdateQP( int buf, int bits, int frames_left, int QP, int B,                    float seconds);void InitializeRateControlMB(PictImage *curr, float bit_rate, float target_frame_rate,                             MotionVector * MV[7][MBR + 1][MBC + 2],                             PictImage *prev_image, unsigned char *prev_ipol,                              MB_Structure *pred_macroblock, int PB, int RTYPE);int Compute_QP(int xpos,int ypos);void UpdateRateControlMB(int bitsMB, int bitsCoeff, int xpos, int ypos, int QP);int UpdateQuantizer( int mb, float QP_mean, int pict_type, float bit_rate,                      int mb_width, int mb_height, int bitcount);int InitializeQuantizer( int pict_type, float bit_rate,                          float target_frame_rate, float QP_mean);void InitializeRateControl();void UpdateRateControl(int bits);int FrameLayerRC(Pict *pic);#ifndef FASTIDCT/* global declarations for idctref */void init_idctref (void);void idctref (int *coeff, int *block);#endif/* Syntax based arithmetic coding routines */void Count_sac_BitsCoeff(int *qcoeff, int I, int CBP, Bits *bits, int ncoeffs);int Code_sac_Coeff(int Mode, int *qcoeff, int block, int ncoeffs);int CodeTCoef(int mod_index, int position, int intra);void Count_sac_BitsVectors( MotionVector *MV[7][MBR+1][MBC+2], Bits *bits,                            int i, int j, int Mode, int newgob, Pict *pic);void Count_sac_BitsMB(int Mode,int COD,int CBP,int CBPB,Pict *pic,Bits *bits);int AR_Encode(int index, int cumul_freq[]);int indexfn(int value, int table[], int max);int bit_opp_bits(int);int bit_in_psc_layer(int);int encoder_flush();/* bitstream-functions */void initbits();void putbits (int, int);int alignbits ();int bitcount();void sacPutbits (int n, int val);/* funtions for advanced intra coding mode */int Choose_Intra_Mode(int *pcoeff, int *store_qcoeff, int xpos, int ypos, int newgob);void fill_null(int pred[][6], int i);void fill_A(int pred[][6],int *store_qcoeff, int xpos,int ypos, int block, int i);void fill_B(int  pred[][6],int *store_qcoeff, int xpos,int ypos, int block, int i);void Intra_AC_DC_Encode(int *pcoeff, int *store_rcoeff, int INTRA_AC_DC, int xpos, int ypos, int newgob, int i);void Intra_AC_DC_Decode(int *rcoeff, int *store_qcoeff, int INTRA_AC_DC, int xpos, int ypos, int newgob, int i);int oddifyclipDC(int x);int clipAC(int x);int clipDC(int x);int put_intra_coeff (int run, int level, int last);/* functions for deblocking filter */void VertEdgeFilter(unsigned char *rec, int width, int height, Pict *pic, int chr);void HorizEdgeFilter(unsigned char *rec, int width, int height, Pict *pic, int chr);void EdgeFilter(PictImage *recon, Pict *pic);/* functions for alternative Inter VLC mode */void show_intra_coeff (int run, int level, int last, int *length, int *code);void show_inter_coeff (int run, int level, int last, int *length, int *code);int show_inter_run(int length, int code);/* Reversible VLC coding function */int put_rvlc(int data);/* ring buffer functions for annex N */int  GetReferencePicture(int tr, PictImage*,PictImage*);void StorePicture(int tr, PictImage*,PictImage*);/* Fix broken header-files on suns to avoid compiler warnings *//* #define BROKEN_SUN_HEADERS here or in Makefile */#ifdef BROKEN_SUN_HEADERSextern int printf();extern int fprintf();extern int time();extern int fclose();extern int rewind();extern int fseek();extern int fread();extern int fwrite();extern int fflush();extern int fscanf();extern int _flsbuf();extern int _filbuf();#endif

⌨️ 快捷键说明

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