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
74d4fd08
Commit
74d4fd08
authored
Jul 10, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_showfreqs: make selecting window size simpler
The previous solution was very bad.
parent
57a2688f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
32 deletions
+5
-32
filters.texi
doc/filters.texi
+2
-18
avf_showfreqs.c
libavfilter/avf_showfreqs.c
+3
-14
No files found.
doc/filters.texi
View file @
74d4fd08
...
...
@@ -22346,25 +22346,9 @@ Reverse logarithmic scale.
Default is @code{lin}.
@item win_size
Set window size.
Set window size.
Allowed range is from 16 to 65536.
It accepts the following values:
@table @samp
@item w16
@item w32
@item w64
@item w128
@item w256
@item w512
@item w1024
@item w2048
@item w4096
@item w8192
@item w16384
@item w32768
@item w65536
@end table
Default is @code{w2048}
Default is @code{2048}
@item win_func
Set windowing function.
...
...
libavfilter/avf_showfreqs.c
View file @
74d4fd08
...
...
@@ -46,6 +46,7 @@ typedef struct ShowFreqsContext {
int
w
,
h
;
int
mode
;
int
cmode
;
int
fft_size
;
int
fft_bits
;
int
ascale
,
fscale
;
int
avg
;
...
...
@@ -85,20 +86,7 @@ static const AVOption showfreqs_options[] = {
{
"lin"
,
"linear"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FS_LINEAR
},
0
,
0
,
FLAGS
,
"fscale"
},
{
"log"
,
"logarithmic"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FS_LOG
},
0
,
0
,
FLAGS
,
"fscale"
},
{
"rlog"
,
"reverse logarithmic"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FS_RLOG
},
0
,
0
,
FLAGS
,
"fscale"
},
{
"win_size"
,
"set window size"
,
OFFSET
(
fft_bits
),
AV_OPT_TYPE_INT
,
{.
i64
=
11
},
4
,
16
,
FLAGS
,
"fft"
},
{
"w16"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
4
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w32"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
5
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w64"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
6
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w128"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
7
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w256"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
8
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w512"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
9
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w1024"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
10
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w2048"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
11
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w4096"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
12
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w8192"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
13
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w16384"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
14
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w32768"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
15
},
0
,
0
,
FLAGS
,
"fft"
},
{
"w65536"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
16
},
0
,
0
,
FLAGS
,
"fft"
},
{
"win_size"
,
"set window size"
,
OFFSET
(
fft_size
),
AV_OPT_TYPE_INT
,
{.
i64
=
2048
},
16
,
65536
,
FLAGS
},
{
"win_func"
,
"set window function"
,
OFFSET
(
win_func
),
AV_OPT_TYPE_INT
,
{.
i64
=
WFUNC_HANNING
},
0
,
NB_WFUNC
-
1
,
FLAGS
,
"win_func"
},
{
"rect"
,
"Rectangular"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_RECT
},
0
,
0
,
FLAGS
,
"win_func"
},
{
"bartlett"
,
"Bartlett"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WFUNC_BARTLETT
},
0
,
0
,
FLAGS
,
"win_func"
},
...
...
@@ -180,6 +168,7 @@ static int config_output(AVFilterLink *outlink)
float
overlap
;
int
i
;
s
->
fft_bits
=
av_log2
(
s
->
fft_size
);
s
->
nb_freq
=
1
<<
(
s
->
fft_bits
-
1
);
s
->
win_size
=
s
->
nb_freq
<<
1
;
av_audio_fifo_free
(
s
->
fifo
);
...
...
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