Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
754d52cf
Commit
754d52cf
authored
Oct 20, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/window_func: add kaiser window
parent
37efcb47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
filters.texi
doc/filters.texi
+7
-0
window_func.h
libavfilter/window_func.h
+25
-2
No files found.
doc/filters.texi
View file @
754d52cf
...
...
@@ -1534,6 +1534,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default is @code{hann}.
...
...
@@ -2960,6 +2961,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default is @code{hann}.
...
...
@@ -6743,6 +6745,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default is @code{hann}.
...
...
@@ -29255,6 +29258,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default is @code{hanning}.
...
...
@@ -29341,6 +29345,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default value is @code{hann}.
...
...
@@ -29505,6 +29510,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default value is @code{hann}.
...
...
@@ -29702,6 +29708,7 @@ It accepts the following values:
@item parzen
@item poisson
@item bohman
@item kaiser
@end table
Default value is @code{hann}.
...
...
libavfilter/window_func.h
View file @
754d52cf
...
...
@@ -31,7 +31,7 @@ enum WindowFunc { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN,
WFUNC_BHARRIS
,
WFUNC_BNUTTALL
,
WFUNC_SINE
,
WFUNC_NUTTALL
,
WFUNC_BHANN
,
WFUNC_LANCZOS
,
WFUNC_GAUSS
,
WFUNC_TUKEY
,
WFUNC_DOLPH
,
WFUNC_CAUCHY
,
WFUNC_PARZEN
,
WFUNC_POISSON
,
WFUNC_BOHMAN
,
WFUNC_BOHMAN
,
WFUNC_KAISER
,
NB_WFUNC
};
#define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func) \
...
...
@@ -56,7 +56,22 @@ enum WindowFunc { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN,
{ "cauchy", "Cauchy", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_CAUCHY}, 0, 0, flag, "win_func" }, \
{ "parzen", "Parzen", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_PARZEN}, 0, 0, flag, "win_func" }, \
{ "poisson", "Poisson", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_POISSON}, 0, 0, flag, "win_func" }, \
{ "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, flag, "win_func" }
{ "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, flag, "win_func" }, \
{ "kaiser", "Kaiser", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_KAISER}, 0, 0, flag, "win_func" }
static
inline
double
get_i0
(
double
x
)
{
double
y
=
1
.
0
,
prev
=
1
.
0
,
i
=
1
.
0
;
while
(
fabs
(
prev
)
>
1e-20
)
{
double
summand
=
prev
*
x
*
x
/
(
4
*
i
*
i
);
y
+=
summand
;
prev
=
summand
;
i
++
;
}
return
y
;
}
static
inline
void
generate_window_func
(
float
*
lut
,
int
N
,
int
win_func
,
float
*
overlap
)
...
...
@@ -216,6 +231,14 @@ static inline void generate_window_func(float *lut, int N, int win_func,
}
*
overlap
=
0
.
75
;
break
;
case
WFUNC_KAISER
:
for
(
n
=
0
;
n
<
N
;
n
++
)
{
double
x
=
2
.
0
/
(
double
)(
N
-
1
);
lut
[
n
]
=
get_i0
(
12
.
*
sqrt
(
1
.
-
SQR
(
n
*
x
-
1
.)))
/
get_i0
(
12
.);
}
*
overlap
=
0
.
75
;
break
;
default:
av_assert0
(
0
);
}
...
...
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