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
4a7c705f
Commit
4a7c705f
authored
Mar 12, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vectorscope: make it possible to override colorspace
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a61cd42c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
filters.texi
doc/filters.texi
+9
-0
vf_vectorscope.c
libavfilter/vf_vectorscope.c
+18
-8
No files found.
doc/filters.texi
View file @
4a7c705f
...
@@ -12656,6 +12656,15 @@ Values higher than this value will be ignored. Default is 1.
...
@@ -12656,6 +12656,15 @@ Values higher than this value will be ignored. Default is 1.
Note this value is multiplied with actual max possible value one pixel component
Note this value is multiplied with actual max possible value one pixel component
can have. So for 8-bit input and high threshold value of 0.9 actual threshold
can have. So for 8-bit input and high threshold value of 0.9 actual threshold
is 0.9 * 255 = 230.
is 0.9 * 255 = 230.
@item colorspace, c
Set what kind of colorspace to use when drawing graticule.
@table @samp
@item auto
@item 601
@item 709
@end table
Default is auto.
@end table
@end table
@anchor{vidstabdetect}
@anchor{vidstabdetect}
...
...
libavfilter/vf_vectorscope.c
View file @
4a7c705f
...
@@ -62,6 +62,7 @@ typedef struct VectorscopeContext {
...
@@ -62,6 +62,7 @@ typedef struct VectorscopeContext {
int
tmin
;
int
tmin
;
int
tmax
;
int
tmax
;
int
flags
;
int
flags
;
int
colorspace
;
int
cs
;
int
cs
;
uint8_t
peak
[
4096
][
4096
];
uint8_t
peak
[
4096
][
4096
];
...
@@ -111,6 +112,11 @@ static const AVOption vectorscope_options[] = {
...
@@ -111,6 +112,11 @@ static const AVOption vectorscope_options[] = {
{
"l"
,
"set low threshold"
,
OFFSET
(
lthreshold
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
0
,
1
,
FLAGS
},
{
"l"
,
"set low threshold"
,
OFFSET
(
lthreshold
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
0
,
1
,
FLAGS
},
{
"hthreshold"
,
"set high threshold"
,
OFFSET
(
hthreshold
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
1
,
FLAGS
},
{
"hthreshold"
,
"set high threshold"
,
OFFSET
(
hthreshold
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
1
,
FLAGS
},
{
"h"
,
"set high threshold"
,
OFFSET
(
hthreshold
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
1
,
FLAGS
},
{
"h"
,
"set high threshold"
,
OFFSET
(
hthreshold
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
1
,
FLAGS
},
{
"colorspace"
,
"set colorspace"
,
OFFSET
(
colorspace
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
2
,
FLAGS
,
"colorspace"
},
{
"c"
,
"set colorspace"
,
OFFSET
(
colorspace
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
2
,
FLAGS
,
"colorspace"
},
{
"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"
},
{
NULL
}
{
NULL
}
};
};
...
@@ -1190,14 +1196,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -1190,14 +1196,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFrame
*
out
;
AVFrame
*
out
;
switch
(
av_frame_get_colorspace
(
in
))
{
if
(
s
->
colorspace
)
{
case
AVCOL_SPC_SMPTE170M
:
s
->
cs
=
(
s
->
depth
-
8
)
*
2
+
s
->
colorspace
-
1
;
case
AVCOL_SPC_BT470BG
:
}
else
{
s
->
cs
=
(
s
->
depth
-
8
)
*
2
+
0
;
switch
(
av_frame_get_colorspace
(
in
))
{
break
;
case
AVCOL_SPC_SMPTE170M
:
case
AVCOL_SPC_BT709
:
case
AVCOL_SPC_BT470BG
:
default:
s
->
cs
=
(
s
->
depth
-
8
)
*
2
+
0
;
s
->
cs
=
(
s
->
depth
-
8
)
*
2
+
1
;
break
;
case
AVCOL_SPC_BT709
:
default:
s
->
cs
=
(
s
->
depth
-
8
)
*
2
+
1
;
}
}
}
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
...
...
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