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
2bdd026b
Commit
2bdd026b
authored
Aug 07, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_avectorscope: stop making output fully transparent
parent
8015150f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
filters.texi
doc/filters.texi
+6
-2
avf_avectorscope.c
libavfilter/avf_avectorscope.c
+10
-6
No files found.
doc/filters.texi
View file @
2bdd026b
...
...
@@ -11696,13 +11696,17 @@ Set the output frame rate. Default value is @code{25}.
@item rc
@item gc
@item bc
Specify the red, green and blue contrast. Default values are @code{40}, @code{160} and @code{80}.
@item ac
Specify the red, green, blue and alpha contrast. Default values are @code{40},
@code{160}, @code{80} and @code{255}.
Allowed range is @code{[0, 255]}.
@item rf
@item gf
@item bf
Specify the red, green and blue fade. Default values are @code{15}, @code{10} and @code{5}.
@item af
Specify the red, green, blue and alpha fade. Default values are @code{15},
@code{10}, @code{5} and @code{5}.
Allowed range is @code{[0, 255]}.
@item zoom
...
...
libavfilter/avf_avectorscope.c
View file @
2bdd026b
...
...
@@ -45,8 +45,8 @@ typedef struct AudioVectorScopeContext {
int
w
,
h
;
int
hw
,
hh
;
int
mode
;
int
contrast
[
3
];
int
fade
[
3
];
int
contrast
[
4
];
int
fade
[
4
];
double
zoom
;
AVRational
frame_rate
;
}
AudioVectorScopeContext
;
...
...
@@ -63,13 +63,15 @@ static const AVOption avectorscope_options[] = {
{
"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
},
{
"s"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"400x400"
},
0
,
0
,
FLAGS
},
{
"rc"
,
"set red contrast"
,
OFFSET
(
contrast
[
0
]),
AV_OPT_TYPE_INT
,
{.
i64
=
40
},
0
,
255
,
FLAGS
},
{
"rc"
,
"set red contrast"
,
OFFSET
(
contrast
[
0
]),
AV_OPT_TYPE_INT
,
{.
i64
=
40
},
0
,
255
,
FLAGS
},
{
"gc"
,
"set green contrast"
,
OFFSET
(
contrast
[
1
]),
AV_OPT_TYPE_INT
,
{.
i64
=
160
},
0
,
255
,
FLAGS
},
{
"bc"
,
"set blue contrast"
,
OFFSET
(
contrast
[
2
]),
AV_OPT_TYPE_INT
,
{.
i64
=
80
},
0
,
255
,
FLAGS
},
{
"bc"
,
"set blue contrast"
,
OFFSET
(
contrast
[
2
]),
AV_OPT_TYPE_INT
,
{.
i64
=
80
},
0
,
255
,
FLAGS
},
{
"ac"
,
"set alpha contrast"
,
OFFSET
(
contrast
[
3
]),
AV_OPT_TYPE_INT
,
{.
i64
=
255
},
0
,
255
,
FLAGS
},
{
"rf"
,
"set red fade"
,
OFFSET
(
fade
[
0
]),
AV_OPT_TYPE_INT
,
{.
i64
=
15
},
0
,
255
,
FLAGS
},
{
"gf"
,
"set green fade"
,
OFFSET
(
fade
[
1
]),
AV_OPT_TYPE_INT
,
{.
i64
=
10
},
0
,
255
,
FLAGS
},
{
"bf"
,
"set blue fade"
,
OFFSET
(
fade
[
2
]),
AV_OPT_TYPE_INT
,
{.
i64
=
5
},
0
,
255
,
FLAGS
},
{
"zoom"
,
"set zoom factor"
,
OFFSET
(
zoom
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
},
1
,
10
,
FLAGS
},
{
"bf"
,
"set blue fade"
,
OFFSET
(
fade
[
2
]),
AV_OPT_TYPE_INT
,
{.
i64
=
5
},
0
,
255
,
FLAGS
},
{
"af"
,
"set alpha fade"
,
OFFSET
(
fade
[
3
]),
AV_OPT_TYPE_INT
,
{.
i64
=
5
},
0
,
255
,
FLAGS
},
{
"zoom"
,
"set zoom factor"
,
OFFSET
(
zoom
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
},
1
,
10
,
FLAGS
},
{
NULL
}
};
...
...
@@ -92,6 +94,7 @@ static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y)
dst
[
0
]
=
FFMIN
(
dst
[
0
]
+
s
->
contrast
[
0
],
255
);
dst
[
1
]
=
FFMIN
(
dst
[
1
]
+
s
->
contrast
[
1
],
255
);
dst
[
2
]
=
FFMIN
(
dst
[
2
]
+
s
->
contrast
[
2
],
255
);
dst
[
3
]
=
FFMIN
(
dst
[
3
]
+
s
->
contrast
[
3
],
255
);
}
static
void
fade
(
AudioVectorScopeContext
*
s
)
...
...
@@ -106,6 +109,7 @@ static void fade(AudioVectorScopeContext *s)
d
[
j
+
0
]
=
FFMAX
(
d
[
j
+
0
]
-
s
->
fade
[
0
],
0
);
d
[
j
+
1
]
=
FFMAX
(
d
[
j
+
1
]
-
s
->
fade
[
1
],
0
);
d
[
j
+
2
]
=
FFMAX
(
d
[
j
+
2
]
-
s
->
fade
[
2
],
0
);
d
[
j
+
3
]
=
FFMAX
(
d
[
j
+
3
]
-
s
->
fade
[
3
],
0
);
}
d
+=
linesize
;
}
...
...
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