intel gpu 解码
2017-08-18 17:46
190 查看
背景
在linux上使用intel的gpu加速解码h264,根据以往的经验往往需要将intel gpu的demo集成到我们自己代码当中, 但是这样局限性很大, 每一代的gpu加速的修改, 我们代码都需要调整,得不偿失。封装接口
接口类class SRH264DecInterface { public: virtual int InitDecode() = 0; virtual int Decode(const SRDec_H264Data &/*[in]*/ h264_data, SRDec_YuvData &/*[out]*/ yuv_data) = 0; public: SRH264DecInterface(){}; virtual ~SRH264DecInterface(){}; };
实现类
class H264IntelDecode: public SRH264DecInterface { public: H264IntelDecode(); ~H264IntelDecode(); int InitDecode(); int Decode(const SRDec_H264Data &/*[in]*/ h264_data, SRDec_YuvData &/*[out]*/ yuv_data); private: bool _init_flag; protected: mfxStatus CreateHWDevice(); private: int Release(); mfxStatus InitMfxParams(); mfxStatus AllocFrames(); mfxStatus CreateAllocator(); int DecConvertSurfaceToBistream(mfxFrameSurface1 *surface); int DecExtendBitstream(int new_size, mfxBitstream *pbs); mfxStatus MFXDecodeHeader(); mfxStatus MFXDecodePacket(SRDec_YuvData &/*[out]*/ yuv_data); private: bool m_bExternalAlloc; // use memory allocator as external for Media SDK MFXVideoSession m_mfxSession; mfxIMPL m_impl; MFXVideoDECODE* m_pmfxDEC; mfxVideoParam m_mfxVideoParams; GeneralAllocator* m_pGeneralAllocator; mfxFrameAllocResponse m_mfxResponse; mfxAllocatorParams* m_pmfxAllocatorParams; mfxFrameSurface1* m_pmfxSurfaces; MemType m_memType; mfxBitstream m_mfxBS; CHWDevice *m_hwdev; bool _initParaSucc; int width; int height; mfxI32 m_monitorType; FILE * fp_yuv; mfxBitstream * frame_bs; };
注意
这里结合了sample_decode这个demo, windows版本和Linux版本都调试通了联系
qq群 h264学习过程交流 191884149相关文章推荐
- Intel GPU及NVIDIA GPU对视频编解码支持情况
- OpenCV利用GPU解码高清视频
- stage video 【利用Gpu解码视频】
- GPU编解码 - 硬解码 - CUVID
- 【GPU编解码】GPU硬编码
- iOS 音视频高级编程:AVAssetReaderTrackOutput改变CMFormatDescription导致Video Toolbox解码失败与不解码GPU直接显示H.264帧
- intel GPU加速在linux 上测试, 多路编码
- 视频流GPU解码在ffempg的实现(二)-GPU解码器
- 树莓派x264和ffmpeg编译(用于支持GPU硬件编解码)
- intel GPU tools
- Nvidia搞笑Intel:CPU vs GPU
- 使用GPU进行视频编解码
- GPU视频解码之CUVID
- Intel caffe 安装及用gpu训练即去掉CPU-Only的方法
- intel 在GPU上干什么?
- 硬件编解码(七)Intel提供的QuickSync使用样例(4)视频编码
- Intel开源深度学习库BigDL:Non GPU on Spark
- 在Ubuntu 14.04平台上利用Intel的GPU实现硬件加速--基于VAAPI
- 【GPU编解码】GPU硬解码---DXVA
- centos/linux 查看gpu使用情况的方法 intel显卡