Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e0df9e44
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,发现更多精彩内容 >>
提交
e0df9e44
编写于
1月 24, 2009
作者:
V
Vitor Sessak
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not allocate RoqTempData on the stack
Originally committed as revision 16739 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
c6f79c3e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
12 deletion
+18
-12
libavcodec/roqvideo.h
libavcodec/roqvideo.h
+3
-0
libavcodec/roqvideoenc.c
libavcodec/roqvideoenc.c
+15
-12
未找到文件。
libavcodec/roqvideo.h
浏览文件 @
e0df9e44
...
...
@@ -39,6 +39,8 @@ typedef struct {
int
d
[
2
];
}
motion_vect
;
struct
RoqTempData
;
typedef
struct
RoqContext
{
AVCodecContext
*
avctx
;
...
...
@@ -69,6 +71,7 @@ typedef struct RoqContext {
AVFrame
*
frame_to_enc
;
uint8_t
*
out_buf
;
struct
RoqTempData
*
tmpData
;
}
RoqContext
;
#define RoQ_INFO 0x1001
...
...
libavcodec/roqvideoenc.c
浏览文件 @
e0df9e44
...
...
@@ -220,7 +220,7 @@ typedef struct
/**
* Temporary vars
*/
typedef
struct
typedef
struct
RoqTempData
{
CelEvaluation
*
cel_evals
;
...
...
@@ -881,14 +881,14 @@ static void generate_new_codebooks(RoqContext *enc, RoqTempdata *tempData)
static
void
roq_encode_video
(
RoqContext
*
enc
)
{
RoqTempdata
te
mpData
;
RoqTempdata
*
tempData
=
enc
->
t
mpData
;
int
i
;
memset
(
&
tempData
,
0
,
sizeof
(
tempData
));
memset
(
tempData
,
0
,
sizeof
(
*
tempData
));
create_cel_evals
(
enc
,
&
tempData
);
create_cel_evals
(
enc
,
tempData
);
generate_new_codebooks
(
enc
,
&
tempData
);
generate_new_codebooks
(
enc
,
tempData
);
if
(
enc
->
framesSinceKeyframe
>=
1
)
{
motion_search
(
enc
,
8
);
...
...
@@ -897,19 +897,19 @@ static void roq_encode_video(RoqContext *enc)
retry_encode:
for
(
i
=
0
;
i
<
enc
->
width
*
enc
->
height
/
64
;
i
++
)
gather_data_for_cel
(
tempData
.
cel_evals
+
i
,
enc
,
&
tempData
);
gather_data_for_cel
(
tempData
->
cel_evals
+
i
,
enc
,
tempData
);
/* Quake 3 can't handle chunks bigger than 65536 bytes */
if
(
tempData
.
mainChunkSize
/
8
>
65536
)
{
if
(
tempData
->
mainChunkSize
/
8
>
65536
)
{
enc
->
lambda
*=
.
8
;
goto
retry_encode
;
}
remap_codebooks
(
enc
,
&
tempData
);
remap_codebooks
(
enc
,
tempData
);
write_codebooks
(
enc
,
&
tempData
);
write_codebooks
(
enc
,
tempData
);
reconstruct_and_encode_image
(
enc
,
&
tempData
,
enc
->
width
,
enc
->
height
,
reconstruct_and_encode_image
(
enc
,
tempData
,
enc
->
width
,
enc
->
height
,
enc
->
width
*
enc
->
height
/
64
);
enc
->
avctx
->
coded_frame
=
enc
->
current_frame
;
...
...
@@ -919,8 +919,8 @@ static void roq_encode_video(RoqContext *enc)
FFSWAP
(
motion_vect
*
,
enc
->
last_motion4
,
enc
->
this_motion4
);
FFSWAP
(
motion_vect
*
,
enc
->
last_motion8
,
enc
->
this_motion8
);
av_free
(
tempData
.
cel_evals
);
av_free
(
tempData
.
closest_cb2
);
av_free
(
tempData
->
cel_evals
);
av_free
(
tempData
->
closest_cb2
);
enc
->
framesSinceKeyframe
++
;
}
...
...
@@ -955,6 +955,8 @@ static int roq_encode_init(AVCodecContext *avctx)
enc
->
last_frame
=
&
enc
->
frames
[
0
];
enc
->
current_frame
=
&
enc
->
frames
[
1
];
enc
->
tmpData
=
av_malloc
(
sizeof
(
RoqTempdata
));
enc
->
this_motion4
=
av_mallocz
((
enc
->
width
*
enc
->
height
/
16
)
*
sizeof
(
motion_vect
));
...
...
@@ -1050,6 +1052,7 @@ static int roq_encode_end(AVCodecContext *avctx)
avctx
->
release_buffer
(
avctx
,
enc
->
last_frame
);
avctx
->
release_buffer
(
avctx
,
enc
->
current_frame
);
av_free
(
enc
->
tmpData
);
av_free
(
enc
->
this_motion4
);
av_free
(
enc
->
last_motion4
);
av_free
(
enc
->
this_motion8
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录