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;
85 if (inlink->
w % (
s->w <<
s->desc->log2_chroma_w) ||
86 inlink->
h % (
s->h <<
s->desc->log2_chroma_h)) {
88 "Input resolution %ux%u not multiple of layout %ux%u.\n",
89 inlink->
w, inlink->
h,
s->w,
s->h);
92 outlink->
w = inlink->
w /
s->w;
93 outlink->
h = inlink->
h /
s->h;
125 if (
s->current ==
s->nb_frames - 1) {
133 x = outlink->
w * (
s->current %
s->w);
134 y = outlink->
h * (
s->current /
s->w);
135 out->width = outlink->
w;
136 out->height = outlink->
h;
137 out->data[0] += y *
out->linesize[0];
138 out->data[0] += x *
s->max_step[0];
140 for (
i = 1;
i < 3;
i ++) {
142 out->data[
i] += (y >>
s->desc->log2_chroma_h) *
out->linesize[
i];
143 out->data[
i] += (x >>
s->desc->log2_chroma_w) *
s->max_step[
i];
148 out->data[3] += y *
out->linesize[3];
149 out->data[3] += x *
s->max_step[3];
153 if (++
s->current ==
s->nb_frames)
197 .priv_class = &untile_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Main libavfilter public API header.
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
#define FF_FILTER_FORWARD_STATUS(inlink, outlink)
Acknowledge the status on an input link and forward it to an output link.
#define FFERROR_NOT_READY
Filters implementation helper functions.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
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.
static AVRational av_make_q(int num, int den)
Create an AVRational.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
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 AV_TIME_BASE
Internal time base represented as integer.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Describe the class of an AVClass context structure.
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
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,...
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
This structure describes decoded (raw) audio or video data.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Rational number (pair of numerator and denominator).
const AVPixFmtDescriptor * desc
static const AVOption untile_options[]
static int query_formats(AVFilterContext *ctx)
AVFILTER_DEFINE_CLASS(untile)
static const AVFilterPad untile_outputs[]
static int activate(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)
static const AVFilterPad untile_inputs[]
static av_cold void uninit(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)