Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
9d9a6239
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,发现更多精彩内容 >>
提交
9d9a6239
编写于
5月 15, 2009
作者:
B
Baptiste Coudurier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
decode mpeg-2 closed gop first b frames, fix issue #824
Originally committed as revision 18837 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
8be080ae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
5 deletion
+17
-5
libavcodec/mpeg12.c
libavcodec/mpeg12.c
+15
-5
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+1
-0
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
未找到文件。
libavcodec/mpeg12.c
浏览文件 @
9d9a6239
...
...
@@ -30,6 +30,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "mpegvideo_common.h"
#include "mpeg12.h"
#include "mpeg12data.h"
...
...
@@ -2139,7 +2140,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
int
drop_frame_flag
;
int
time_code_hours
,
time_code_minutes
;
int
time_code_seconds
,
time_code_pictures
;
int
closed_gop
,
broken_link
;
int
broken_link
;
init_get_bits
(
&
s
->
gb
,
buf
,
buf_size
*
8
);
...
...
@@ -2151,7 +2152,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
time_code_seconds
=
get_bits
(
&
s
->
gb
,
6
);
time_code_pictures
=
get_bits
(
&
s
->
gb
,
6
);
closed_gop
=
get_bits1
(
&
s
->
gb
);
s
->
closed_gop
=
get_bits1
(
&
s
->
gb
);
/*broken_link indicate that after editing the
reference frames of the first B-Frames after GOP I-Frame
are missing (open gop)*/
...
...
@@ -2160,7 +2161,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"GOP (%2d:%02d:%02d.[%02d]) closed_gop=%d broken_link=%d
\n
"
,
time_code_hours
,
time_code_minutes
,
time_code_seconds
,
time_code_pictures
,
closed_gop
,
broken_link
);
time_code_pictures
,
s
->
closed_gop
,
broken_link
);
}
/**
* Finds the end of the current frame in the bitstream.
...
...
@@ -2354,8 +2355,17 @@ static int decode_chunks(AVCodecContext *avctx,
int
mb_y
=
start_code
-
SLICE_MIN_START_CODE
;
if
(
s2
->
last_picture_ptr
==
NULL
){
/* Skip B-frames if we do not have reference frames. */
if
(
s2
->
pict_type
==
FF_B_TYPE
)
break
;
/* Skip B-frames if we do not have reference frames and gop is not closed */
if
(
s2
->
pict_type
==
FF_B_TYPE
){
int
i
;
if
(
!
s2
->
closed_gop
)
break
;
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s2
,
0
);
s2
->
last_picture_ptr
=
&
s2
->
picture
[
i
];
if
(
alloc_picture
(
s2
,
s2
->
last_picture_ptr
,
0
)
<
0
)
return
-
1
;
}
}
if
(
s2
->
next_picture_ptr
==
NULL
){
/* Skip P-frames if we do not have a reference frame or we have an invalid header. */
...
...
libavcodec/mpegvideo.c
浏览文件 @
9d9a6239
...
...
@@ -2107,6 +2107,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){
s
->
current_picture_ptr
=
s
->
last_picture_ptr
=
s
->
next_picture_ptr
=
NULL
;
s
->
mb_x
=
s
->
mb_y
=
0
;
s
->
closed_gop
=
0
;
s
->
parse_context
.
state
=
-
1
;
s
->
parse_context
.
frame_start_found
=
0
;
...
...
libavcodec/mpegvideo.h
浏览文件 @
9d9a6239
...
...
@@ -312,6 +312,7 @@ typedef struct MpegEncContext {
int
*
lambda_table
;
int
adaptive_quant
;
///< use adaptive quantization
int
dquant
;
///< qscale difference to prev qscale
int
closed_gop
;
///< MPEG1/2 GOP is closed
int
pict_type
;
///< FF_I_TYPE, FF_P_TYPE, FF_B_TYPE, ...
int
last_pict_type
;
//FIXME removes
int
last_non_b_pict_type
;
///< used for mpeg4 gmc b-frames & ratecontrol
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录