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
8440835d
Commit
8440835d
authored
Dec 03, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_overlay: fix filtering with negative y
parent
8ef0fdaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
vf_overlay.c
libavfilter/vf_overlay.c
+16
-16
No files found.
libavfilter/vf_overlay.c
View file @
8440835d
...
...
@@ -380,15 +380,15 @@ static av_always_inline void blend_slice_packed_rgb(AVFilterContext *ctx,
uint8_t
*
S
,
*
sp
,
*
d
,
*
dp
;
i
=
FFMAX
(
-
y
,
0
);
imax
=
FFMIN
(
-
y
+
dst_h
,
src_h
);
imax
=
FFMIN
3
(
-
y
+
dst_h
,
FFMIN
(
src_h
,
dst_h
),
y
+
src_h
);
slice_start
=
(
imax
*
jobnr
)
/
nb_jobs
;
slice_end
=
(
imax
*
(
jobnr
+
1
))
/
nb_jobs
;
slice_start
=
i
+
(
imax
*
jobnr
)
/
nb_jobs
;
slice_end
=
i
+
(
imax
*
(
jobnr
+
1
))
/
nb_jobs
;
sp
=
src
->
data
[
0
]
+
(
i
+
slice_start
)
*
src
->
linesize
[
0
];
dp
=
dst
->
data
[
0
]
+
(
y
+
i
+
slice_start
)
*
dst
->
linesize
[
0
];
sp
=
src
->
data
[
0
]
+
(
slice_start
)
*
src
->
linesize
[
0
];
dp
=
dst
->
data
[
0
]
+
(
y
+
slice_start
)
*
dst
->
linesize
[
0
];
for
(
i
=
i
+
slice_start
;
i
<
slice_end
;
i
++
)
{
for
(
i
=
slice_start
;
i
<
slice_end
;
i
++
)
{
j
=
FFMAX
(
-
x
,
0
);
S
=
sp
+
j
*
sstep
;
d
=
dp
+
(
x
+
j
)
*
dstep
;
...
...
@@ -468,19 +468,19 @@ static av_always_inline void blend_plane(AVFilterContext *ctx,
int
slice_start
,
slice_end
;
j
=
FFMAX
(
-
yp
,
0
);
jmax
=
FFMIN
(
-
yp
+
dst_hp
,
src_hp
);
jmax
=
FFMIN
3
(
-
yp
+
dst_hp
,
FFMIN
(
src_hp
,
dst_hp
),
yp
+
src_hp
);
slice_start
=
(
jmax
*
jobnr
)
/
nb_jobs
;
slice_end
=
(
jmax
*
(
jobnr
+
1
))
/
nb_jobs
;
slice_start
=
j
+
(
jmax
*
jobnr
)
/
nb_jobs
;
slice_end
=
j
+
(
jmax
*
(
jobnr
+
1
))
/
nb_jobs
;
sp
=
src
->
data
[
i
]
+
(
j
+
slice_start
)
*
src
->
linesize
[
i
];
sp
=
src
->
data
[
i
]
+
(
slice_start
)
*
src
->
linesize
[
i
];
dp
=
dst
->
data
[
dst_plane
]
+
(
yp
+
j
+
slice_start
)
*
dst
->
linesize
[
dst_plane
]
+
(
yp
+
slice_start
)
*
dst
->
linesize
[
dst_plane
]
+
dst_offset
;
ap
=
src
->
data
[
3
]
+
(
j
+
slice_start
<<
vsub
)
*
src
->
linesize
[
3
];
dap
=
dst
->
data
[
3
]
+
((
yp
+
j
+
slice_start
)
<<
vsub
)
*
dst
->
linesize
[
3
];
ap
=
src
->
data
[
3
]
+
(
slice_start
<<
vsub
)
*
src
->
linesize
[
3
];
dap
=
dst
->
data
[
3
]
+
((
yp
+
slice_start
)
<<
vsub
)
*
dst
->
linesize
[
3
];
for
(
j
=
j
+
slice_start
;
j
<
slice_end
;
j
++
)
{
for
(
j
=
slice_start
;
j
<
slice_end
;
j
++
)
{
k
=
FFMAX
(
-
xp
,
0
);
d
=
dp
+
(
xp
+
k
)
*
dst_step
;
s
=
sp
+
k
;
...
...
@@ -961,13 +961,13 @@ static int do_blend(FFFrameSync *fs)
s
->
var_values
[
VAR_Y
],
s
->
y
);
}
if
(
s
->
x
<
mainpic
->
width
&&
s
->
x
+
second
->
width
>=
0
||
if
(
s
->
x
<
mainpic
->
width
&&
s
->
x
+
second
->
width
>=
0
&&
s
->
y
<
mainpic
->
height
&&
s
->
y
+
second
->
height
>=
0
)
{
ThreadData
td
;
td
.
dst
=
mainpic
;
td
.
src
=
second
;
ctx
->
internal
->
execute
(
ctx
,
s
->
blend_slice
,
&
td
,
NULL
,
FFMIN
(
FFM
IN
(
mainpic
->
height
-
s
->
y
,
second
->
height
),
ctx
->
internal
->
execute
(
ctx
,
s
->
blend_slice
,
&
td
,
NULL
,
FFMIN
(
FFM
AX
(
1
,
FFMIN3
(
s
->
y
+
second
->
height
,
FFMIN
(
second
->
height
,
mainpic
->
height
),
mainpic
->
height
-
s
->
y
)
),
ff_filter_get_nb_threads
(
ctx
)));
}
return
ff_filter_frame
(
ctx
->
outputs
[
0
],
mainpic
);
...
...
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