H.264——C++实现了图像的解码功能

Home / C++ MrLee 2015-12-30 2954

上篇中是编码,现在是解码。再次介绍下H.264
H.264,同时也是MPEG-4第十部分,是由ITU-T视频编码专家组(VCEG)和ISO/IEC动态图像专家组(MPEG)联合组成的联合视频组(JVT,Joint Video Team)提出的高度压缩数字视频编解码器标准。这个标准通常被称之为H.264/AVC(或者AVC/H.264或者H.264/MPEG-4 AVC或MPEG-4/H.264 AVC)而明确的说明它两方面的开发者。 H264标准各主要部分有Access Unit delimiter(访问单元分割符),SEI(附加增强信息),primary coded picture(基本图像编码),Redundant Coded Picture(冗余图像编码)。还有Instantaneous Decoding Refresh(IDR,即时解码刷新)、Hypothetical Reference Decoder(HRD,假想参考解码)、Hypothetical Stream Scheduler(HSS,假想码流调度器)
// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the DECODER264_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// DECODER264_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#include "stdafx.h"
#ifdef DECODER264_EXPORTS
#define DECODER264_API __declspec(dllexport)
#else
#define DECODER264_API __declspec(dllimport)
#endif

// This class is exported from the Decoder264.dll
class DECODER264_API CDecoder264 {
public:
	CDecoder264(void);
	// TODO: add your methods here.
};
extern DECODER264_API int nDecoder264;
DECODER264_API int fnDecoder264(void);
#ifndef DECODER_H
#define DECODER_H

//错误代号定义
#define ERR_UNDEFINED_ERRFUNC	 -1 //无错误函数定义
#define ERR_UNDEFINED_ENDDECODER -2 //无解压完函数注册
#define ERR_SAVEFILE_ERROR		 -3 //存储文件错误
//#include "framefunc.h"
//解压完成后事件
typedef int (* De_FrameFinish_t)(unsigned char* Y,unsigned char* U,unsigned char* V);
//错误编号
typedef int (* De_ErrHandler_t)(char *errText,int errNo);

 //错误报告
 void ErrHandFunc(char *errText,int errNum);
 void FrameEndFunc(unsigned char* Y,unsigned char* U,unsigned char* V);
extern "C" DECODER264_API  int De_Init();						//解压初始化
extern "C" DECODER264_API  int De_RegErrHandler(De_ErrHandler_t errFunc);//错误处理事件注册
extern "C" DECODER264_API  int De_SetSave(bool bSave);			//true存储,false不存储
extern "C" DECODER264_API  int De_SetQCIF(bool QCif);			//设置图形格式QCIF 176*144,CIF 352*228
extern "C" DECODER264_API  int De_SetDisplay(bool bDisplay);	//true显示,false不显示
extern "C" DECODER264_API  int De_SetSaveFile(char* saveFile);	//设置存储名
extern "C" DECODER264_API  int De_DecoderFrame(char* bstream,int size);//解压 bstream,264数据流,size,数据流大小,pos数据流依稀位置,第一次调用时,设置Pos为0
extern "C" DECODER264_API  int De_RegDecoderEnd(De_FrameFinish_t De_FrameFinishFunc);
extern "C" DECODER264_API  void ConvertYUVtoRGB(unsigned char *src0, unsigned char *src1, unsigned char *src2, unsigned char *dst_ori, int width, int height );
#endif

源码下载:Decoder

本文链接:https://www.it72.com/7422.htm

推荐阅读
最新回复 (0)
返回