#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | DelogoContext |
Defines | |
#define | OFFSET(x) offsetof(DelogoContext, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
#define | CHECK_UNSET_OPT(opt) |
Functions | |
static void | apply_delogo (uint8_t *dst, int dst_linesize, uint8_t *src, int src_linesize, int w, int h, int logo_x, int logo_y, int logo_w, int logo_h, int band, int show, int direct) |
Apply a simple delogo algorithm to the image in dst and put the result in src. | |
AVFILTER_DEFINE_CLASS (delogo) | |
static int | query_formats (AVFilterContext *ctx) |
static av_cold int | init (AVFilterContext *ctx, const char *args) |
static int | null_draw_slice (AVFilterLink *link, int y, int h, int slice_dir) |
static int | end_frame (AVFilterLink *inlink) |
Variables | |
static const AVOption | delogo_options [] |
AVFilter | avfilter_vf_delogo |
Definition in file vf_delogo.c.
#define CHECK_UNSET_OPT | ( | opt | ) |
Value:
if (delogo->opt == -1) { \ av_log(delogo, AV_LOG_ERROR, "Option %s was not set.\n", #opt); \ return AVERROR(EINVAL); \ }
Referenced by init().
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 143 of file vf_delogo.c.
#define OFFSET | ( | x | ) | offsetof(DelogoContext, x) |
Definition at line 142 of file vf_delogo.c.
static void apply_delogo | ( | uint8_t * | dst, | |
int | dst_linesize, | |||
uint8_t * | src, | |||
int | src_linesize, | |||
int | w, | |||
int | h, | |||
int | logo_x, | |||
int | logo_y, | |||
int | logo_w, | |||
int | logo_h, | |||
int | band, | |||
int | show, | |||
int | direct | |||
) | [static] |
Apply a simple delogo algorithm to the image in dst and put the result in src.
The algorithm is only applied to the region specified by the logo parameters.
w | width of the input image | |
h | height of the input image | |
logo_x | x coordinate of the top left corner of the logo region | |
logo_y | y coordinate of the top left corner of the logo region | |
logo_w | width of the logo | |
logo_h | height of the logo | |
band | the size of the band around the processed area | |
show | show a rectangle around the processed area, useful for parameters tweaking | |
direct | if non-zero perform in-place processing |
Definition at line 55 of file vf_delogo.c.
Referenced by end_frame().
AVFILTER_DEFINE_CLASS | ( | delogo | ) |
static int end_frame | ( | AVFilterLink * | inlink | ) | [static] |
Definition at line 217 of file vf_delogo.c.
static av_cold int init | ( | AVFilterContext * | ctx, | |
const char * | args | |||
) | [static] |
Definition at line 171 of file vf_delogo.c.
static int null_draw_slice | ( | AVFilterLink * | link, | |
int | y, | |||
int | h, | |||
int | slice_dir | |||
) | [static] |
Definition at line 212 of file vf_delogo.c.
static int query_formats | ( | AVFilterContext * | ctx | ) | [static] |
Definition at line 158 of file vf_delogo.c.
Initial value:
{ .name = "delogo", .description = NULL_IF_CONFIG_SMALL("Remove logo from input video."), .priv_size = sizeof(DelogoContext), .init = init, .query_formats = query_formats, .inputs = (const AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = ff_null_get_video_buffer, .start_frame = ff_inplace_start_frame, .draw_slice = null_draw_slice, .end_frame = end_frame, .min_perms = AV_PERM_WRITE | AV_PERM_READ }, { .name = NULL}}, .outputs = (const AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, }
Definition at line 248 of file vf_delogo.c.
const AVOption delogo_options[] [static] |
Initial value:
{ {"x", "set logo x position", OFFSET(x), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, {"y", "set logo y position", OFFSET(y), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, {"w", "set logo width", OFFSET(w), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, {"h", "set logo height", OFFSET(h), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, {"band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.i64 = 4}, -1, INT_MAX, FLAGS}, {"t", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.i64 = 4}, -1, INT_MAX, FLAGS}, {"show", "show delogo area", OFFSET(show), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS}, {NULL}, }
Definition at line 145 of file vf_delogo.c.