Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e2e8121e
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,发现更多精彩内容 >>
提交
e2e8121e
编写于
5月 29, 2020
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avfilter/af_aiir: add S-plane support
上级
327b5241
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
3 deletion
+41
-3
doc/filters.texi
doc/filters.texi
+2
-0
libavfilter/af_aiir.c
libavfilter/af_aiir.c
+39
-3
未找到文件。
doc/filters.texi
浏览文件 @
e2e8121e
...
...
@@ -1416,6 +1416,8 @@ Z-plane zeros/poles, cartesian (default)
Z-plane zeros/poles, polar radians
@item pd
Z-plane zeros/poles, polar degrees
@item sp
S-plane zeros/poles
@end table
@item process, r
...
...
libavfilter/af_aiir.c
浏览文件 @
e2e8121e
...
...
@@ -336,7 +336,7 @@ static int read_zp_coefficients(AVFilterContext *ctx, char *item_str, int nb_ite
return
0
;
}
static
const
char
*
format
[]
=
{
"%lf"
,
"%lf %lfi"
,
"%lf %lfr"
,
"%lf %lfd"
};
static
const
char
*
format
[]
=
{
"%lf"
,
"%lf %lfi"
,
"%lf %lfr"
,
"%lf %lfd"
,
"%lf %lfi"
};
static
int
read_channels
(
AVFilterContext
*
ctx
,
int
channels
,
uint8_t
*
item_str
,
int
ab
)
{
...
...
@@ -696,6 +696,39 @@ static void convert_pr2zp(AVFilterContext *ctx, int channels)
}
}
static
void
convert_sp2zp
(
AVFilterContext
*
ctx
,
int
channels
)
{
AudioIIRContext
*
s
=
ctx
->
priv
;
int
ch
;
for
(
ch
=
0
;
ch
<
channels
;
ch
++
)
{
IIRChannel
*
iir
=
&
s
->
iir
[
ch
];
int
n
;
for
(
n
=
0
;
n
<
iir
->
nb_ab
[
0
];
n
++
)
{
double
sr
=
iir
->
ab
[
0
][
2
*
n
];
double
si
=
iir
->
ab
[
0
][
2
*
n
+
1
];
double
snr
=
1
.
+
sr
;
double
sdr
=
1
.
-
sr
;
double
div
=
sdr
*
sdr
+
si
*
si
;
iir
->
ab
[
0
][
2
*
n
]
=
(
snr
*
sdr
-
si
*
si
)
/
div
;
iir
->
ab
[
0
][
2
*
n
+
1
]
=
(
sdr
*
si
+
snr
*
si
)
/
div
;
}
for
(
n
=
0
;
n
<
iir
->
nb_ab
[
1
];
n
++
)
{
double
sr
=
iir
->
ab
[
1
][
2
*
n
];
double
si
=
iir
->
ab
[
1
][
2
*
n
+
1
];
double
snr
=
1
.
+
sr
;
double
sdr
=
1
.
-
sr
;
double
div
=
sdr
*
sdr
+
si
*
si
;
iir
->
ab
[
1
][
2
*
n
]
=
(
snr
*
sdr
-
si
*
si
)
/
div
;
iir
->
ab
[
1
][
2
*
n
+
1
]
=
(
sdr
*
si
+
snr
*
si
)
/
div
;
}
}
}
static
void
convert_pd2zp
(
AVFilterContext
*
ctx
,
int
channels
)
{
AudioIIRContext
*
s
=
ctx
->
priv
;
...
...
@@ -996,6 +1029,8 @@ static int config_output(AVFilterLink *outlink)
convert_pr2zp
(
ctx
,
inlink
->
channels
);
}
else
if
(
s
->
format
==
3
)
{
convert_pd2zp
(
ctx
,
inlink
->
channels
);
}
else
if
(
s
->
format
==
4
)
{
convert_sp2zp
(
ctx
,
inlink
->
channels
);
}
if
(
s
->
format
>
0
)
{
check_stability
(
ctx
,
inlink
->
channels
);
...
...
@@ -1221,12 +1256,13 @@ static const AVOption aiir_options[] = {
{
"k"
,
"set channels gains"
,
OFFSET
(
g_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"1|1"
},
0
,
0
,
AF
},
{
"dry"
,
"set dry gain"
,
OFFSET
(
dry_gain
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
},
0
,
1
,
AF
},
{
"wet"
,
"set wet gain"
,
OFFSET
(
wet_gain
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
},
0
,
1
,
AF
},
{
"format"
,
"set coefficients format"
,
OFFSET
(
format
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
3
,
AF
,
"format"
},
{
"f"
,
"set coefficients format"
,
OFFSET
(
format
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
3
,
AF
,
"format"
},
{
"format"
,
"set coefficients format"
,
OFFSET
(
format
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
4
,
AF
,
"format"
},
{
"f"
,
"set coefficients format"
,
OFFSET
(
format
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
4
,
AF
,
"format"
},
{
"tf"
,
"digital transfer function"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
AF
,
"format"
},
{
"zp"
,
"Z-plane zeros/poles"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
AF
,
"format"
},
{
"pr"
,
"Z-plane zeros/poles (polar radians)"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
0
,
AF
,
"format"
},
{
"pd"
,
"Z-plane zeros/poles (polar degrees)"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
3
},
0
,
0
,
AF
,
"format"
},
{
"sp"
,
"S-plane zeros/poles"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
4
},
0
,
0
,
AF
,
"format"
},
{
"process"
,
"set kind of processing"
,
OFFSET
(
process
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
1
,
AF
,
"process"
},
{
"r"
,
"set kind of processing"
,
OFFSET
(
process
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
1
,
AF
,
"process"
},
{
"d"
,
"direct"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
AF
,
"process"
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录