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
710c97d5
Commit
710c97d5
authored
Apr 23, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_premultiply: add planes option
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
9d1f9ba5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
filters.texi
doc/filters.texi
+8
-0
vf_premultiply.c
libavfilter/vf_premultiply.c
+12
-1
No files found.
doc/filters.texi
View file @
710c97d5
...
...
@@ -11077,6 +11077,14 @@ of second stream as alpha.
Both streams must have same dimensions and same pixel format.
The filter accepts the following option:
@table @option
@item planes
Set which planes will be processed, unprocessed planes will be copied.
By default value 0xf, all planes will be processed.
@end table
@section prewitt
Apply prewitt operator to input video stream.
...
...
libavfilter/vf_premultiply.c
View file @
710c97d5
...
...
@@ -30,6 +30,7 @@
typedef
struct
PreMultiplyContext
{
const
AVClass
*
class
;
int
width
[
4
],
height
[
4
];
int
linesize
[
4
];
int
nb_planes
;
int
planes
;
int
half
,
depth
,
offset
;
...
...
@@ -47,6 +48,7 @@ typedef struct PreMultiplyContext {
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
premultiply_options
[]
=
{
{
"planes"
,
"set planes"
,
OFFSET
(
planes
),
AV_OPT_TYPE_INT
,
{.
i64
=
0xF
},
0
,
0xF
,
FLAGS
},
{
NULL
}
};
...
...
@@ -269,6 +271,12 @@ static int process_frame(FFFrameSync *fs)
}
for
(
p
=
0
;
p
<
s
->
nb_planes
;
p
++
)
{
if
(
!
((
1
<<
p
)
&
s
->
planes
))
{
av_image_copy_plane
(
out
->
data
[
p
],
out
->
linesize
[
p
],
base
->
data
[
p
],
base
->
linesize
[
p
],
s
->
linesize
[
p
],
s
->
height
[
p
]);
continue
;
}
s
->
premultiply
[
p
](
base
->
data
[
p
],
alpha
->
data
[
0
],
out
->
data
[
p
],
base
->
linesize
[
p
],
alpha
->
linesize
[
0
],
...
...
@@ -287,10 +295,13 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext
*
ctx
=
inlink
->
dst
;
PreMultiplyContext
*
s
=
ctx
->
priv
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
int
vsub
,
hsub
;
int
vsub
,
hsub
,
ret
;
s
->
nb_planes
=
av_pix_fmt_count_planes
(
inlink
->
format
);
if
((
ret
=
av_image_fill_linesizes
(
s
->
linesize
,
inlink
->
format
,
inlink
->
w
))
<
0
)
return
ret
;
hsub
=
desc
->
log2_chroma_w
;
vsub
=
desc
->
log2_chroma_h
;
s
->
height
[
1
]
=
s
->
height
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
h
,
vsub
);
...
...
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