96 memset(ptr + y * linesize,
105 memcpy(ptr + y * linesize,
110 memcpy(ptr + y * linesize,
122 uint16_t *ptr = (uint16_t *)frame->
data[p];
123 int linesize = frame->
linesize[p] / 2;
127 ptr[y * linesize + x] = *(ptr + y * linesize + s->
borders[p].
left);
137 memcpy(ptr + y * linesize,
142 memcpy(ptr + y * linesize,
159 ptr[y * linesize + x] = ptr[y * linesize + s->
borders[p].
left * 2 - 1 - x];
169 memcpy(ptr + y * linesize,
170 ptr + (s->
borders[p].
top * 2 - 1 - y) * linesize,
187 uint16_t *ptr = (uint16_t *)frame->
data[p];
188 int linesize = frame->
linesize[p] / 2;
192 ptr[y * linesize + x] = ptr[y * linesize + s->
borders[p].
left * 2 - 1 - x];
202 memcpy(ptr + y * linesize,
203 ptr + (s->
borders[p].
top * 2 - 1 - y) * linesize,
225 memset(ptr + y * linesize, fill, s->
borders[p].
left);
231 memset(ptr + y * linesize, fill, s->
planewidth[p]);
235 memset(ptr + y * linesize, fill, s->
planewidth[p]);
245 uint16_t *ptr = (uint16_t *)frame->
data[p];
247 int linesize = frame->
linesize[p] / 2;
251 ptr[y * linesize + x] =
fill;
261 ptr[y * linesize + x] =
fill;
267 ptr[y * linesize + x] =
fill;
283 ptr[y * linesize + x] = ptr[y * linesize + s->
borders[p].
left * 2 - x];
293 memcpy(ptr + y * linesize,
311 uint16_t *ptr = (uint16_t *)frame->
data[p];
312 int linesize = frame->
linesize[p] / 2;
316 ptr[y * linesize + x] = ptr[y * linesize + s->
borders[p].
left * 2 - x];
326 memcpy(ptr + y * linesize,
359 memcpy(ptr + y * linesize,
377 uint16_t *ptr = (uint16_t *)frame->
data[p];
378 int linesize = frame->
linesize[p] / 2;
392 memcpy(ptr + y * linesize,
407 return av_clip_uint8(((fill * 256 * pos / size) + (src * 256 * (size - pos) / size)) >> 8);
412 return av_clip_uintp2_c(((fill * (1LL << depth) * pos / size) + (src * (1LL << depth) * (size - pos) / size)) >> depth, depth);
422 const int linesize = frame->
linesize[p];
428 for (y = 0; y < start_top; y++) {
430 int src = ptr[y * linesize + x];
431 ptr[y * linesize + x] =
lerp8(fill, src, start_top - y, start_top);
435 for (y = start_bottom; y < s->
planeheight[p]; y++) {
437 int src = ptr[y * linesize + x];
443 for (x = 0; x < start_left; x++) {
444 int src = ptr[y * linesize + x];
445 ptr[y * linesize + x] =
lerp8(fill, src, start_left - x, start_left);
449 int src = ptr[y * linesize + start_right + x];
462 uint16_t *ptr = (uint16_t *)frame->
data[p];
463 const uint16_t
fill = s->
fill[p] << (depth - 8);
464 const int linesize = frame->
linesize[p] / 2;
470 for (y = 0; y < start_top; y++) {
472 int src = ptr[y * linesize + x];
473 ptr[y * linesize + x] =
lerp16(
fill, src, start_top - y, start_top, depth);
477 for (y = start_bottom; y < s->
planeheight[p]; y++) {
479 int src = ptr[y * linesize + x];
485 for (x = 0; x < start_left; x++) {
486 int src = ptr[y * linesize + x];
487 ptr[y * linesize + x] =
lerp16(
fill, src, start_left - x, start_left, depth);
491 int src = ptr[y * linesize + start_right + x];
522 inlink->
w <= s->
left ||
525 inlink->
h <= s->
top ||
527 inlink->
w < s->
left * 2 ||
528 inlink->
w < s->
right * 2 ||
529 inlink->
h < s->
top * 2 ||
570 for (i = 0; i < 4; i++)
580 char *res,
int res_len,
int flags)
591 #define OFFSET(x) offsetof(FillBordersContext, x) 592 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM 632 .
name =
"fillborders",
635 .priv_class = &fillborders_class,
637 .
inputs = fillborders_inputs,
638 .
outputs = fillborders_outputs,
static int lerp16(int fill, int src, int pos, int size, int depth)
AVFILTER_DEFINE_CLASS(fillborders)
#define AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P9
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static const AVOption fillborders_options[]
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA422P10
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Main libavfilter public API header.
int h
agreed upon image height
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV420P12
static void fixed_borders16(FillBordersContext *s, AVFrame *frame)
static const AVFilterPad fillborders_inputs[]
static void mirror_borders8(FillBordersContext *s, AVFrame *frame)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
static void fade_borders16(FillBordersContext *s, AVFrame *frame)
#define AV_PIX_FMT_GRAY10
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
const char * name
Pad name.
#define AV_PIX_FMT_GRAY12
AVFilterLink ** inputs
array of pointers to input links
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static void mirror_borders16(FillBordersContext *s, AVFrame *frame)
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
static void fade_borders8(FillBordersContext *s, AVFrame *frame)
#define AV_PIX_FMT_YUVA420P9
static void smear_borders16(FillBordersContext *s, AVFrame *frame)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static void fixed_borders8(FillBordersContext *s, AVFrame *frame)
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUVA420P16
A filter pad used for either input or output.
A link between two filters.
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Various defines for YUV<->RGB conversion.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
static void reflect_borders8(FillBordersContext *s, AVFrame *frame)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options...
void * priv
private data for use by the filter
#define RGB_TO_U_CCIR(r1, g1, b1, shift)
#define AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_GBRAP12
simple assert() macros that are a bit more flexible than ISO C assert().
#define AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_GBRAP16
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
#define AV_PIX_FMT_YUV422P9
uint8_t nb_components
The number of components each pixel has, (1-4)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GRAY16
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static void smear_borders8(FillBordersContext *s, AVFrame *frame)
#define AV_PIX_FMT_YUVA444P12
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static int config_input(AVFilterLink *inlink)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_GBRP14
static const AVFilterPad outputs[]
int format
agreed upon media format
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P14
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_YUV420P10
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static int query_formats(AVFilterContext *ctx)
Describe the class of an AVClass context structure.
static const AVFilterPad fillborders_outputs[]
const char * name
Filter name.
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV420P9
AVFilterLink ** outputs
array of pointers to output links
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_GBRP12
#define flags(name, subs,...)
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P12
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
static void reflect_borders16(FillBordersContext *s, AVFrame *frame)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal and external API header
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_YUVA444P9
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static void wrap_borders16(FillBordersContext *s, AVFrame *frame)
AVFilterContext * dst
dest filter
AVFilter ff_vf_fillborders
#define RGB_TO_V_CCIR(r1, g1, b1, shift)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
static void wrap_borders8(FillBordersContext *s, AVFrame *frame)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
void(* fillborders)(struct FillBordersContext *s, AVFrame *frame)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
static int lerp8(int fill, int src, int pos, int size)
int depth
Number of bits in the component.
#define RGB_TO_Y_CCIR(r, g, b)
AVPixelFormat
Pixel format.
mode
Use these values in ebur128_init (or'ed).
#define AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUVA422P12
#define AV_CEIL_RSHIFT(a, b)
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
Clip a signed integer to an unsigned power of two range.