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
9c8b2408
Commit
9c8b2408
authored
Nov 20, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/showspectrum: add blackman window.
parent
3e69f7c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
filters.texi
doc/filters.texi
+2
-0
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+7
-1
No files found.
doc/filters.texi
View file @
9c8b2408
...
...
@@ -9782,6 +9782,8 @@ No samples pre-processing (do not expect this to be faster)
Hann window
@item hamming
Hamming window
@item blackman
Blackman window
@end table
Default value is @code{hann}.
...
...
libavfilter/avf_showspectrum.c
View file @
9c8b2408
...
...
@@ -37,7 +37,7 @@
enum
DisplayMode
{
COMBINED
,
SEPARATE
,
NB_MODES
};
enum
DisplayScale
{
LINEAR
,
SQRT
,
CBRT
,
LOG
,
NB_SCALES
};
enum
ColorMode
{
CHANNEL
,
INTENSITY
,
NB_CLMODES
};
enum
WindowFunc
{
WFUNC_NONE
,
WFUNC_HANN
,
WFUNC_HAMMING
,
NB_WFUNC
};
enum
WindowFunc
{
WFUNC_NONE
,
WFUNC_HANN
,
WFUNC_HAMMING
,
WFUNC_BLACKMAN
,
NB_WFUNC
};
typedef
struct
{
const
AVClass
*
class
;
...
...
@@ -84,6 +84,7 @@ static const AVOption showspectrum_options[] = {
{
"win_func"
,
"set window function"
,
OFFSET
(
win_func
),
AV_OPT_TYPE_INT
,
{.
i64
=
WFUNC_HANN
},
0
,
NB_WFUNC
-
1
,
FLAGS
,
"win_func"
},
{
"hann"
,
"Hann window"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_HANN
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"win_func"
},
{
"hamming"
,
"Hamming window"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_HAMMING
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"win_func"
},
{
"blackman"
,
"Blackman window"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_BLACKMAN
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"win_func"
},
{
NULL
}
};
...
...
@@ -219,6 +220,11 @@ static int config_output(AVFilterLink *outlink)
for
(
i
=
0
;
i
<
win_size
;
i
++
)
s
->
window_func_lut
[
i
]
=
.
54
f
-
.
46
f
*
cos
(
2
*
M_PI
*
i
/
(
win_size
-
1
));
break
;
case
WFUNC_BLACKMAN
:
{
for
(
i
=
0
;
i
<
win_size
;
i
++
)
s
->
window_func_lut
[
i
]
=
.
42
f
-
.
5
f
*
cos
(
2
*
M_PI
*
i
/
(
win_size
-
1
))
+
.
08
f
*
cos
(
4
*
M_PI
*
i
/
(
win_size
-
1
));
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