FFmpeg
Loading...
Searching...
No Matches
vf_displace.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 Paul B Mahol
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "libavutil/pixdesc.h"
22#include "libavutil/opt.h"
23#include "avfilter.h"
24#include "filters.h"
25#include "framesync.h"
26#include "video.h"
27
35
36typedef struct DisplaceContext {
37 const AVClass *class;
38 int width[4], height[4];
39 /* enum EdgeMode */
40 int edge;
43 int step;
44 uint8_t blank[4];
46
47 int (*displace_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
49
50#define OFFSET(x) offsetof(DisplaceContext, x)
51#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
52
53static const AVOption displace_options[] = {
54 { "edge", "set edge mode", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=EDGE_SMEAR}, 0, EDGE_NB-1, FLAGS, .unit = "edge" },
55 { "blank", "", 0, AV_OPT_TYPE_CONST, {.i64=EDGE_BLANK}, 0, 0, FLAGS, .unit = "edge" },
56 { "smear", "", 0, AV_OPT_TYPE_CONST, {.i64=EDGE_SMEAR}, 0, 0, FLAGS, .unit = "edge" },
57 { "wrap" , "", 0, AV_OPT_TYPE_CONST, {.i64=EDGE_WRAP}, 0, 0, FLAGS, .unit = "edge" },
58 { "mirror" , "", 0, AV_OPT_TYPE_CONST, {.i64=EDGE_MIRROR}, 0, 0, FLAGS, .unit = "edge" },
59 { NULL }
60};
61
63
76
77typedef struct ThreadData {
80
81static int displace_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
82{
83 DisplaceContext *s = ctx->priv;
84 const ThreadData *td = arg;
85 const AVFrame *in = td->in;
86 const AVFrame *xin = td->xin;
87 const AVFrame *yin = td->yin;
88 const AVFrame *out = td->out;
89
90 for (int plane = 0; plane < s->nb_planes; plane++) {
91 const int h = s->height[plane];
92 const int w = s->width[plane];
93 const int slice_start = ff_slice_pos(h, jobnr, nb_jobs);
94 const int slice_end = ff_slice_pos(h, jobnr + 1, nb_jobs);
95 const int dlinesize = out->linesize[plane];
96 const int slinesize = in->linesize[plane];
97 const int xlinesize = xin->linesize[plane];
98 const int ylinesize = yin->linesize[plane];
99 const uint8_t *src = in->data[plane];
100 const uint8_t *ysrc = yin->data[plane] + slice_start * ylinesize;
101 const uint8_t *xsrc = xin->data[plane] + slice_start * xlinesize;
102 uint8_t *dst = out->data[plane] + slice_start * dlinesize;
103 const uint8_t blank = s->blank[plane];
104
105 for (int y = slice_start; y < slice_end; y++) {
106 switch (s->edge) {
107 case EDGE_BLANK:
108 for (int x = 0; x < w; x++) {
109 int Y = y + ysrc[x] - 128;
110 int X = x + xsrc[x] - 128;
111
112 if (Y < 0 || Y >= h || X < 0 || X >= w)
113 dst[x] = blank;
114 else
115 dst[x] = src[Y * slinesize + X];
116 }
117 break;
118 case EDGE_SMEAR:
119 for (int x = 0; x < w; x++) {
120 int Y = av_clip(y + ysrc[x] - 128, 0, h - 1);
121 int X = av_clip(x + xsrc[x] - 128, 0, w - 1);
122 dst[x] = src[Y * slinesize + X];
123 }
124 break;
125 case EDGE_WRAP:
126 for (int x = 0; x < w; x++) {
127 int Y = (y + ysrc[x] - 128) % h;
128 int X = (x + xsrc[x] - 128) % w;
129
130 if (Y < 0)
131 Y += h;
132 if (X < 0)
133 X += w;
134 dst[x] = src[Y * slinesize + X];
135 }
136 break;
137 case EDGE_MIRROR:
138 for (int x = 0; x < w; x++) {
139 int Y = y + ysrc[x] - 128;
140 int X = x + xsrc[x] - 128;
141
142 if (Y < 0)
143 Y = (-Y) % h;
144 if (X < 0)
145 X = (-X) % w;
146 if (Y >= h)
147 Y = h - (Y % h) - 1;
148 if (X >= w)
149 X = w - (X % w) - 1;
150 dst[x] = src[Y * slinesize + X];
151 }
152 break;
153 }
154
155 ysrc += ylinesize;
156 xsrc += xlinesize;
157 dst += dlinesize;
158 }
159 }
160 return 0;
161}
162
163static int displace_packed(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
164{
165 DisplaceContext *s = ctx->priv;
166 const ThreadData *td = arg;
167 const AVFrame *in = td->in;
168 const AVFrame *xin = td->xin;
169 const AVFrame *yin = td->yin;
170 const AVFrame *out = td->out;
171 const int step = s->step;
172 const int h = s->height[0];
173 const int w = s->width[0];
174 const int slice_start = ff_slice_pos(h, jobnr, nb_jobs);
175 const int slice_end = ff_slice_pos(h, jobnr + 1, nb_jobs);
176 const int dlinesize = out->linesize[0];
177 const int slinesize = in->linesize[0];
178 const int xlinesize = xin->linesize[0];
179 const int ylinesize = yin->linesize[0];
180 const uint8_t *src = in->data[0];
181 const uint8_t *ysrc = yin->data[0] + slice_start * ylinesize;
182 const uint8_t *xsrc = xin->data[0] + slice_start * xlinesize;
183 uint8_t *dst = out->data[0] + slice_start * dlinesize;
184 const uint8_t *blank = s->blank;
185
186 for (int y = slice_start; y < slice_end; y++) {
187 switch (s->edge) {
188 case EDGE_BLANK:
189 for (int x = 0; x < w; x++) {
190 for (int c = 0; c < s->nb_components; c++) {
191 int Y = y + (ysrc[x * step + c] - 128);
192 int X = x + (xsrc[x * step + c] - 128);
193
194 if (Y < 0 || Y >= h || X < 0 || X >= w)
195 dst[x * step + c] = blank[c];
196 else
197 dst[x * step + c] = src[Y * slinesize + X * step + c];
198 }
199 }
200 break;
201 case EDGE_SMEAR:
202 for (int x = 0; x < w; x++) {
203 for (int c = 0; c < s->nb_components; c++) {
204 int Y = av_clip(y + (ysrc[x * step + c] - 128), 0, h - 1);
205 int X = av_clip(x + (xsrc[x * step + c] - 128), 0, w - 1);
206
207 dst[x * step + c] = src[Y * slinesize + X * step + c];
208 }
209 }
210 break;
211 case EDGE_WRAP:
212 for (int x = 0; x < w; x++) {
213 for (int c = 0; c < s->nb_components; c++) {
214 int Y = (y + (ysrc[x * step + c] - 128)) % h;
215 int X = (x + (xsrc[x * step + c] - 128)) % w;
216
217 if (Y < 0)
218 Y += h;
219 if (X < 0)
220 X += w;
221 dst[x * step + c] = src[Y * slinesize + X * step + c];
222 }
223 }
224 break;
225 case EDGE_MIRROR:
226 for (int x = 0; x < w; x++) {
227 for (int c = 0; c < s->nb_components; c++) {
228 int Y = y + ysrc[x * step + c] - 128;
229 int X = x + xsrc[x * step + c] - 128;
230
231 if (Y < 0)
232 Y = (-Y) % h;
233 if (X < 0)
234 X = (-X) % w;
235 if (Y >= h)
236 Y = h - (Y % h) - 1;
237 if (X >= w)
238 X = w - (X % w) - 1;
239 dst[x * step + c] = src[Y * slinesize + X * step + c];
240 }
241 }
242 break;
243 }
244
245 ysrc += ylinesize;
246 xsrc += xlinesize;
247 dst += dlinesize;
248 }
249 return 0;
250}
251
253{
254 AVFilterContext *ctx = fs->parent;
255 DisplaceContext *s = fs->opaque;
256 AVFilterLink *outlink = ctx->outputs[0];
257 AVFrame *out, *in, *xin, *yin;
258 int ret;
259
260 if ((ret = ff_framesync_get_frame(&s->fs, 0, &in, 0)) < 0 ||
261 (ret = ff_framesync_get_frame(&s->fs, 1, &xin, 0)) < 0 ||
262 (ret = ff_framesync_get_frame(&s->fs, 2, &yin, 0)) < 0)
263 return ret;
264
265 if (ctx->is_disabled) {
266 out = av_frame_clone(in);
267 if (!out)
268 return AVERROR(ENOMEM);
269 } else {
270 ThreadData td;
271
272 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
273 if (!out)
274 return AVERROR(ENOMEM);
276
277 td.in = in;
278 td.xin = xin;
279 td.yin = yin;
280 td.out = out;
281 ff_filter_execute(ctx, s->displace_slice, &td, NULL,
282 FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
283 }
284 out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
285
286 return ff_filter_frame(outlink, out);
287}
288
289static int config_input(AVFilterLink *inlink)
290{
291 AVFilterContext *ctx = inlink->dst;
292 DisplaceContext *s = ctx->priv;
294 int vsub, hsub;
295
296 s->nb_planes = av_pix_fmt_count_planes(inlink->format);
297 s->nb_components = desc->nb_components;
298
299 if (s->nb_planes > 1 || s->nb_components == 1)
300 s->displace_slice = displace_planar;
301 else
302 s->displace_slice = displace_packed;
303
304 if (!(desc->flags & AV_PIX_FMT_FLAG_RGB)) {
305 s->blank[1] = s->blank[2] = 128;
306 s->blank[0] = 16;
307 }
308
309 s->step = av_get_padded_bits_per_pixel(desc) >> 3;
310 hsub = desc->log2_chroma_w;
311 vsub = desc->log2_chroma_h;
312 s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub);
313 s->height[0] = s->height[3] = inlink->h;
314 s->width[1] = s->width[2] = AV_CEIL_RSHIFT(inlink->w, hsub);
315 s->width[0] = s->width[3] = inlink->w;
316
317 return 0;
318}
319
320static int config_output(AVFilterLink *outlink)
321{
322 FilterLink *outl = ff_filter_link(outlink);
323 AVFilterContext *ctx = outlink->src;
324 DisplaceContext *s = ctx->priv;
325 AVFilterLink *srclink = ctx->inputs[0];
326 FilterLink *sl = ff_filter_link(srclink);
327 AVFilterLink *xlink = ctx->inputs[1];
328 AVFilterLink *ylink = ctx->inputs[2];
329 FFFrameSyncIn *in;
330 int ret;
331
332 if (srclink->w != xlink->w ||
333 srclink->h != xlink->h ||
334 srclink->w != ylink->w ||
335 srclink->h != ylink->h) {
336 av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
337 "(size %dx%d) do not match the corresponding "
338 "second input link %s parameters (%dx%d) "
339 "and/or third input link %s parameters (%dx%d)\n",
340 ctx->input_pads[0].name, srclink->w, srclink->h,
341 ctx->input_pads[1].name, xlink->w, xlink->h,
342 ctx->input_pads[2].name, ylink->w, ylink->h);
343 return AVERROR(EINVAL);
344 }
345
346 outlink->w = srclink->w;
347 outlink->h = srclink->h;
348 outlink->sample_aspect_ratio = srclink->sample_aspect_ratio;
349 outl->frame_rate = sl->frame_rate;
350
351 ret = ff_framesync_init(&s->fs, ctx, 3);
352 if (ret < 0)
353 return ret;
354
355 in = s->fs.in;
356 in[0].time_base = srclink->time_base;
357 in[1].time_base = xlink->time_base;
358 in[2].time_base = ylink->time_base;
359 in[0].sync = 2;
360 in[0].before = EXT_STOP;
361 in[0].after = EXT_STOP;
362 in[1].sync = 1;
363 in[1].before = EXT_NULL;
364 in[1].after = EXT_INFINITY;
365 in[2].sync = 1;
366 in[2].before = EXT_NULL;
367 in[2].after = EXT_INFINITY;
368 s->fs.opaque = s;
369 s->fs.on_event = process_frame;
370
371 ret = ff_framesync_configure(&s->fs);
372 outlink->time_base = s->fs.time_base;
373
374 return ret;
375}
376
378{
379 DisplaceContext *s = ctx->priv;
380 return ff_framesync_activate(&s->fs);
381}
382
384{
385 DisplaceContext *s = ctx->priv;
386
388}
389
390static const AVFilterPad displace_inputs[] = {
391 {
392 .name = "source",
393 .type = AVMEDIA_TYPE_VIDEO,
394 .config_props = config_input,
395 },
396 {
397 .name = "xmap",
398 .type = AVMEDIA_TYPE_VIDEO,
399 },
400 {
401 .name = "ymap",
402 .type = AVMEDIA_TYPE_VIDEO,
403 },
404};
405
407 {
408 .name = "default",
409 .type = AVMEDIA_TYPE_VIDEO,
410 .config_props = config_output,
411 },
412};
413
415 .p.name = "displace",
416 .p.description = NULL_IF_CONFIG_SMALL("Displace pixels."),
417 .p.priv_class = &displace_class,
420 .priv_size = sizeof(DisplaceContext),
421 .uninit = uninit,
426 .process_command = ff_filter_process_command,
427};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
static int config_input(AVFilterLink *inlink)
const FFFilter ff_vf_displace
static FILE * out
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
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.
Definition avfilter.c:906
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition avfilter.c:1696
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition avfilter.c:846
Main libavfilter public API header.
#define Y
Definition boxblur.h:37
#define s(width, name)
Definition cbs_vp9.c:198
#define fs(width, name, subs,...)
Definition cbs_vp9.c:200
#define FLAGS
Definition cmdutils.c:598
#define AV_CEIL_RSHIFT(a, b)
Definition common.h:60
#define av_clip
Definition common.h:100
#define NULL
Definition coverity.c:32
#define X
Definition f_ebur128.c:157
static av_always_inline int process_frame(AVTextFormatContext *tfc, InputFile *ifile, AVFrame *frame, const AVPacket *pkt, int *packet_new)
Definition ffprobe.c:1596
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
Definition framesync.c:137
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
Definition framesync.c:352
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
Definition framesync.c:269
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
Definition framesync.c:301
int ff_framesync_init(FFFrameSync *fs, AVFilterContext *parent, unsigned nb_in)
Initialize a frame sync structure.
Definition framesync.c:86
@ EXT_INFINITY
Extend the frame to infinity.
Definition framesync.h:75
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition avfilter.h:204
#define AVERROR(e)
Definition error.h:45
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition frame.c:483
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
const char * arg
Definition jacosubdec.c:65
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
Definition filters.h:763
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
const char * desc
Definition libsvtav1.c:83
uint8_t w
Definition llvidencdsp.c:39
#define FFMIN(a, b)
Definition macros.h:49
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
Definition mpeg12dec.c:1697
AVOptions.
@ EXT_STOP
Completely stop all streams with this one.
Definition packetsync.h:62
@ EXT_NULL
Ignore this stream and continue processing the other ones.
Definition packetsync.h:67
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3500
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
Definition pixdesc.c:3425
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition pixdesc.h:136
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition pixfmt.h:265
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition pixfmt.h:99
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition pixfmt.h:101
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition pixfmt.h:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition pixfmt.h:264
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition pixfmt.h:283
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition pixfmt.h:263
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition pixfmt.h:262
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition frame.h:517
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
FFFrameSync fs
Definition vf_displace.c:45
uint8_t blank[4]
Definition vf_displace.c:44
int(* displace_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition vf_displace.c:47
Input stream structure.
Definition framesync.h:102
enum FFFrameSyncExtMode after
Extrapolation mode for timestamps after the last frame.
Definition framesync.h:112
enum FFFrameSyncExtMode before
Extrapolation mode for timestamps before the first frame.
Definition framesync.h:107
AVRational time_base
Time base for the incoming frames.
Definition framesync.h:117
unsigned sync
Synchronization level: frames on input at the highest sync level will generate output frame events.
Definition framesync.h:160
Frame sync structure.
Definition framesync.h:168
Used for passing data between threads.
Definition dsddec.c:71
AVFrame * xin
Definition vf_displace.c:78
AVFrame * out
AVFrame * yin
Definition vf_displace.c:78
#define av_log(a,...)
#define src
Definition vp8dsp.c:248
static const AVFilterPad displace_inputs[]
static int config_input(AVFilterLink *inlink)
static const AVFilterPad displace_outputs[]
static int displace_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition vf_displace.c:81
EdgeMode
Definition vf_displace.c:28
@ EDGE_BLANK
Definition vf_displace.c:29
@ EDGE_MIRROR
Definition vf_displace.c:32
@ EDGE_SMEAR
Definition vf_displace.c:30
@ EDGE_NB
Definition vf_displace.c:33
@ EDGE_WRAP
Definition vf_displace.c:31
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
#define OFFSET(x)
Definition vf_displace.c:50
static int config_output(AVFilterLink *outlink)
static const AVOption displace_options[]
Definition vf_displace.c:53
static int process_frame(FFFrameSync *fs)
static int displace_packed(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static void hsub(htype *dst, const htype *src, int bins)
Definition vf_median.c:74
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89
static double c[64]
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition dec.c:844