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
33021583
Commit
33021583
authored
Apr 25, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_mix: clip output pixel values
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a5172dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
vf_mix.c
libavfilter/vf_mix.c
+4
-2
No files found.
libavfilter/vf_mix.c
View file @
33021583
...
...
@@ -44,6 +44,7 @@ typedef struct MixContext {
int
nb_frames
;
int
depth
;
int
max
;
int
nb_planes
;
int
linesize
[
4
];
int
height
[
4
];
...
...
@@ -137,7 +138,7 @@ static void mix_frames(MixContext *s, AVFrame **in, AVFrame *out)
val
+=
src
*
s
->
weights
[
i
];
}
dst
[
x
]
=
val
*
s
->
wfactor
;
dst
[
x
]
=
av_clip_uint8
(
val
*
s
->
wfactor
)
;
}
dst
+=
out
->
linesize
[
p
];
...
...
@@ -157,7 +158,7 @@ static void mix_frames(MixContext *s, AVFrame **in, AVFrame *out)
val
+=
src
*
s
->
weights
[
i
];
}
dst
[
x
]
=
val
*
s
->
wfactor
;
dst
[
x
]
=
av_clip
(
val
*
s
->
wfactor
,
0
,
s
->
max
)
;
}
dst
+=
out
->
linesize
[
p
]
/
2
;
...
...
@@ -216,6 +217,7 @@ static int config_output(AVFilterLink *outlink)
return
AVERROR_BUG
;
s
->
nb_planes
=
av_pix_fmt_count_planes
(
outlink
->
format
);
s
->
depth
=
s
->
desc
->
comp
[
0
].
depth
;
s
->
max
=
(
1
<<
s
->
depth
)
-
1
;
if
((
ret
=
av_image_fill_linesizes
(
s
->
linesize
,
inlink
->
format
,
inlink
->
w
))
<
0
)
return
ret
;
...
...
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