Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
a4dae92b
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,发现更多精彩内容 >>
提交
a4dae92b
编写于
1月 04, 2005
作者:
L
Loren Merritt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sort B-frames into display order.
Originally committed as revision 3799 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
96db7add
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
9 deletion
+39
-9
libavcodec/h264.c
libavcodec/h264.c
+39
-9
未找到文件。
libavcodec/h264.c
浏览文件 @
a4dae92b
...
...
@@ -281,6 +281,7 @@ typedef struct H264Context{
Picture
default_ref_list
[
2
][
32
];
Picture
ref_list
[
2
][
32
];
//FIXME size?
Picture
field_ref_list
[
2
][
32
];
//FIXME size?
Picture
*
delayed_pic
[
16
];
//FIXME size?
/**
* memory management control operations buffer.
...
...
@@ -2929,20 +2930,30 @@ static int pred_weight_table(H264Context *h){
* instantaneous decoder refresh.
*/
static
void
idr
(
H264Context
*
h
){
int
i
;
int
i
,
j
;
#define CHECK_DELAY(pic) \
for(j = 0; h->delayed_pic[j]; j++) \
if(pic == h->delayed_pic[j]){ \
pic->reference=1; \
break; \
}
for
(
i
=
0
;
i
<
h
->
long_ref_count
;
i
++
){
h
->
long_ref
[
i
]
->
reference
=
0
;
CHECK_DELAY
(
h
->
long_ref
[
i
]);
h
->
long_ref
[
i
]
=
NULL
;
}
h
->
long_ref_count
=
0
;
for
(
i
=
0
;
i
<
h
->
short_ref_count
;
i
++
){
h
->
short_ref
[
i
]
->
reference
=
0
;
CHECK_DELAY
(
h
->
short_ref
[
i
]);
h
->
short_ref
[
i
]
=
NULL
;
}
h
->
short_ref_count
=
0
;
}
#undef CHECK_DELAY
/**
*
...
...
@@ -6088,19 +6099,38 @@ static int decode_frame(AVCodecContext *avctx,
//FIXME do something with unavailable reference frames
// if(ret==FRAME_SKIPED) return get_consumed_bytes(s, buf_index, buf_size);
#if 0
if(s->pict_type==B_TYPE || s->low_delay){
*pict= *(AVFrame*)&s->current_picture;
} else {
*pict= *(AVFrame*)&s->last_picture;
}
#endif
if
(
!
s
->
current_picture_ptr
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_DEBUG
,
"error, NO frame
\n
"
);
return
-
1
;
}
*
pict
=
*
(
AVFrame
*
)
&
s
->
current_picture
;
//FIXME
{
/* Sort B-frames into display order
* FIXME doesn't allow for multiple delayed frames */
Picture
*
cur
=
s
->
current_picture_ptr
;
Picture
*
prev
=
h
->
delayed_pic
[
0
];
Picture
*
out
;
if
(
cur
->
pict_type
==
B_TYPE
||
(
!
h
->
sps
.
gaps_in_frame_num_allowed_flag
&&
prev
&&
cur
->
poc
-
prev
->
poc
>
2
)){
s
->
low_delay
=
0
;
s
->
avctx
->
has_b_frames
=
1
;
}
if
(
s
->
low_delay
||
!
prev
||
cur
->
pict_type
==
B_TYPE
)
out
=
cur
;
else
{
out
=
prev
;
if
(
prev
->
reference
==
1
)
prev
->
reference
=
0
;
}
if
(
!
s
->
low_delay
&&
(
!
prev
||
out
==
prev
))
h
->
delayed_pic
[
0
]
=
cur
;
*
pict
=
*
(
AVFrame
*
)
out
;
}
ff_print_debug_info
(
s
,
pict
);
assert
(
pict
->
data
[
0
]);
//printf("out %d\n", (int)pict->data[0]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录