45#define OFFSET(x) offsetof(CoverContext, x)
46#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
66 for (p = 0; p < 3; p++) {
71 for (y = 0; y <
h; y++) {
72 for (x = 0; x <
w; x++) {
93 for (y = 0; y <
h; y++) {
94 for (x = 0; x <
w; x++) {
98 int scale = 65536 / (x + 1);
103 int scale = 65536 / (y + 1);
108 int scale = 65536 / (
w - x);
113 int scale = 65536 / (
h - y);
128 int ret, x = -1, y = -1,
w = -1,
h = -1;
135 if (ex && ey && ew && eh) {
136 x = strtol(ex->
value, &xendptr, 10);
137 y = strtol(ey->
value, ¥dptr, 10);
138 w = strtol(ew->
value, &wendptr, 10);
139 h = strtol(eh->
value, &hendptr, 10);
142 if (!xendptr || *xendptr || !yendptr || *yendptr ||
143 !wendptr || *wendptr || !hendptr || *hendptr
180 blur (cover, in, x, y);
228 .p.name =
"cover_rect",
230 .p.priv_class = &cover_rect_class,
static int config_input(AVFilterLink *inlink)
const FFFilter ff_vf_cover_rect
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe)
Make sure a frame is writable.
#define AV_CEIL_RSHIFT(a, b)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void scale(int *out, const int *in, const int w, const int h, const int shift)
int ff_load_image(struct AVFrame **outframe, const char *filename, void *log_ctx)
Load image from filename and put the resulting image in an AVFrame.
Miscellaneous utilities which make use of the libavformat library.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FILTER_PIXFMTS(...)
#define AVFILTER_DEFINE_CLASS(fname)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVDictionary * metadata
metadata.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
static void blur(CoverContext *cover, AVFrame *in, int offx, int offy)
static const AVFilterPad cover_rect_inputs[]
static int config_input(AVFilterLink *inlink)
static void cover_rect(CoverContext *cover, AVFrame *in, int offx, int offy)
static const AVOption cover_rect_options[]
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static av_cold void uninit(AVFilterContext *ctx)
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.