Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
7a0f9d7e
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,发现更多精彩内容 >>
提交
7a0f9d7e
编写于
12月 12, 2003
作者:
F
Fabrice Bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed top_field_first support when encoding
Originally committed as revision 2600 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
3e9d718e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
33 deletion
+39
-33
ffmpeg.c
ffmpeg.c
+31
-31
libavcodec/mpeg12.c
libavcodec/mpeg12.c
+5
-1
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+3
-1
未找到文件。
ffmpeg.c
浏览文件 @
7a0f9d7e
...
...
@@ -465,7 +465,7 @@ static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void
static
void
do_video_out
(
AVFormatContext
*
s
,
AVOutputStream
*
ost
,
AVInputStream
*
ist
,
AV
Pictur
e
*
in_picture
,
AV
Fram
e
*
in_picture
,
int
*
frame_size
,
AVOutputStream
*
audio_sync
)
{
int
nb_frames
,
i
,
ret
;
...
...
@@ -557,13 +557,13 @@ static void do_video_out(AVFormatContext *s,
avpicture_fill
(
formatted_picture
,
buf
,
target_pixfmt
,
dec
->
width
,
dec
->
height
);
if
(
img_convert
(
formatted_picture
,
target_pixfmt
,
in_picture
,
dec
->
pix_fmt
,
(
AVPicture
*
)
in_picture
,
dec
->
pix_fmt
,
dec
->
width
,
dec
->
height
)
<
0
)
{
fprintf
(
stderr
,
"pixel format conversion not handled
\n
"
);
goto
the_end
;
}
}
else
{
formatted_picture
=
in_picture
;
formatted_picture
=
(
AVPicture
*
)
in_picture
;
}
/* XXX: resampling could be done before raw format convertion in
...
...
@@ -627,7 +627,11 @@ static void do_video_out(AVFormatContext *s,
memset
(
&
big_picture
,
0
,
sizeof
(
AVFrame
));
*
(
AVPicture
*
)
&
big_picture
=
*
final_picture
;
/* better than nothing: use input picture interlaced
settings */
big_picture
.
interlaced_frame
=
in_picture
->
interlaced_frame
;
big_picture
.
top_field_first
=
in_picture
->
top_field_first
;
/* handles sameq here. This is not correct because it may
not be a global option */
if
(
same_quality
)
{
...
...
@@ -1187,7 +1191,7 @@ static int av_encode(AVFormatContext **output_files,
int
len
;
uint8_t
*
data_buf
;
int
data_size
,
got_picture
;
AV
Pictur
e
picture
;
AV
Fram
e
picture
;
short
samples
[
AVCODEC_MAX_AUDIO_FRAME_SIZE
/
2
];
void
*
buffer_to_free
;
double
pts_min
;
...
...
@@ -1285,32 +1289,27 @@ static int av_encode(AVFormatContext **output_files,
(
2
*
ist
->
st
->
codec
.
channels
);
break
;
case
CODEC_TYPE_VIDEO
:
{
AVFrame
big_picture
;
data_size
=
(
ist
->
st
->
codec
.
width
*
ist
->
st
->
codec
.
height
*
3
)
/
2
;
ret
=
avcodec_decode_video
(
&
ist
->
st
->
codec
,
&
big_picture
,
&
got_picture
,
ptr
,
len
);
picture
=
*
(
AVPicture
*
)
&
big_picture
;
ist
->
st
->
quality
=
big_picture
.
quality
;
if
(
ret
<
0
)
{
fail_decode:
fprintf
(
stderr
,
"Error while decoding stream #%d.%d
\n
"
,
ist
->
file_index
,
ist
->
index
);
av_free_packet
(
&
pkt
);
goto
redo
;
}
if
(
!
got_picture
)
{
/* no picture yet */
goto
discard_packet
;
}
if
(
ist
->
st
->
codec
.
frame_rate_base
!=
0
)
{
ist
->
next_pts
+=
((
int64_t
)
AV_TIME_BASE
*
ist
->
st
->
codec
.
frame_rate_base
)
/
ist
->
st
->
codec
.
frame_rate
;
}
len
=
0
;
data_size
=
(
ist
->
st
->
codec
.
width
*
ist
->
st
->
codec
.
height
*
3
)
/
2
;
ret
=
avcodec_decode_video
(
&
ist
->
st
->
codec
,
&
picture
,
&
got_picture
,
ptr
,
len
);
ist
->
st
->
quality
=
picture
.
quality
;
if
(
ret
<
0
)
{
fail_decode:
fprintf
(
stderr
,
"Error while decoding stream #%d.%d
\n
"
,
ist
->
file_index
,
ist
->
index
);
av_free_packet
(
&
pkt
);
goto
redo
;
}
if
(
!
got_picture
)
{
/* no picture yet */
goto
discard_packet
;
}
if
(
ist
->
st
->
codec
.
frame_rate_base
!=
0
)
{
ist
->
next_pts
+=
((
int64_t
)
AV_TIME_BASE
*
ist
->
st
->
codec
.
frame_rate_base
)
/
ist
->
st
->
codec
.
frame_rate
;
}
len
=
0
;
break
;
default:
goto
fail_decode
;
...
...
@@ -1324,7 +1323,8 @@ static int av_encode(AVFormatContext **output_files,
buffer_to_free
=
NULL
;
if
(
ist
->
st
->
codec
.
codec_type
==
CODEC_TYPE_VIDEO
)
{
pre_process_video_frame
(
ist
,
&
picture
,
&
buffer_to_free
);
pre_process_video_frame
(
ist
,
(
AVPicture
*
)
&
picture
,
&
buffer_to_free
);
}
/* frame rate emulation */
...
...
libavcodec/mpeg12.c
浏览文件 @
7a0f9d7e
...
...
@@ -448,7 +448,11 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
}
put_bits
(
&
s
->
pb
,
2
,
s
->
intra_dc_precision
);
put_bits
(
&
s
->
pb
,
2
,
s
->
picture_structure
=
PICT_FRAME
);
put_bits
(
&
s
->
pb
,
1
,
s
->
top_field_first
);
if
(
s
->
progressive_sequence
)
{
put_bits
(
&
s
->
pb
,
1
,
0
);
/* no repeat */
}
else
{
put_bits
(
&
s
->
pb
,
1
,
s
->
current_picture_ptr
->
top_field_first
);
}
/* XXX: optimize the generation of this flag with entropy
measures */
s
->
frame_pred_frame_dct
=
s
->
progressive_sequence
;
...
...
libavcodec/mpegvideo.c
浏览文件 @
7a0f9d7e
...
...
@@ -1560,7 +1560,9 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
pic
->
quality
=
pic_arg
->
quality
;
pic
->
pict_type
=
pic_arg
->
pict_type
;
pic
->
pts
=
pic_arg
->
pts
;
pic
->
interlaced_frame
=
pic_arg
->
interlaced_frame
;
pic
->
top_field_first
=
pic_arg
->
top_field_first
;
if
(
s
->
input_picture
[
encoding_delay
])
pic
->
display_picture_number
=
s
->
input_picture
[
encoding_delay
]
->
display_picture_number
+
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录