www.pudn.com > MyPlayerbylqh.rar > DECORE.H


/************************************************************************** 
 *                                                                        * 
 *                                                                        * 
 **************************************************************************/ 
 
// 这个头文件描述了编码器核心的入口函数 
 
#ifdef __cplusplus 
extern "C" { 
#endif  
 
#ifndef _DECORE_H_ 
#define _DECORE_H_ 
 
#ifdef WIN32 
#define STDCALL _stdcall 
#else 
#define STDCALL 
#endif 
 
#if ( (! defined (WIN32)) && (! defined (LINUX)) ) 
#define BIG_ENDIAN 
#endif 
 
 
// 解码器选项 
#define DEC_OPT_MEMORY_REQS	0x00004000 
#define DEC_OPT_INIT				0x00008000 
#define DEC_OPT_RELEASE			0x00010000 
#define DEC_OPT_SETPP				0x00020000 // 设置后处理模式 
#define DEC_OPT_SETOUT			0x00040000 // 设置输出模式 
 
// 解码器返回值 
#define DEC_OK					0 
#define DEC_MEMORY			1 
#define DEC_BAD_FORMAT	2 
#define DEC_EXIT				3 
 
// 解码器的YUV色度格式 
#define DEC_YUV2			1 
#define DEC_UYVY			2 
#define DEC_420				3 
 
// 解码器的RGB颜色格式 
#define DEC_RGB32			4  
#define DEC_RGB24			5  
#define DEC_RGB555		6  
#define DEC_RGB565		7	 
 
#define DEC_RGB32_INV		8 
#define DEC_RGB24_INV		9 
#define DEC_RGB555_INV 10 
#define DEC_RGB565_INV 11 
 
 
#define DEC_MBC         45 
#define DEC_MBR         36 
 
 
typedef struct _DEC_MEM_REQS_ 
{ 
	unsigned long mp4_edged_ref_buffers_size; 
	unsigned long mp4_edged_for_buffers_size; 
	unsigned long mp4_display_buffers_size; 
	unsigned long mp4_state_size; 
	unsigned long mp4_tables_size; 
	unsigned long mp4_stream_size; 
} DEC_MEM_REQS; 
 
typedef struct _DEC_BUFFERS_  
{ 
	void * mp4_edged_ref_buffers;   
	void * mp4_edged_for_buffers;   
	void * mp4_display_buffers; 
	void * mp4_state; 
	void * mp4_tables; 
	void * mp4_stream; 
} DEC_BUFFERS; 
 
typedef struct _DEC_PARAM_  
{ 
	int x_dim; // 被解码的帧的x维 
	int y_dim; // 被解码的帧的y维 
	int output_format;	// 输出颜色格式 
	int time_incr; 
	DEC_BUFFERS buffers; 
} DEC_PARAM; 
 
typedef struct _DEC_FRAME_ 
{ 
	void *bmp; // 被解码的bitmap  
	void *bitstream; // 解码器的缓冲 
	long length; // 解码器流的长度 
	int render_flag;	// 1: 帧正被补偿 
	unsigned int stride; // 解码位图(bitmap)时的步长 
} DEC_FRAME; 
 
typedef struct _DEC_SET_ 
{ 
	int postproc_level; // 有效间隔在[0..100] 
} DEC_SET; 
 
/** 
 * 
**/ 
 
// decore()函数的原型 
//  ——主解码引擎的入口 
// 
 
typedef int (STDCALL *decoreFunc)(unsigned long handle,	// handle	- 用于调用实体(该实体必须是唯一的)的句柄 
						  unsigned long dec_opt,   // dec_opt  - 解码选项,参看以下参数 
						  void *param1,         	// param1	- 参数1(实际意义依赖参数dec_opt) 
						  void *param2);	        // param2	- 参数2(实际意义依赖参数dec_opt) 
 
#endif // _DECORE_H_ 
#ifdef __cplusplus 
} 
#endif