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

📄 decore.h

📁 <VC++视频音频开发>一书的光盘资料。
💻 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; // 被解码的位图 
	void *bitstream; // 解码器的缓冲
	long length; // 解码器流的长度
	int render_flag;	// 1: 帧正在被渲染
	unsigned int stride; // 被解码的位图的跨度
} DEC_FRAME;

// 解码器设置
typedef struct _DEC_SET_
{
	int postproc_level; // 有效间隔在[0..100]内
} DEC_SET;

/**
 *
**/


// decore()函数的原型,是主要的解码器引擎的入口
int STDCALL decore(
			unsigned long handle,	// 调用实体的句柄,必需是唯一的
			unsigned long dec_opt, // 解码器的项,参见下列参数
			void *param1,	// 依赖于dec_opt
			void *param2);	// 依赖于dec_opt

#endif // _DECORE_H_
#ifdef __cplusplus
}
#endif 

⌨️ 快捷键说明

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