FFmpeg
Loading...
Searching...
No Matches
avf_avectorscope.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/**
22 * @file
23 * audio to video multimedia vectorscope filter
24 */
25
26#include "libavutil/avassert.h"
28#include "libavutil/opt.h"
30#include "avfilter.h"
31#include "filters.h"
32#include "formats.h"
33#include "audio.h"
34#include "video.h"
35
42
49
57
59 const AVClass *class;
61 int w, h;
62 int hw, hh;
63 int mode;
64 int draw;
65 int scale;
66 int contrast[4];
67 int fade[4];
68 double zoom;
69 int swap;
70 int mirror;
71 unsigned prev_x, prev_y;
75
76#define OFFSET(x) offsetof(AudioVectorScopeContext, x)
77#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
78#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
79
81 { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=LISSAJOUS}, 0, MODE_NB-1, TFLAGS, .unit = "mode" },
82 { "m", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=LISSAJOUS}, 0, MODE_NB-1, TFLAGS, .unit = "mode" },
83 { "lissajous", "", 0, AV_OPT_TYPE_CONST, {.i64=LISSAJOUS}, 0, 0, TFLAGS, .unit = "mode" },
84 { "lissajous_xy", "", 0, AV_OPT_TYPE_CONST, {.i64=LISSAJOUS_XY}, 0, 0, TFLAGS, .unit = "mode" },
85 { "polar", "", 0, AV_OPT_TYPE_CONST, {.i64=POLAR}, 0, 0, TFLAGS, .unit = "mode" },
86 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
87 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
88 { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="400x400"}, 0, 0, FLAGS },
89 { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="400x400"}, 0, 0, FLAGS },
90 { "rc", "set red contrast", OFFSET(contrast[0]), AV_OPT_TYPE_INT, {.i64=40}, 0, 255, TFLAGS },
91 { "gc", "set green contrast", OFFSET(contrast[1]), AV_OPT_TYPE_INT, {.i64=160}, 0, 255, TFLAGS },
92 { "bc", "set blue contrast", OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=80}, 0, 255, TFLAGS },
93 { "ac", "set alpha contrast", OFFSET(contrast[3]), AV_OPT_TYPE_INT, {.i64=255}, 0, 255, TFLAGS },
94 { "rf", "set red fade", OFFSET(fade[0]), AV_OPT_TYPE_INT, {.i64=15}, 0, 255, TFLAGS },
95 { "gf", "set green fade", OFFSET(fade[1]), AV_OPT_TYPE_INT, {.i64=10}, 0, 255, TFLAGS },
96 { "bf", "set blue fade", OFFSET(fade[2]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, TFLAGS },
97 { "af", "set alpha fade", OFFSET(fade[3]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, TFLAGS },
98 { "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 10, TFLAGS },
99 { "draw", "set draw mode", OFFSET(draw), AV_OPT_TYPE_INT, {.i64=DOT}, 0, DRAW_NB-1, TFLAGS, .unit = "draw" },
100 { "dot", "draw dots", 0, AV_OPT_TYPE_CONST, {.i64=DOT} , 0, 0, TFLAGS, .unit = "draw" },
101 { "line", "draw lines", 0, AV_OPT_TYPE_CONST, {.i64=LINE}, 0, 0, TFLAGS, .unit = "draw" },
102 { "aaline","draw anti-aliased lines", 0, AV_OPT_TYPE_CONST, {.i64=AALINE},0,0, TFLAGS, .unit = "draw" },
103 { "scale", "set amplitude scale mode", OFFSET(scale), AV_OPT_TYPE_INT, {.i64=LIN}, 0, SCALE_NB-1, TFLAGS, .unit = "scale" },
104 { "lin", "linear", 0, AV_OPT_TYPE_CONST, {.i64=LIN}, 0, 0, TFLAGS, .unit = "scale" },
105 { "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=SQRT}, 0, 0, TFLAGS, .unit = "scale" },
106 { "cbrt", "cube root", 0, AV_OPT_TYPE_CONST, {.i64=CBRT}, 0, 0, TFLAGS, .unit = "scale" },
107 { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=LOG}, 0, 0, TFLAGS, .unit = "scale" },
108 { "swap", "swap x axis with y axis", OFFSET(swap), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, TFLAGS },
109 { "mirror", "mirror axis", OFFSET(mirror), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, TFLAGS, .unit = "mirror" },
110 { "none", "no mirror", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, TFLAGS, .unit = "mirror" },
111 { "x", "mirror x", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, TFLAGS, .unit = "mirror" },
112 { "y", "mirror y", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, TFLAGS, .unit = "mirror" },
113 { "xy", "mirror both", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, TFLAGS, .unit = "mirror" },
114 { NULL }
115};
116
118
119static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y, int value)
120{
121 const ptrdiff_t linesize = s->outpicref->linesize[0];
122 uint8_t *dst;
123
124 if (s->zoom > 1) {
125 if (y >= s->h || x >= s->w)
126 return;
127 } else {
128 y = FFMIN(y, s->h - 1);
129 x = FFMIN(x, s->w - 1);
130 }
131
132 dst = s->outpicref->data[0] + y * linesize + x * 4;
133 dst[0] = FFMIN(dst[0] + s->contrast[0], value);
134 dst[1] = FFMIN(dst[1] + s->contrast[1], value);
135 dst[2] = FFMIN(dst[2] + s->contrast[2], value);
136 dst[3] = FFMIN(dst[3] + s->contrast[3], value);
137}
138
139static void draw_line(AudioVectorScopeContext *s, int x0, int y0, int x1, int y1)
140{
141 int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1;
142 int dy = FFABS(y1-y0), sy = y0 < y1 ? 1 : -1;
143 int err = (dx>dy ? dx : -dy) / 2, e2;
144
145 for (;;) {
146 draw_dot(s, x0, y0, 255);
147
148 if (x0 == x1 && y0 == y1)
149 break;
150
151 e2 = err;
152
153 if (e2 >-dx) {
154 err -= dy;
155 x0 += sx;
156 }
157
158 if (e2 < dy) {
159 err += dx;
160 y0 += sy;
161 }
162 }
163}
164
165static void draw_aaline(AudioVectorScopeContext *s, int x0, int y0, int x1, int y1)
166{
167 int sx = x0 < x1 ? 1 : -1, sy = y0 < y1 ? 1 : -1, x2;
168 int dx = FFABS(x1-x0), dy = FFABS(y1-y0), err = dx * dx + dy * dy;
169 int e2 = err == 0 ? 1 : 0xffffff / (dx + dy);
170
171 dx *= e2;
172 dy *= e2;
173 err = dx - dy;
174
175 for (;;) {
176 draw_dot(s, x0, y0, 255-(FFABS(err - dx + dy) >> 16));
177 e2 = err;
178 x2 = x0;
179 if (2 * e2 >= -dx) {
180 if (x0 == x1)
181 break;
182 if (e2 + dy < 0xff0000)
183 draw_dot(s, x0, y0 + sy, 255-((e2 + dy) >> 16));
184 err -= dy;
185 x0 += sx;
186 }
187
188 if (2 * e2 <= dy) {
189 if (y0 == y1)
190 break;
191 if (dx - e2 < 0xff0000)
192 draw_dot(s, x2 + sx, y0, 255-((dx - e2) >> 16));
193 err += dx;
194 y0 += sy;
195 }
196 }
197}
198
199static int fade(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
200{
202 const int linesize = s->outpicref->linesize[0];
203 const int height = s->outpicref->height;
204 const int slice_start = ff_slice_pos(height, jobnr, nb_jobs);
205 const int slice_end = ff_slice_pos(height, jobnr + 1, nb_jobs);
206
207 if (s->fade[0] == 255 && s->fade[1] == 255 && s->fade[2] == 255) {
208 for (int i = slice_start; i < slice_end; i++)
209 memset(s->outpicref->data[0] + i * linesize, 0, s->outpicref->width * 4);
210 return 0;
211 }
212
213 if (s->fade[0] || s->fade[1] || s->fade[2]) {
214 uint8_t *d = s->outpicref->data[0] + slice_start * linesize;
215 for (int i = slice_start; i < slice_end; i++) {
216 for (int j = 0; j < s->w*4; j+=4) {
217 if (d[j+0])
218 d[j+0] = FFMAX(d[j+0] - s->fade[0], 0);
219 if (d[j+1])
220 d[j+1] = FFMAX(d[j+1] - s->fade[1], 0);
221 if (d[j+2])
222 d[j+2] = FFMAX(d[j+2] - s->fade[2], 0);
223 if (d[j+3])
224 d[j+3] = FFMAX(d[j+3] - s->fade[3], 0);
225 }
226 d += linesize;
227 }
228 }
229
230 return 0;
231}
232
234 AVFilterFormatsConfig **cfg_in,
235 AVFilterFormatsConfig **cfg_out)
236{
239 static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE };
240 static const AVChannelLayout layouts[] = {
242 { .nb_channels = 0 },
243 };
244 int ret;
245
247 if ((ret = ff_formats_ref (formats, &cfg_in[0]->formats )) < 0)
248 return ret;
249
251 if (ret < 0)
252 return ret;
253
255 if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0)
256 return ret;
257
258 return 0;
259}
260
261static int config_input(AVFilterLink *inlink)
262{
263 AVFilterContext *ctx = inlink->dst;
265
266 s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
267
268 return 0;
269}
270
271static int config_output(AVFilterLink *outlink)
272{
273 AudioVectorScopeContext *s = outlink->src->priv;
274 FilterLink *l = ff_filter_link(outlink);
275
276 outlink->w = s->w;
277 outlink->h = s->h;
278 outlink->sample_aspect_ratio = (AVRational){1,1};
279 l->frame_rate = s->frame_rate;
280 outlink->time_base = av_inv_q(l->frame_rate);
281
282 s->prev_x = s->hw = s->w / 2;
283 s->prev_y = s->hh = s->mode == POLAR ? s->h - 1 : s->h / 2;
284
285 return 0;
286}
287
288static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
289{
290 AVFilterContext *ctx = inlink->dst;
291 AVFilterLink *outlink = ctx->outputs[0];
292 const int16_t *samples = (const int16_t *)insamples->data[0];
293 const float *samplesf = (const float *)insamples->data[0];
295 const int hw = s->hw;
296 const int hh = s->hh;
297 AVFrame *clone;
298 unsigned x, y;
299 unsigned prev_x = s->prev_x, prev_y = s->prev_y;
300 double zoom = s->zoom;
301 int ret;
302
303 if (!s->outpicref || s->outpicref->width != outlink->w ||
304 s->outpicref->height != outlink->h) {
305 av_frame_free(&s->outpicref);
306 s->outpicref = ff_get_video_buffer(outlink, outlink->w, outlink->h);
307 if (!s->outpicref) {
308 av_frame_free(&insamples);
309 return AVERROR(ENOMEM);
310 }
311
312 s->outpicref->sample_aspect_ratio = (AVRational){1,1};
313 for (int i = 0; i < outlink->h; i++)
314 memset(s->outpicref->data[0] + i * s->outpicref->linesize[0], 0, outlink->w * 4);
315 }
316 s->outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
317 s->outpicref->duration = 1;
318
319 ret = ff_inlink_make_frame_writable(outlink, &s->outpicref);
320 if (ret < 0) {
321 av_frame_free(&insamples);
322 return ret;
323 }
325
326 if (zoom < 1) {
327 float max = 0;
328
329 switch (insamples->format) {
331 for (int i = 0; i < insamples->nb_samples * 2; i++) {
332 float sample = samples[i] / (float)INT16_MAX;
333 max = FFMAX(FFABS(sample), max);
334 }
335 break;
337 for (int i = 0; i < insamples->nb_samples * 2; i++) {
338 max = FFMAX(FFABS(samplesf[i]), max);
339 }
340 break;
341 default:
342 av_assert2(0);
343 }
344
345 switch (s->scale) {
346 case SQRT:
347 max = sqrtf(max);
348 break;
349 case CBRT:
350 max = cbrtf(max);
351 break;
352 case LOG:
353 max = logf(1 + max) / logf(2);
354 break;
355 }
356
357 if (max > 0.f)
358 zoom = 1. / max;
359 }
360
361 for (int i = 0; i < insamples->nb_samples; i++) {
362 float src[2];
363
364 switch (insamples->format) {
366 src[0] = samples[i*2+0] / (float)INT16_MAX;
367 src[1] = samples[i*2+1] / (float)INT16_MAX;
368 break;
370 src[0] = samplesf[i*2+0];
371 src[1] = samplesf[i*2+1];
372 break;
373 default:
374 av_assert2(0);
375 }
376
377 switch (s->scale) {
378 case SQRT:
379 src[0] = FFSIGN(src[0]) * sqrtf(FFABS(src[0]));
380 src[1] = FFSIGN(src[1]) * sqrtf(FFABS(src[1]));
381 break;
382 case CBRT:
383 src[0] = FFSIGN(src[0]) * cbrtf(FFABS(src[0]));
384 src[1] = FFSIGN(src[1]) * cbrtf(FFABS(src[1]));
385 break;
386 case LOG:
387 src[0] = FFSIGN(src[0]) * logf(1 + FFABS(src[0])) / logf(2);
388 src[1] = FFSIGN(src[1]) * logf(1 + FFABS(src[1])) / logf(2);
389 break;
390 }
391
392 if (s->mirror & 1)
393 src[0] = -src[0];
394
395 if (s->mirror & 2)
396 src[1] = -src[1];
397
398 if (s->swap)
399 FFSWAP(float, src[0], src[1]);
400
401 if (s->mode == LISSAJOUS) {
402 x = ((src[1] - src[0]) * zoom / 2 + 1) * hw;
403 y = (1.0 - (src[0] + src[1]) * zoom / 2) * hh;
404 } else if (s->mode == LISSAJOUS_XY) {
405 x = (src[1] * zoom + 1) * hw;
406 y = (src[0] * zoom + 1) * hh;
407 } else {
408 float sx, sy, cx, cy;
409
410 sx = src[1] * zoom;
411 sy = src[0] * zoom;
412 cx = sx * sqrtf(1 - 0.5 * sy * sy);
413 cy = sy * sqrtf(1 - 0.5 * sx * sx);
414 x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7;
415 y = s->h - s->h * fabsf(cx + cy) * .7;
416 }
417
418 if (s->draw == DOT) {
419 draw_dot(s, x, y, 255);
420 } else if (s->draw == LINE) {
421 draw_line(s, x, y, prev_x, prev_y);
422 } else {
423 draw_aaline(s, x, y, prev_x, prev_y);
424 }
425 prev_x = x;
426 prev_y = y;
427 }
428
429 s->prev_x = x, s->prev_y = y;
430 av_frame_free(&insamples);
431
432 clone = av_frame_clone(s->outpicref);
433 if (!clone)
434 return AVERROR(ENOMEM);
435
436 return ff_filter_frame(outlink, clone);
437}
438
440{
441 AVFilterLink *inlink = ctx->inputs[0];
442 AVFilterLink *outlink = ctx->outputs[0];
444 AVFrame *in;
445 int ret;
446
447 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
448
449 ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
450 if (ret < 0)
451 return ret;
452 if (ret > 0)
453 return filter_frame(inlink, in);
454
455 if (ff_inlink_queued_samples(inlink) >= s->nb_samples) {
457 return 0;
458 }
459
460 FF_FILTER_FORWARD_STATUS(inlink, outlink);
461 FF_FILTER_FORWARD_WANTED(outlink, inlink);
462
463 return FFERROR_NOT_READY;
464}
465
467{
469
470 av_frame_free(&s->outpicref);
471}
472
474 {
475 .name = "default",
476 .type = AVMEDIA_TYPE_AUDIO,
477 .config_props = config_input,
478 },
479};
480
482 {
483 .name = "default",
484 .type = AVMEDIA_TYPE_VIDEO,
485 .config_props = config_output,
486 },
487};
488
490 .p.name = "avectorscope",
491 .p.description = NULL_IF_CONFIG_SMALL("Convert input audio to vectorscope video output."),
492 .p.priv_class = &avectorscope_class,
494 .uninit = uninit,
495 .priv_size = sizeof(AudioVectorScopeContext),
500 .process_command = ff_filter_process_command,
501};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
static enum AVSampleFormat sample_fmts[]
Definition adpcmenc.c:933
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
static int config_input(AVFilterLink *inlink)
#define TFLAGS
Definition af_afade.c:66
const FFFilter ff_avf_avectorscope
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition avassert.h:68
VectorScopeScale
@ LIN
@ SCALE_NB
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
static int fade(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int config_input(AVFilterLink *inlink)
static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y, int value)
static void draw_line(AudioVectorScopeContext *s, int x0, int y0, int x1, int y1)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static void draw_aaline(AudioVectorScopeContext *s, int x0, int y0, int x1, int y1)
static const AVFilterPad audiovectorscope_outputs[]
#define OFFSET(x)
static int config_output(AVFilterLink *outlink)
static const AVOption avectorscope_options[]
VectorScopeMode
@ MODE_NB
@ POLAR
@ LISSAJOUS_XY
@ LISSAJOUS
VectorScopeDraw
@ DOT
@ LINE
@ AALINE
@ DRAW_NB
static const AVFilterPad audiovectorscope_inputs[]
static int draw(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
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_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe)
Take samples from the link's FIFO and update the link's stats.
Definition avfilter.c:1540
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition avfilter.c:846
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
Definition avfilter.c:229
int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe)
Make sure a frame is writable.
Definition avfilter.c:1567
int ff_inlink_queued_samples(AVFilterLink *link)
Definition avfilter.c:1495
Main libavfilter public API header.
#define CBRT(x)
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
Public libavutil channel layout APIs header.
#define FLAGS
Definition cmdutils.c:598
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition common.h:74
#define FFSIGN(a)
Definition common.h:75
#define NULL
Definition coverity.c:32
static __device__ float sqrtf(float a)
static __device__ float fabsf(float a)
#define max(a, b)
double value
Definition eval.c:102
#define sample
int ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
Add ref as a new reference to formats.
Definition formats.c:756
int ff_set_common_channel_layouts_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const AVChannelLayout *fmts)
Definition formats.c:1026
av_warn_unused_result AVFilterFormats * ff_make_sample_format_list(const enum AVSampleFormat *fmts)
Create a list of supported sample formats.
av_warn_unused_result AVFilterFormats * ff_make_pixel_format_list(const enum AVPixelFormat *fmts)
Create a list of supported pixel formats.
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition opt.h:302
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition opt.h:314
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
#define AV_CHANNEL_LAYOUT_STEREO
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition frame.c:483
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition rational.h:159
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
AVSampleFormat
Audio sample formats.
Definition samplefmt.h:55
@ AV_SAMPLE_FMT_FLT
float
Definition samplefmt.h:60
@ AV_SAMPLE_FMT_NONE
Definition samplefmt.h:56
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition samplefmt.h:58
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Definition intra.c:278
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 FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
Definition filters.h:694
#define FF_FILTER_FORWARD_STATUS(inlink, outlink)
Acknowledge the status on an input link and forward it to an output link.
Definition filters.h:666
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
Definition filters.h:34
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
Definition filters.h:639
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#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
static av_always_inline float cbrtf(float x)
Definition libm.h:63
uint8_t w
Definition llvidencdsp.c:39
#define FFSWAP(type, a, b)
Definition macros.h:52
#define FFMIN(a, b)
Definition macros.h:49
#define FFMAX(a, b)
Definition macros.h:47
enum MovChannelLayoutTag * layouts
Definition mov_chan.c:335
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
Definition mpeg12dec.c:1697
AVOptions.
misc parsing utilities
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
formats
Definition signature.h:47
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
void * priv
private data for use by the filter
Definition avfilter.h:288
Lists of formats / etc.
Definition avfilter.h:120
A list of supported formats for one end of a filter link.
Definition formats.h:64
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
int nb_samples
number of audio samples (per channel) described by this frame
Definition frame.h:552
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition frame.h:574
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition frame.h:559
AVOption.
Definition opt.h:428
Rational number (pair of numerator and denominator).
Definition rational.h:58
Definition swscale.c:71
#define LOG(...)
Definition internal.h:126
#define src
Definition vp8dsp.c:248
static AVFormatContext * ctx
Definition movenc.c:49
#define height
Definition dsp.h:89
static void mirror(const float *modifier, float *vec)
Definition vf_v360.c:4107
static void zoom(float *u, float *v, float amount)
Definition vf_xfade.c:1695
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 void fade(uint8_t *dst, ptrdiff_t dst_linesize, const uint8_t *src, ptrdiff_t src_linesize, int width, int height, int alpha, int beta)
Definition vp8.c:512
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition dec.c:844