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
4b0e1124
Commit
4b0e1124
authored
Aug 14, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_avectorscope: add polar mode
parent
f3fbe790
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
filters.texi
doc/filters.texi
+3
-0
avf_avectorscope.c
libavfilter/avf_avectorscope.c
+22
-2
No files found.
doc/filters.texi
View file @
4b0e1124
...
...
@@ -11713,6 +11713,9 @@ Lissajous rotated by 45 degrees.
@item lissajous_xy
Same as above but not rotated.
@item polar
Shape resembling half of circle.
@end table
Default value is @samp{lissajous}.
...
...
libavfilter/avf_avectorscope.c
View file @
4b0e1124
...
...
@@ -36,6 +36,7 @@
enum
VectorScopeMode
{
LISSAJOUS
,
LISSAJOUS_XY
,
POLAR
,
MODE_NB
,
};
...
...
@@ -59,6 +60,7 @@ static const AVOption avectorscope_options[] = {
{
"m"
,
"set mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
LISSAJOUS
},
0
,
MODE_NB
-
1
,
FLAGS
,
"mode"
},
{
"lissajous"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LISSAJOUS
},
0
,
0
,
FLAGS
,
"mode"
},
{
"lissajous_xy"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LISSAJOUS_XY
},
0
,
0
,
FLAGS
,
"mode"
},
{
"polar"
,
""
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
POLAR
},
0
,
0
,
FLAGS
,
"mode"
},
{
"rate"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"size"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"400x400"
},
0
,
0
,
FLAGS
},
...
...
@@ -210,9 +212,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if
(
s
->
mode
==
LISSAJOUS
)
{
x
=
((
src
[
1
]
-
src
[
0
])
*
zoom
/
(
float
)(
UINT16_MAX
)
+
1
)
*
hw
;
y
=
(
1
.
0
-
(
src
[
0
]
+
src
[
1
])
*
zoom
/
(
float
)
UINT16_MAX
)
*
hh
;
}
else
{
}
else
if
(
s
->
mode
==
LISSAJOUS_XY
)
{
x
=
(
src
[
1
]
*
zoom
/
(
float
)
INT16_MAX
+
1
)
*
hw
;
y
=
(
src
[
0
]
*
zoom
/
(
float
)
INT16_MAX
+
1
)
*
hh
;
}
else
{
float
sx
,
sy
,
cx
,
cy
;
sx
=
src
[
1
]
*
zoom
/
(
float
)
INT16_MAX
;
sy
=
src
[
0
]
*
zoom
/
(
float
)
INT16_MAX
;
cx
=
sx
*
sqrtf
(
1
-
0
.
5
*
sy
*
sy
);
cy
=
sy
*
sqrtf
(
1
-
0
.
5
*
sx
*
sx
);
x
=
hw
+
hw
*
FFSIGN
(
cx
+
cy
)
*
(
cx
-
cy
)
*
.
7
;
y
=
s
->
h
-
s
->
h
*
FFABS
(
cx
+
cy
)
*
.
7
;
}
draw_dot
(
s
,
x
,
y
);
...
...
@@ -225,9 +236,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if
(
s
->
mode
==
LISSAJOUS
)
{
x
=
((
src
[
1
]
-
src
[
0
])
*
zoom
/
2
+
1
)
*
hw
;
y
=
(
1
.
0
-
(
src
[
0
]
+
src
[
1
])
*
zoom
/
2
)
*
hh
;
}
else
{
}
else
if
(
s
->
mode
==
LISSAJOUS_XY
)
{
x
=
(
src
[
1
]
*
zoom
+
1
)
*
hw
;
y
=
(
src
[
0
]
*
zoom
+
1
)
*
hh
;
}
else
{
float
sx
,
sy
,
cx
,
cy
;
sx
=
src
[
1
]
*
zoom
;
sy
=
src
[
0
]
*
zoom
;
cx
=
sx
*
sqrtf
(
1
-
0
.
5
*
sy
*
sy
);
cy
=
sy
*
sqrtf
(
1
-
0
.
5
*
sx
*
sx
);
x
=
hw
+
hw
*
FFSIGN
(
cx
+
cy
)
*
(
cx
-
cy
)
*
.
7
;
y
=
s
->
h
-
s
->
h
*
FFABS
(
cx
+
cy
)
*
.
7
;
}
draw_dot
(
s
,
x
,
y
);
...
...
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