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
613f7164
Commit
613f7164
authored
May 19, 2023
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_mix: improve speed even more by avoiding using filter private context
parent
c789a232
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
vf_mix.c
libavfilter/vf_mix.c
+8
-5
No files found.
libavfilter/vf_mix.c
View file @
613f7164
...
...
@@ -161,27 +161,27 @@ typedef struct ThreadData {
continue; \
} \
\
for (int i = 0; i <
s->nb_inputs; i++)
\
for (int i = 0; i <
nb_inputs; i++)
\
linesize[i] = in[i]->linesize[p]; \
\
for (int i = 0; i <
s->nb_inputs; i++)
\
for (int i = 0; i <
nb_inputs; i++)
\
srcf[i] = in[i]->data[p] + slice_start * linesize[i]; \
\
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
float val = 0.f; \
\
for (int i = 0; i <
s->nb_inputs; i++) {
\
for (int i = 0; i <
nb_inputs; i++) {
\
float src = *(type *)(srcf[i] + x * sizeof(type)); \
\
val += src * weights[i]; \
} \
\
dst[x] = clip(fun(val *
s->wfactor), 0, s->max);
\
dst[x] = clip(fun(val *
wfactor), 0, max);
\
} \
\
dst += dst_linesize; \
for (int i = 0; i <
s->nb_inputs; i++)
\
for (int i = 0; i <
nb_inputs; i++)
\
srcf[i] += linesize[i]; \
} \
}
...
...
@@ -200,6 +200,9 @@ static int mix_frames(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
const
float
*
weights
=
s
->
weights
;
uint8_t
**
srcf
=
s
->
data
+
jobnr
*
s
->
nb_inputs
;
int
*
linesize
=
s
->
linesize
+
jobnr
*
s
->
nb_inputs
;
const
int
nb_inputs
=
s
->
nb_inputs
;
const
float
wfactor
=
s
->
wfactor
;
const
int
max
=
s
->
max
;
if
(
s
->
depth
<=
8
)
{
MIX_SLICE
(
uint8_t
,
lrintf
,
CLIP8
)
...
...
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