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
16229fae
Commit
16229fae
authored
Aug 29, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vectorscope: add yet another mode
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b48d8fa3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
1 deletion
+36
-1
filters.texi
doc/filters.texi
+5
-0
vf_vectorscope.c
libavfilter/vf_vectorscope.c
+24
-1
filter-video.mak
tests/fate/filter-video.mak
+3
-0
filter-vectorscope_color4
tests/ref/fate/filter-vectorscope_color4
+4
-0
No files found.
doc/filters.texi
View file @
16229fae
...
...
@@ -10587,6 +10587,11 @@ Actual color components values present in video frame are displayed on graph.
Similar as color2 but higher frequency of same values @code{x} and @code{y}
on graph increases value of another color component, which is luminance by
default values of @code{x} and @code{y}.
@item color4
Actual colors present in video frame are displayed on graph. If two different
colors map to same position on graph then color with higher value of component
not present in graph is picked.
@end table
@item x
...
...
libavfilter/vf_vectorscope.c
View file @
16229fae
...
...
@@ -32,6 +32,7 @@ enum VectorscopeMode {
COLOR
,
COLOR2
,
COLOR3
,
COLOR4
,
MODE_NB
};
...
...
@@ -56,6 +57,7 @@ static const AVOption vectorscope_options[] = {
{
"color"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COLOR
},
0
,
0
,
FLAGS
,
"mode"
},
{
"color2"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COLOR2
},
0
,
0
,
FLAGS
,
"mode"
},
{
"color3"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COLOR3
},
0
,
0
,
FLAGS
,
"mode"
},
{
"color4"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COLOR4
},
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
},
...
...
@@ -107,7 +109,8 @@ static int query_formats(AVFilterContext *ctx)
if
(
!
ctx
->
inputs
[
0
]
->
out_formats
)
{
const
enum
AVPixelFormat
*
in_pix_fmts
;
if
((
s
->
x
==
1
&&
s
->
y
==
2
)
||
(
s
->
x
==
2
&&
s
->
y
==
1
))
if
(((
s
->
x
==
1
&&
s
->
y
==
2
)
||
(
s
->
x
==
2
&&
s
->
y
==
1
))
&&
(
s
->
mode
!=
COLOR4
))
in_pix_fmts
=
in2_pix_fmts
;
else
in_pix_fmts
=
in1_pix_fmts
;
...
...
@@ -185,6 +188,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
uint8_t
*
const
*
src
=
(
const
uint8_t
*
const
*
)
in
->
data
;
const
int
slinesizex
=
in
->
linesize
[
s
->
x
];
const
int
slinesizey
=
in
->
linesize
[
s
->
y
];
const
int
slinesized
=
in
->
linesize
[
pd
];
const
int
dlinesize
=
out
->
linesize
[
0
];
const
int
intensity
=
s
->
intensity
;
int
i
,
j
,
px
=
s
->
x
,
py
=
s
->
y
;
...
...
@@ -192,6 +196,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
int
w
=
s
->
planewidth
[
px
];
const
uint8_t
*
spx
=
src
[
px
];
const
uint8_t
*
spy
=
src
[
py
];
const
uint8_t
*
spd
=
src
[
pd
];
uint8_t
**
dst
=
out
->
data
;
uint8_t
*
dpx
=
dst
[
px
];
uint8_t
*
dpy
=
dst
[
py
];
...
...
@@ -296,6 +301,24 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
}
}
break
;
case
COLOR4
:
for
(
i
=
0
;
i
<
h
;
i
++
)
{
const
int
iwx
=
i
*
slinesizex
;
const
int
iwy
=
i
*
slinesizey
;
const
int
iwd
=
i
*
slinesized
;
for
(
j
=
0
;
j
<
w
;
j
++
)
{
const
int
x
=
spx
[
iwx
+
j
];
const
int
y
=
spy
[
iwy
+
j
];
const
int
pos
=
y
*
dlinesize
+
x
;
dpd
[
pos
]
=
FFMAX
(
spd
[
iwd
+
j
],
dpd
[
pos
]);
dpx
[
pos
]
=
x
;
dpy
[
pos
]
=
y
;
if
(
dst
[
3
])
dst
[
3
][
pos
]
=
255
;
}
}
break
;
default:
av_assert0
(
0
);
}
...
...
tests/fate/filter-video.mak
View file @
16229fae
...
...
@@ -135,6 +135,9 @@ fate-filter-vectorscope_color2: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf vectors
FATE_FILTER_VSYNTH-$(CONFIG_VECTORSCOPE_FILTER) += fate-filter-vectorscope_color3
fate-filter-vectorscope_color3: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf vectorscope=color3 -sws_flags +accurate_rnd+bitexact -vframes 3
FATE_FILTER_VSYNTH-$(CONFIG_VECTORSCOPE_FILTER) += fate-filter-vectorscope_color4
fate-filter-vectorscope_color4: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf vectorscope=color4 -sws_flags +accurate_rnd+bitexact -vframes 3
FATE_FILTER_VSYNTH-$(CONFIG_VECTORSCOPE_FILTER) += fate-filter-vectorscope_xy
fate-filter-vectorscope_xy: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf vectorscope=x=0:y=1 -sws_flags +accurate_rnd+bitexact -vframes 3
...
...
tests/ref/fate/filter-vectorscope_color4
0 → 100644
View file @
16229fae
#tb 0: 1/25
0, 0, 0, 1, 196608, 0xb6d22af1
0, 1, 1, 1, 196608, 0xd7c6f971
0, 2, 2, 1, 196608, 0xfe729faa
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