Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
5b432d66
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b432d66
编写于
4月 11, 2012
作者:
D
Diego Biurrun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libxvid: Separate libxvid encoder from libxvid rate control code.
This allows compiling the Xvid rate control code without the encoder.
上级
727af82a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
43 addition
and
40 deletion
+43
-40
libavcodec/Makefile
libavcodec/Makefile
+2
-1
libavcodec/libxvid_rc.c
libavcodec/libxvid_rc.c
+41
-0
libavcodec/libxvidff.c
libavcodec/libxvidff.c
+0
-39
未找到文件。
libavcodec/Makefile
浏览文件 @
5b432d66
...
...
@@ -42,6 +42,7 @@ OBJS-$(CONFIG_GOLOMB) += golomb.o
OBJS-$(CONFIG_H264DSP)
+=
h264dsp.o h264idct.o
OBJS-$(CONFIG_H264PRED)
+=
h264pred.o
OBJS-$(CONFIG_HUFFMAN)
+=
huffman.o
OBJS-$(CONFIG_LIBXVID)
+=
libxvid_rc.o
OBJS-$(CONFIG_LPC)
+=
lpc.o
OBJS-$(CONFIG_LSP)
+=
lsp.o
OBJS-$(CONFIG_MDCT)
+=
mdct_fixed.o mdct_float.o
...
...
@@ -615,7 +616,7 @@ OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_ENCODER)
+=
libvpxenc.o
OBJS-$(CONFIG_LIBX264_ENCODER)
+=
libx264.o
OBJS-$(CONFIG_LIBXAVS_ENCODER)
+=
libxavs.o
OBJS-$(CONFIG_LIBXVID
)
+=
libxvidff.o libxvid_rc
.o
OBJS-$(CONFIG_LIBXVID
_ENCODER)
+=
libxvidff
.o
# parsers
OBJS-$(CONFIG_AAC_PARSER)
+=
aac_parser.o aac_ac3_parser.o
\
...
...
libavcodec/libxvid_rc.c
浏览文件 @
5b432d66
...
...
@@ -20,8 +20,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <xvid.h>
#include <unistd.h>
#if !HAVE_MKSTEMP
#include <fcntl.h>
#endif
#include "avcodec.h"
#include "libxvid_internal.h"
//#include "dsputil.h"
...
...
@@ -30,6 +35,42 @@
#undef NDEBUG
#include <assert.h>
/* Wrapper to work around the lack of mkstemp() on mingw.
* Also, tries to create file in /tmp first, if possible.
* *prefix can be a character constant; *filename will be allocated internally.
* @return file descriptor of opened file (or -1 on error)
* and opened file name in **filename. */
int
ff_tempfile
(
const
char
*
prefix
,
char
**
filename
)
{
int
fd
=-
1
;
#if !HAVE_MKSTEMP
*
filename
=
tempnam
(
"."
,
prefix
);
#else
size_t
len
=
strlen
(
prefix
)
+
12
;
/* room for "/tmp/" and "XXXXXX\0" */
*
filename
=
av_malloc
(
len
);
#endif
/* -----common section-----*/
if
(
*
filename
==
NULL
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"ff_tempfile: Cannot allocate file name
\n
"
);
return
-
1
;
}
#if !HAVE_MKSTEMP
fd
=
open
(
*
filename
,
O_RDWR
|
O_BINARY
|
O_CREAT
,
0444
);
#else
snprintf
(
*
filename
,
len
,
"/tmp/%sXXXXXX"
,
prefix
);
fd
=
mkstemp
(
*
filename
);
if
(
fd
<
0
)
{
snprintf
(
*
filename
,
len
,
"./%sXXXXXX"
,
prefix
);
fd
=
mkstemp
(
*
filename
);
}
#endif
/* -----common section-----*/
if
(
fd
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"ff_tempfile: Cannot open temporary file %s
\n
"
,
*
filename
);
return
-
1
;
}
return
fd
;
/* success */
}
int
ff_xvid_rate_control_init
(
MpegEncContext
*
s
){
char
*
tmp_name
;
int
fd
,
i
;
...
...
libavcodec/libxvidff.c
浏览文件 @
5b432d66
...
...
@@ -33,9 +33,6 @@
#include "libavutil/mathematics.h"
#include "libxvid_internal.h"
#include "mpegvideo.h"
#if !HAVE_MKSTEMP
#include <fcntl.h>
#endif
/**
* Buffer management macros.
...
...
@@ -83,42 +80,6 @@ struct xvid_ff_pass1 {
* rate-control plugin.
*/
/* Wrapper to work around the lack of mkstemp() on mingw.
* Also, tries to create file in /tmp first, if possible.
* *prefix can be a character constant; *filename will be allocated internally.
* @return file descriptor of opened file (or -1 on error)
* and opened file name in **filename. */
int
ff_tempfile
(
const
char
*
prefix
,
char
**
filename
)
{
int
fd
=-
1
;
#if !HAVE_MKSTEMP
*
filename
=
tempnam
(
"."
,
prefix
);
#else
size_t
len
=
strlen
(
prefix
)
+
12
;
/* room for "/tmp/" and "XXXXXX\0" */
*
filename
=
av_malloc
(
len
);
#endif
/* -----common section-----*/
if
(
*
filename
==
NULL
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"ff_tempfile: Cannot allocate file name
\n
"
);
return
-
1
;
}
#if !HAVE_MKSTEMP
fd
=
open
(
*
filename
,
O_RDWR
|
O_BINARY
|
O_CREAT
,
0444
);
#else
snprintf
(
*
filename
,
len
,
"/tmp/%sXXXXXX"
,
prefix
);
fd
=
mkstemp
(
*
filename
);
if
(
fd
<
0
)
{
snprintf
(
*
filename
,
len
,
"./%sXXXXXX"
,
prefix
);
fd
=
mkstemp
(
*
filename
);
}
#endif
/* -----common section-----*/
if
(
fd
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"ff_tempfile: Cannot open temporary file %s
\n
"
,
*
filename
);
return
-
1
;
}
return
fd
;
/* success */
}
/**
* Initialize the two-pass plugin and context.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录