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
c34c0503
Commit
c34c0503
authored
Aug 23, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vectorscope: make intensity user configurable
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
ee155c18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
filters.texi
doc/filters.texi
+4
-0
vf_vectorscope.c
libavfilter/vf_vectorscope.c
+8
-5
No files found.
doc/filters.texi
View file @
c34c0503
...
...
@@ -10533,6 +10533,10 @@ Set which color component will be represented on X-axis. Default is @code{1}.
@item y
Set which color component will be represented on Y-axis. Default is @code{2}.
@item intensity
Set intensity, used by modes: gray, color and color3 for increasing brightness
of color component which represents frequency of (X, Y) location in graph.
@end table
@anchor{vidstabdetect}
...
...
libavfilter/vf_vectorscope.c
View file @
c34c0503
...
...
@@ -38,6 +38,7 @@ enum VectorscopeMode {
typedef
struct
VectorscopeContext
{
const
AVClass
*
class
;
int
mode
;
int
intensity
;
const
uint8_t
*
bg_color
;
int
planewidth
[
4
];
int
planeheight
[
4
];
...
...
@@ -56,6 +57,7 @@ static const AVOption vectorscope_options[] = {
{
"color3"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COLOR3
},
0
,
0
,
FLAGS
,
"mode"
},
{
"x"
,
"set color component on X axis"
,
OFFSET
(
x
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
2
,
FLAGS
},
{
"y"
,
"set color component on Y axis"
,
OFFSET
(
y
),
AV_OPT_TYPE_INT
,
{.
i64
=
2
},
0
,
2
,
FLAGS
},
{
"intensity"
,
"set intensity"
,
OFFSET
(
intensity
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
1
,
255
,
FLAGS
},
{
NULL
}
};
...
...
@@ -182,6 +184,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
int
slinesizex
=
in
->
linesize
[
s
->
x
];
const
int
slinesizey
=
in
->
linesize
[
s
->
y
];
const
int
dlinesize
=
out
->
linesize
[
0
];
const
int
intensity
=
s
->
intensity
;
int
i
,
j
,
px
=
s
->
x
,
py
=
s
->
y
;
const
int
h
=
s
->
planeheight
[
py
];
const
int
w
=
s
->
planewidth
[
px
];
...
...
@@ -204,7 +207,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
int
y
=
spy
[
iwy
+
j
];
const
int
pos
=
y
*
dlinesize
+
x
;
dpd
[
pos
]
=
FFMIN
(
dpd
[
pos
]
+
1
,
255
);
dpd
[
pos
]
=
FFMIN
(
dpd
[
pos
]
+
intensity
,
255
);
if
(
dst
[
3
])
dst
[
3
][
pos
]
=
255
;
}
...
...
@@ -218,9 +221,9 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
int
y
=
spy
[
iwy
+
j
];
const
int
pos
=
y
*
dlinesize
+
x
;
dst
[
0
][
pos
]
=
FFMIN
(
dst
[
0
][
pos
]
+
1
,
255
);
dst
[
1
][
pos
]
=
FFMIN
(
dst
[
1
][
pos
]
+
1
,
255
);
dst
[
2
][
pos
]
=
FFMIN
(
dst
[
2
][
pos
]
+
1
,
255
);
dst
[
0
][
pos
]
=
FFMIN
(
dst
[
0
][
pos
]
+
intensity
,
255
);
dst
[
1
][
pos
]
=
FFMIN
(
dst
[
1
][
pos
]
+
intensity
,
255
);
dst
[
2
][
pos
]
=
FFMIN
(
dst
[
2
][
pos
]
+
intensity
,
255
);
if
(
dst
[
3
])
dst
[
3
][
pos
]
=
255
;
}
...
...
@@ -283,7 +286,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
int
y
=
spy
[
iw2
+
j
];
const
int
pos
=
y
*
dlinesize
+
x
;
dpd
[
pos
]
=
FFMIN
(
255
,
dpd
[
pos
]
+
1
);
dpd
[
pos
]
=
FFMIN
(
255
,
dpd
[
pos
]
+
intensity
);
dpx
[
pos
]
=
x
;
dpy
[
pos
]
=
y
;
if
(
dst
[
3
])
...
...
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