Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
fc97db64
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,发现更多精彩内容 >>
提交
fc97db64
编写于
9月 13, 2002
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
interlaced b frames cleanup
Originally committed as revision 938 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
a343d33e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
74 addition
and
73 deletion
+74
-73
libavcodec/h263.c
libavcodec/h263.c
+74
-73
未找到文件。
libavcodec/h263.c
浏览文件 @
fc97db64
...
...
@@ -2812,13 +2812,19 @@ int h263_decode_mb(MpegEncContext *s,
return
0
;
}
modb1
=
get_bits1
(
&
s
->
gb
);
if
(
modb1
==
0
){
modb1
=
get_bits1
(
&
s
->
gb
);
if
(
modb1
){
mb_type
=
4
;
//like MB_TYPE_B_DIRECT but no vectors coded
cbp
=
0
;
}
else
{
int
field_mv
;
modb2
=
get_bits1
(
&
s
->
gb
);
mb_type
=
get_vlc2
(
&
s
->
gb
,
mb_type_b_vlc
.
table
,
MB_TYPE_B_VLC_BITS
,
1
);
if
(
modb2
==
0
)
cbp
=
get_bits
(
&
s
->
gb
,
6
);
else
cbp
=
0
;
if
(
mb_type
&&
cbp
)
{
if
(
modb2
)
cbp
=
0
;
else
cbp
=
get_bits
(
&
s
->
gb
,
6
);
if
(
mb_type
!=
MB_TYPE_B_DIRECT
&&
cbp
)
{
if
(
get_bits1
(
&
s
->
gb
)){
s
->
qscale
+=
get_bits1
(
&
s
->
gb
)
*
4
-
2
;
if
(
s
->
qscale
<
1
)
...
...
@@ -2828,87 +2834,81 @@ int h263_decode_mb(MpegEncContext *s,
h263_dc_scale
(
s
);
}
}
s
->
mv_type
=
MV_TYPE_16X16
;
//might be changed to 8X8 or FIELD later
field_mv
=
0
;
if
(
!
s
->
progressive_sequence
){
if
(
cbp
)
s
->
interlaced_dct
=
get_bits1
(
&
s
->
gb
);
if
(
mb_type
!=
MB_TYPE_B_DIRECT
){
if
(
get_bits1
(
&
s
->
gb
)){
s
->
mv_type
=
MV_TYPE_FIELD
;
if
(
mb_type
!=
MB_TYPE_B_BACKW
){
s
->
field_select
[
0
][
0
]
=
get_bits1
(
&
s
->
gb
);
//FIXME move down
s
->
field_select
[
0
][
1
]
=
get_bits1
(
&
s
->
gb
);
}
if
(
mb_type
!=
MB_TYPE_B_FORW
){
s
->
field_select
[
1
][
0
]
=
get_bits1
(
&
s
->
gb
);
s
->
field_select
[
1
][
1
]
=
get_bits1
(
&
s
->
gb
);
}
}
}
if
(
mb_type
!=
MB_TYPE_B_DIRECT
&&
get_bits1
(
&
s
->
gb
))
field_mv
=
1
;
}
}
else
{
s
->
mv_type
=
MV_TYPE_16X16
;
//might be changed to 8X8 later
mb_type
=
4
;
//like MB_TYPE_B_DIRECT but no vectors coded
cbp
=
0
;
}
mx
=
my
=
0
;
if
(
mb_type
==
MB_TYPE_B_DIRECT
){
mx
=
h263_decode_motion
(
s
,
0
,
1
);
my
=
h263_decode_motion
(
s
,
0
,
1
);
}
if
(
s
->
mv_type
==
MV_TYPE_16X16
){
if
(
mb_type
==
MB_TYPE_B_FORW
||
mb_type
==
MB_TYPE_B_BIDIR
){
s
->
mv_dir
=
MV_DIR_FORWARD
;
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
0
][
0
],
s
->
f_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
0
][
1
],
s
->
f_code
);
s
->
last_mv
[
0
][
1
][
0
]
=
s
->
last_mv
[
0
][
0
][
0
]
=
s
->
mv
[
0
][
0
][
0
]
=
mx
;
s
->
last_mv
[
0
][
1
][
1
]
=
s
->
last_mv
[
0
][
0
][
1
]
=
s
->
mv
[
0
][
0
][
1
]
=
my
;
}
else
s
->
mv_dir
=
0
;
if
(
mb_type
==
MB_TYPE_B_BACKW
||
mb_type
==
MB_TYPE_B_BIDIR
){
s
->
mv_dir
|=
MV_DIR_BACKWARD
;
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
0
][
0
],
s
->
b_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
0
][
1
],
s
->
b_code
);
s
->
last_mv
[
1
][
1
][
0
]
=
s
->
last_mv
[
1
][
0
][
0
]
=
s
->
mv
[
1
][
0
][
0
]
=
mx
;
s
->
last_mv
[
1
][
1
][
1
]
=
s
->
last_mv
[
1
][
0
][
1
]
=
s
->
mv
[
1
][
0
][
1
]
=
my
;
}
if
(
mb_type
!=
4
&&
mb_type
!=
MB_TYPE_B_DIRECT
)
PRINT_MB_TYPE
(
mb_type
==
MB_TYPE_B_FORW
?
"F"
:
(
mb_type
==
MB_TYPE_B_BACKW
?
"B"
:
"T"
));
}
else
{
/* MV_TYPE_FIELD */
if
(
mb_type
==
MB_TYPE_B_FORW
||
mb_type
==
MB_TYPE_B_BIDIR
){
s
->
mv_dir
=
MV_DIR_FORWARD
;
for
(
i
=
0
;
i
<
2
;
i
++
){
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
i
][
0
]
,
s
->
f_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
i
][
1
]
/
2
,
s
->
f_code
);
s
->
last_mv
[
0
][
i
][
0
]
=
s
->
mv
[
0
][
i
][
0
]
=
mx
;
s
->
last_mv
[
0
][
i
][
1
]
=
(
s
->
mv
[
0
][
i
][
1
]
=
my
)
*
2
;
}
}
else
s
->
mv_dir
=
0
;
if
(
mb_type
==
MB_TYPE_B_BACKW
||
mb_type
==
MB_TYPE_B_BIDIR
){
s
->
mv_dir
|=
MV_DIR_BACKWARD
;
for
(
i
=
0
;
i
<
2
;
i
++
){
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
i
][
0
]
,
s
->
b_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
i
][
1
]
/
2
,
s
->
b_code
);
s
->
last_mv
[
1
][
i
][
0
]
=
s
->
mv
[
1
][
i
][
0
]
=
mx
;
s
->
last_mv
[
1
][
i
][
1
]
=
(
s
->
mv
[
1
][
i
][
1
]
=
my
)
*
2
;
if
(
mb_type
!=
MB_TYPE_B_DIRECT
&&
!
field_mv
){
s
->
mv_type
=
MV_TYPE_16X16
;
if
(
mb_type
!=
MB_TYPE_B_BACKW
){
s
->
mv_dir
=
MV_DIR_FORWARD
;
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
0
][
0
],
s
->
f_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
0
][
1
],
s
->
f_code
);
s
->
last_mv
[
0
][
1
][
0
]
=
s
->
last_mv
[
0
][
0
][
0
]
=
s
->
mv
[
0
][
0
][
0
]
=
mx
;
s
->
last_mv
[
0
][
1
][
1
]
=
s
->
last_mv
[
0
][
0
][
1
]
=
s
->
mv
[
0
][
0
][
1
]
=
my
;
}
else
s
->
mv_dir
=
0
;
if
(
mb_type
!=
MB_TYPE_B_FORW
){
s
->
mv_dir
|=
MV_DIR_BACKWARD
;
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
0
][
0
],
s
->
b_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
0
][
1
],
s
->
b_code
);
s
->
last_mv
[
1
][
1
][
0
]
=
s
->
last_mv
[
1
][
0
][
0
]
=
s
->
mv
[
1
][
0
][
0
]
=
mx
;
s
->
last_mv
[
1
][
1
][
1
]
=
s
->
last_mv
[
1
][
0
][
1
]
=
s
->
mv
[
1
][
0
][
1
]
=
my
;
}
if
(
mb_type
!=
MB_TYPE_B_DIRECT
)
PRINT_MB_TYPE
(
mb_type
==
MB_TYPE_B_FORW
?
"F"
:
(
mb_type
==
MB_TYPE_B_BACKW
?
"B"
:
"T"
));
}
else
if
(
mb_type
!=
MB_TYPE_B_DIRECT
){
s
->
mv_type
=
MV_TYPE_FIELD
;
if
(
mb_type
!=
MB_TYPE_B_BACKW
){
s
->
mv_dir
=
MV_DIR_FORWARD
;
s
->
field_select
[
0
][
0
]
=
get_bits1
(
&
s
->
gb
);
s
->
field_select
[
0
][
1
]
=
get_bits1
(
&
s
->
gb
);
for
(
i
=
0
;
i
<
2
;
i
++
){
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
i
][
0
]
,
s
->
f_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
0
][
i
][
1
]
/
2
,
s
->
f_code
);
s
->
last_mv
[
0
][
i
][
0
]
=
s
->
mv
[
0
][
i
][
0
]
=
mx
;
s
->
last_mv
[
0
][
i
][
1
]
=
(
s
->
mv
[
0
][
i
][
1
]
=
my
)
*
2
;
}
}
else
s
->
mv_dir
=
0
;
if
(
mb_type
!=
MB_TYPE_B_FORW
){
s
->
mv_dir
|=
MV_DIR_BACKWARD
;
s
->
field_select
[
1
][
0
]
=
get_bits1
(
&
s
->
gb
);
s
->
field_select
[
1
][
1
]
=
get_bits1
(
&
s
->
gb
);
for
(
i
=
0
;
i
<
2
;
i
++
){
mx
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
i
][
0
]
,
s
->
b_code
);
my
=
h263_decode_motion
(
s
,
s
->
last_mv
[
1
][
i
][
1
]
/
2
,
s
->
b_code
);
s
->
last_mv
[
1
][
i
][
0
]
=
s
->
mv
[
1
][
i
][
0
]
=
mx
;
s
->
last_mv
[
1
][
i
][
1
]
=
(
s
->
mv
[
1
][
i
][
1
]
=
my
)
*
2
;
}
}
if
(
mb_type
!=
MB_TYPE_B_DIRECT
)
PRINT_MB_TYPE
(
mb_type
==
MB_TYPE_B_FORW
?
"f"
:
(
mb_type
==
MB_TYPE_B_BACKW
?
"b"
:
"t"
));
}
if
(
mb_type
!=
4
&&
mb_type
!=
MB_TYPE_B_DIRECT
)
PRINT_MB_TYPE
(
mb_type
==
MB_TYPE_B_FORW
?
"f"
:
(
mb_type
==
MB_TYPE_B_BACKW
?
"b"
:
"t"
));
}
if
(
mb_type
==
4
||
mb_type
==
MB_TYPE_B_DIRECT
){
int
mb_index
=
s
->
mb_x
+
s
->
mb_y
*
s
->
mb_width
;
int
i
;
if
(
mb_type
==
4
)
mx
=
my
=
0
;
else
{
mx
=
h263_decode_motion
(
s
,
0
,
1
);
my
=
h263_decode_motion
(
s
,
0
,
1
);
}
s
->
mv_dir
=
MV_DIR_FORWARD
|
MV_DIR_BACKWARD
|
MV_DIRECT
;
xy
=
s
->
block_index
[
0
];
...
...
@@ -2918,6 +2918,7 @@ int h263_decode_mb(MpegEncContext *s,
//FIXME avoid divides
switch
(
s
->
co_located_type_table
[
mb_index
]){
case
0
:
s
->
mv_type
=
MV_TYPE_16X16
;
s
->
mv
[
0
][
0
][
0
]
=
s
->
motion_val
[
xy
][
0
]
*
time_pb
/
time_pp
+
mx
;
s
->
mv
[
0
][
0
][
1
]
=
s
->
motion_val
[
xy
][
1
]
*
time_pb
/
time_pp
+
my
;
s
->
mv
[
1
][
0
][
0
]
=
mx
?
s
->
mv
[
0
][
0
][
0
]
-
s
->
motion_val
[
xy
][
0
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录