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
6260ab60
Commit
6260ab60
authored
Dec 18, 2017
by
Mateusz
Committed by
Paul B Mahol
Dec 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_overlay: fix packed_rgb case
Signed-off-by:
Mateusz Brzostek
<
mateuszb@poczta.onet.pl
>
parent
df3222d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
vf_overlay.c
libavfilter/vf_overlay.c
+10
-7
No files found.
libavfilter/vf_overlay.c
View file @
6260ab60
...
...
@@ -456,9 +456,12 @@ static av_always_inline void blend_image_packed_rgb(AVFilterContext *ctx,
default:
// main_value = main_value * (1 - alpha) + overlay_value * alpha
// since alpha is in the range 0-255, the result must divided by 255
d
[
dr
]
=
is_straight
?
FAST_DIV255
(
d
[
dr
]
*
(
255
-
alpha
)
+
S
[
sr
]
*
alpha
)
:
FAST_DIV255
(
d
[
dr
]
*
(
255
-
alpha
)
+
S
[
sr
]);
d
[
dg
]
=
is_straight
?
FAST_DIV255
(
d
[
dg
]
*
(
255
-
alpha
)
+
S
[
sg
]
*
alpha
)
:
FAST_DIV255
(
d
[
dr
]
*
(
255
-
alpha
)
+
S
[
sr
]);
d
[
db
]
=
is_straight
?
FAST_DIV255
(
d
[
db
]
*
(
255
-
alpha
)
+
S
[
sb
]
*
alpha
)
:
FAST_DIV255
(
d
[
dr
]
*
(
255
-
alpha
)
+
S
[
sr
]);
d
[
dr
]
=
is_straight
?
FAST_DIV255
(
d
[
dr
]
*
(
255
-
alpha
)
+
S
[
sr
]
*
alpha
)
:
FFMIN
(
FAST_DIV255
(
d
[
dr
]
*
(
255
-
alpha
))
+
S
[
sr
],
255
);
d
[
dg
]
=
is_straight
?
FAST_DIV255
(
d
[
dg
]
*
(
255
-
alpha
)
+
S
[
sg
]
*
alpha
)
:
FFMIN
(
FAST_DIV255
(
d
[
dg
]
*
(
255
-
alpha
))
+
S
[
sg
],
255
);
d
[
db
]
=
is_straight
?
FAST_DIV255
(
d
[
db
]
*
(
255
-
alpha
)
+
S
[
sb
]
*
alpha
)
:
FFMIN
(
FAST_DIV255
(
d
[
db
]
*
(
255
-
alpha
))
+
S
[
sb
],
255
);
}
if
(
main_has_alpha
)
{
switch
(
alpha
)
{
...
...
@@ -742,22 +745,22 @@ static void blend_image_gbrap_pm(AVFilterContext *ctx, AVFrame *dst, const AVFra
static
void
blend_image_rgb
(
AVFilterContext
*
ctx
,
AVFrame
*
dst
,
const
AVFrame
*
src
,
int
x
,
int
y
)
{
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
0
,
x
,
y
,
0
);
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
0
,
x
,
y
,
1
);
}
static
void
blend_image_rgba
(
AVFilterContext
*
ctx
,
AVFrame
*
dst
,
const
AVFrame
*
src
,
int
x
,
int
y
)
{
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
1
,
x
,
y
,
0
);
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
1
,
x
,
y
,
1
);
}
static
void
blend_image_rgb_pm
(
AVFilterContext
*
ctx
,
AVFrame
*
dst
,
const
AVFrame
*
src
,
int
x
,
int
y
)
{
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
0
,
x
,
y
,
1
);
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
0
,
x
,
y
,
0
);
}
static
void
blend_image_rgba_pm
(
AVFilterContext
*
ctx
,
AVFrame
*
dst
,
const
AVFrame
*
src
,
int
x
,
int
y
)
{
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
1
,
x
,
y
,
1
);
blend_image_packed_rgb
(
ctx
,
dst
,
src
,
1
,
x
,
y
,
0
);
}
static
int
config_input_main
(
AVFilterLink
*
inlink
)
...
...
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