2011-10-10 0:22:22
来源:互联网 发布:中信建投mac版下载 编辑:程序博客网 时间:2024/06/05 20:12
2011-10-10 0:22:22
4. 上面调用了avcodec_init函数:
void avcodec_init(void)
{
static int initialized = 0;
if (initialized != 0)
return;
initialized = 1;
dsputil_static_init ();
}
av_cold void dsputil_static_init(void)
{
int i;
for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i;
for(i=0;i<MAX_NEG_CROP;i++) {
ff_cropTbl[i] = 0;
ff_cropTbl[i + MAX_NEG_CROP + 256] = 255;
}
for(i=0;i<512;i++) {
ff_squareTbl[i] = (i - 256) * (i - 256);
}
for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
}
REGISTER_MUXDEMUX (H264, h264);
// 注册文件协议
REGISTER_PROTOCOL (FILE, file);
注册mux和demux
#define REGISTER_MUXER(X,x) { \
extern AVOutputFormat x##_muxer; \
if(CONFIG_##X##_MUXER) av_register_output_format(&x##_muxer); }
#define REGISTER_DEMUXER(X,x) { \
extern AVInputFormat x##_demuxer; \
if(CONFIG_##X##_DEMUXER) av_register_input_format(&x##_demuxer); }
#define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
#define REGISTER_PROTOCOL(X,x) { \
extern URLProtocol x##_protocol; \
if(CONFIG_##X##_PROTOCOL) av_register_protocol(&x##_protocol); }
URL协议结构:
typedef struct URLProtocol {
const char *name;
int (*url_open)(URLContext *h, const char *url, int flags);
int (*url_read)(URLContext *h, unsigned char *buf, int size);
int (*url_write)(URLContext *h, unsigned char *buf, int size);
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
int (*url_close)(URLContext *h);
struct URLProtocol *next;
int (*url_read_pause)(URLContext *h, int pause);
int64_t (*url_read_seek)(URLContext *h, int stream_index,
int64_t timestamp, int flags);
int (*url_get_file_handle)(URLContext *h);
} URLProtocol;
4. 上面调用了avcodec_init函数:
void avcodec_init(void)
{
static int initialized = 0;
if (initialized != 0)
return;
initialized = 1;
dsputil_static_init ();
}
av_cold void dsputil_static_init(void)
{
int i;
for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i;
for(i=0;i<MAX_NEG_CROP;i++) {
ff_cropTbl[i] = 0;
ff_cropTbl[i + MAX_NEG_CROP + 256] = 255;
}
for(i=0;i<512;i++) {
ff_squareTbl[i] = (i - 256) * (i - 256);
}
for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
}
REGISTER_MUXDEMUX (H264, h264);
// 注册文件协议
REGISTER_PROTOCOL (FILE, file);
注册mux和demux
#define REGISTER_MUXER(X,x) { \
extern AVOutputFormat x##_muxer; \
if(CONFIG_##X##_MUXER) av_register_output_format(&x##_muxer); }
#define REGISTER_DEMUXER(X,x) { \
extern AVInputFormat x##_demuxer; \
if(CONFIG_##X##_DEMUXER) av_register_input_format(&x##_demuxer); }
#define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
#define REGISTER_PROTOCOL(X,x) { \
extern URLProtocol x##_protocol; \
if(CONFIG_##X##_PROTOCOL) av_register_protocol(&x##_protocol); }
URL协议结构:
typedef struct URLProtocol {
const char *name;
int (*url_open)(URLContext *h, const char *url, int flags);
int (*url_read)(URLContext *h, unsigned char *buf, int size);
int (*url_write)(URLContext *h, unsigned char *buf, int size);
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
int (*url_close)(URLContext *h);
struct URLProtocol *next;
int (*url_read_pause)(URLContext *h, int pause);
int64_t (*url_read_seek)(URLContext *h, int stream_index,
int64_t timestamp, int flags);
int (*url_get_file_handle)(URLContext *h);
} URLProtocol;
- 2011-10-10 0:22:22
- 2011-10-22日记
- 读书时间 2011/10/22
- 10-22
- 10-22
- 2011-05-10 11:56:22
- 2011-8-10 22:04:09
- 2011年10月22日
- 2008-10-23 22:10
- 05/10/22(夜)
- 2005-10-22 风波
- 06/10/22 阴天
- 昨天 10-22
- 10/22的记录
- 2009-10-22
- 10-22-09
- 10-3-22
- 10 04 22 困
- 什么是抽象
- 11g Release 2 Rolling Upgrade using Transient Logical Standby database
- 大学随想1
- 2011-10-10 0:07:18
- C# 中,ListView的自定义显示,可用于显示不同的颜色和字体等
- 2011-10-10 0:22:22
- 2011-10-10 0:24:49
- [来自vckbase]Win32串口编程
- 安装sql2008时出现JIT错误
- js try、catch、finally语句还有with语句
- 2011-10-10 0:27:53
- Java【多线程知识总结(8)】线程通信,wait()与notify()的运用
- Oracle 通过存储过程删除两个表中符合条件的记录
- 黑马程序员 交通灯管理系统