Go to the documentation of this file.
47 #define OFFSET(x) offsetof(CoverContext, x)
48 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
68 for (p = 0; p < 3; p++) {
73 for (y = 0; y <
h; y++) {
74 for (x = 0; x <
w; x++) {
95 for (y = 0; y <
h; y++) {
96 for (x = 0; x <
w; x++) {
100 int scale = 65536 / (x + 1);
105 int scale = 65536 / (y + 1);
110 int scale = 65536 / (
w - x);
115 int scale = 65536 / (
h - y);
130 int ret, x = -1, y = -1,
w = -1,
h = -1;
137 if (ex && ey && ew && eh) {
138 x = strtol(ex->
value, &xendptr, 10);
139 y = strtol(ey->
value, ¥dptr, 10);
140 w = strtol(ew->
value, &wendptr, 10);
141 h = strtol(eh->
value, &hendptr, 10);
144 if (!xendptr || *xendptr || !yendptr || *yendptr ||
145 !wendptr || *wendptr || !hendptr || *hendptr
182 blur (cover, in, x, y);
237 .
name =
"cover_rect",
245 .priv_class = &cover_rect_class,
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
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVFilter ff_vf_cover_rect
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
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_always_inline float scale(float x, float s)
A filter pad used for either input or output.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const AVFilterPad cover_rect_inputs[]
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_CEIL_RSHIFT(a, b)
static void cover_rect(CoverContext *cover, AVFrame *in, int offx, int offy)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FILTER_INPUTS(array)
int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe)
Make sure a frame is writable.
Describe the class of an AVClass context structure.
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static void blur(CoverContext *cover, AVFrame *in, int offx, int offy)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define FILTER_PIXFMTS(...)
int ff_load_image(uint8_t *data[4], int linesize[4], int *w, int *h, enum AVPixelFormat *pix_fmt, const char *filename, void *log_ctx)
Load image from filename and put the resulting image in data.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
static av_cold void uninit(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
const char * name
Pad name.
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
AVDictionary * metadata
metadata.
static av_cold int init(AVFilterContext *ctx)
AVFILTER_DEFINE_CLASS(cover_rect)
#define FILTER_OUTPUTS(array)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static const AVOption cover_rect_options[]