Go to the documentation of this file.
40 #define OFFSET(x) offsetof(UntileContext, x)
41 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
45 {.str =
"6x5"}, 0, 0,
FLAGS },
55 if (
s->w > UINT_MAX /
s->h) {
60 s->nb_frames =
s->w *
s->h;
86 if (
inlink->w % (
s->w <<
s->desc->log2_chroma_w) ||
87 inlink->h % (
s->h <<
s->desc->log2_chroma_h)) {
89 "Input resolution %ux%u not multiple of layout %ux%u.\n",
126 if (
s->current ==
s->nb_frames - 1) {
134 x = outlink->
w * (
s->current %
s->w);
135 y = outlink->
h * (
s->current /
s->w);
136 out->width = outlink->
w;
137 out->height = outlink->
h;
138 out->data[0] += y *
out->linesize[0];
139 out->data[0] += x *
s->max_step[0];
141 for (
i = 1;
i < 3;
i ++) {
143 out->data[
i] += (y >>
s->desc->log2_chroma_h) *
out->linesize[
i];
144 out->data[
i] += (x >>
s->desc->log2_chroma_w) *
s->max_step[
i];
149 out->data[3] += y *
out->linesize[3];
150 out->data[3] += x *
s->max_step[3];
154 if (++
s->current ==
s->nb_frames)
189 .priv_class = &untile_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 AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
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.
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
const AVFilter ff_vf_untile
#define AV_LOG_VERBOSE
Detailed information.
const char * name
Filter name.
A link between two filters.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
Link properties exposed to filter code, but not external callers.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
static const AVFilterPad untile_outputs[]
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
static av_cold int init(AVFilterContext *ctx)
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVOption untile_options[]
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define FILTER_OUTPUTS(array)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
const AVPixFmtDescriptor * desc
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
AVFILTER_DEFINE_CLASS(untile)
static FilterLink * ff_filter_link(AVFilterLink *link)
static av_cold void uninit(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int format
agreed upon media format
static int activate(AVFilterContext *ctx)
static AVRational av_make_q(int num, int den)
Create an AVRational.
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
AVFilterContext * src
source filter
FF_FILTER_FORWARD_WANTED(outlink, inlink)
static int config_output(AVFilterLink *outlink)
#define i(width, name, range_min, range_max)
AVRational av_gcd_q(AVRational a, AVRational b, int max_den, AVRational def)
Return the best rational so that a and b are multiple of it.
int w
agreed upon image width
#define AV_TIME_BASE
Internal time base represented as integer.
#define FILTER_QUERY_FUNC2(func)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
const char * name
Pad name.
int h
agreed upon image height
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
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.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
FF_FILTER_FORWARD_STATUS(inlink, outlink)
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.