资源简介
x264-snapshot-20091006-2245版本h264编码,针对vs2010的修改。
修改了在vs工程下定义变量的错误,初始化内存的错误问题。
编译通过。
对http://trace.eas.asu.edu/yuv/网站上的176x144(qcif)和352x288(cif)yuv测试正常运行。
代码片段和文件信息
/*****************************************************************************
* matroska.c:
*****************************************************************************
* Copyright (C) 2005 Mike Matsnev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 51 Franklin Street Fifth Floor Boston MA 02111 USA.
*****************************************************************************/
#include
#include
#include “common/osdep.h“
#include “matroska.h“
#define CLSIZE 1048576
#define CHECK(x)\
do\
{\
if( (x) < 0 ) return -1;\
}\
while( 0 )
struct mk_context
{
struct mk_context *next **prev *parent;
struct mk_writer *owner;
unsigned id;
void *data;
unsigned d_cur d_max;
};
typedef struct mk_context mk_context;
struct mk_writer
{
FILE *fp;
unsigned duration_ptr;
mk_context *root *cluster *frame;
mk_context *freelist;
mk_context *actlist;
int64_t def_duration;
int64_t timescale;
int64_t cluster_tc_scaled;
int64_t frame_tc prev_frame_tc_scaled max_frame_tc;
char wrote_header in_frame keyframe;
};
static mk_context *mk_create_context( mk_writer *w mk_context *parent unsigned id )
{
mk_context *c;
if( w->freelist )
{
c = w->freelist;
w->freelist = w->freelist->next;
}
else
{
c = malloc( sizeof(*c) );
if( !c )
return NULL;
memset( c 0 sizeof(*c) );
}
c->parent = parent;
c->owner = w;
c->id = id;
if( c->owner->actlist )
c->owner->actlist->prev = &c->next;
c->next = c->owner->actlist;
c->prev = &c->owner->actlist;
c->owner->actlist = c;
return c;
}
static int mk_append_context_data( mk_context *c const void *data unsigned size )
{
unsigned ns = c->d_cur + size;
if( ns > c->d_max )
{
void *dp;
unsigned dn = c->d_max ? c->d_max << 1 : 16;
while( ns > dn )
dn <<= 1;
dp = realloc( c->data dn );
if( !dp )
return -1;
c->data = dp;
c->d_max = dn;
}
memcpy( (char*)c->data + c->d_cur data size );
c->d_cur = ns;
return 0;
}
static int mk_write_id( mk_context *c unsigned id )
{
unsigned char c_id[4] = { id >> 24 id >> 16 id >> 8 id };
if( c_id[0] )
return mk_append_context_data( c c_id 4 );
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 256 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\config
文件 58 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\desc
文件 23 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\HEAD
文件 441 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\applypatch-msg
文件 887 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\commit-msg
文件 152 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\post-commit
文件 510 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\post-receive
文件 207 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\post-update
文件 387 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\pre-applypatch
文件 1706 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\pre-commit
文件 4262 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\pre-reba
文件 1196 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\prepare-commit-msg
文件 2910 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\hooks\update
文件 10840 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\index
文件 240 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\info\exclude
文件 182 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\logs\HEAD
文件 182 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\logs\refs\heads\master
文件 182 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\logs\refs\remotes\origin\HEAD
文件 182 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\logs\refs\remotes\origin\master
文件 213824 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\ob
文件 2214951 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\ob
文件 41 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\refs\heads\master
文件 32 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\refs\remotes\origin\HEAD
文件 41 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.git\refs\remotes\origin\master
文件 156 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\.gitignore
文件 2002 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\AUTHORS
文件 3726 2012-12-14 14:38 vs-2010-x264-snapshot-20091005-2245\build\win32\Debug\libx264.Build.CppClean.log
文件 397 2012-12-14 14:38 vs-2010-x264-snapshot-20091005-2245\build\win32\Debug\libx264.log
文件 35651584 2012-12-14 14:38 vs-2010-x264-snapshot-20091005-2245\build\win32\ipch\x264-bbece019\obj\x264_debug\x264-edb24b7a.ipch
文件 31069 2009-10-06 04:45 vs-2010-x264-snapshot-20091005-2245\build\win32\libx264.vcproj
............此处省略189个文件信息
相关资源
- Nginx源代码VS2010直接编译运行
- 自然语言处理课程设计--中文情感分类
- HandBrake视频转换VS2010编译通过
- iperf vs2010工程编译
- Read_Ionex.rar
- 基于opencv2.4.3、VS2010的背景差分法目标
- H264裸流视频
- 如何使用mp4v2将H264+AAC裸流录制成mp4文
- 排座管理系统
- 房屋出租管理系统,用VS2010编译的
- h264中文协议(中英文对照)H264解码手
- IrisSkin4_VS2010可用.rar
- Apress Visual C Sharp 2010 Recipes A Problem S
- VS2010 TCP一个进程拥有多个端口,cli
- vs2010编译的g2o库文件 win 7可用 直接解
- RtspRtcpRtpLoad_h264.tar.gz
- YML保存 cvCompareHist cvCalcEMD2 直方图对比
- 摄像头CT跟踪算法
- h264编码流程概述
- 简单的RTSP RTP RTCP推送H264码流服务器实
- Tesseract-OCR在VS2010下调用API所需要的
- AnkhSvn-2.1.7444.278.msi & AnkhSvn-2.1.8420.8.
- 大数库miracl 7.0.1 附带vs2010编译工程及
- h264标准文档中文版
- 基于VS2010的OpenGL 3D场景
- rtsp 服务器代码,VC可编译使用,RTS
- YUV测试序列:foreman.cif(1-4)
- tracert课程设计
- H264_AAC_TS_MUX_本地文件_1
- H264_AAC_FLV_MUX_本地文件_1
评论
共有 条评论