Go to the documentation of this file.
78 if (
s->input ==
NULL) {
121 outlink->
w =
ctx->inputs[0]->w;
122 outlink->
h =
ctx->inputs[0]->h;
123 outlink->
format =
ctx->inputs[0]->format;
128 s->hold = outlink->
w;
135 uint8_t black_data[] = { 0x10, 0x80, 0x80, 0x10 };
145 black_data[0] = black_data[3] = 0;
148 outlink->
h, outlink->
format, 1);
153 for (j = 0; j < (!
i ? outlink->
h
154 : -((-outlink->
h) >>
desc->log2_chroma_h)); j++)
155 memset(
s->black_buffers[
i] + j *
s->black_linesizes[
i],
170 uint8_t *dst_data[4],
int dst_linesizes[4],
171 const uint8_t *src_data[4],
const int src_linesizes[4],
177 const uint8_t *
src[4];
179 dst[0] = dst_data[0] + ncol;
180 dst[1] = dst_data[1] + (ncol >>
s->desc->log2_chroma_w);
181 dst[2] = dst_data[2] + (ncol >>
s->desc->log2_chroma_w);
185 src[0] = src_data[0] + ncol;
186 src[1] = src_data[1] + (ncol >>
s->desc->log2_chroma_w);
187 src[2] = src_data[2] + (ncol >>
s->desc->log2_chroma_w);
205 for ( ; ncol <
s->hold; ncol++)
207 (
const uint8_t **)
s->black_buffers,
s->black_linesizes,
213 for ( ; ncol <
s->input_size; ncol++) {
217 (
const uint8_t **)
src->data,
src->linesize,
229 for ( ; ncol < outlink->
w; ncol++)
231 (
const uint8_t **)
s->prev->data,
232 s->prev->linesize, ncol, 1);
234 for ( ; ncol < outlink->
w; ncol++)
236 (
const uint8_t **)
s->black_buffers,
s->black_linesizes,
270 if (!
s->eof_recv &&
s->input_size < outlink->
w -
s->pad) {
271 av_log(
ctx,
AV_LOG_DEBUG,
"Not enough frames in the list (%zu/%d), waiting for more.\n",
s->input_size, outlink->
w -
s->pad);
286 if ((
s->input_size <= 0 ||
s->input_size == outlink->
w -
s->pad ||
s->end ==
TILT_NONE) &&
s->eof_recv) {
293 }
else if (
ret < 0) {
298 while (
s->input_size) {
310 #define OFFSET(x) offsetof(TiltandshiftContext, x)
311 #define V AV_OPT_FLAG_VIDEO_PARAM
314 { .i64 = 1 }, 0, 1, .flags =
V, .unit =
"tilt" },
319 { .i64 =
TILT_NONE }, INT_MIN, INT_MAX, .flags =
V, .unit =
"start" },
321 { .i64 =
TILT_FRAME }, INT_MIN, INT_MAX, .flags =
V, .unit =
"start" },
323 { .i64 =
TILT_BLACK }, INT_MIN, INT_MAX, .flags =
V, .unit =
"start" },
328 { .i64 =
TILT_NONE }, INT_MIN, INT_MAX, .flags =
V, .unit =
"end" },
330 { .i64 =
TILT_FRAME }, INT_MIN, INT_MAX, .flags =
V, .unit =
"end" },
332 { .i64 =
TILT_BLACK }, INT_MIN, INT_MAX, .flags =
V, .unit =
"end" },
335 { .i64 = 0 }, 0, INT_MAX, .flags =
V, .unit =
"hold" },
337 { .i64 = 0 }, 0, INT_MAX, .flags =
V, .unit =
"pad" },
362 .
name =
"tiltandshift",
365 .priv_class = &tiltandshift_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
AVPixelFormat
Pixel format.
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
static const AVFilterPad tiltandshift_inputs[]
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 AVERROR_EOF
End of file.
#define FILTER_PIXFMTS_ARRAY(array)
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.
void * opaque
Frame owner's private data.
This structure describes decoded (raw) audio or video data.
@ AVCOL_RANGE_JPEG
Full range content.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
#define AV_LOG_VERBOSE
Detailed information.
static void list_remove_head(TiltandshiftContext *s)
const char * name
Filter name.
static av_cold void uninit(AVFilterContext *ctx)
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void * priv
private data for use by the filter
A filter pad used for either input or output.
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const AVFilter ff_vf_tiltandshift
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
static int request_frame(AVFilterLink *outlink)
static const AVFilterPad tiltandshift_outputs[]
static enum AVPixelFormat pix_fmts[]
int av_image_alloc(uint8_t *pointers[4], int linesizes[4], int w, int h, enum AVPixelFormat pix_fmt, int align)
Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordi...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int format
agreed upon media format
AVFilterContext * src
source filter
const AVPixFmtDescriptor * desc
static int config_props(AVFilterLink *outlink)
#define i(width, name, range_min, range_max)
int w
agreed upon image width
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
const char * name
Pad name.
static const AVOption tiltandshift_options[]
static int list_add_frame(TiltandshiftContext *s, AVFrame *frame)
int h
agreed upon image height
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static int output_frame(AVFilterLink *outlink)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define FILTER_OUTPUTS(array)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
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_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static void copy_column(AVFilterLink *outlink, uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], int ncol, int tilt)
uint8_t * black_buffers[4]
void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], const uint8_t *const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
enum AVColorRange color_range
agreed upon YUV color range
AVFILTER_DEFINE_CLASS(tiltandshift)