Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
5d1c2e53
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,发现更多精彩内容 >>
提交
5d1c2e53
编写于
2月 27, 2014
作者:
V
Vittorio Giovara
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define
上级
9b749c82
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
12 deletion
+14
-12
libavcodec/h264.c
libavcodec/h264.c
+11
-11
libavcodec/h264.h
libavcodec/h264.h
+2
-0
libavcodec/h264_ps.c
libavcodec/h264_ps.c
+1
-1
未找到文件。
libavcodec/h264.c
浏览文件 @
5d1c2e53
...
...
@@ -279,7 +279,7 @@ static void release_unused_pictures(H264Context *h, int remove_current)
int
i
;
/* release non reference frames */
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
{
if
(
h
->
DPB
[
i
].
f
.
buf
[
0
]
&&
!
h
->
DPB
[
i
].
reference
&&
(
remove_current
||
&
h
->
DPB
[
i
]
!=
h
->
cur_pic_ptr
))
{
unref_picture
(
h
,
&
h
->
DPB
[
i
]);
...
...
@@ -467,11 +467,11 @@ static int find_unused_picture(H264Context *h)
{
int
i
;
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
{
if
(
pic_is_unused
(
h
,
&
h
->
DPB
[
i
]))
break
;
}
if
(
i
==
MAX_PICTURE_COUNT
)
if
(
i
==
H264_
MAX_PICTURE_COUNT
)
return
AVERROR_INVALIDDATA
;
if
(
h
->
DPB
[
i
].
needs_realloc
)
{
...
...
@@ -1185,11 +1185,11 @@ static void free_tables(H264Context *h, int free_rbsp)
av_buffer_pool_uninit
(
&
h
->
ref_index_pool
);
if
(
free_rbsp
&&
h
->
DPB
)
{
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
unref_picture
(
h
,
&
h
->
DPB
[
i
]);
av_freep
(
&
h
->
DPB
);
}
else
if
(
h
->
DPB
)
{
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
h
->
DPB
[
i
].
needs_realloc
=
1
;
}
...
...
@@ -1338,10 +1338,10 @@ int ff_h264_alloc_tables(H264Context *h)
init_dequant_tables
(
h
);
if
(
!
h
->
DPB
)
{
h
->
DPB
=
av_mallocz_array
(
MAX_PICTURE_COUNT
,
sizeof
(
*
h
->
DPB
));
h
->
DPB
=
av_mallocz_array
(
H264_
MAX_PICTURE_COUNT
,
sizeof
(
*
h
->
DPB
));
if
(
!
h
->
DPB
)
return
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
av_frame_unref
(
&
h
->
DPB
[
i
].
f
);
av_frame_unref
(
&
h
->
cur_pic
.
f
);
}
...
...
@@ -1595,7 +1595,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
#undef REBASE_PICTURE
#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
((pic && pic >= old_ctx->DPB && \
pic < old_ctx->DPB + MAX_PICTURE_COUNT) ? \
pic < old_ctx->DPB +
H264_
MAX_PICTURE_COUNT) ? \
&new_ctx->DPB[pic - old_ctx->DPB] : NULL)
static
void
copy_picture_range
(
H264Picture
**
to
,
H264Picture
**
from
,
int
count
,
...
...
@@ -1607,7 +1607,7 @@ static void copy_picture_range(H264Picture **to, H264Picture **from, int count,
for
(
i
=
0
;
i
<
count
;
i
++
)
{
assert
((
IN_RANGE
(
from
[
i
],
old_base
,
sizeof
(
*
old_base
))
||
IN_RANGE
(
from
[
i
],
old_base
->
DPB
,
sizeof
(
H264Picture
)
*
MAX_PICTURE_COUNT
)
||
sizeof
(
H264Picture
)
*
H264_
MAX_PICTURE_COUNT
)
||
!
from
[
i
]));
to
[
i
]
=
REBASE_PICTURE
(
from
[
i
],
new_base
,
old_base
);
}
...
...
@@ -1767,7 +1767,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
h
->
droppable
=
h1
->
droppable
;
h
->
low_delay
=
h1
->
low_delay
;
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
{
unref_picture
(
h
,
&
h
->
DPB
[
i
]);
if
(
h1
->
DPB
[
i
].
f
.
buf
[
0
]
&&
(
ret
=
ref_picture
(
h
,
&
h
->
DPB
[
i
],
&
h1
->
DPB
[
i
]))
<
0
)
...
...
@@ -2801,7 +2801,7 @@ static void flush_dpb(AVCodecContext *avctx)
flush_change
(
h
);
if
(
h
->
DPB
)
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
for
(
i
=
0
;
i
<
H264_
MAX_PICTURE_COUNT
;
i
++
)
unref_picture
(
h
,
&
h
->
DPB
[
i
]);
h
->
cur_pic_ptr
=
NULL
;
unref_picture
(
h
,
&
h
->
cur_pic
);
...
...
libavcodec/h264.h
浏览文件 @
5d1c2e53
...
...
@@ -39,6 +39,8 @@
#include "h264qpel.h"
#include "rectangle.h"
#define H264_MAX_PICTURE_COUNT 32
#define MAX_SPS_COUNT 32
#define MAX_PPS_COUNT 256
...
...
libavcodec/h264_ps.c
浏览文件 @
5d1c2e53
...
...
@@ -400,7 +400,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
}
sps
->
ref_frame_count
=
get_ue_golomb_31
(
&
h
->
gb
);
if
(
sps
->
ref_frame_count
>
MAX_PICTURE_COUNT
-
2
||
if
(
sps
->
ref_frame_count
>
H264_
MAX_PICTURE_COUNT
-
2
||
sps
->
ref_frame_count
>=
32U
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"too many reference frames %d
\n
"
,
sps
->
ref_frame_count
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录