Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
46f2f05f
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,发现更多精彩内容 >>
提交
46f2f05f
编写于
1月 23, 2005
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simplify deblock
Originally committed as revision 3868 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
91c56db6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
43 deletion
+26
-43
libavcodec/h264.c
libavcodec/h264.c
+26
-43
未找到文件。
libavcodec/h264.c
浏览文件 @
46f2f05f
...
...
@@ -408,7 +408,7 @@ static inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t v
assert
(
0
);
}
static
inline
void
fill_caches
(
H264Context
*
h
,
int
mb_type
){
static
inline
void
fill_caches
(
H264Context
*
h
,
int
mb_type
,
int
for_deblock
){
MpegEncContext
*
const
s
=
&
h
->
s
;
const
int
mb_xy
=
s
->
mb_x
+
s
->
mb_y
*
s
->
mb_stride
;
int
topleft_xy
,
top_xy
,
topright_xy
,
left_xy
[
2
];
...
...
@@ -435,11 +435,19 @@ static inline void fill_caches(H264Context *h, int mb_type){
left_block
[
3
]
=
3
;
}
topleft_type
=
h
->
slice_table
[
topleft_xy
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
topleft_xy
]
:
0
;
top_type
=
h
->
slice_table
[
top_xy
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
top_xy
]
:
0
;
topright_type
=
h
->
slice_table
[
topright_xy
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
topright_xy
]
:
0
;
left_type
[
0
]
=
h
->
slice_table
[
left_xy
[
0
]
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
left_xy
[
0
]]
:
0
;
left_type
[
1
]
=
h
->
slice_table
[
left_xy
[
1
]
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
left_xy
[
1
]]
:
0
;
if
(
for_deblock
){
topleft_type
=
h
->
slice_table
[
topleft_xy
]
<
255
?
s
->
current_picture
.
mb_type
[
topleft_xy
]
:
0
;
top_type
=
h
->
slice_table
[
top_xy
]
<
255
?
s
->
current_picture
.
mb_type
[
top_xy
]
:
0
;
topright_type
=
h
->
slice_table
[
topright_xy
]
<
255
?
s
->
current_picture
.
mb_type
[
topright_xy
]
:
0
;
left_type
[
0
]
=
h
->
slice_table
[
left_xy
[
0
]
]
<
255
?
s
->
current_picture
.
mb_type
[
left_xy
[
0
]]
:
0
;
left_type
[
1
]
=
h
->
slice_table
[
left_xy
[
1
]
]
<
255
?
s
->
current_picture
.
mb_type
[
left_xy
[
1
]]
:
0
;
}
else
{
topleft_type
=
h
->
slice_table
[
topleft_xy
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
topleft_xy
]
:
0
;
top_type
=
h
->
slice_table
[
top_xy
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
top_xy
]
:
0
;
topright_type
=
h
->
slice_table
[
topright_xy
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
topright_xy
]
:
0
;
left_type
[
0
]
=
h
->
slice_table
[
left_xy
[
0
]
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
left_xy
[
0
]]
:
0
;
left_type
[
1
]
=
h
->
slice_table
[
left_xy
[
1
]
]
==
h
->
slice_num
?
s
->
current_picture
.
mb_type
[
left_xy
[
1
]]
:
0
;
}
if
(
IS_INTRA
(
mb_type
)){
h
->
topleft_samples_available
=
...
...
@@ -651,6 +659,9 @@ static inline void fill_caches(H264Context *h, int mb_type){
h
->
ref_cache
[
list
][
scan8
[
0
]
-
1
+
3
*
8
]
=
left_type
[
0
]
?
LIST_NOT_USED
:
PART_NOT_AVAILABLE
;
}
if
(
for_deblock
)
continue
;
h
->
ref_cache
[
list
][
scan8
[
5
]
+
1
]
=
h
->
ref_cache
[
list
][
scan8
[
7
]
+
1
]
=
h
->
ref_cache
[
list
][
scan8
[
13
]
+
1
]
=
//FIXME remove past 3 (init somewher else)
...
...
@@ -2835,6 +2846,7 @@ static void hl_decode_mb(H264Context *h){
}
if
(
h
->
deblocking_filter
)
{
backup_mb_border
(
h
,
dest_y
,
dest_cb
,
dest_cr
,
linesize
,
uvlinesize
);
fill_caches
(
h
,
mb_type
,
1
);
//FIXME dont fill stuff which isnt used by filter_mb
filter_mb
(
h
,
mb_x
,
mb_y
,
dest_y
,
dest_cb
,
dest_cr
);
}
}
...
...
@@ -3857,7 +3869,7 @@ static void decode_mb_skip(H264Context *h){
mb_type
=
MB_TYPE_16x16
|
MB_TYPE_P0L0
|
MB_TYPE_P0L1
|
MB_TYPE_DIRECT2
|
MB_TYPE_SKIP
;
//FIXME mbaff
fill_caches
(
h
,
mb_type
);
//FIXME check what is needed and what not ...
fill_caches
(
h
,
mb_type
,
0
);
//FIXME check what is needed and what not ...
pred_direct_motion
(
h
,
&
mb_type
);
if
(
h
->
pps
.
cabac
){
fill_rectangle
(
h
->
mvd_cache
[
0
][
scan8
[
0
]],
4
,
4
,
8
,
0
,
4
);
...
...
@@ -3875,7 +3887,7 @@ static void decode_mb_skip(H264Context *h){
if
(
h
->
mb_field_decoding_flag
)
mb_type
|=
MB_TYPE_INTERLACED
;
fill_caches
(
h
,
mb_type
);
//FIXME check what is needed and what not ...
fill_caches
(
h
,
mb_type
,
0
);
//FIXME check what is needed and what not ...
pred_pskip_motion
(
h
,
&
mx
,
&
my
);
fill_rectangle
(
&
h
->
ref_cache
[
0
][
scan8
[
0
]],
4
,
4
,
8
,
0
,
1
);
fill_rectangle
(
h
->
mv_cache
[
0
][
scan8
[
0
]],
4
,
4
,
8
,
pack16to32
(
mx
,
my
),
4
);
...
...
@@ -3994,7 +4006,7 @@ decode_intra_mb:
return
0
;
}
fill_caches
(
h
,
mb_type
);
fill_caches
(
h
,
mb_type
,
0
);
//mb_pred
if
(
IS_INTRA
(
mb_type
)){
...
...
@@ -4890,7 +4902,7 @@ decode_intra_mb:
return
-
1
;
}
fill_caches
(
h
,
mb_type
);
fill_caches
(
h
,
mb_type
,
0
);
if
(
IS_INTRA
(
mb_type
)
)
{
if
(
IS_INTRA4x4
(
mb_type
)
)
{
...
...
@@ -5546,49 +5558,20 @@ static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8
bS
[
0
]
=
bS
[
1
]
=
bS
[
2
]
=
bS
[
3
]
=
(
edge
==
0
?
4
:
3
);
}
else
{
int
i
;
const
int
slice_boundary
=
(
h
->
slice_table
[
mbn_xy
]
!=
h
->
slice_table
[
mb_xy
]);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
int
x
=
dir
==
0
?
edge
:
i
;
int
y
=
dir
==
0
?
i
:
edge
;
int
b_idx
=
8
+
4
+
x
+
8
*
y
;
int
bn_idx
=
b_idx
-
(
dir
?
8
:
1
);
uint8_t
left_non_zero_count
;
if
(
slice_boundary
)
{
// must not use non_zero_count_cache, it is not valid
// across slice boundaries
if
(
0
==
dir
)
{
left_non_zero_count
=
h
->
non_zero_count
[
mbn_xy
][
6
-
i
];
}
else
{
left_non_zero_count
=
h
->
non_zero_count
[
mbn_xy
][
i
];
}
}
else
{
left_non_zero_count
=
h
->
non_zero_count_cache
[
bn_idx
];
}
if
(
h
->
non_zero_count_cache
[
b_idx
]
!=
0
||
left_non_zero_count
!=
0
)
{
h
->
non_zero_count_cache
[
bn_idx
]
!=
0
)
{
bS
[
i
]
=
2
;
}
else
if
(
h
->
slice_type
==
P_TYPE
)
{
int16_t
left_mv
[
2
];
int8_t
left_ref
;
if
(
slice_boundary
)
{
// must not use ref_cache and mv_cache, they are not
// valid across slice boundaries
if
(
dir
==
0
)
{
left_ref
=
s
->
current_picture
.
ref_index
[
0
][
h
->
mb2b8_xy
[
mbn_xy
]
+
(
i
>>
1
)
*
h
->
b8_stride
+
1
];
*
(
uint32_t
*
)
left_mv
=
*
(
uint32_t
*
)
s
->
current_picture
.
motion_val
[
0
][
h
->
mb2b_xy
[
mbn_xy
]
+
i
*
h
->
b_stride
+
3
];
}
else
{
left_ref
=
s
->
current_picture
.
ref_index
[
0
][
h
->
mb2b8_xy
[
mbn_xy
]
+
(
i
>>
1
)
+
h
->
b8_stride
];
*
(
uint32_t
*
)
left_mv
=
*
(
uint32_t
*
)
s
->
current_picture
.
motion_val
[
0
][
h
->
mb2b_xy
[
mbn_xy
]
+
3
*
h
->
b_stride
+
i
];
}
}
else
{
left_ref
=
h
->
ref_cache
[
0
][
bn_idx
];
*
(
uint32_t
*
)
left_mv
=
*
(
uint32_t
*
)
h
->
mv_cache
[
0
][
bn_idx
];
}
if
(
h
->
ref_cache
[
0
][
b_idx
]
!=
left_ref
||
ABS
(
h
->
mv_cache
[
0
][
b_idx
][
0
]
-
left_mv
[
0
]
)
>=
4
||
ABS
(
h
->
mv_cache
[
0
][
b_idx
][
1
]
-
left_mv
[
1
]
)
>=
4
)
if
(
h
->
ref_cache
[
0
][
b_idx
]
!=
h
->
ref_cache
[
0
][
bn_idx
]
||
ABS
(
h
->
mv_cache
[
0
][
b_idx
][
0
]
-
h
->
mv_cache
[
0
][
bn_idx
][
0
]
)
>=
4
||
ABS
(
h
->
mv_cache
[
0
][
b_idx
][
1
]
-
h
->
mv_cache
[
0
][
bn_idx
][
1
]
)
>=
4
)
bS
[
i
]
=
1
;
else
bS
[
i
]
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录