Go to the documentation of this file.
45 #define OFFSET(x) offsetof(SwapRectContext, x)
46 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
68 static const char *
const var_names[] = {
"w",
"h",
"a",
"n",
"t",
150 w = dw;
h = dh; x1[0] = dx1; y1[0] = dy1; x2[0] = dx2; y2[0] = dy2;
172 lh[0] = lh[3] =
inlink->h;
174 lw[0] = lw[3] =
inlink->w;
176 x1[1] = x1[2] = (x1[0] >>
s->desc->log2_chroma_w);
177 x1[0] = x1[3] = x1[0];
178 y1[1] = y1[2] = (y1[0] >>
s->desc->log2_chroma_h);
179 y1[0] = y1[3] = y1[0];
181 x2[1] = x2[2] = (x2[0] >>
s->desc->log2_chroma_w);
182 x2[0] = x2[3] = x2[0];
183 y2[1] = y2[2] = (y2[0] >>
s->desc->log2_chroma_h);
184 y2[0] = y2[3] = y2[0];
190 for (p = 0; p <
s->nb_planes; p++) {
191 if (
ph[p] == ah[p] && pw[p] == aw[p]) {
192 uint8_t *
src = in->
data[p] + y1[p] * in->
linesize[p] + x1[p] *
s->pixsteps[p];
193 uint8_t *dst = in->
data[p] + y2[p] * in->
linesize[p] + x2[p] *
s->pixsteps[p];
195 for (y = 0; y <
ph[p]; y++) {
196 memcpy(
s->temp,
src, pw[p] *
s->pixsteps[p]);
197 memmove(
src, dst, pw[p] *
s->pixsteps[p]);
198 memcpy(dst,
s->temp, pw[p] *
s->pixsteps[p]);
213 if (!
s->w || !
s->h ||
249 .priv_class = &swaprect_class,
#define FF_ENABLE_DEPRECATION_WARNINGS
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 AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
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 av_cold void uninit(AVFilterContext *ctx)
const AVPixFmtDescriptor * desc
static int FUNC() ph(CodedBitstreamContext *ctx, RWContext *rw, H266RawPH *current)
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define FILTER_QUERY_FUNC(func)
static int query_formats(AVFilterContext *ctx)
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
A filter pad used for either input or output.
const AVFilter ff_vf_swaprect
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
#define AV_CEIL_RSHIFT(a, b)
static double av_q2d(AVRational a)
Convert an AVRational to a double.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
attribute_deprecated int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
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.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
AVFILTER_DEFINE_CLASS(swaprect)
#define av_malloc_array(a, b)
const char * name
Pad name.
static const AVOption swaprect_options[]
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
Compute the max pixel step for each plane of an image with a format described by pixdesc.
#define FF_DISABLE_DEPRECATION_WARNINGS
static const char *const var_names[]
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define FILTER_OUTPUTS(array)
static const AVFilterPad inputs[]
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int config_input(AVFilterLink *inlink)
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.