Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
88e0e205
Commit
88e0e205
authored
May 08, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: remove alphaextract special code
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a1159318
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
131 deletions
+26
-131
Makefile
libavfilter/Makefile
+1
-1
vf_alphaextract.c
libavfilter/vf_alphaextract.c
+0
-130
vf_extractplanes.c
libavfilter/vf_extractplanes.c
+25
-0
No files found.
libavfilter/Makefile
View file @
88e0e205
...
@@ -101,7 +101,7 @@ OBJS-$(CONFIG_SINE_FILTER) += asrc_sine.o
...
@@ -101,7 +101,7 @@ OBJS-$(CONFIG_SINE_FILTER) += asrc_sine.o
OBJS-$(CONFIG_ANULLSINK_FILTER)
+=
asink_anullsink.o
OBJS-$(CONFIG_ANULLSINK_FILTER)
+=
asink_anullsink.o
OBJS-$(CONFIG_ASS_FILTER)
+=
vf_subtitles.o
OBJS-$(CONFIG_ASS_FILTER)
+=
vf_subtitles.o
OBJS-$(CONFIG_ALPHAEXTRACT_FILTER)
+=
vf_
alphaextract
.o
OBJS-$(CONFIG_ALPHAEXTRACT_FILTER)
+=
vf_
extractplanes
.o
OBJS-$(CONFIG_ALPHAMERGE_FILTER)
+=
vf_alphamerge.o
OBJS-$(CONFIG_ALPHAMERGE_FILTER)
+=
vf_alphamerge.o
OBJS-$(CONFIG_BBOX_FILTER)
+=
bbox.o
vf_bbox.o
OBJS-$(CONFIG_BBOX_FILTER)
+=
bbox.o
vf_bbox.o
OBJS-$(CONFIG_BLACKDETECT_FILTER)
+=
vf_blackdetect.o
OBJS-$(CONFIG_BLACKDETECT_FILTER)
+=
vf_blackdetect.o
...
...
libavfilter/vf_alphaextract.c
deleted
100644 → 0
View file @
a1159318
/*
* Copyright (c) 2012 Steven Robertson
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* simple channel-swapping filter to get at the alpha component
*/
#include <string.h>
#include "libavutil/pixfmt.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"
#include "formats.h"
#include "video.h"
enum
{
Y
,
U
,
V
,
A
};
typedef
struct
{
int
is_packed_rgb
;
uint8_t
rgba_map
[
4
];
}
AlphaExtractContext
;
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
static
const
enum
AVPixelFormat
in_fmts
[]
=
{
AV_PIX_FMT_YUVA444P
,
AV_PIX_FMT_YUVA422P
,
AV_PIX_FMT_YUVA420P
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_BGRA
,
AV_PIX_FMT_ARGB
,
AV_PIX_FMT_ABGR
,
AV_PIX_FMT_NONE
};
static
const
enum
AVPixelFormat
out_fmts
[]
=
{
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
};
ff_formats_ref
(
ff_make_format_list
(
in_fmts
),
&
ctx
->
inputs
[
0
]
->
out_formats
);
ff_formats_ref
(
ff_make_format_list
(
out_fmts
),
&
ctx
->
outputs
[
0
]
->
in_formats
);
return
0
;
}
static
int
config_input
(
AVFilterLink
*
inlink
)
{
AlphaExtractContext
*
extract
=
inlink
->
dst
->
priv
;
extract
->
is_packed_rgb
=
ff_fill_rgba_map
(
extract
->
rgba_map
,
inlink
->
format
)
>=
0
;
return
0
;
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
cur_buf
)
{
AlphaExtractContext
*
extract
=
inlink
->
dst
->
priv
;
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
AVFrame
*
out_buf
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
int
ret
;
if
(
!
out_buf
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
av_frame_copy_props
(
out_buf
,
cur_buf
);
if
(
extract
->
is_packed_rgb
)
{
int
x
,
y
;
uint8_t
*
pcur
,
*
pout
;
for
(
y
=
0
;
y
<
outlink
->
h
;
y
++
)
{
pcur
=
cur_buf
->
data
[
0
]
+
y
*
cur_buf
->
linesize
[
0
]
+
extract
->
rgba_map
[
A
];
pout
=
out_buf
->
data
[
0
]
+
y
*
out_buf
->
linesize
[
0
];
for
(
x
=
0
;
x
<
outlink
->
w
;
x
++
)
{
*
pout
=
*
pcur
;
pout
+=
1
;
pcur
+=
4
;
}
}
}
else
{
int
y
;
for
(
y
=
0
;
y
<
outlink
->
h
;
y
++
)
{
memcpy
(
out_buf
->
data
[
Y
]
+
y
*
out_buf
->
linesize
[
Y
],
cur_buf
->
data
[
A
]
+
y
*
cur_buf
->
linesize
[
A
],
outlink
->
w
);
}
}
ret
=
ff_filter_frame
(
outlink
,
out_buf
);
end:
av_frame_free
(
&
cur_buf
);
return
ret
;
}
static
const
AVFilterPad
alphaextract_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
config_props
=
config_input
,
.
filter_frame
=
filter_frame
,
},
{
NULL
}
};
static
const
AVFilterPad
alphaextract_outputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
},
{
NULL
}
};
AVFilter
avfilter_vf_alphaextract
=
{
.
name
=
"alphaextract"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Extract an alpha channel as a "
"grayscale image component."
),
.
priv_size
=
sizeof
(
AlphaExtractContext
),
.
query_formats
=
query_formats
,
.
inputs
=
alphaextract_inputs
,
.
outputs
=
alphaextract_outputs
,
};
libavfilter/vf_extractplanes.c
View file @
88e0e205
...
@@ -308,3 +308,28 @@ AVFilter avfilter_vf_extractplanes = {
...
@@ -308,3 +308,28 @@ AVFilter avfilter_vf_extractplanes = {
.
outputs
=
NULL
,
.
outputs
=
NULL
,
.
flags
=
AVFILTER_FLAG_DYNAMIC_OUTPUTS
,
.
flags
=
AVFILTER_FLAG_DYNAMIC_OUTPUTS
,
};
};
#if CONFIG_ALPHAEXTRACT_FILTER
static
int
init_alphaextract
(
AVFilterContext
*
ctx
)
{
ExtractPlanesContext
*
e
=
ctx
->
priv
;
e
->
requested_planes
=
PLANE_A
;
return
init
(
ctx
);
}
AVFilter
avfilter_vf_alphaextract
=
{
.
name
=
"alphaextract"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Extract an alpha channel as a "
"grayscale image component."
),
.
priv_size
=
sizeof
(
ExtractPlanesContext
),
.
init
=
init_alphaextract
,
.
uninit
=
uninit
,
.
query_formats
=
query_formats
,
.
inputs
=
extractplanes_inputs
,
.
outputs
=
NULL
,
.
flags
=
AVFILTER_FLAG_DYNAMIC_OUTPUTS
,
};
#endif
/* CONFIG_ALPHAEXTRACT_FILTER */
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