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
2736dc05
Commit
2736dc05
authored
Dec 28, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vectorscope: rename gray mode to tint mode
parent
29b765d6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
28 deletions
+64
-28
filters.texi
doc/filters.texi
+6
-0
vf_vectorscope.c
libavfilter/vf_vectorscope.c
+40
-10
filter-vectorscope_color
tests/ref/fate/filter-vectorscope_color
+3
-3
filter-vectorscope_color2
tests/ref/fate/filter-vectorscope_color2
+3
-3
filter-vectorscope_color3
tests/ref/fate/filter-vectorscope_color3
+3
-3
filter-vectorscope_color4
tests/ref/fate/filter-vectorscope_color4
+3
-3
filter-vectorscope_gray
tests/ref/fate/filter-vectorscope_gray
+3
-3
filter-vectorscope_xy
tests/ref/fate/filter-vectorscope_xy
+3
-3
No files found.
doc/filters.texi
View file @
2736dc05
...
...
@@ -18945,6 +18945,7 @@ Set vectorscope mode.
It accepts the following values:
@table @samp
@item gray
@item tint
Gray values are displayed on graph, higher brightness means more pixels have
same component color value on location in graph. This is the default mode.
...
...
@@ -19048,6 +19049,11 @@ Set what kind of colorspace to use when drawing graticule.
@item 709
@end table
Default is auto.
@item tint0, t0
@item tint1, t1
Set color tint for gray/tint vectorscope mode. By default both options are zero.
This means no tint, and output will remain gray.
@end table
@anchor{vidstabdetect}
...
...
libavfilter/vf_vectorscope.c
View file @
2736dc05
...
...
@@ -38,7 +38,7 @@ enum GraticuleType {
};
enum
VectorscopeMode
{
GRAY
,
TINT
,
COLOR
,
COLOR2
,
COLOR3
,
...
...
@@ -53,6 +53,7 @@ typedef struct VectorscopeContext {
int
intensity
;
float
fintensity
;
uint16_t
bg_color
[
4
];
float
ftint
[
2
];
int
planewidth
[
4
];
int
planeheight
[
4
];
int
hsub
,
vsub
;
...
...
@@ -67,6 +68,7 @@ typedef struct VectorscopeContext {
float
bgopacity
;
float
lthreshold
;
float
hthreshold
;
int
tint
[
2
];
int
tmin
;
int
tmax
;
int
flags
;
...
...
@@ -87,7 +89,8 @@ typedef struct VectorscopeContext {
static
const
AVOption
vectorscope_options
[]
=
{
{
"mode"
,
"set vectorscope mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
MODE_NB
-
1
,
FLAGS
,
"mode"
},
{
"m"
,
"set vectorscope mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
MODE_NB
-
1
,
FLAGS
,
"mode"
},
{
"gray"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
GRAY
},
0
,
0
,
FLAGS
,
"mode"
},
{
"gray"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TINT
},
0
,
0
,
FLAGS
,
"mode"
},
{
"tint"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TINT
},
0
,
0
,
FLAGS
,
"mode"
},
{
"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"
},
...
...
@@ -127,6 +130,10 @@ static const AVOption vectorscope_options[] = {
{
"auto"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
FLAGS
,
"colorspace"
},
{
"601"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
FLAGS
,
"colorspace"
},
{
"709"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
0
,
FLAGS
,
"colorspace"
},
{
"tint0"
,
"set 1st tint"
,
OFFSET
(
ftint
[
0
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
1
,
1
,
FLAGS
},
{
"t0"
,
"set 1st tint"
,
OFFSET
(
ftint
[
0
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
1
,
1
,
FLAGS
},
{
"tint1"
,
"set 2nd tint"
,
OFFSET
(
ftint
[
1
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
1
,
1
,
FLAGS
},
{
"t1"
,
"set 2nd tint"
,
OFFSET
(
ftint
[
1
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
1
,
1
,
FLAGS
},
{
NULL
}
};
...
...
@@ -442,7 +449,7 @@ static void vectorscope16(VectorscopeContext *s, AVFrame *in, AVFrame *out, int
switch
(
s
->
mode
)
{
case
COLOR
:
case
COLOR5
:
case
GRAY
:
case
TINT
:
if
(
s
->
is_yuv
)
{
for
(
i
=
0
;
i
<
h
;
i
++
)
{
const
int
iwx
=
i
*
slinesizex
;
...
...
@@ -581,7 +588,17 @@ static void vectorscope16(VectorscopeContext *s, AVFrame *in, AVFrame *out, int
}
}
if
(
s
->
mode
==
COLOR
)
{
if
(
s
->
mode
==
TINT
&&
(
s
->
tint
[
0
]
!=
mid
||
s
->
tint
[
1
]
!=
mid
))
{
for
(
i
=
0
;
i
<
out
->
height
;
i
++
)
{
for
(
j
=
0
;
j
<
out
->
width
;
j
++
)
{
if
(
dpd
[
i
*
dlinesize
+
j
])
{
dst
[
1
][
i
*
dlinesize
+
j
]
=
s
->
tint
[
0
];
dst
[
2
][
i
*
dlinesize
+
j
]
=
s
->
tint
[
1
];
}
}
}
}
else
if
(
s
->
mode
==
COLOR
)
{
for
(
i
=
0
;
i
<
out
->
height
;
i
++
)
{
for
(
j
=
0
;
j
<
out
->
width
;
j
++
)
{
if
(
!
dpd
[
i
*
dlinesize
+
j
])
{
...
...
@@ -636,7 +653,7 @@ static void vectorscope8(VectorscopeContext *s, AVFrame *in, AVFrame *out, int p
switch
(
s
->
mode
)
{
case
COLOR5
:
case
COLOR
:
case
GRAY
:
case
TINT
:
if
(
s
->
is_yuv
)
{
for
(
i
=
0
;
i
<
h
;
i
++
)
{
const
int
iwx
=
i
*
slinesizex
;
...
...
@@ -775,7 +792,17 @@ static void vectorscope8(VectorscopeContext *s, AVFrame *in, AVFrame *out, int p
}
}
if
(
s
->
mode
==
COLOR
)
{
if
(
s
->
mode
==
TINT
&&
(
s
->
tint
[
0
]
!=
128
||
s
->
tint
[
1
]
!=
128
))
{
for
(
i
=
0
;
i
<
out
->
height
;
i
++
)
{
for
(
j
=
0
;
j
<
out
->
width
;
j
++
)
{
if
(
dpd
[
i
*
dlinesize
+
j
])
{
dst
[
1
][
i
*
dlinesize
+
j
]
=
s
->
tint
[
0
];
dst
[
2
][
i
*
dlinesize
+
j
]
=
s
->
tint
[
1
];
}
}
}
}
else
if
(
s
->
mode
==
COLOR
)
{
for
(
i
=
0
;
i
<
out
->
height
;
i
++
)
{
for
(
j
=
0
;
j
<
out
->
width
;
j
++
)
{
if
(
!
dpd
[
i
*
out
->
linesize
[
pd
]
+
j
])
{
...
...
@@ -1483,9 +1510,9 @@ static int config_input(AVFilterLink *inlink)
return
AVERROR
(
EINVAL
);
}
if
(
s
->
mode
==
GRAY
&&
s
->
is_yuv
)
if
(
s
->
mode
==
TINT
&&
s
->
is_yuv
)
{
s
->
pd
=
0
;
else
{
}
else
{
if
((
s
->
x
==
1
&&
s
->
y
==
2
)
||
(
s
->
x
==
2
&&
s
->
y
==
1
))
s
->
pd
=
0
;
else
if
((
s
->
x
==
0
&&
s
->
y
==
2
)
||
(
s
->
x
==
2
&&
s
->
y
==
0
))
...
...
@@ -1519,6 +1546,9 @@ static int config_input(AVFilterLink *inlink)
s
->
bg_color
[
3
]
=
s
->
bgopacity
*
(
s
->
size
-
1
);
s
->
tint
[
0
]
=
.
5
f
*
(
s
->
ftint
[
0
]
+
1
.
f
)
*
(
s
->
size
-
1
);
s
->
tint
[
1
]
=
.
5
f
*
(
s
->
ftint
[
1
]
+
1
.
f
)
*
(
s
->
size
-
1
);
switch
(
inlink
->
format
)
{
case
AV_PIX_FMT_GBRP12
:
case
AV_PIX_FMT_GBRP10
:
...
...
@@ -1531,8 +1561,8 @@ static int config_input(AVFilterLink *inlink)
break
;
default:
s
->
bg_color
[
0
]
=
0
;
s
->
bg_color
[
1
]
=
s
->
size
/
2
-
1
;
s
->
bg_color
[
2
]
=
s
->
size
/
2
-
1
;
s
->
bg_color
[
1
]
=
s
->
size
/
2
;
s
->
bg_color
[
2
]
=
s
->
size
/
2
;
}
s
->
hsub
=
desc
->
log2_chroma_w
;
...
...
tests/ref/fate/filter-vectorscope_color
View file @
2736dc05
...
...
@@ -3,6 +3,6 @@
#codec_id 0: rawvideo
#dimensions 0: 256x256
#sar 0: 1/1
0, 0, 0, 1, 196608, 0x
f6e3aa30
0, 1, 1, 1, 196608, 0x
5584acf9
0, 2, 2, 1, 196608, 0x
a862775d
0, 0, 0, 1, 196608, 0x
7c431d1f
0, 1, 1, 1, 196608, 0x
b7e82028
0, 2, 2, 1, 196608, 0x
2feeeb61
tests/ref/fate/filter-vectorscope_color2
View file @
2736dc05
...
...
@@ -3,6 +3,6 @@
#codec_id 0: rawvideo
#dimensions 0: 256x256
#sar 0: 1/1
0, 0, 0, 1, 196608, 0x
5e62fae5
0, 1, 1, 1, 196608, 0x
4c27fcbf
0, 2, 2, 1, 196608, 0x
b7531088
0, 0, 0, 1, 196608, 0x
dad38823
0, 1, 1, 1, 196608, 0x
eb8589bd
0, 2, 2, 1, 196608, 0x
31a79c93
tests/ref/fate/filter-vectorscope_color3
View file @
2736dc05
...
...
@@ -3,6 +3,6 @@
#codec_id 0: rawvideo
#dimensions 0: 256x256
#sar 0: 1/1
0, 0, 0, 1, 196608, 0x
83df8770
0, 1, 1, 1, 196608, 0x
a6a674a7
0, 2, 2, 1, 196608, 0x
11757143
0, 0, 0, 1, 196608, 0x
005f14ae
0, 1, 1, 1, 196608, 0x
461301a5
0, 2, 2, 1, 196608, 0x
8bbafd4e
tests/ref/fate/filter-vectorscope_color4
View file @
2736dc05
...
...
@@ -3,6 +3,6 @@
#codec_id 0: rawvideo
#dimensions 0: 256x256
#sar 0: 1/1
0, 0, 0, 1, 196608, 0x
326953c4
0, 1, 1, 1, 196608, 0x
870e1dcc
0, 2, 2, 1, 196608, 0x
87cb8800
0, 0, 0, 1, 196608, 0x
aedae0f3
0, 1, 1, 1, 196608, 0x
267baabb
0, 2, 2, 1, 196608, 0x
021f141a
tests/ref/fate/filter-vectorscope_gray
View file @
2736dc05
...
...
@@ -3,6 +3,6 @@
#codec_id 0: rawvideo
#dimensions 0: 256x256
#sar 0: 1/1
0, 0, 0, 1, 196608, 0x
79ba71e2
0, 1, 1, 1, 196608, 0x
909271e2
0, 2, 2, 1, 196608, 0x
143971e2
0, 0, 0, 1, 196608, 0x
f62bff11
0, 1, 1, 1, 196608, 0x
2ffffed1
0, 2, 2, 1, 196608, 0x
8e7efded
tests/ref/fate/filter-vectorscope_xy
View file @
2736dc05
...
...
@@ -3,6 +3,6 @@
#codec_id 0: rawvideo
#dimensions 0: 256x256
#sar 0: 1/1
0, 0, 0, 1, 196608, 0x
a2899af1
0, 1, 1, 1, 196608, 0x2
6409af1
0, 2, 2, 1, 196608, 0x
f5209af1
0, 0, 0, 1, 196608, 0x
d2bfcc40
0, 1, 1, 1, 196608, 0x2
851cb74
0, 2, 2, 1, 196608, 0x
48efcc64
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