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
afd2bf54
Commit
afd2bf54
authored
Nov 21, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_avectorscope: add swap and mirror options
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
37810bee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
filters.texi
doc/filters.texi
+20
-0
avf_avectorscope.c
libavfilter/avf_avectorscope.c
+17
-0
No files found.
doc/filters.texi
View file @
afd2bf54
...
@@ -17232,6 +17232,26 @@ Cubic root.
...
@@ -17232,6 +17232,26 @@ Cubic root.
Logarithmic.
Logarithmic.
@end table
@end table
@item swap
Swap left channel axis with right channel axis.
@item mirror
Mirror axis.
@table @samp
@item none
No mirror.
@item x
Mirror only x axis.
@item y
Mirror only y axis.
@item xy
Mirror both axis.
@end table
@end table
@end table
@subsection Examples
@subsection Examples
...
...
libavfilter/avf_avectorscope.c
View file @
afd2bf54
...
@@ -65,6 +65,8 @@ typedef struct AudioVectorScopeContext {
...
@@ -65,6 +65,8 @@ typedef struct AudioVectorScopeContext {
int
contrast
[
4
];
int
contrast
[
4
];
int
fade
[
4
];
int
fade
[
4
];
double
zoom
;
double
zoom
;
int
swap
;
int
mirror
;
unsigned
prev_x
,
prev_y
;
unsigned
prev_x
,
prev_y
;
AVRational
frame_rate
;
AVRational
frame_rate
;
}
AudioVectorScopeContext
;
}
AudioVectorScopeContext
;
...
@@ -99,6 +101,12 @@ static const AVOption avectorscope_options[] = {
...
@@ -99,6 +101,12 @@ static const AVOption avectorscope_options[] = {
{
"sqrt"
,
"square root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SQRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"sqrt"
,
"square root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SQRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"cbrt"
,
"cube root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
CBRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"cbrt"
,
"cube root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
CBRT
},
0
,
0
,
FLAGS
,
"scale"
},
{
"log"
,
"logarithmic"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LOG
},
0
,
0
,
FLAGS
,
"scale"
},
{
"log"
,
"logarithmic"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LOG
},
0
,
0
,
FLAGS
,
"scale"
},
{
"swap"
,
"swap x axis with y axis"
,
OFFSET
(
swap
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
1
},
0
,
1
,
FLAGS
},
{
"mirror"
,
"mirror axis"
,
OFFSET
(
mirror
),
AV_OPT_TYPE_INT
,
{.
i64
=
2
},
0
,
3
,
FLAGS
,
"mirror"
},
{
"none"
,
"no mirror"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
FLAGS
,
"mirror"
},
{
"x"
,
"mirror x"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
FLAGS
,
"mirror"
},
{
"y"
,
"mirror y"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
0
,
FLAGS
,
"mirror"
},
{
"xy"
,
"mirror both"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
3
},
0
,
0
,
FLAGS
,
"mirror"
},
{
NULL
}
{
NULL
}
};
};
...
@@ -316,6 +324,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
...
@@ -316,6 +324,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
break
;
break
;
}
}
if
(
s
->
mirror
&
1
)
src
[
0
]
=
-
src
[
0
];
if
(
s
->
mirror
&
2
)
src
[
1
]
=
-
src
[
1
];
if
(
s
->
swap
)
FFSWAP
(
float
,
src
[
0
],
src
[
1
]);;
if
(
s
->
mode
==
LISSAJOUS
)
{
if
(
s
->
mode
==
LISSAJOUS
)
{
x
=
((
src
[
1
]
-
src
[
0
])
*
zoom
/
2
+
1
)
*
hw
;
x
=
((
src
[
1
]
-
src
[
0
])
*
zoom
/
2
+
1
)
*
hw
;
y
=
(
1
.
0
-
(
src
[
0
]
+
src
[
1
])
*
zoom
/
2
)
*
hh
;
y
=
(
1
.
0
-
(
src
[
0
]
+
src
[
1
])
*
zoom
/
2
)
*
hh
;
...
...
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