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
9e569abe
Commit
9e569abe
authored
Dec 20, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_showfreqs: make it possible to split channels
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
367ffa0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
filters.texi
doc/filters.texi
+11
-0
avf_showfreqs.c
libavfilter/avf_showfreqs.c
+17
-2
No files found.
doc/filters.texi
View file @
9e569abe
...
@@ -14438,6 +14438,17 @@ Default is @code{1}, which means time averaging is disabled.
...
@@ -14438,6 +14438,17 @@ Default is @code{1}, which means time averaging is disabled.
Specify list of colors separated by space or by '|' which will be used to
Specify list of colors separated by space or by '|' which will be used to
draw channel frequencies. Unrecognized or missing colors will be replaced
draw channel frequencies. Unrecognized or missing colors will be replaced
by white color.
by white color.
@item cmode
Set channel display mode.
It accepts the following values:
@table @samp
@item combined
@item separate
@end table
Default is @code{combined}.
@end table
@end table
@section showspectrum
@section showspectrum
...
...
libavfilter/avf_showfreqs.c
View file @
9e569abe
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "internal.h"
#include "internal.h"
enum
DisplayMode
{
LINE
,
BAR
,
DOT
,
NB_MODES
};
enum
DisplayMode
{
LINE
,
BAR
,
DOT
,
NB_MODES
};
enum
ChannelMode
{
COMBINED
,
SEPARATE
,
NB_CMODES
};
enum
FrequencyScale
{
FS_LINEAR
,
FS_LOG
,
FS_RLOG
,
NB_FSCALES
};
enum
FrequencyScale
{
FS_LINEAR
,
FS_LOG
,
FS_RLOG
,
NB_FSCALES
};
enum
AmplitudeScale
{
AS_LINEAR
,
AS_SQRT
,
AS_CBRT
,
AS_LOG
,
NB_ASCALES
};
enum
AmplitudeScale
{
AS_LINEAR
,
AS_SQRT
,
AS_CBRT
,
AS_LOG
,
NB_ASCALES
};
enum
WindowFunc
{
WFUNC_RECT
,
WFUNC_HANNING
,
WFUNC_HAMMING
,
WFUNC_BLACKMAN
,
enum
WindowFunc
{
WFUNC_RECT
,
WFUNC_HANNING
,
WFUNC_HAMMING
,
WFUNC_BLACKMAN
,
...
@@ -45,6 +46,7 @@ typedef struct ShowFreqsContext {
...
@@ -45,6 +46,7 @@ typedef struct ShowFreqsContext {
const
AVClass
*
class
;
const
AVClass
*
class
;
int
w
,
h
;
int
w
,
h
;
int
mode
;
int
mode
;
int
cmode
;
int
fft_bits
;
int
fft_bits
;
int
ascale
,
fscale
;
int
ascale
,
fscale
;
int
avg
;
int
avg
;
...
@@ -115,6 +117,9 @@ static const AVOption showfreqs_options[] = {
...
@@ -115,6 +117,9 @@ static const AVOption showfreqs_options[] = {
{
"overlap"
,
"set window overlap"
,
OFFSET
(
overlap
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
.},
0
.,
1
.,
FLAGS
},
{
"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
},
{
"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
},
{
"colors"
,
"set channels colors"
,
OFFSET
(
colors
),
AV_OPT_TYPE_STRING
,
{.
str
=
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
},
0
,
0
,
FLAGS
},
{
"cmode"
,
"set channel mode"
,
OFFSET
(
cmode
),
AV_OPT_TYPE_INT
,
{.
i64
=
COMBINED
},
0
,
NB_CMODES
-
1
,
FLAGS
,
"cmode"
},
{
"combined"
,
"show all channels in same window"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COMBINED
},
0
,
0
,
FLAGS
,
"cmode"
},
{
"separate"
,
"show each channel in own window"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SEPARATE
},
0
,
0
,
FLAGS
,
"cmode"
},
{
NULL
}
{
NULL
}
};
};
...
@@ -358,6 +363,7 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
...
@@ -358,6 +363,7 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
const
float
avg
=
s
->
avg_data
[
ch
][
f
];
const
float
avg
=
s
->
avg_data
[
ch
][
f
];
const
float
bsize
=
get_bsize
(
s
,
f
);
const
float
bsize
=
get_bsize
(
s
,
f
);
const
int
sx
=
get_sx
(
s
,
f
);
const
int
sx
=
get_sx
(
s
,
f
);
int
end
=
outlink
->
h
;
int
x
,
y
,
i
;
int
x
,
y
,
i
;
switch
(
s
->
ascale
)
{
switch
(
s
->
ascale
)
{
...
@@ -374,7 +380,16 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
...
@@ -374,7 +380,16 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
a
=
1
.
0
-
a
;
a
=
1
.
0
-
a
;
break
;
break
;
}
}
y
=
a
*
outlink
->
h
-
1
;
switch
(
s
->
cmode
)
{
case
COMBINED
:
y
=
a
*
outlink
->
h
-
1
;
break
;
case
SEPARATE
:
end
=
(
outlink
->
h
/
s
->
nb_channels
)
*
(
ch
+
1
);
y
=
(
outlink
->
h
/
s
->
nb_channels
)
*
ch
+
a
*
(
outlink
->
h
/
s
->
nb_channels
)
-
1
;
break
;
}
if
(
y
<
0
)
if
(
y
<
0
)
return
;
return
;
...
@@ -410,7 +425,7 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
...
@@ -410,7 +425,7 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
break
;
break
;
case
BAR
:
case
BAR
:
for
(
x
=
sx
;
x
<
sx
+
bsize
&&
x
<
w
;
x
++
)
for
(
x
=
sx
;
x
<
sx
+
bsize
&&
x
<
w
;
x
++
)
for
(
i
=
y
;
i
<
outlink
->
h
;
i
++
)
for
(
i
=
y
;
i
<
end
;
i
++
)
draw_dot
(
out
,
x
,
i
,
fg
);
draw_dot
(
out
,
x
,
i
,
fg
);
break
;
break
;
case
DOT
:
case
DOT
:
...
...
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