Go to the documentation of this file.
39 #define OFFSET(x) offsetof(UntileContext, x)
40 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
44 {.str =
"6x5"}, 0, 0,
FLAGS },
54 if (
s->w > UINT_MAX /
s->h) {
59 s->nb_frames =
s->w *
s->h;
80 if (
inlink->w % (
s->w <<
s->desc->log2_chroma_w) ||
81 inlink->h % (
s->h <<
s->desc->log2_chroma_h)) {
83 "Input resolution %ux%u not multiple of layout %ux%u.\n",
120 if (
s->current ==
s->nb_frames - 1) {
128 x = outlink->
w * (
s->current %
s->w);
129 y = outlink->
h * (
s->current /
s->w);
130 out->width = outlink->
w;
131 out->height = outlink->
h;
132 out->data[0] += y *
out->linesize[0];
133 out->data[0] += x *
s->max_step[0];
135 for (
i = 1;
i < 3;
i ++) {
137 out->data[
i] += (y >>
s->desc->log2_chroma_w) *
out->linesize[
i];
138 out->data[
i] += (x >>
s->desc->log2_chroma_h) *
s->max_step[
i];
143 out->data[3] += y *
out->linesize[3];
144 out->data[3] += x *
s->max_step[3];
148 if (++
s->current ==
s->nb_frames)
190 .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.
This structure describes decoded (raw) audio or video data.
#define FILTER_QUERY_FUNC(func)
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.
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)
static const AVFilterPad untile_inputs[]
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const AVOption untile_options[]
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
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_INPUTS(array)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
const AVPixFmtDescriptor * desc
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
AVFILTER_DEFINE_CLASS(untile)
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.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
const char * name
Pad name.
static int query_formats(AVFilterContext *ctx)
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)
#define FILTER_OUTPUTS(array)
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.