Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
2308a3c7
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,发现更多精彩内容 >>
提交
2308a3c7
编写于
5月 01, 2018
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avfilter/af_biquads: change clipping detection from global to channel
Signed-off-by:
N
Paul B Mahol
<
onemda@gmail.com
>
上级
5bfc433a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
13 deletion
+17
-13
libavfilter/af_biquads.c
libavfilter/af_biquads.c
+17
-13
未找到文件。
libavfilter/af_biquads.c
浏览文件 @
2308a3c7
...
...
@@ -95,6 +95,7 @@ enum WidthType {
typedef
struct
ChanCache
{
double
i1
,
i2
;
double
o1
,
o2
;
int
clippings
;
}
ChanCache
;
typedef
struct
BiquadsContext
{
...
...
@@ -114,12 +115,11 @@ typedef struct BiquadsContext {
double
b0
,
b1
,
b2
;
ChanCache
*
cache
;
int
clippings
;
int
block_align
;
void
(
*
filter
)(
struct
BiquadsContext
*
s
,
const
void
*
ibuf
,
void
*
obuf
,
int
len
,
double
*
i1
,
double
*
i2
,
double
*
o1
,
double
*
o2
,
double
b0
,
double
b1
,
double
b2
,
double
a1
,
double
a2
);
double
b0
,
double
b1
,
double
b2
,
double
a1
,
double
a2
,
int
*
clippings
);
}
BiquadsContext
;
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
...
...
@@ -176,7 +176,7 @@ static void biquad_## name (BiquadsContext *s, \
double *in1, double *in2, \
double *out1, double *out2, \
double b0, double b1, double b2, \
double a1, double a2
)
\
double a1, double a2
, int *clippings)
\
{ \
const type *ibuf = input; \
type *obuf = output; \
...
...
@@ -192,10 +192,10 @@ static void biquad_## name (BiquadsContext *s, \
o2 = i2 * b2 + i1 * b1 + ibuf[i] * b0 + o2 * a2 + o1 * a1; \
i2 = ibuf[i]; \
if (need_clipping && o2 < min) { \
s->clippings
++; \
(*clippings)
++; \
obuf[i] = min; \
} else if (need_clipping && o2 > max) { \
s->clippings
++; \
(*clippings)
++; \
obuf[i] = max; \
} else { \
obuf[i] = o2; \
...
...
@@ -204,10 +204,10 @@ static void biquad_## name (BiquadsContext *s, \
o1 = i1 * b2 + i2 * b1 + ibuf[i] * b0 + o1 * a2 + o2 * a1; \
i1 = ibuf[i]; \
if (need_clipping && o1 < min) { \
s->clippings
++; \
(*clippings)
++; \
obuf[i] = min; \
} else if (need_clipping && o1 > max) { \
s->clippings
++; \
(*clippings)
++; \
obuf[i] = max; \
} else { \
obuf[i] = o1; \
...
...
@@ -220,10 +220,10 @@ static void biquad_## name (BiquadsContext *s, \
o2 = o1; \
o1 = o0; \
if (need_clipping && o0 < min) { \
s->clippings
++; \
(*clippings)
++; \
obuf[i] = min; \
} else if (need_clipping && o0 > max) { \
s->clippings
++; \
(*clippings)
++; \
obuf[i] = max; \
} else { \
obuf[i] = o0; \
...
...
@@ -446,12 +446,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
out_buf
->
extended_data
[
ch
],
nb_samples
,
&
s
->
cache
[
ch
].
i1
,
&
s
->
cache
[
ch
].
i2
,
&
s
->
cache
[
ch
].
o1
,
&
s
->
cache
[
ch
].
o2
,
s
->
b0
,
s
->
b1
,
s
->
b2
,
s
->
a1
,
s
->
a2
);
s
->
b0
,
s
->
b1
,
s
->
b2
,
s
->
a1
,
s
->
a2
,
&
s
->
cache
[
ch
].
clippings
);
}
if
(
s
->
clippings
>
0
)
av_log
(
ctx
,
AV_LOG_WARNING
,
"clipping %d times. Please reduce gain.
\n
"
,
s
->
clippings
);
s
->
clippings
=
0
;
for
(
ch
=
0
;
ch
<
outlink
->
channels
;
ch
++
)
{
if
(
s
->
cache
[
ch
].
clippings
>
0
)
av_log
(
ctx
,
AV_LOG_WARNING
,
"Channel %d clipping %d times. Please reduce gain.
\n
"
,
ch
,
s
->
cache
[
ch
].
clippings
);
s
->
cache
[
ch
].
clippings
=
0
;
}
if
(
buf
!=
out_buf
)
av_frame_free
(
&
buf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录