Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
370b622a
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,发现更多精彩内容 >>
提交
370b622a
编写于
8月 02, 2010
作者:
J
Jason Garrett-Glaser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
VP8: eliminate a dereference in coefficient decoding
Originally committed as revision 24671 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
f311208c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
12 deletion
+19
-12
libavcodec/vp8.c
libavcodec/vp8.c
+17
-9
libavcodec/vp8data.h
libavcodec/vp8data.h
+2
-3
未找到文件。
libavcodec/vp8.c
浏览文件 @
370b622a
...
...
@@ -195,7 +195,8 @@ typedef struct {
uint8_t
golden
;
uint8_t
pred16x16
[
4
];
uint8_t
pred8x8c
[
3
];
uint8_t
token
[
4
][
8
][
3
][
NUM_DCT_TOKENS
-
1
];
/* Padded to allow overreads */
uint8_t
token
[
4
][
17
][
3
][
NUM_DCT_TOKENS
-
1
];
uint8_t
mvc
[
2
][
19
];
}
prob
[
2
];
}
VP8Context
;
...
...
@@ -388,7 +389,7 @@ static void update_refs(VP8Context *s)
static
int
decode_frame_header
(
VP8Context
*
s
,
const
uint8_t
*
buf
,
int
buf_size
)
{
VP56RangeCoder
*
c
=
&
s
->
c
;
int
header_size
,
hscale
,
vscale
,
i
,
j
,
k
,
l
,
ret
;
int
header_size
,
hscale
,
vscale
,
i
,
j
,
k
,
l
,
m
,
ret
;
int
width
=
s
->
avctx
->
width
;
int
height
=
s
->
avctx
->
height
;
...
...
@@ -428,7 +429,10 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
av_log_missing_feature
(
s
->
avctx
,
"Upscaling"
,
1
);
s
->
update_golden
=
s
->
update_altref
=
VP56_FRAME_CURRENT
;
memcpy
(
s
->
prob
->
token
,
vp8_token_default_probs
,
sizeof
(
s
->
prob
->
token
));
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
j
=
0
;
j
<
16
;
j
++
)
memcpy
(
s
->
prob
->
token
[
i
][
j
],
vp8_token_default_probs
[
i
][
vp8_coeff_band
[
j
]],
sizeof
(
s
->
prob
->
token
[
i
][
j
]));
memcpy
(
s
->
prob
->
pred16x16
,
vp8_pred16x16_prob_inter
,
sizeof
(
s
->
prob
->
pred16x16
));
memcpy
(
s
->
prob
->
pred8x8c
,
vp8_pred8x8c_prob_inter
,
sizeof
(
s
->
prob
->
pred8x8c
));
memcpy
(
s
->
prob
->
mvc
,
vp8_mv_default_prob
,
sizeof
(
s
->
prob
->
mvc
));
...
...
@@ -488,8 +492,12 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
for
(
j
=
0
;
j
<
8
;
j
++
)
for
(
k
=
0
;
k
<
3
;
k
++
)
for
(
l
=
0
;
l
<
NUM_DCT_TOKENS
-
1
;
l
++
)
if
(
vp56_rac_get_prob_branchy
(
c
,
vp8_token_update_probs
[
i
][
j
][
k
][
l
]))
s
->
prob
->
token
[
i
][
j
][
k
][
l
]
=
vp8_rac_get_uint
(
c
,
8
);
if
(
vp56_rac_get_prob_branchy
(
c
,
vp8_token_update_probs
[
i
][
j
][
k
][
l
]))
{
int
prob
=
vp8_rac_get_uint
(
c
,
8
);
for
(
m
=
0
;
m
<
16
;
m
++
)
if
(
vp8_coeff_band
[
m
]
==
j
)
s
->
prob
->
token
[
i
][
m
][
k
][
l
]
=
prob
;
}
if
((
s
->
mbskip_enabled
=
vp8_rac_get
(
c
)))
s
->
prob
->
mbskip
=
vp8_rac_get_uint
(
c
,
8
);
...
...
@@ -807,7 +815,7 @@ static int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16],
uint8_t
probs
[
8
][
3
][
NUM_DCT_TOKENS
-
1
],
int
i
,
int
zero_nhood
,
int16_t
qmul
[
2
])
{
uint8_t
*
token_prob
=
probs
[
vp8_coeff_band
[
i
]
][
zero_nhood
];
uint8_t
*
token_prob
=
probs
[
i
][
zero_nhood
];
int
nonzero
=
0
;
int
coeff
;
...
...
@@ -819,13 +827,13 @@ skip_eob:
if
(
!
vp56_rac_get_prob_branchy
(
c
,
token_prob
[
1
]))
{
// DCT_0
if
(
++
i
==
16
)
return
nonzero
;
// invalid input; blocks should end with EOB
token_prob
=
probs
[
vp8_coeff_band
[
i
]
][
0
];
token_prob
=
probs
[
i
][
0
];
goto
skip_eob
;
}
if
(
!
vp56_rac_get_prob_branchy
(
c
,
token_prob
[
2
]))
{
// DCT_1
coeff
=
1
;
token_prob
=
probs
[
vp8_coeff_band
[
i
+
1
]
][
1
];
token_prob
=
probs
[
i
+
1
][
1
];
}
else
{
if
(
!
vp56_rac_get_prob_branchy
(
c
,
token_prob
[
3
]))
{
// DCT 2,3,4
coeff
=
vp56_rac_get_prob
(
c
,
token_prob
[
4
]);
...
...
@@ -850,7 +858,7 @@ skip_eob:
coeff
+=
vp8_rac_get_coeff
(
c
,
vp8_dct_cat_prob
[
cat
]);
}
}
token_prob
=
probs
[
vp8_coeff_band
[
i
+
1
]
][
2
];
token_prob
=
probs
[
i
+
1
][
2
];
}
// todo: full [16] qmat? load into register?
...
...
libavcodec/vp8data.h
浏览文件 @
370b622a
...
...
@@ -314,10 +314,9 @@ static const int8_t vp8_segmentid_tree[][2] =
{
-
2
,
-
3
},
// '10', '11'
};
/* Padded by one byte to allow overreads */
static
const
uint8_t
vp8_coeff_band
[
17
]
=
static
const
uint8_t
vp8_coeff_band
[
16
]
=
{
0
,
1
,
2
,
3
,
6
,
4
,
5
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
7
,
0
0
,
1
,
2
,
3
,
6
,
4
,
5
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
7
};
static
const
uint8_t
vp8_dct_cat1_prob
[]
=
{
159
,
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录