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
4cf60b4f
Commit
4cf60b4f
authored
Sep 26, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_blend: add addition128 mode
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
2ab65b65
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
filters.texi
doc/filters.texi
+1
-0
vf_blend.c
libavfilter/vf_blend.c
+5
-0
No files found.
doc/filters.texi
View file @
4cf60b4f
...
...
@@ -3493,6 +3493,7 @@ of @var{all_mode}. Default value is @code{normal}.
Available values for component modes are:
@table @samp
@item addition
@item addition128
@item and
@item average
@item burn
...
...
libavfilter/vf_blend.c
View file @
4cf60b4f
...
...
@@ -62,6 +62,7 @@ enum BlendMode {
BLEND_HARDMIX
,
BLEND_LINEARLIGHT
,
BLEND_GLOW
,
BLEND_ADDITION128
,
BLEND_NB
};
...
...
@@ -110,6 +111,7 @@ typedef struct {
{ "c3_mode", "set component #3 blend mode", OFFSET(params[3].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, "mode"},\
{ "all_mode", "set blend mode for all components", OFFSET(all_mode), AV_OPT_TYPE_INT, {.i64=-1},-1, BLEND_NB-1, FLAGS, "mode"},\
{ "addition", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_ADDITION}, 0, 0, FLAGS, "mode" },\
{ "addition128", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_ADDITION128}, 0, 0, FLAGS, "mode" },\
{ "and", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_AND}, 0, 0, FLAGS, "mode" },\
{ "average", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_AVERAGE}, 0, 0, FLAGS, "mode" },\
{ "burn", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_BURN}, 0, 0, FLAGS, "mode" },\
...
...
@@ -224,6 +226,7 @@ static void blend_## name##_16bit(const uint8_t *_top, int top_linesize, \
#define DODGE(a, b) (((a) == 255) ? (a) : FFMIN(255, (((b) << 8) / (255 - (a)))))
DEFINE_BLEND8
(
addition
,
FFMIN
(
255
,
A
+
B
))
DEFINE_BLEND8
(
addition128
,
av_clip_uint8
(
A
+
B
-
128
))
DEFINE_BLEND8
(
average
,
(
A
+
B
)
/
2
)
DEFINE_BLEND8
(
subtract
,
FFMAX
(
0
,
A
-
B
))
DEFINE_BLEND8
(
multiply
,
MULTIPLY
(
1
,
A
,
B
))
...
...
@@ -262,6 +265,7 @@ DEFINE_BLEND8(linearlight,av_clip_uint8((B < 128) ? B + 2 * A - 255 : B + 2 * (A
#define DODGE(a, b) (((a) == 65535) ? (a) : FFMIN(65535, (((b) << 16) / (65535 - (a)))))
DEFINE_BLEND16
(
addition
,
FFMIN
(
65535
,
A
+
B
))
DEFINE_BLEND16
(
addition128
,
av_clip_uint16
(
A
+
B
-
32768
))
DEFINE_BLEND16
(
average
,
(
A
+
B
)
/
2
)
DEFINE_BLEND16
(
subtract
,
FFMAX
(
0
,
A
-
B
))
DEFINE_BLEND16
(
multiply
,
MULTIPLY
(
1
,
A
,
B
))
...
...
@@ -481,6 +485,7 @@ static int config_output(AVFilterLink *outlink)
switch
(
param
->
mode
)
{
case
BLEND_ADDITION
:
param
->
blend
=
is_16bit
?
blend_addition_16bit
:
blend_addition_8bit
;
break
;
case
BLEND_ADDITION128
:
param
->
blend
=
is_16bit
?
blend_addition128_16bit
:
blend_addition128_8bit
;
break
;
case
BLEND_AND
:
param
->
blend
=
is_16bit
?
blend_and_16bit
:
blend_and_8bit
;
break
;
case
BLEND_AVERAGE
:
param
->
blend
=
is_16bit
?
blend_average_16bit
:
blend_average_8bit
;
break
;
case
BLEND_BURN
:
param
->
blend
=
is_16bit
?
blend_burn_16bit
:
blend_burn_8bit
;
break
;
...
...
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