Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
0da255dd
Commit
0da255dd
authored
Feb 14, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_mix: improve speed of processing
parent
e235c764
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
vf_mix.c
libavfilter/vf_mix.c
+7
-6
No files found.
libavfilter/vf_mix.c
View file @
0da255dd
...
...
@@ -138,6 +138,7 @@ static int mix_frames(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
ThreadData
*
td
=
arg
;
AVFrame
**
in
=
td
->
in
;
AVFrame
*
out
=
td
->
out
;
const
float
*
weights
=
s
->
weights
;
int
i
,
p
,
x
,
y
;
if
(
s
->
depth
<=
8
)
{
...
...
@@ -148,15 +149,15 @@ static int mix_frames(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
for
(
y
=
slice_start
;
y
<
slice_end
;
y
++
)
{
for
(
x
=
0
;
x
<
s
->
linesize
[
p
];
x
++
)
{
int
val
=
0
;
float
val
=
0
.
f
;
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
uint8_t
src
=
in
[
i
]
->
data
[
p
][
y
*
in
[
i
]
->
linesize
[
p
]
+
x
];
val
+=
src
*
s
->
weights
[
i
];
val
+=
src
*
weights
[
i
];
}
dst
[
x
]
=
av_clip_uint8
(
val
*
s
->
wfactor
);
dst
[
x
]
=
av_clip_uint8
(
lrintf
(
val
*
s
->
wfactor
)
);
}
dst
+=
out
->
linesize
[
p
];
...
...
@@ -170,15 +171,15 @@ static int mix_frames(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
for
(
y
=
slice_start
;
y
<
slice_end
;
y
++
)
{
for
(
x
=
0
;
x
<
s
->
linesize
[
p
]
/
2
;
x
++
)
{
int
val
=
0
;
float
val
=
0
.
f
;
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
uint16_t
src
=
AV_RN16
(
in
[
i
]
->
data
[
p
]
+
y
*
in
[
i
]
->
linesize
[
p
]
+
x
*
2
);
val
+=
src
*
s
->
weights
[
i
];
val
+=
src
*
weights
[
i
];
}
dst
[
x
]
=
av_clip
(
val
*
s
->
wfactor
,
0
,
s
->
max
);
dst
[
x
]
=
av_clip
(
lrintf
(
val
*
s
->
wfactor
)
,
0
,
s
->
max
);
}
dst
+=
out
->
linesize
[
p
]
/
2
;
...
...
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