Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
c0d1463d
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,发现更多精彩内容 >>
提交
c0d1463d
编写于
9月 29, 2009
作者:
M
Måns Rullgård
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WMA: use a table instead of pow() in decode_exp_vlc
Originally committed as revision 20076 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
4b4ac5c7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
73 addition
and
4 deletion
+73
-4
libavcodec/wmadec.c
libavcodec/wmadec.c
+73
-4
未找到文件。
libavcodec/wmadec.c
浏览文件 @
c0d1463d
...
...
@@ -240,6 +240,74 @@ static void decode_exp_lsp(WMACodecContext *s, int ch)
s
->
block_len
,
lsp_coefs
);
}
/** pow(10, i / 16.0) for i in -60..67 */
static
const
float
pow_tab
[
128
]
=
{
1.7782794100389e-04
,
2.0535250264571e-04
,
2.3713737056617e-04
,
2.7384196342644e-04
,
3.1622776601684e-04
,
3.6517412725484e-04
,
4.2169650342858e-04
,
4.8696752516586e-04
,
5.6234132519035e-04
,
6.4938163157621e-04
,
7.4989420933246e-04
,
8.6596432336006e-04
,
1.0000000000000e-03
,
1.1547819846895e-03
,
1.3335214321633e-03
,
1.5399265260595e-03
,
1.7782794100389e-03
,
2.0535250264571e-03
,
2.3713737056617e-03
,
2.7384196342644e-03
,
3.1622776601684e-03
,
3.6517412725484e-03
,
4.2169650342858e-03
,
4.8696752516586e-03
,
5.6234132519035e-03
,
6.4938163157621e-03
,
7.4989420933246e-03
,
8.6596432336006e-03
,
1.0000000000000e-02
,
1.1547819846895e-02
,
1.3335214321633e-02
,
1.5399265260595e-02
,
1.7782794100389e-02
,
2.0535250264571e-02
,
2.3713737056617e-02
,
2.7384196342644e-02
,
3.1622776601684e-02
,
3.6517412725484e-02
,
4.2169650342858e-02
,
4.8696752516586e-02
,
5.6234132519035e-02
,
6.4938163157621e-02
,
7.4989420933246e-02
,
8.6596432336007e-02
,
1.0000000000000e-01
,
1.1547819846895e-01
,
1.3335214321633e-01
,
1.5399265260595e-01
,
1.7782794100389e-01
,
2.0535250264571e-01
,
2.3713737056617e-01
,
2.7384196342644e-01
,
3.1622776601684e-01
,
3.6517412725484e-01
,
4.2169650342858e-01
,
4.8696752516586e-01
,
5.6234132519035e-01
,
6.4938163157621e-01
,
7.4989420933246e-01
,
8.6596432336007e-01
,
1.0000000000000e+00
,
1.1547819846895e+00
,
1.3335214321633e+00
,
1.5399265260595e+00
,
1.7782794100389e+00
,
2.0535250264571e+00
,
2.3713737056617e+00
,
2.7384196342644e+00
,
3.1622776601684e+00
,
3.6517412725484e+00
,
4.2169650342858e+00
,
4.8696752516586e+00
,
5.6234132519035e+00
,
6.4938163157621e+00
,
7.4989420933246e+00
,
8.6596432336007e+00
,
1.0000000000000e+01
,
1.1547819846895e+01
,
1.3335214321633e+01
,
1.5399265260595e+01
,
1.7782794100389e+01
,
2.0535250264571e+01
,
2.3713737056617e+01
,
2.7384196342644e+01
,
3.1622776601684e+01
,
3.6517412725484e+01
,
4.2169650342858e+01
,
4.8696752516586e+01
,
5.6234132519035e+01
,
6.4938163157621e+01
,
7.4989420933246e+01
,
8.6596432336007e+01
,
1.0000000000000e+02
,
1.1547819846895e+02
,
1.3335214321633e+02
,
1.5399265260595e+02
,
1.7782794100389e+02
,
2.0535250264571e+02
,
2.3713737056617e+02
,
2.7384196342644e+02
,
3.1622776601684e+02
,
3.6517412725484e+02
,
4.2169650342858e+02
,
4.8696752516586e+02
,
5.6234132519035e+02
,
6.4938163157621e+02
,
7.4989420933246e+02
,
8.6596432336007e+02
,
1.0000000000000e+03
,
1.1547819846895e+03
,
1.3335214321633e+03
,
1.5399265260595e+03
,
1.7782794100389e+03
,
2.0535250264571e+03
,
2.3713737056617e+03
,
2.7384196342644e+03
,
3.1622776601684e+03
,
3.6517412725484e+03
,
4.2169650342858e+03
,
4.8696752516586e+03
,
5.6234132519035e+03
,
6.4938163157621e+03
,
7.4989420933246e+03
,
8.6596432336007e+03
,
1.0000000000000e+04
,
1.1547819846895e+04
,
1.3335214321633e+04
,
1.5399265260595e+04
,
};
/**
* decode exponents coded with VLC codes
*/
...
...
@@ -248,6 +316,7 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
int
last_exp
,
n
,
code
;
const
uint16_t
*
ptr
;
float
v
,
*
q
,
max_scale
,
*
q_end
;
const
float
*
ptab
=
pow_tab
+
60
;
ptr
=
s
->
exponent_bands
[
s
->
frame_len_bits
-
s
->
block_len_bits
];
q
=
s
->
exponents
[
ch
];
...
...
@@ -255,8 +324,7 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
max_scale
=
0
;
if
(
s
->
version
==
1
)
{
last_exp
=
get_bits
(
&
s
->
gb
,
5
)
+
10
;
/* XXX: use a table */
v
=
pow
(
10
,
last_exp
*
(
1
.
0
/
16
.
0
));
v
=
ptab
[
last_exp
];
max_scale
=
v
;
n
=
*
ptr
++
;
do
{
...
...
@@ -271,8 +339,9 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
return
-
1
;
/* NOTE: this offset is the same as MPEG4 AAC ! */
last_exp
+=
code
-
60
;
/* XXX: use a table */
v
=
pow
(
10
,
last_exp
*
(
1
.
0
/
16
.
0
));
if
((
unsigned
)
last_exp
+
60
>
FF_ARRAY_ELEMS
(
pow_tab
))
return
-
1
;
v
=
ptab
[
last_exp
];
if
(
v
>
max_scale
)
max_scale
=
v
;
n
=
*
ptr
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录