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
38baaa16
Commit
38baaa16
authored
May 05, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vibrance: add alternate option
parent
526bc220
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
filters.texi
doc/filters.texi
+4
-0
vf_vibrance.c
libavfilter/vf_vibrance.c
+10
-6
No files found.
doc/filters.texi
View file @
38baaa16
...
...
@@ -17984,6 +17984,10 @@ Set the green luma coefficient.
@item blum
Set the blue luma coefficient.
@item alternate
If @code{intensity} is negative and this is set to 1, colors will change,
otherwise colors will be less saturated, more towards gray.
@end table
@anchor{vignette}
...
...
libavfilter/vf_vibrance.c
View file @
38baaa16
...
...
@@ -31,6 +31,7 @@ typedef struct VibranceContext {
float
intensity
;
float
balance
[
3
];
float
lcoeffs
[
3
];
int
alternate
;
int
depth
;
...
...
@@ -54,12 +55,13 @@ static int vibrance_slice8(AVFilterContext *avctx, void *arg, int jobnr, int nb_
const
float
bc
=
s
->
lcoeffs
[
1
];
const
float
rc
=
s
->
lcoeffs
[
2
];
const
float
intensity
=
s
->
intensity
;
const
float
alternate
=
s
->
alternate
?
1
.
f
:
-
1
.
f
;
const
float
gintensity
=
intensity
*
s
->
balance
[
0
];
const
float
bintensity
=
intensity
*
s
->
balance
[
1
];
const
float
rintensity
=
intensity
*
s
->
balance
[
2
];
const
float
sgintensity
=
FFSIGN
(
intensity
);
const
float
sbintensity
=
FFSIGN
(
intensity
);
const
float
srintensity
=
FFSIGN
(
intensity
);
const
float
sgintensity
=
alternate
*
FFSIGN
(
g
intensity
);
const
float
sbintensity
=
alternate
*
FFSIGN
(
b
intensity
);
const
float
srintensity
=
alternate
*
FFSIGN
(
r
intensity
);
const
int
slice_start
=
(
height
*
jobnr
)
/
nb_jobs
;
const
int
slice_end
=
(
height
*
(
jobnr
+
1
))
/
nb_jobs
;
const
int
glinesize
=
frame
->
linesize
[
0
];
...
...
@@ -112,12 +114,13 @@ static int vibrance_slice16(AVFilterContext *avctx, void *arg, int jobnr, int nb
const
int
width
=
frame
->
width
;
const
int
height
=
frame
->
height
;
const
float
intensity
=
s
->
intensity
;
const
float
alternate
=
s
->
alternate
?
1
.
f
:
-
1
.
f
;
const
float
gintensity
=
intensity
*
s
->
balance
[
0
];
const
float
bintensity
=
intensity
*
s
->
balance
[
1
];
const
float
rintensity
=
intensity
*
s
->
balance
[
2
];
const
float
sgintensity
=
FFSIGN
(
intensity
);
const
float
sbintensity
=
FFSIGN
(
intensity
);
const
float
srintensity
=
FFSIGN
(
intensity
);
const
float
sgintensity
=
alternate
*
FFSIGN
(
g
intensity
);
const
float
sbintensity
=
alternate
*
FFSIGN
(
b
intensity
);
const
float
srintensity
=
alternate
*
FFSIGN
(
r
intensity
);
const
int
slice_start
=
(
height
*
jobnr
)
/
nb_jobs
;
const
int
slice_end
=
(
height
*
(
jobnr
+
1
))
/
nb_jobs
;
const
int
glinesize
=
frame
->
linesize
[
0
]
/
2
;
...
...
@@ -231,6 +234,7 @@ static const AVOption vibrance_options[] = {
{
"rlum"
,
"set the red luma coefficient"
,
OFFSET
(
lcoeffs
[
2
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
0721
86
},
0
,
1
,
VF
},
{
"glum"
,
"set the green luma coefficient"
,
OFFSET
(
lcoeffs
[
0
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
715158
},
0
,
1
,
VF
},
{
"blum"
,
"set the blue luma coefficient"
,
OFFSET
(
lcoeffs
[
1
]),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
212656
},
0
,
1
,
VF
},
{
"alternate"
,
"use alternate colors"
,
OFFSET
(
alternate
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
VF
},
{
NULL
}
};
...
...
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