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
ba25936d
Commit
ba25936d
authored
Feb 13, 2016
by
Timothy Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_blend: Templatize identity function and use a better name
parent
4c44972f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
vf_blend.c
libavfilter/vf_blend.c
+14
-8
No files found.
libavfilter/vf_blend.c
View file @
ba25936d
...
...
@@ -118,15 +118,21 @@ static const AVOption blend_options[] = {
AVFILTER_DEFINE_CLASS
(
blend
);
static
void
blend_normal
(
const
uint8_t
*
top
,
ptrdiff_t
top_linesize
,
const
uint8_t
*
bottom
,
ptrdiff_t
bottom_linesize
,
uint8_t
*
dst
,
ptrdiff_t
dst_linesize
,
ptrdiff_t
width
,
ptrdiff_t
start
,
ptrdiff_t
end
,
FilterParams
*
param
,
double
*
values
)
{
av_image_copy_plane
(
dst
,
dst_linesize
,
top
,
top_linesize
,
width
,
end
-
start
);
#define COPY(src) \
static void blend_copy ## src(const uint8_t *top, ptrdiff_t top_linesize, \
const uint8_t *bottom, ptrdiff_t bottom_linesize,\
uint8_t *dst, ptrdiff_t dst_linesize, \
ptrdiff_t width, ptrdiff_t start, ptrdiff_t end, \
FilterParams *param, double *values) \
{ \
av_image_copy_plane(dst, dst_linesize, src, src ## _linesize, \
width, end - start); \
}
COPY
(
top
)
#undef COPY
static
void
blend_normal_8bit
(
const
uint8_t
*
top
,
ptrdiff_t
top_linesize
,
const
uint8_t
*
bottom
,
ptrdiff_t
bottom_linesize
,
uint8_t
*
dst
,
ptrdiff_t
dst_linesize
,
...
...
@@ -505,7 +511,7 @@ static int config_output(AVFilterLink *outlink)
case
BLEND_MULTIPLY
:
param
->
blend
=
is_16bit
?
blend_multiply_16bit
:
blend_multiply_8bit
;
break
;
case
BLEND_MULTIPLY128
:
param
->
blend
=
is_16bit
?
blend_multiply128_16bit
:
blend_multiply128_8bit
;
break
;
case
BLEND_NEGATION
:
param
->
blend
=
is_16bit
?
blend_negation_16bit
:
blend_negation_8bit
;
break
;
case
BLEND_NORMAL
:
param
->
blend
=
param
->
opacity
==
1
?
blend_
normal
:
case
BLEND_NORMAL
:
param
->
blend
=
param
->
opacity
==
1
?
blend_
copytop
:
is_16bit
?
blend_normal_16bit
:
blend_normal_8bit
;
break
;
case
BLEND_OR
:
param
->
blend
=
is_16bit
?
blend_or_16bit
:
blend_or_8bit
;
break
;
case
BLEND_OVERLAY
:
param
->
blend
=
is_16bit
?
blend_overlay_16bit
:
blend_overlay_8bit
;
break
;
...
...
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