Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
f50d9377
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,发现更多精彩内容 >>
提交
f50d9377
编写于
4月 05, 2011
作者:
N
Nathan Caldwell
提交者:
Martin Storsjö
4月 23, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aacenc: Fix whitespace after last commit.
Signed-off-by:
N
Martin Storsjö
<
martin@martin.st
>
上级
62582a69
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
10 deletion
+13
-10
libavcodec/aacpsy.c
libavcodec/aacpsy.c
+13
-10
未找到文件。
libavcodec/aacpsy.c
浏览文件 @
f50d9377
...
...
@@ -100,9 +100,9 @@ enum {
* information for single band used by 3GPP TS26.403-inspired psychoacoustic model
*/
typedef
struct
AacPsyBand
{
float
energy
;
///< band energy
float
thr
;
///< energy threshold
float
thr_quiet
;
///< threshold in quiet
float
energy
;
///< band energy
float
thr
;
///< energy threshold
float
thr_quiet
;
///< threshold in quiet
float
nz_lines
;
///< number of non-zero spectral lines
float
active_lines
;
///< number of active spectral lines
float
pe
;
///< perceptual entropy
...
...
@@ -566,43 +566,46 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
float
desired_bits
,
desired_pe
,
delta_pe
,
reduction
,
spread_en
[
128
]
=
{
0
};
float
a
=
0
.
0
f
,
active_lines
=
0
.
0
f
,
norm_fac
=
0
.
0
f
;
float
pe
=
pctx
->
chan_bitrate
>
32000
?
0
.
0
f
:
FFMAX
(
50
.
0
f
,
100
.
0
f
-
pctx
->
chan_bitrate
*
100
.
0
f
/
32000
.
0
f
);
const
int
num_bands
=
ctx
->
num_bands
[
wi
->
num_windows
==
8
];
const
uint8_t
*
band_sizes
=
ctx
->
bands
[
wi
->
num_windows
==
8
];
AacPsyCoeffs
*
coeffs
=
pctx
->
psy_coef
[
wi
->
num_windows
==
8
];
const
int
num_bands
=
ctx
->
num_bands
[
wi
->
num_windows
==
8
];
const
uint8_t
*
band_sizes
=
ctx
->
bands
[
wi
->
num_windows
==
8
];
AacPsyCoeffs
*
coeffs
=
pctx
->
psy_coef
[
wi
->
num_windows
==
8
];
const
float
avoid_hole_thr
=
wi
->
num_windows
==
8
?
PSY_3GPP_AH_THR_SHORT
:
PSY_3GPP_AH_THR_LONG
;
//calculate energies, initial thresholds and related values - 5.4.2 "Threshold Calculation"
for
(
w
=
0
;
w
<
wi
->
num_windows
*
16
;
w
+=
16
)
{
for
(
g
=
0
;
g
<
num_bands
;
g
++
)
{
AacPsyBand
*
band
=
&
pch
->
band
[
w
+
g
];
float
form_factor
=
0
.
0
f
;
band
->
energy
=
0
.
0
f
;
for
(
i
=
0
;
i
<
band_sizes
[
g
];
i
++
)
{
band
->
energy
+=
coefs
[
start
+
i
]
*
coefs
[
start
+
i
];
form_factor
+=
sqrtf
(
fabs
(
coefs
[
start
+
i
]));
}
band
->
thr
=
band
->
energy
*
0
.
00125
8925
f
;
band
->
thr
=
band
->
energy
*
0
.
00125
8925
f
;
band
->
nz_lines
=
form_factor
/
powf
(
band
->
energy
/
band_sizes
[
g
],
0
.
25
f
);
start
+=
band_sizes
[
g
];
start
+=
band_sizes
[
g
];
}
}
//modify thresholds and energies - spread, threshold in quiet, pre-echo control
for
(
w
=
0
;
w
<
wi
->
num_windows
*
16
;
w
+=
16
)
{
AacPsyBand
*
bands
=
&
pch
->
band
[
w
];
//5.4.2.3 "Spreading" & 5.4.3 "Spreaded Energy Calculation"
spread_en
[
0
]
=
bands
[
0
].
energy
;
for
(
g
=
1
;
g
<
num_bands
;
g
++
)
{
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
-
1
].
thr
*
coeffs
[
g
].
spread_hi
[
0
]);
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
-
1
].
thr
*
coeffs
[
g
].
spread_hi
[
0
]);
spread_en
[
w
+
g
]
=
FFMAX
(
bands
[
g
].
energy
,
spread_en
[
w
+
g
-
1
]
*
coeffs
[
g
].
spread_hi
[
1
]);
}
for
(
g
=
num_bands
-
2
;
g
>=
0
;
g
--
)
{
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
+
1
].
thr
*
coeffs
[
g
].
spread_low
[
0
]);
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
+
1
].
thr
*
coeffs
[
g
].
spread_low
[
0
]);
spread_en
[
w
+
g
]
=
FFMAX
(
spread_en
[
w
+
g
],
spread_en
[
w
+
g
+
1
]
*
coeffs
[
g
].
spread_low
[
1
]);
}
//5.4.2.4 "Threshold in quiet"
for
(
g
=
0
;
g
<
num_bands
;
g
++
)
{
AacPsyBand
*
band
=
&
bands
[
g
];
band
->
thr_quiet
=
band
->
thr
=
FFMAX
(
band
->
thr
,
coeffs
[
g
].
ath
);
//5.4.2.5 "Pre-echo control"
if
(
!
(
wi
->
window_type
[
0
]
==
LONG_STOP_SEQUENCE
||
(
wi
->
window_type
[
1
]
==
LONG_START_SEQUENCE
&&
!
w
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录