WebRTC源码分析3_jpeg编解码
2012-12-26 11:59
429 查看
所属模块:webrtc_jpeg
1、接口路径:webrtc\trunk\src\common_video\jpeg\main\interface\jpeg.h
2、特点
底层调用三方库:jpeglib
支持的未压缩图像格式:I420
3、使用方法:
将jpeglib封装成 JpegDecoder和JpegEncoder 两个类使用
JpegEncoder目前只支持输出到文件(SetFileName(const WebRtc_Word8* fileName))
4、该模块接口支持的功能有限,可根据需求重新封装jpeglib
[cpp] view
plaincopy
class JpegEncoder
{
public:
JpegEncoder();
~JpegEncoder();
// SetFileName
// Input:
// - fileName - Pointer to input vector (should be less than 256) to which the
// compressed file will be written to
// Output:
// - 0 : OK
// - (-1) : Error
WebRtc_Word32 SetFileName(const WebRtc_Word8* fileName);
// Encode an I420 image. The encoded image is saved to a file
//
// Input:
// - inputImage : Image to be encoded
//
// Output:
// - 0 : OK
// - (-1) : Error
WebRtc_Word32 Encode(const RawImage& inputImage);
private:
jpeg_compress_struct* _cinfo;
WebRtc_Word8 _fileName[256];
};
class JpegDecoder
{
public:
JpegDecoder();
~JpegDecoder();
// Decodes a JPEG-stream
// Supports 1 image component. 3 interleaved image components,
// YCbCr sub-sampling 4:4:4, 4:2:2, 4:2:0.
//
// Input:
// - inputImage : encoded image to be decoded.
// - outputImage : RawImage to store decoded output
//
// Output:
// - 0 : OK
// - (-1) : Error
WebRtc_Word32 Decode(const EncodedImage& inputImage,
RawImage& outputImage);
private:
jpeg_decompress_struct* _cinfo;
};
1、接口路径:webrtc\trunk\src\common_video\jpeg\main\interface\jpeg.h
2、特点
底层调用三方库:jpeglib
支持的未压缩图像格式:I420
3、使用方法:
将jpeglib封装成 JpegDecoder和JpegEncoder 两个类使用
JpegEncoder目前只支持输出到文件(SetFileName(const WebRtc_Word8* fileName))
4、该模块接口支持的功能有限,可根据需求重新封装jpeglib
[cpp] view
plaincopy
class JpegEncoder
{
public:
JpegEncoder();
~JpegEncoder();
// SetFileName
// Input:
// - fileName - Pointer to input vector (should be less than 256) to which the
// compressed file will be written to
// Output:
// - 0 : OK
// - (-1) : Error
WebRtc_Word32 SetFileName(const WebRtc_Word8* fileName);
// Encode an I420 image. The encoded image is saved to a file
//
// Input:
// - inputImage : Image to be encoded
//
// Output:
// - 0 : OK
// - (-1) : Error
WebRtc_Word32 Encode(const RawImage& inputImage);
private:
jpeg_compress_struct* _cinfo;
WebRtc_Word8 _fileName[256];
};
class JpegDecoder
{
public:
JpegDecoder();
~JpegDecoder();
// Decodes a JPEG-stream
// Supports 1 image component. 3 interleaved image components,
// YCbCr sub-sampling 4:4:4, 4:2:2, 4:2:0.
//
// Input:
// - inputImage : encoded image to be decoded.
// - outputImage : RawImage to store decoded output
//
// Output:
// - 0 : OK
// - (-1) : Error
WebRtc_Word32 Decode(const EncodedImage& inputImage,
RawImage& outputImage);
private:
jpeg_decompress_struct* _cinfo;
};
相关文章推荐
- WebRTC源码分析3_jpeg编解码
- WebRTC源码分析:音频模块结构分析
- g723源码详细分析-13-解码
- MINA源码分析---协议解码输出接口ProtocolDecoderOutput及其实现
- WebRTC源码分析一:音频处理流程
- WebRTC源码分析一:音频处理流程
- WebRTC源码分析三:视频处理流程
- webrtc 源码分析
- WebRTC源码分析四:视频模块结构
- WebRTC源码分析一:音频处理流程
- Glide源码分析4 -- 缓存,编解码和网络请求
- WebRTC-Chrome Android平台上的硬件加速编解码分析
- WebRTC源码分析三:视频处理流程
- webrtc 源码目录结构分析及各模块介绍
- WebRTC-Android 源码导读(三):视频硬编码实现分析
- WebRTC源码分析三:视频处理流程
- WebRTC源码分析二:音频模块结构
- WebRTC --- Chrome Android平台上的硬件加速编解码分析
- suricata 3.1 源码分析26 (数据包VLAN解码)
- WebRTC源码分析四:视频模块结构