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
b438c202
Commit
b438c202
authored
Aug 16, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/window_func: add cauchy, parzen and poisson window function
parent
46bfc156
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
1 deletion
+64
-1
filters.texi
doc/filters.texi
+9
-0
avf_showfreqs.c
libavfilter/avf_showfreqs.c
+3
-0
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+6
-0
window_func.c
libavfilter/window_func.c
+44
-0
window_func.h
libavfilter/window_func.h
+2
-1
No files found.
doc/filters.texi
View file @
b438c202
...
...
@@ -16519,6 +16519,9 @@ It accepts the following values:
@item gauss
@item tukey
@item dolph
@item cauchy
@item parzen
@item poisson
@end table
Default is @code{hanning}.
...
...
@@ -16667,6 +16670,9 @@ It accepts the following values:
@item gauss
@item tukey
@item dolph
@item cauchy
@item parzen
@item poisson
@end table
Default value is @code{hann}.
...
...
@@ -16811,6 +16817,9 @@ It accepts the following values:
@item gauss
@item tukey
@item dolph
@item cauchy
@item parzen
@item poisson
@end table
Default value is @code{hann}.
...
...
libavfilter/avf_showfreqs.c
View file @
b438c202
...
...
@@ -113,6 +113,9 @@ static const AVOption showfreqs_options[] = {
{
"gauss"
,
"Gauss"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_GAUSS
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"tukey"
,
"Tukey"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_TUKEY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"dolph"
,
"Dolph-Chebyshev"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_DOLPH
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"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"
},
{
"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 @
b438c202
...
...
@@ -135,6 +135,9 @@ static const AVOption showspectrum_options[] = {
{
"gauss"
,
"Gauss"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_GAUSS
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"tukey"
,
"Tukey"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_TUKEY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"dolph"
,
"Dolph-Chebyshev"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_DOLPH
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"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"
},
{
"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"
},
...
...
@@ -967,6 +970,9 @@ static const AVOption showspectrumpic_options[] = {
{
"gauss"
,
"Gauss"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_GAUSS
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"tukey"
,
"Tukey"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_TUKEY
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"dolph"
,
"Dolph-Chebyshev"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_DOLPH
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"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"
},
{
"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.c
View file @
b438c202
...
...
@@ -128,6 +128,50 @@ void ff_generate_window_func(float *lut, int N, int win_func, float *overlap)
}
*
overlap
=
0
.
5
;}
break
;
case
WFUNC_CAUCHY
:
for
(
n
=
0
;
n
<
N
;
n
++
)
{
double
x
=
2
*
((
n
/
(
double
)(
N
-
1
))
-
.
5
);
if
(
x
<=
-
.
5
||
x
>=
.
5
)
{
lut
[
n
]
=
0
;
}
else
{
lut
[
n
]
=
FFMIN
(
1
,
fabs
(
1
/
(
1
+
4
*
16
*
x
*
x
)));
}
}
*
overlap
=
0
.
75
;
break
;
case
WFUNC_PARZEN
:
for
(
n
=
0
;
n
<
N
;
n
++
)
{
double
x
=
2
*
((
n
/
(
double
)(
N
-
1
))
-
.
5
);
if
(
x
>
0
.
25
&&
x
<=
0
.
5
)
{
lut
[
n
]
=
-
2
*
powf
(
-
1
+
2
*
x
,
3
);
}
else
if
(
x
>=
-
.
5
&&
x
<
-
.
25
)
{
lut
[
n
]
=
2
*
powf
(
1
+
2
*
x
,
3
);
}
else
if
(
x
>=
-
.
25
&&
x
<
0
)
{
lut
[
n
]
=
1
-
24
*
x
*
x
-
48
*
x
*
x
*
x
;
}
else
if
(
x
>=
0
&&
x
<=
.
25
)
{
lut
[
n
]
=
1
-
24
*
x
*
x
+
48
*
x
*
x
*
x
;
}
else
{
lut
[
n
]
=
0
;
}
}
*
overlap
=
0
.
75
;
break
;
case
WFUNC_POISSON
:
for
(
n
=
0
;
n
<
N
;
n
++
)
{
double
x
=
2
*
((
n
/
(
double
)(
N
-
1
))
-
.
5
);
if
(
x
>=
0
&&
x
<=
.
5
)
{
lut
[
n
]
=
exp
(
-
6
*
x
);
}
else
if
(
x
<
0
&&
x
>=
-
.
5
)
{
lut
[
n
]
=
exp
(
6
*
x
);
}
else
{
lut
[
n
]
=
0
;
}
}
*
overlap
=
0
.
75
;
break
;
default:
av_assert0
(
0
);
}
...
...
libavfilter/window_func.h
View file @
b438c202
...
...
@@ -26,7 +26,8 @@ enum WindowFunc { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN,
WFUNC_BARTLETT
,
WFUNC_WELCH
,
WFUNC_FLATTOP
,
WFUNC_BHARRIS
,
WFUNC_BNUTTALL
,
WFUNC_SINE
,
WFUNC_NUTTALL
,
WFUNC_BHANN
,
WFUNC_LANCZOS
,
WFUNC_GAUSS
,
WFUNC_TUKEY
,
WFUNC_DOLPH
,
NB_WFUNC
};
WFUNC_DOLPH
,
WFUNC_CAUCHY
,
WFUNC_PARZEN
,
WFUNC_POISSON
,
NB_WFUNC
};
void
ff_generate_window_func
(
float
*
lut
,
int
N
,
int
win_func
,
float
*
overlap
);
...
...
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