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
71 static const char *
const var_names[] = {
"w",
"h",
"a",
"n",
"t",
154 w = dw;
h = dh; x1[0] = dx1; y1[0] = dy1; x2[0] = dx2; y2[0] = dy2;
176 lh[0] = lh[3] =
inlink->h;
178 lw[0] = lw[3] =
inlink->w;
180 x1[1] = x1[2] = (x1[0] >>
s->desc->log2_chroma_w);
181 x1[0] = x1[3] = x1[0];
182 y1[1] = y1[2] = (y1[0] >>
s->desc->log2_chroma_h);
183 y1[0] = y1[3] = y1[0];
185 x2[1] = x2[2] = (x2[0] >>
s->desc->log2_chroma_w);
186 x2[0] = x2[3] = x2[0];
187 y2[1] = y2[2] = (y2[0] >>
s->desc->log2_chroma_h);
188 y2[0] = y2[3] = y2[0];
194 for (p = 0; p <
s->nb_planes; p++) {
195 if (
ph[p] == ah[p] && pw[p] == aw[p]) {
196 uint8_t *
src = in->
data[p] + y1[p] * in->
linesize[p] + x1[p] *
s->pixsteps[p];
197 uint8_t *
dst = in->
data[p] + y2[p] * in->
linesize[p] + x2[p] *
s->pixsteps[p];
199 for (y = 0; y <
ph[p]; y++) {
200 memcpy(
s->temp,
src, pw[p] *
s->pixsteps[p]);
201 memmove(
src,
dst, pw[p] *
s->pixsteps[p]);
202 memcpy(
dst,
s->temp, pw[p] *
s->pixsteps[p]);
217 if (!
s->w || !
s->h ||
253 .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
#define FILTER_INPUTS(array)
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).
const char * name
Filter name.
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Link properties exposed to filter code, but not external callers.
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_OUTPUTS(array)
Describe the class of an AVClass context structure.
static FilterLink * ff_filter_link(AVFilterLink *link)
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
#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.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#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)
#define FILTER_QUERY_FUNC2(func)
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...
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...
@ 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...
#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)