Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
5f194811
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,发现更多精彩内容 >>
提交
5f194811
编写于
10月 30, 2003
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pts fix and related fixes
Originally committed as revision 2452 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
2a2bbcb0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
31 deletion
+32
-31
libavcodec/h263.c
libavcodec/h263.c
+4
-4
libavcodec/h263dec.c
libavcodec/h263dec.c
+6
-11
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+21
-16
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
未找到文件。
libavcodec/h263.c
浏览文件 @
5f194811
...
...
@@ -1848,8 +1848,8 @@ void ff_mpeg4_stuffing(PutBitContext * pbc)
void
ff_set_mpeg4_time
(
MpegEncContext
*
s
,
int
picture_number
){
int
time_div
,
time_mod
;
if
(
s
->
current_picture
.
pts
)
s
->
time
=
(
s
->
current_picture
.
pts
*
s
->
time_increment_resolution
+
500
*
1000
)
/
(
1000
*
1000
);
if
(
s
->
current_picture
_ptr
->
pts
)
s
->
time
=
(
s
->
current_picture
_ptr
->
pts
*
s
->
time_increment_resolution
+
500
*
1000
)
/
(
1000
*
1000
);
else
s
->
time
=
av_rescale
(
picture_number
*
(
int64_t
)
s
->
avctx
->
frame_rate_base
,
s
->
time_increment_resolution
,
s
->
avctx
->
frame_rate
);
time_div
=
s
->
time
/
s
->
time_increment_resolution
;
...
...
@@ -4994,9 +4994,9 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
-
ROUNDED_DIV
(
s
->
last_non_b_time
-
s
->
pp_time
,
s
->
t_frame
))
*
2
;
}
s
->
current_picture
.
pts
=
s
->
time
*
1000LL
*
1000LL
/
s
->
time_increment_resolution
;
s
->
current_picture
_ptr
->
pts
=
s
->
time
*
1000LL
*
1000LL
/
s
->
time_increment_resolution
;
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PTS
)
printf
(
"MPEG4 PTS: %f
\n
"
,
s
->
current_picture
.
pts
/
(
1000
.
0
*
1000
.
0
));
printf
(
"MPEG4 PTS: %f
\n
"
,
s
->
current_picture
_ptr
->
pts
/
(
1000
.
0
*
1000
.
0
));
check_marker
(
gb
,
"before vop_coded"
);
...
...
libavcodec/h263dec.c
浏览文件 @
5f194811
...
...
@@ -28,17 +28,6 @@
//#define DEBUG
//#define PRINT_FRAME_TIME
#ifdef PRINT_FRAME_TIME
static
inline
long
long
rdtsc
()
{
long
long
l
;
asm
volatile
(
"rdtsc
\n\t
"
:
"=A"
(
l
)
);
// printf("%d\n", int(l/1000));
return
l
;
}
#endif
int
ff_h263_decode_init
(
AVCodecContext
*
avctx
)
{
...
...
@@ -446,6 +435,12 @@ retry:
if
(
MPV_common_init
(
s
)
<
0
)
//we need the idct permutaton for reading a custom matrix
return
-
1
;
}
//we need to set current_picture_ptr before reading the header, otherwise we cant store anyting im there
if
(
s
->
current_picture_ptr
==
NULL
||
s
->
current_picture_ptr
->
data
[
0
]){
int
i
=
ff_find_unused_picture
(
s
,
0
);
s
->
current_picture_ptr
=
&
s
->
picture
[
i
];
}
/* let's go :-) */
if
(
s
->
msmpeg4_version
==
5
)
{
...
...
libavcodec/mpegvideo.c
浏览文件 @
5f194811
...
...
@@ -1014,32 +1014,33 @@ static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
}
}
static
int
find_unused_picture
(
MpegEncContext
*
s
,
int
shared
){
int
ff_
find_unused_picture
(
MpegEncContext
*
s
,
int
shared
){
int
i
;
if
(
shared
){
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
){
if
(
s
->
picture
[
i
].
data
[
0
]
==
NULL
&&
s
->
picture
[
i
].
type
==
0
)
break
;
if
(
s
->
picture
[
i
].
data
[
0
]
==
NULL
&&
s
->
picture
[
i
].
type
==
0
)
return
i
;
}
}
else
{
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
){
if
(
s
->
picture
[
i
].
data
[
0
]
==
NULL
&&
s
->
picture
[
i
].
type
!=
0
)
break
;
//FIXME
if
(
s
->
picture
[
i
].
data
[
0
]
==
NULL
&&
s
->
picture
[
i
].
type
!=
0
)
return
i
;
//FIXME
}
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
){
if
(
s
->
picture
[
i
].
data
[
0
]
==
NULL
)
break
;
if
(
s
->
picture
[
i
].
data
[
0
]
==
NULL
)
return
i
;
}
}
assert
(
i
<
MAX_PICTURE_COUNT
);
return
i
;
assert
(
0
);
return
-
1
;
}
/* generic function for encode/decode called before a frame is coded/decoded */
/**
* generic function for encode/decode called after coding/decoding the header and before a frame is coded/decoded
*/
int
MPV_frame_start
(
MpegEncContext
*
s
,
AVCodecContext
*
avctx
)
{
int
i
;
AVFrame
*
pic
;
s
->
mb_skiped
=
0
;
assert
(
s
->
last_picture_ptr
==
NULL
||
s
->
out_format
!=
FMT_H264
||
s
->
codec_id
==
CODEC_ID_SVQ3
);
...
...
@@ -1068,18 +1069,22 @@ alloc:
}
}
i
=
find_unused_picture
(
s
,
0
);
pic
=
(
AVFrame
*
)
&
s
->
picture
[
i
];
if
(
s
->
current_picture_ptr
&&
s
->
current_picture_ptr
->
data
[
0
]
==
NULL
)
pic
=
(
AVFrame
*
)
s
->
current_picture_ptr
;
//we allready have a unused image (maybe it was set before reading the header)
else
{
i
=
ff_find_unused_picture
(
s
,
0
);
pic
=
(
AVFrame
*
)
&
s
->
picture
[
i
];
}
pic
->
reference
=
s
->
pict_type
!=
B_TYPE
?
3
:
0
;
if
(
s
->
current_picture_ptr
)
if
(
s
->
current_picture_ptr
)
//FIXME broken, we need a coded_picture_number in MpegEncContext
pic
->
coded_picture_number
=
s
->
current_picture_ptr
->
coded_picture_number
+
1
;
if
(
alloc_picture
(
s
,
(
Picture
*
)
pic
,
0
)
<
0
)
return
-
1
;
s
->
current_picture_ptr
=
&
s
->
picture
[
i
]
;
s
->
current_picture_ptr
=
(
Picture
*
)
pic
;
}
s
->
current_picture_ptr
->
pict_type
=
s
->
pict_type
;
...
...
@@ -1425,7 +1430,7 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
// printf("%d %d %d %d\n",pic_arg->linesize[0], pic_arg->linesize[1], s->linesize, s->uvlinesize);
if
(
direct
){
i
=
find_unused_picture
(
s
,
1
);
i
=
f
f_f
ind_unused_picture
(
s
,
1
);
pic
=
(
AVFrame
*
)
&
s
->
picture
[
i
];
pic
->
reference
=
3
;
...
...
@@ -1437,7 +1442,7 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
alloc_picture
(
s
,
(
Picture
*
)
pic
,
1
);
}
else
{
int
offset
=
16
;
i
=
find_unused_picture
(
s
,
0
);
i
=
f
f_f
ind_unused_picture
(
s
,
0
);
pic
=
(
AVFrame
*
)
&
s
->
picture
[
i
];
pic
->
reference
=
3
;
...
...
@@ -1587,7 +1592,7 @@ static void select_input_picture(MpegEncContext *s){
if
(
s
->
reordered_input_picture
[
0
]
->
type
==
FF_BUFFER_TYPE_SHARED
){
// input is a shared pix, so we cant modifiy it -> alloc a new one & ensure that the shared one is reuseable
int
i
=
find_unused_picture
(
s
,
0
);
int
i
=
f
f_f
ind_unused_picture
(
s
,
0
);
Picture
*
pic
=
&
s
->
picture
[
i
];
/* mark us unused / free shared pic */
...
...
libavcodec/mpegvideo.h
浏览文件 @
5f194811
...
...
@@ -718,6 +718,7 @@ int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size)
void
ff_mpeg_flush
(
AVCodecContext
*
avctx
);
void
ff_print_debug_info
(
MpegEncContext
*
s
,
Picture
*
pict
);
void
ff_write_quant_matrix
(
PutBitContext
*
pb
,
int16_t
*
matrix
);
int
ff_find_unused_picture
(
MpegEncContext
*
s
,
int
shared
);
void
ff_er_frame_start
(
MpegEncContext
*
s
);
void
ff_er_frame_end
(
MpegEncContext
*
s
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录