Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
1206a10d
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,发现更多精彩内容 >>
提交
1206a10d
编写于
5月 23, 2020
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avfilter/af_biquads: implement 1st order allpass
上级
f3068be1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
6 deletion
+25
-6
doc/filters.texi
doc/filters.texi
+3
-0
libavfilter/af_biquads.c
libavfilter/af_biquads.c
+22
-6
未找到文件。
doc/filters.texi
浏览文件 @
1206a10d
...
@@ -1568,6 +1568,9 @@ Specify which channels to filter, by default all available are filtered.
...
@@ -1568,6 +1568,9 @@ Specify which channels to filter, by default all available are filtered.
@item normalize, n
@item normalize, n
Normalize biquad coefficients, by default is disabled.
Normalize biquad coefficients, by default is disabled.
Enabling it will normalize magnitude response at DC to 0dB.
Enabling it will normalize magnitude response at DC to 0dB.
@item order, o
Set the filter order, can be 1 or 2. Default is 2.
@end table
@end table
@subsection Commands
@subsection Commands
...
...
libavfilter/af_biquads.c
浏览文件 @
1206a10d
...
@@ -113,6 +113,7 @@ typedef struct BiquadsContext {
...
@@ -113,6 +113,7 @@ typedef struct BiquadsContext {
double
mix
;
double
mix
;
uint64_t
channels
;
uint64_t
channels
;
int
normalize
;
int
normalize
;
int
order
;
double
a0
,
a1
,
a2
;
double
a0
,
a1
,
a2
;
double
b0
,
b1
,
b2
;
double
b0
,
b1
,
b2
;
...
@@ -264,6 +265,7 @@ static int config_filter(AVFilterLink *outlink, int reset)
...
@@ -264,6 +265,7 @@ static int config_filter(AVFilterLink *outlink, int reset)
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
double
A
=
ff_exp10
(
s
->
gain
/
40
);
double
A
=
ff_exp10
(
s
->
gain
/
40
);
double
w0
=
2
*
M_PI
*
s
->
frequency
/
inlink
->
sample_rate
;
double
w0
=
2
*
M_PI
*
s
->
frequency
/
inlink
->
sample_rate
;
double
K
=
tan
(
w0
/
2
.);
double
alpha
,
beta
;
double
alpha
,
beta
;
if
(
w0
>
M_PI
)
{
if
(
w0
>
M_PI
)
{
...
@@ -389,12 +391,24 @@ static int config_filter(AVFilterLink *outlink, int reset)
...
@@ -389,12 +391,24 @@ static int config_filter(AVFilterLink *outlink, int reset)
}
}
break
;
break
;
case
allpass
:
case
allpass
:
s
->
a0
=
1
+
alpha
;
switch
(
s
->
order
)
{
s
->
a1
=
-
2
*
cos
(
w0
);
case
1
:
s
->
a2
=
1
-
alpha
;
s
->
a0
=
1
.;
s
->
b0
=
1
-
alpha
;
s
->
a1
=
-
(
1
.
-
K
)
/
(
1
.
+
K
);
s
->
b1
=
-
2
*
cos
(
w0
);
s
->
a2
=
0
.;
s
->
b2
=
1
+
alpha
;
s
->
b0
=
s
->
a1
;
s
->
b1
=
s
->
a0
;
s
->
b2
=
0
.;
break
;
case
2
:
s
->
a0
=
1
+
alpha
;
s
->
a1
=
-
2
*
cos
(
w0
);
s
->
a2
=
1
-
alpha
;
s
->
b0
=
1
-
alpha
;
s
->
b1
=
-
2
*
cos
(
w0
);
s
->
b2
=
1
+
alpha
;
break
;
}
break
;
break
;
default:
default:
av_assert0
(
0
);
av_assert0
(
0
);
...
@@ -773,6 +787,8 @@ static const AVOption allpass_options[] = {
...
@@ -773,6 +787,8 @@ static const AVOption allpass_options[] = {
{
"c"
,
"set channels to filter"
,
OFFSET
(
channels
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=-
1
},
INT64_MIN
,
INT64_MAX
,
FLAGS
},
{
"c"
,
"set channels to filter"
,
OFFSET
(
channels
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=-
1
},
INT64_MIN
,
INT64_MAX
,
FLAGS
},
{
"normalize"
,
"normalize coefficients"
,
OFFSET
(
normalize
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"normalize"
,
"normalize coefficients"
,
OFFSET
(
normalize
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"n"
,
"normalize coefficients"
,
OFFSET
(
normalize
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"n"
,
"normalize coefficients"
,
OFFSET
(
normalize
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"order"
,
"set filter order"
,
OFFSET
(
order
),
AV_OPT_TYPE_INT
,
{.
i64
=
2
},
1
,
2
,
FLAGS
},
{
"o"
,
"set filter order"
,
OFFSET
(
order
),
AV_OPT_TYPE_INT
,
{.
i64
=
2
},
1
,
2
,
FLAGS
},
{
NULL
}
{
NULL
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录