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
40ac6224
Commit
40ac6224
authored
Oct 27, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/window_func: add bohman window
parent
59a35fe1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
0 deletions
+16
-0
filters.texi
doc/filters.texi
+3
-0
asrc_hilbert.c
libavfilter/asrc_hilbert.c
+1
-0
avf_showfreqs.c
libavfilter/avf_showfreqs.c
+1
-0
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+2
-0
window_func.h
libavfilter/window_func.h
+9
-0
No files found.
doc/filters.texi
View file @
40ac6224
...
...
@@ -20851,6 +20851,7 @@ It accepts the following values:
@item cauchy
@item parzen
@item poisson
@item bohman
@end table
Default is @code{hanning}.
...
...
@@ -21009,6 +21010,7 @@ It accepts the following values:
@item cauchy
@item parzen
@item poisson
@item bohman
@end table
Default value is @code{hann}.
...
...
@@ -21172,6 +21174,7 @@ It accepts the following values:
@item cauchy
@item parzen
@item poisson
@item bohman
@end table
Default value is @code{hann}.
...
...
libavfilter/asrc_hilbert.c
View file @
40ac6224
...
...
@@ -67,6 +67,7 @@ static const AVOption hilbert_options[] = {
{
"cauchy"
,
"Cauchy"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_CAUCHY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"parzen"
,
"Parzen"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_PARZEN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"poisson"
,
"Poisson"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_POISSON
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"bohman"
,
"Bohman"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_BOHMAN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
NULL
}
};
...
...
libavfilter/avf_showfreqs.c
View file @
40ac6224
...
...
@@ -118,6 +118,7 @@ static const AVOption showfreqs_options[] = {
{
"cauchy"
,
"Cauchy"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_CAUCHY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"parzen"
,
"Parzen"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_PARZEN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"poisson"
,
"Poisson"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_POISSON
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"bohman"
,
"Bohman"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_BOHMAN
}
,
0
,
0
,
FLAGS
,
"win_func"
},
{
"overlap"
,
"set window overlap"
,
OFFSET
(
overlap
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
.},
0
.,
1
.,
FLAGS
},
{
"averaging"
,
"set time averaging"
,
OFFSET
(
avg
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
INT32_MAX
,
FLAGS
},
{
"colors"
,
"set channels colors"
,
OFFSET
(
colors
),
AV_OPT_TYPE_STRING
,
{.
str
=
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
},
0
,
0
,
FLAGS
},
...
...
libavfilter/avf_showspectrum.c
View file @
40ac6224
...
...
@@ -152,6 +152,7 @@ static const AVOption showspectrum_options[] = {
{
"cauchy"
,
"Cauchy"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_CAUCHY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"parzen"
,
"Parzen"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_PARZEN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"poisson"
,
"Poisson"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_POISSON
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"bohman"
,
"Bohman"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_BOHMAN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"orientation"
,
"set orientation"
,
OFFSET
(
orientation
),
AV_OPT_TYPE_INT
,
{.
i64
=
VERTICAL
},
0
,
NB_ORIENTATIONS
-
1
,
FLAGS
,
"orientation"
},
{
"vertical"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
VERTICAL
},
0
,
0
,
FLAGS
,
"orientation"
},
{
"horizontal"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
HORIZONTAL
},
0
,
0
,
FLAGS
,
"orientation"
},
...
...
@@ -1425,6 +1426,7 @@ static const AVOption showspectrumpic_options[] = {
{
"cauchy"
,
"Cauchy"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_CAUCHY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"parzen"
,
"Parzen"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_PARZEN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"poisson"
,
"Poisson"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_POISSON
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"bohman"
,
"Bohman"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_BOHMAN
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"orientation"
,
"set orientation"
,
OFFSET
(
orientation
),
AV_OPT_TYPE_INT
,
{.
i64
=
VERTICAL
},
0
,
NB_ORIENTATIONS
-
1
,
FLAGS
,
"orientation"
},
{
"vertical"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
VERTICAL
},
0
,
0
,
FLAGS
,
"orientation"
},
{
"horizontal"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
HORIZONTAL
},
0
,
0
,
FLAGS
,
"orientation"
},
...
...
libavfilter/window_func.h
View file @
40ac6224
...
...
@@ -30,6 +30,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
,
NB_WFUNC
};
static
inline
void
generate_window_func
(
float
*
lut
,
int
N
,
int
win_func
,
...
...
@@ -182,6 +183,14 @@ static inline void generate_window_func(float *lut, int N, int win_func,
}
*
overlap
=
0
.
75
;
break
;
case
WFUNC_BOHMAN
:
for
(
n
=
0
;
n
<
N
;
n
++
)
{
double
x
=
2
*
((
n
/
(
double
)(
N
-
1
)))
-
1
.;
lut
[
n
]
=
(
1
-
fabs
(
x
))
*
cos
(
M_PI
*
fabs
(
x
))
+
1
.
/
M_PI
*
sin
(
M_PI
*
fabs
(
x
));
}
*
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