WebRTC源码分析3_jpeg编解码
2013-09-06 12:12
344 查看
所属模块: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源码分析二:音频模块结构
- WebRTC --- Chrome Android平台上的硬件加速编解码分析
- g729源码分析-9-g729-解码
- WebRTC源码分析四:视频模块结构
- Wangle源码分析:编解码Handler
- MINA源码分析---协议编码解码过滤器ProtocolCodecFilter
- webrtc-android平台视频编解码分析
- faac源码分析之解码参数配置
- Tiny Jpeg Decoder (JPEG解码程序) 源代码分析 2:解码数据
- MINA源码分析---base64编码和解码
- 通过这次源码分析直播了解到在中国真正关心源码的webrtc开发者只有1%
- suricata 3.1 源码分析25 (数据包以太层解码)
- WebRTC源码分析之Video Capture
- WebRTC源码分析:音频模块结构分析
- Tiny Jpeg Decoder (JPEG解码程序) 源代码分析 2:解码数据
- 数据压缩实验五:JPEG文件解码实验分析
- WebRTC源码分析三:视频处理流程
- jpeg库使用及源码分析 (转载)
- suricata 3.1 源码分析27 (数据包IPv4解码)