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
8c56a4a1
Commit
8c56a4a1
authored
Feb 10, 2016
by
Timothy Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_blend: Move C dsp function mapping to separate function
parent
8395b6ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
41 deletions
+47
-41
blend.h
libavfilter/blend.h
+1
-0
vf_blend.c
libavfilter/vf_blend.c
+46
-41
No files found.
libavfilter/blend.h
View file @
8c56a4a1
...
...
@@ -71,6 +71,7 @@ typedef struct FilterParams {
struct
FilterParams
*
param
,
double
*
values
);
}
FilterParams
;
void
ff_blend_init
(
FilterParams
*
param
,
int
is_16bit
);
void
ff_blend_init_x86
(
FilterParams
*
param
,
int
is_16bit
);
#endif
/* AVFILTER_BLEND_H */
libavfilter/vf_blend.c
View file @
8c56a4a1
...
...
@@ -437,6 +437,51 @@ static av_cold void uninit(AVFilterContext *ctx)
av_expr_free
(
s
->
params
[
i
].
e
);
}
void
ff_blend_init
(
FilterParams
*
param
,
int
is_16bit
)
{
switch
(
param
->
mode
)
{
case
BLEND_ADDITION
:
param
->
blend
=
is_16bit
?
blend_addition_16bit
:
blend_addition_8bit
;
break
;
case
BLEND_ADDITION128
:
param
->
blend
=
is_16bit
?
blend_addition128_16bit
:
blend_addition128_8bit
;
break
;
case
BLEND_AND
:
param
->
blend
=
is_16bit
?
blend_and_16bit
:
blend_and_8bit
;
break
;
case
BLEND_AVERAGE
:
param
->
blend
=
is_16bit
?
blend_average_16bit
:
blend_average_8bit
;
break
;
case
BLEND_BURN
:
param
->
blend
=
is_16bit
?
blend_burn_16bit
:
blend_burn_8bit
;
break
;
case
BLEND_DARKEN
:
param
->
blend
=
is_16bit
?
blend_darken_16bit
:
blend_darken_8bit
;
break
;
case
BLEND_DIFFERENCE
:
param
->
blend
=
is_16bit
?
blend_difference_16bit
:
blend_difference_8bit
;
break
;
case
BLEND_DIFFERENCE128
:
param
->
blend
=
is_16bit
?
blend_difference128_16bit
:
blend_difference128_8bit
;
break
;
case
BLEND_DIVIDE
:
param
->
blend
=
is_16bit
?
blend_divide_16bit
:
blend_divide_8bit
;
break
;
case
BLEND_DODGE
:
param
->
blend
=
is_16bit
?
blend_dodge_16bit
:
blend_dodge_8bit
;
break
;
case
BLEND_EXCLUSION
:
param
->
blend
=
is_16bit
?
blend_exclusion_16bit
:
blend_exclusion_8bit
;
break
;
case
BLEND_GLOW
:
param
->
blend
=
is_16bit
?
blend_glow_16bit
:
blend_glow_8bit
;
break
;
case
BLEND_HARDLIGHT
:
param
->
blend
=
is_16bit
?
blend_hardlight_16bit
:
blend_hardlight_8bit
;
break
;
case
BLEND_HARDMIX
:
param
->
blend
=
is_16bit
?
blend_hardmix_16bit
:
blend_hardmix_8bit
;
break
;
case
BLEND_LIGHTEN
:
param
->
blend
=
is_16bit
?
blend_lighten_16bit
:
blend_lighten_8bit
;
break
;
case
BLEND_LINEARLIGHT
:
param
->
blend
=
is_16bit
?
blend_linearlight_16bit
:
blend_linearlight_8bit
;
break
;
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_copytop
:
param
->
opacity
==
0
?
blend_copybottom
:
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
;
case
BLEND_PHOENIX
:
param
->
blend
=
is_16bit
?
blend_phoenix_16bit
:
blend_phoenix_8bit
;
break
;
case
BLEND_PINLIGHT
:
param
->
blend
=
is_16bit
?
blend_pinlight_16bit
:
blend_pinlight_8bit
;
break
;
case
BLEND_REFLECT
:
param
->
blend
=
is_16bit
?
blend_reflect_16bit
:
blend_reflect_8bit
;
break
;
case
BLEND_SCREEN
:
param
->
blend
=
is_16bit
?
blend_screen_16bit
:
blend_screen_8bit
;
break
;
case
BLEND_SOFTLIGHT
:
param
->
blend
=
is_16bit
?
blend_softlight_16bit
:
blend_softlight_8bit
;
break
;
case
BLEND_SUBTRACT
:
param
->
blend
=
is_16bit
?
blend_subtract_16bit
:
blend_subtract_8bit
;
break
;
case
BLEND_VIVIDLIGHT
:
param
->
blend
=
is_16bit
?
blend_vividlight_16bit
:
blend_vividlight_8bit
;
break
;
case
BLEND_XOR
:
param
->
blend
=
is_16bit
?
blend_xor_16bit
:
blend_xor_8bit
;
break
;
}
if
(
param
->
opacity
==
0
&&
param
->
mode
!=
BLEND_NORMAL
)
{
param
->
blend
=
blend_copytop
;
}
if
(
ARCH_X86
)
ff_blend_init_x86
(
param
,
is_16bit
);
}
static
int
config_output
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
...
...
@@ -493,47 +538,7 @@ static int config_output(AVFilterLink *outlink)
if
(
s
->
all_opacity
<
1
)
param
->
opacity
=
s
->
all_opacity
;
switch
(
param
->
mode
)
{
case
BLEND_ADDITION
:
param
->
blend
=
is_16bit
?
blend_addition_16bit
:
blend_addition_8bit
;
break
;
case
BLEND_ADDITION128
:
param
->
blend
=
is_16bit
?
blend_addition128_16bit
:
blend_addition128_8bit
;
break
;
case
BLEND_AND
:
param
->
blend
=
is_16bit
?
blend_and_16bit
:
blend_and_8bit
;
break
;
case
BLEND_AVERAGE
:
param
->
blend
=
is_16bit
?
blend_average_16bit
:
blend_average_8bit
;
break
;
case
BLEND_BURN
:
param
->
blend
=
is_16bit
?
blend_burn_16bit
:
blend_burn_8bit
;
break
;
case
BLEND_DARKEN
:
param
->
blend
=
is_16bit
?
blend_darken_16bit
:
blend_darken_8bit
;
break
;
case
BLEND_DIFFERENCE
:
param
->
blend
=
is_16bit
?
blend_difference_16bit
:
blend_difference_8bit
;
break
;
case
BLEND_DIFFERENCE128
:
param
->
blend
=
is_16bit
?
blend_difference128_16bit
:
blend_difference128_8bit
;
break
;
case
BLEND_DIVIDE
:
param
->
blend
=
is_16bit
?
blend_divide_16bit
:
blend_divide_8bit
;
break
;
case
BLEND_DODGE
:
param
->
blend
=
is_16bit
?
blend_dodge_16bit
:
blend_dodge_8bit
;
break
;
case
BLEND_EXCLUSION
:
param
->
blend
=
is_16bit
?
blend_exclusion_16bit
:
blend_exclusion_8bit
;
break
;
case
BLEND_GLOW
:
param
->
blend
=
is_16bit
?
blend_glow_16bit
:
blend_glow_8bit
;
break
;
case
BLEND_HARDLIGHT
:
param
->
blend
=
is_16bit
?
blend_hardlight_16bit
:
blend_hardlight_8bit
;
break
;
case
BLEND_HARDMIX
:
param
->
blend
=
is_16bit
?
blend_hardmix_16bit
:
blend_hardmix_8bit
;
break
;
case
BLEND_LIGHTEN
:
param
->
blend
=
is_16bit
?
blend_lighten_16bit
:
blend_lighten_8bit
;
break
;
case
BLEND_LINEARLIGHT
:
param
->
blend
=
is_16bit
?
blend_linearlight_16bit
:
blend_linearlight_8bit
;
break
;
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_copytop
:
param
->
opacity
==
0
?
blend_copybottom
:
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
;
case
BLEND_PHOENIX
:
param
->
blend
=
is_16bit
?
blend_phoenix_16bit
:
blend_phoenix_8bit
;
break
;
case
BLEND_PINLIGHT
:
param
->
blend
=
is_16bit
?
blend_pinlight_16bit
:
blend_pinlight_8bit
;
break
;
case
BLEND_REFLECT
:
param
->
blend
=
is_16bit
?
blend_reflect_16bit
:
blend_reflect_8bit
;
break
;
case
BLEND_SCREEN
:
param
->
blend
=
is_16bit
?
blend_screen_16bit
:
blend_screen_8bit
;
break
;
case
BLEND_SOFTLIGHT
:
param
->
blend
=
is_16bit
?
blend_softlight_16bit
:
blend_softlight_8bit
;
break
;
case
BLEND_SUBTRACT
:
param
->
blend
=
is_16bit
?
blend_subtract_16bit
:
blend_subtract_8bit
;
break
;
case
BLEND_VIVIDLIGHT
:
param
->
blend
=
is_16bit
?
blend_vividlight_16bit
:
blend_vividlight_8bit
;
break
;
case
BLEND_XOR
:
param
->
blend
=
is_16bit
?
blend_xor_16bit
:
blend_xor_8bit
;
break
;
}
if
(
ARCH_X86
)
ff_blend_init_x86
(
param
,
is_16bit
);
if
(
param
->
opacity
==
0
&&
param
->
mode
!=
BLEND_NORMAL
)
{
param
->
blend
=
blend_copytop
;
}
ff_blend_init
(
param
,
is_16bit
);
if
(
s
->
all_expr
&&
!
param
->
expr_str
)
{
param
->
expr_str
=
av_strdup
(
s
->
all_expr
);
...
...
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