Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c36e72ed
Commit
c36e72ed
authored
Nov 22, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_aiir: check for stability
parent
1b78da44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
af_aiir.c
libavfilter/af_aiir.c
+25
-3
No files found.
libavfilter/af_aiir.c
View file @
c36e72ed
...
@@ -596,9 +596,9 @@ static int decompose_zp2biquads(AVFilterContext *ctx, int channels)
...
@@ -596,9 +596,9 @@ static int decompose_zp2biquads(AVFilterContext *ctx, int channels)
iir
->
biquads
[
current_biquad
].
a0
=
1
.
0
;
iir
->
biquads
[
current_biquad
].
a0
=
1
.
0
;
iir
->
biquads
[
current_biquad
].
a1
=
a
[
2
]
/
a
[
4
];
iir
->
biquads
[
current_biquad
].
a1
=
a
[
2
]
/
a
[
4
];
iir
->
biquads
[
current_biquad
].
a2
=
a
[
0
]
/
a
[
4
];
iir
->
biquads
[
current_biquad
].
a2
=
a
[
0
]
/
a
[
4
];
iir
->
biquads
[
current_biquad
].
b0
=
b
[
4
]
/
a
[
4
]
*
(
current_biquad
?
1
.
0
:
iir
->
g
);
iir
->
biquads
[
current_biquad
].
b0
=
(
b
[
4
]
/
a
[
4
])
*
(
current_biquad
?
1
.
0
:
iir
->
g
);
iir
->
biquads
[
current_biquad
].
b1
=
b
[
2
]
/
a
[
4
]
*
(
current_biquad
?
1
.
0
:
iir
->
g
);
iir
->
biquads
[
current_biquad
].
b1
=
(
b
[
2
]
/
a
[
4
])
*
(
current_biquad
?
1
.
0
:
iir
->
g
);
iir
->
biquads
[
current_biquad
].
b2
=
b
[
0
]
/
a
[
4
]
*
(
current_biquad
?
1
.
0
:
iir
->
g
);
iir
->
biquads
[
current_biquad
].
b2
=
(
b
[
0
]
/
a
[
4
])
*
(
current_biquad
?
1
.
0
:
iir
->
g
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"a=%f %f %f:b=%f %f %f
\n
"
,
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"a=%f %f %f:b=%f %f %f
\n
"
,
iir
->
biquads
[
current_biquad
].
a0
,
iir
->
biquads
[
current_biquad
].
a0
,
...
@@ -669,6 +669,25 @@ static void convert_pd2zp(AVFilterContext *ctx, int channels)
...
@@ -669,6 +669,25 @@ static void convert_pd2zp(AVFilterContext *ctx, int channels)
}
}
}
}
static
void
check_stability
(
AVFilterContext
*
ctx
,
int
channels
)
{
AudioIIRContext
*
s
=
ctx
->
priv
;
int
ch
;
for
(
ch
=
0
;
ch
<
channels
;
ch
++
)
{
IIRChannel
*
iir
=
&
s
->
iir
[
ch
];
for
(
int
n
=
0
;
n
<
iir
->
nb_ab
[
0
];
n
++
)
{
double
pr
=
hypot
(
iir
->
ab
[
0
][
2
*
n
],
iir
->
ab
[
0
][
2
*
n
+
1
]);
if
(
pr
>=
1
.)
{
av_log
(
ctx
,
AV_LOG_WARNING
,
"pole %d at channel %d is unstable
\n
"
,
n
,
ch
);
break
;
}
}
}
}
static
void
drawtext
(
AVFrame
*
pic
,
int
x
,
int
y
,
const
char
*
txt
,
uint32_t
color
)
static
void
drawtext
(
AVFrame
*
pic
,
int
x
,
int
y
,
const
char
*
txt
,
uint32_t
color
)
{
{
const
uint8_t
*
font
;
const
uint8_t
*
font
;
...
@@ -885,6 +904,9 @@ static int config_output(AVFilterLink *outlink)
...
@@ -885,6 +904,9 @@ static int config_output(AVFilterLink *outlink)
}
else
if
(
s
->
format
==
3
)
{
}
else
if
(
s
->
format
==
3
)
{
convert_pd2zp
(
ctx
,
inlink
->
channels
);
convert_pd2zp
(
ctx
,
inlink
->
channels
);
}
}
if
(
s
->
format
>
0
)
{
check_stability
(
ctx
,
inlink
->
channels
);
}
av_frame_free
(
&
s
->
video
);
av_frame_free
(
&
s
->
video
);
if
(
s
->
response
)
{
if
(
s
->
response
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment