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

📄 mavrix_chang_log.txt

📁 优化过的xvid1.1.2源代码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
2007-01-21 本次对xvid的解码器改动比较大,为了较为详细的记录改动的信息,使用中文抒写
  修改作者:武海滨
	
  修改记录:这个修改是从上一次的版本中,提取相关函数和宏结构体变量声明保存到相关的
            .c .h文件中,真正的作到了纯C语言的版本,不依赖与编译平台和编译宏来实现
	    这些文件有(所有文件名和文件都是暂定义):
	     MVStruct.h:定义了解码器所需要的结构体,如DECODER等
	     MVMacro.h:定义了解码器所需要的宏定义
	     MVGlobal.h:定义了一些数据类型
	     MVCommon.h MVCommon.c 实现了宏块反量化函数和反量化矩阵等一般函数的定义和声明
	     MVTablle.c定义了解码器一些 VLC表
	     MVIdct.h MVIdct.c 包含IDCT的函数的声明和使用
	     MVBitstream.h 和MVBitstream.c 文件包括了关于字节流的操作函数
	     MVBlock.h和MVBlock.c 文件包括了对块操作的函数定义和声明
	     MVMb.h MVMb.c 包含了关于宏块操作函数的声明和使用
	     MVVolVop.h MVVolVop.c 包含了读VOL和VOP函数声明和定义
	     MVMv.h MvMv.c 包含了求运动向量的函数的声明和定义
	     MVMc.h MVMc.c 包含了运动补偿的函数声明和定义
	     MVMemoryalloc.h MVMemoryalloc.c包含分配内存给解码器的函数声明和定义
	     MVImage.h MVImage.c包含了图象输出和拷贝交换等操作函数。
	     MVDecodec.h MVDecodec.c包含了解码器的接口函数
             
             
        MVStruct.h:包括的内容有:IMAGE定义  VECTOR定义  WARPPOINTS定义  GMC_DATA定义
                                  NEW_GMC_DATA定义  Bitstream定义 MACROBLOCK定义 VLC定义
                                  EVENT定义 REVERSE_EVENT定义 VLC_TABLE定义 xvid_image_t定义
                                  xvid_gbl_info_t定义 xvid_gbl_convert_t定义 xvid_dec_create_t定义
                                  xvid_dec_frame_t定义 xvid_dec_stats_t定义 DECODER定义
       
       MVMacro.h:包含的宏有:      MBPRED_SIZE  	XVID_GBL_INIT 	 	XVID_GBL_INFO
                                   XVID_GBL_CONVERT     XVID_DEC_CREATE         XVID_DEC_DESTROY 
                                   XVID_DEC_DECODE MODE_INTER                   MODE_INTER_Q	
                                   MODE_INTER4V MODE_INTRA 			MODE_INTRA_Q MODE_NOT_CODED
                                   MODE_NOT_CODED_GMC    MODE_DIRECT		MODE_INTERPOLATE
                                   MODE_BACKWARD         MODE_FORWARD		MODE_DIRECT_NONE_MV
				   MODE_DIRECT_NO4V	 I_VOP			P_VOP
				   B_VOP		 S_VOP			N_VOP
				   XVID_CSP_PLANAR       XVID_CSP_USER	        XVID_CSP_PLANAR
                                   XVID_CSP_I420         XVID_CSP_YV12       	XVID_CSP_YUY2
                                   XVID_CSP_UYVY         XVID_CSP_YVYU          XVID_CSP_BGRA
                                   XVID_CSP_ABGR         XVID_CSP_RGBA          XVID_CSP_ARGB 
                                   XVID_CSP_BGR          XVID_CSP_RGB555    	XVID_CSP_RGB565
                                   XVID_CSP_SLICE        XVID_CSP_INTERNAL  	XVID_CSP_NULL
                                   XVID_CSP_VFLIP        XVID_ERR_FAIL		XVID_ERR_MEMORY
                                   XVID_ERR_FORMAT       XVID_ERR_VERSION       XVID_ERR_END
                                   VIDOBJLAY_START_CODE	 VOP_START_CODE 	VIDOBJLAY_SHAPE_RECTANGULAR
                                   VIDOBJLAY_SHAPE_BINARY	         	VIDOBJLAY_SHAPE_BINARY_ONLY
                                   VIDOBJLAY_SHAPE_GRAYSCALE            	SPRITE_NONE
                                   SPRITE_STATIC	 SPRITE_GMC		NUMBITS_VP_RESYNC_MARKER  
                                   RESYNC_MARKER         VLC_ERROR		ESCAPE  		
                                   ESCAPE1 		 ESCAPE2 		ESCAPE3 	
                                   MIN(X, Y) 		 MAX(X, Y) 		SIGN(X)   		
                                   CLIP(X,AMIN,AMAX)   	 DIV_DIV(a,b)    	SWAP(_T_,A,B)
                                   BSWAP(a)              DIV2ROUND(n)  		DIV2(n)
                                   DIVUVMOV(n) 		 GET_BITS(cache, n)     EDGE_SIZE 
                                   BS_VERSION_BUGGY_DC_CLIPPING                 VM18P 
                                   VM18Q 		SCALEBITS 		FIX(X)
                                   SAFETY		EDGE_SIZE2  		MLT(i)
                                   RSHIFT(a,b)          RDIV(a,b)               DIV2ROUND(n) 
                                   BS_VERSION_BUGGY_CHROMA_ROUNDING             VIDOBJLAY_AR_EXTPAR
                                   LEVELOFFSET	        READ_MARKER()	               
    
         MVGlobal.h 定义有:       int8_t		uint8_t		        int16_t
                                   uint16_t	        int32_t		        uint32_t 
                                   int64_t		uint64_t	        CACHE_LINE
                                   ptr_t 		intptr_t
                                   
         MVCommon.h MVCommon.c :定义的函数有   mavrix_fine_start_code(Bitstream * bs);
                                                log2bin(uint32_t value);
                                                get_intra_matrix(const uint16_t * mpeg_quant_matrices);
						get_inter_matrix(const uint16_t * mpeg_quant_matrices);
						get_default_intra_matrix(void);
						get_default_inter_matrix(void);
						set_intra_matrix(uint16_t * mpeg_quant_matrices, const uint8_t * matrix);
						set_inter_matrix(uint16_t * mpeg_quant_matrices, const uint8_t * matrix);
						bs_get_spritetrajectory(Bitstream * bs);
						check_resync_marker(Bitstream * bs, int addbits);
						get_dc_scaler(uint32_t quant, uint32_t lum);
						quant_h263_intra(int16_t * coeff, const int16_t * data,
								   const uint32_t quant, const uint32_t dcscalar,
								   const uint16_t * mpeg_quant_matrices);
						   
						dequant_h263_intra(int16_t * data, const int16_t * coeff,
								   const uint32_t quant,  const uint32_t dcscalar,
								   const uint16_t * mpeg_quant_matrices);
								
						quant_mpeg_intra(int16_t * coeff, const int16_t * data,
								   const uint32_t quant, const uint32_t dcscalar,
								   const uint16_t * mpeg_quant_matrices);

						quant_mpeg_inter(int16_t * coeff, const int16_t * data,
						   		const uint32_t quant, const uint16_t * mpeg_quant_matrices);

						dequant_mpeg_intra(int16_t * data, const int16_t * coeff,
						                   const uint32_t quant, const uint32_t dcscalar,
							 	   const uint16_t * mpeg_quant_matrices);

                                                dequant_mpeg_inter(int16_t * data, const int16_t * coeff,
							           const uint32_t quant, const uint16_t * mpeg_quant_matrices);
						
						init_mpeg_matrix(uint16_t * mpeg_quant_matrices);
						
		MVTablle.c:定义了:            VLC coeff_VLC[2][2][64][64]           VLC_TABLE const coeff_tab[2][102] 
                                                uint8_t const max_level[2][2][64]     uint8_t const max_run[2][2][64]  
                                                VLC sprite_trajectory_code[32768]     VLC sprite_trajectory_len[15]
						VLC mcbpc_intra_tab[15]               VLC mcbpc_inter_tab[29] 
						const VLC xvid_cbpy_tab[16]           VLC dcy_tab[511] 
						const VLC dcc_tab[511] 		      const VLC mb_motion_table[65] 
						VLC const mcbpc_intra_table[64]       VLC const mcbpc_inter_table[257]
						VLC const cbpy_table[64]              VLC const TMNMVtab0[]
						VLC const TMNMVtab1[] 		      VLC const TMNMVtab2[] 
						short const dc_threshold[] 	      VLC const dc_lum_tab[]
						const uint16_t scan_tables[3][64]     const uint8_t default_intra_matrix[64]
						const uint8_t default_inter_matrix[64] 
						const uint32_t intra_dc_threshold_table[8] 
						const int16_t default_acdc_values[15] 
						REVERSE_EVENT DCT3D[2][4096]          const uint32_t multipliers[32] 
						const uint32_t MTab[16]               const int32_t dquant_table[4]
						const uint32_t roundtab_79[4]         const uint32_t roundtab_76[16]
						const int32_t FIR_Tab_8[9][8] 
						
				    函数:      void init_vlc_tables(void)
	         
	        MVIdct.h MVIdct.c 定义的函数有:
	                                        void idct_int32_init(void);           void idct_int32(short *const block)
	                                        
                MVBitstream.h 和MVBitstream.c定义和实现的函数有:
                                                void BitstreamInit(Bitstream * const bs, void *const bitstream,uint32_t length)
                                                uint32_t BitstreamShowBits(Bitstream * const bs, const uint32_t bits)
                                                void BitstreamSkip(Bitstream * const bs, const uint32_t bits)
                                                uint32_t  BitstreamGetBits(Bitstream * const bs,const uint32_t n)
                                                uint32_t  BitstreamGetBit(Bitstream * const bs)
                                                uint32_t BitstreamNumBitsToByteAlign(Bitstream *bs)
						uint32_t BitstreamShowBitsFromByteAlign(Bitstream *bs, int bits)
                                                void BitstreamByteAlign(Bitstream * const bs)
                                                uint32_t BitstreamPos(const Bitstream * const bs)
                                                void bs_get_matrix(Bitstream * bs, uint8_t * matrix);
                                                int32_t get_dbquant(Bitstream * bs);
                
                MVBlock.h和MVBlock.c定义和实现的函数有:
                                                 void get_intra_block(Bitstream * bs, int16_t * block,int direction, int coeff);
                                                 void  get_inter_block_h263(Bitstream * bs, int16_t * block,
									 int direction, const int quant,
									 const uint16_t *matrix);
				                 void get_inter_block_mpeg(Bitstream * bs,int16_t * block,
		                                                           int direction, const int quant,
		                                                           const uint16_t *matrix);                               
		MVMb.h MVMb.c 定义和实现的函数有:
		                                 int rescale(int predict_quant,	int current_quant, int coeff)
						int get_mcbpc_intra(Bitstream * bs);
						int get_mcbpc_inter(Bitstream * bs);
						int get_cbpy(Bitstream * bs, int intra);
						int32_t get_mbtype(Bitstream * bs);
						int get_dc_size_lum(Bitstream * bs);
						int get_dc_size_chrom(Bitstream * bs);
						int get_dc_dif(Bitstream * bs, uint32_t dc_size);
						void predict_acdc(MACROBLOCK * pMBs, uint32_t x, uint32_t y,uint32_t mb_width,
					 			uint32_t block, int16_t qcoeff[64], uint32_t current_quant,
					 			int32_t iDcScaler, int16_t predictors[8], const int bound);
						void add_acdc(MACROBLOCK * pMB, uint32_t block,	int16_t dct_codes[64], 
							      uint32_t iDcScaler,int16_t predictors[8], const int bsversion);
						void decoder_mbintra(DECODER * dec,MACROBLOCK * pMB, const uint32_t x_pos,
							             const uint32_t y_pos,const uint32_t acpred_flag,
							             const uint32_t cbp,Bitstream * bs,const uint32_t quant,
							             const uint32_t intra_dc_threshold,const unsigned int bound);
                                                 void decoder_mbinter(DECODER * dec,const MACROBLOCK * pMB,const uint32_t x_pos,
							              const uint32_t y_pos,const uint32_t cbp,Bitstream * bs,
							              const uint32_t rounding, const int ref,const int bvop);
																		        
						void  decoder_mb_decode(DECODER * dec, const uint32_t cbp,Bitstream * bs,
								        uint8_t * pY_Cur, uint8_t * pU_Cur,uint8_t * pV_Cur,
								        const MACROBLOCK * pMB);

						void decoder_mbinter_field(DECODER * dec,const MACROBLOCK * pMB,const uint32_t x_pos,
									const uint32_t y_pos, const uint32_t cbp,Bitstream * bs,
									const uint32_t rounding, const int ref,	const int bvop);
																						        
						void decoder_mbgmc(DECODER * dec, MACROBLOCK * const pMB, const uint32_t x_pos,
							        const uint32_t y_pos,  const uint32_t fcode, const uint32_t cbp,
							        Bitstream * bs, const uint32_t rounding);
						
						void decoder_bf_interpolate_mbinter(DECODER * dec,IMAGE forward,IMAGE backward,
										MACROBLOCK * pMB,const uint32_t x_pos, const uint32_t y_pos,
									        Bitstream * bs,	const int direct);                                 
                                                
               MVVolVop.h MVVolVop.c 包含了函数有:
                                                int mavrix_read_vol(Bitstream * bs,DECODER * dec,uint32_t * rounding,
			 						uint32_t * quant,uint32_t * fcode_forward,
			 						uint32_t * fcode_backward, uint32_t * intra_dc_threshold,
			 						WARPPOINTS *gmc_warp);
					 
						int mavtrix_read_vop(Bitstream * bs,DECODER * dec,uint32_t * rounding,
									 uint32_t * quant,uint32_t * fcode_forward,
									 uint32_t * fcode_backward,uint32_t * intra_dc_threshold,
									 WARPPOINTS *gmc_warp);
			 
						int read_video_packet_header(Bitstream *bs,DECODER * dec, const int addbits,
							                     int * quant,int * fcode_forward,int  * fcode_backward,
									     int * intra_dc_threshold);
														
						void decoder_iframe(DECODER * dec, Bitstream * bs, int quant,
								    int intra_dc_threshold);
							
					        void  decoder_pframe(DECODER * dec, Bitstream * bs,int rounding,
								int quant, int fcode, int intra_dc_threshold,
								const WARPPOINTS *const gmc_warp);
							        						       
						void decoder_bframe(DECODER * dec,Bitstream * bs,int quant,
								    int fcode_forward, int fcode_backward);
                                               
			MVMv.h MvMv.c 包含函数有:
			                        void __inline validate_vector(VECTOR * mv, unsigned int x_pos, unsigned int y_pos, const DECODER * dec)
                              VECTOR get_pmv2_interlaced(const MACROBLOCK * const mbs, const int mb_width,
									   																			const int bound, const int x, const int y,const int block);
												   
															int get_mv(Bitstream * bs, int fcode);
													
															VECTOR get_pmv2(const MACROBLOCK * const mbs,const int mb_width,
																	const int bound,const int x,const int y,const int block);

⌨️ 快捷键说明

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