63 if (
s->is_packed_rgb) {
66 for (y = 0; y < main_buf->
height; y++) {
68 pout = main_buf->
data[0] + y * main_buf->
linesize[0] +
s->rgba_map[
A];
69 for (x = 0; x < main_buf->
width; x++) {
76 const int main_linesize = main_buf->
linesize[
A];
77 const int alpha_linesize = alpha_buf->
linesize[
Y];
79 alpha_buf->
data[
Y], alpha_linesize,
80 FFMIN(main_linesize, alpha_linesize), alpha_buf->
height);
111 &
ctx->inputs[1]->outcfg.formats);
131 if (mainlink->
w != alphalink->
w || mainlink->
h != alphalink->
h) {
133 "Input frame sizes do not match (%dx%d vs %dx%d).\n",
134 mainlink->
w, mainlink->
h,
135 alphalink->
w, alphalink->
h);
142 outlink->
w = mainlink->
w;
143 outlink->
h = mainlink->
h;
192 .
name =
"alphamerge",
194 "input into the alpha channel of the first input."),
195 .preinit = alphamerge_framesync_preinit,
197 .priv_class = &alphamerge_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
#define flags(name, subs,...)
#define fs(width, name, subs,...)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
Same as ff_framesync_dualinput_get(), but make sure that f0 is writable.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Describe the class of an AVClass context structure.
void * priv
private data for use by the filter
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static const AVFilterPad alphamerge_inputs[]
static int do_alphamerge(FFFrameSync *fs)
static int query_formats(AVFilterContext *ctx)
static const AVOption alphamerge_options[]
static int config_input_main(AVFilterLink *inlink)
FRAMESYNC_DEFINE_CLASS(alphamerge, AlphaMergeContext, fs)
static int activate(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad alphamerge_outputs[]
static int config_output(AVFilterLink *outlink)
AVFilter ff_vf_alphamerge