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
af018d80
Commit
af018d80
authored
Jan 02, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_showspectrum: add 4th and 5th root scaler
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
2b172cb6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
filters.texi
doc/filters.texi
+8
-0
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+11
-1
No files found.
doc/filters.texi
View file @
af018d80
...
...
@@ -14640,6 +14640,10 @@ linear
square root, default
@item cbrt
cubic root
@item 4thrt
4th root
@item 5thrt
5th root
@item log
logarithmic
@end table
...
...
@@ -14764,6 +14768,10 @@ linear
square root, default
@item cbrt
cubic root
@item 4thrt
4th root
@item 5thrt
5th root
@item log
logarithmic
@end table
...
...
libavfilter/avf_showspectrum.c
View file @
af018d80
...
...
@@ -40,7 +40,7 @@
#include "window_func.h"
enum
DisplayMode
{
COMBINED
,
SEPARATE
,
NB_MODES
};
enum
DisplayScale
{
LINEAR
,
SQRT
,
CBRT
,
LOG
,
NB_SCALES
};
enum
DisplayScale
{
LINEAR
,
SQRT
,
CBRT
,
LOG
,
FOURTHRT
,
FIFTHRT
,
NB_SCALES
};
enum
ColorMode
{
CHANNEL
,
INTENSITY
,
RAINBOW
,
MORELAND
,
NEBULAE
,
FIRE
,
FIERY
,
NB_CLMODES
};
enum
SlideMode
{
REPLACE
,
SCROLL
,
FULLFRAME
,
RSCROLL
,
NB_SLIDES
};
enum
Orientation
{
VERTICAL
,
HORIZONTAL
,
NB_ORIENTATIONS
};
...
...
@@ -100,6 +100,8 @@ static const AVOption showspectrum_options[] = {
{
"scale"
,
"set display scale"
,
OFFSET
(
scale
),
AV_OPT_TYPE_INT
,
{.
i64
=
SQRT
},
LINEAR
,
NB_SCALES
-
1
,
FLAGS
,
"scale"
},
{
"sqrt"
,
"square root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SQRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"cbrt"
,
"cubic root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
CBRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"4thrt"
,
"4th root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FOURTHRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"5thrt"
,
"5th root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FIFTHRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"log"
,
"logarithmic"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LOG
},
0
,
0
,
FLAGS
,
"scale"
},
{
"lin"
,
"linear"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LINEAR
},
0
,
0
,
FLAGS
,
"scale"
},
{
"saturation"
,
"color saturation multiplier"
,
OFFSET
(
saturation
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
-
10
,
10
,
FLAGS
},
...
...
@@ -568,6 +570,12 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
case
CBRT
:
a
=
cbrt
(
a
);
break
;
case
FOURTHRT
:
a
=
pow
(
a
,
0
.
25
);
break
;
case
FIFTHRT
:
a
=
pow
(
a
,
0
.
20
);
break
;
case
LOG
:
a
=
1
+
log10
(
FFMAX
(
FFMIN
(
1
,
a
),
1e-6
))
/
5
;
// zero = -120dBFS
break
;
...
...
@@ -778,6 +786,8 @@ static const AVOption showspectrumpic_options[] = {
{
"scale"
,
"set display scale"
,
OFFSET
(
scale
),
AV_OPT_TYPE_INT
,
{.
i64
=
LOG
},
0
,
NB_SCALES
-
1
,
FLAGS
,
"scale"
},
{
"sqrt"
,
"square root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SQRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"cbrt"
,
"cubic root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
CBRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"4thrt"
,
"4th root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FOURTHRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"5thrt"
,
"5th root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FIFTHRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"log"
,
"logarithmic"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LOG
},
0
,
0
,
FLAGS
,
"scale"
},
{
"lin"
,
"linear"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LINEAR
},
0
,
0
,
FLAGS
,
"scale"
},
{
"saturation"
,
"color saturation multiplier"
,
OFFSET
(
saturation
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
-
10
,
10
,
FLAGS
},
...
...
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