FFmpeg
af_stereotools.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen
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 
22 #include "libavutil/opt.h"
23 #include "avfilter.h"
24 #include "audio.h"
25 #include "formats.h"
26 
27 typedef struct StereoToolsContext {
28  const AVClass *class;
29 
30  int softclip;
31  int mute_l;
32  int mute_r;
33  int phase_l;
34  int phase_r;
35  int mode;
36  int bmode_in;
37  int bmode_out;
38  double slev;
39  double sbal;
40  double mlev;
41  double mpan;
42  double phase;
43  double base;
44  double delay;
45  double balance_in;
46  double balance_out;
49  double sc_level;
51  double level_in;
52  double level_out;
53 
54  double *buffer;
55  int length;
56  int pos;
58 
59 #define OFFSET(x) offsetof(StereoToolsContext, x)
60 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
61 
62 static const AVOption stereotools_options[] = {
63  { "level_in", "set level in", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
64  { "level_out", "set level out", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
65  { "balance_in", "set balance in", OFFSET(balance_in), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
66  { "balance_out", "set balance out", OFFSET(balance_out), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
67  { "softclip", "enable softclip", OFFSET(softclip), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
68  { "mutel", "mute L", OFFSET(mute_l), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
69  { "muter", "mute R", OFFSET(mute_r), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
70  { "phasel", "phase L", OFFSET(phase_l), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
71  { "phaser", "phase R", OFFSET(phase_r), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
72  { "mode", "set stereo mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 10, A, "mode" },
73  { "lr>lr", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "mode" },
74  { "lr>ms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "mode" },
75  { "ms>lr", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, "mode" },
76  { "lr>ll", 0, 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, A, "mode" },
77  { "lr>rr", 0, 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, A, "mode" },
78  { "lr>l+r", 0, 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, A, "mode" },
79  { "lr>rl", 0, 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, A, "mode" },
80  { "ms>ll", 0, 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, A, "mode" },
81  { "ms>rr", 0, 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, A, "mode" },
82  { "ms>rl", 0, 0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, A, "mode" },
83  { "lr>l-r", 0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, A, "mode" },
84  { "slev", "set side level", OFFSET(slev), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
85  { "sbal", "set side balance", OFFSET(sbal), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
86  { "mlev", "set middle level", OFFSET(mlev), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
87  { "mpan", "set middle pan", OFFSET(mpan), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
88  { "base", "set stereo base", OFFSET(base), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
89  { "delay", "set delay", OFFSET(delay), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -20, 20, A },
90  { "sclevel", "set S/C level", OFFSET(sc_level), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 100, A },
91  { "phase", "set stereo phase", OFFSET(phase), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 360, A },
92  { "bmode_in", "set balance in mode", OFFSET(bmode_in), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, A, "bmode" },
93  { "balance", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "bmode" },
94  { "amplitude", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "bmode" },
95  { "power", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, "bmode" },
96  { "bmode_out", "set balance out mode", OFFSET(bmode_out), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, A, "bmode" },
97  { NULL }
98 };
99 
100 AVFILTER_DEFINE_CLASS(stereotools);
101 
103 {
106  int ret;
107 
108  if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL )) < 0 ||
109  (ret = ff_set_common_formats (ctx , formats )) < 0 ||
110  (ret = ff_add_channel_layout (&layout , AV_CH_LAYOUT_STEREO)) < 0 ||
111  (ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
112  return ret;
113 
114  formats = ff_all_samplerates();
115  return ff_set_common_samplerates(ctx, formats);
116 }
117 
119 {
120  AVFilterContext *ctx = inlink->dst;
121  StereoToolsContext *s = ctx->priv;
122 
123  s->length = FFALIGN(inlink->sample_rate / 10, 2);
124  if (!s->buffer)
125  s->buffer = av_calloc(s->length, sizeof(*s->buffer));
126  if (!s->buffer)
127  return AVERROR(ENOMEM);
128 
129  s->inv_atan_shape = 1.0 / atan(s->sc_level);
130  s->phase_cos_coef = cos(s->phase / 180 * M_PI);
131  s->phase_sin_coef = sin(s->phase / 180 * M_PI);
132 
133  return 0;
134 }
135 
137 {
138  AVFilterContext *ctx = inlink->dst;
139  AVFilterLink *outlink = ctx->outputs[0];
140  StereoToolsContext *s = ctx->priv;
141  const double *src = (const double *)in->data[0];
142  const double sb = s->base < 0 ? s->base * 0.5 : s->base;
143  const double sbal = 1 + s->sbal;
144  const double mpan = 1 + s->mpan;
145  const double slev = s->slev;
146  const double mlev = s->mlev;
147  const double balance_in = s->balance_in;
148  const double balance_out = s->balance_out;
149  const double level_in = s->level_in;
150  const double level_out = s->level_out;
151  const double sc_level = s->sc_level;
152  const double delay = s->delay;
153  const int length = s->length;
154  const int mute_l = s->mute_l;
155  const int mute_r = s->mute_r;
156  const int phase_l = s->phase_l;
157  const int phase_r = s->phase_r;
158  double *buffer = s->buffer;
159  AVFrame *out;
160  double *dst;
161  int nbuf = inlink->sample_rate * (fabs(delay) / 1000.);
162  int n;
163 
164  nbuf -= nbuf % 2;
165  if (av_frame_is_writable(in)) {
166  out = in;
167  } else {
168  out = ff_get_audio_buffer(outlink, in->nb_samples);
169  if (!out) {
170  av_frame_free(&in);
171  return AVERROR(ENOMEM);
172  }
174  }
175  dst = (double *)out->data[0];
176 
177  for (n = 0; n < in->nb_samples; n++, src += 2, dst += 2) {
178  double L = src[0], R = src[1], l, r, m, S, gl, gr, gd;
179 
180  L *= level_in;
181  R *= level_in;
182 
183  gl = 1. - FFMAX(0., balance_in);
184  gr = 1. + FFMIN(0., balance_in);
185  switch (s->bmode_in) {
186  case 1:
187  gd = gl - gr;
188  gl = 1. + gd;
189  gr = 1. - gd;
190  break;
191  case 2:
192  if (balance_in < 0.) {
193  gr = FFMAX(0.5, gr);
194  gl = 1. / gr;
195  } else if (balance_in > 0.) {
196  gl = FFMAX(0.5, gl);
197  gr = 1. / gl;
198  }
199  break;
200  }
201  L *= gl;
202  R *= gr;
203 
204  if (s->softclip) {
205  R = s->inv_atan_shape * atan(R * sc_level);
206  L = s->inv_atan_shape * atan(L * sc_level);
207  }
208 
209  switch (s->mode) {
210  case 0:
211  m = (L + R) * 0.5;
212  S = (L - R) * 0.5;
213  l = m * mlev * FFMIN(1., 2. - mpan) + S * slev * FFMIN(1., 2. - sbal);
214  r = m * mlev * FFMIN(1., mpan) - S * slev * FFMIN(1., sbal);
215  L = l;
216  R = r;
217  break;
218  case 1:
219  l = L * FFMIN(1., 2. - sbal);
220  r = R * FFMIN(1., sbal);
221  L = 0.5 * (l + r) * mlev;
222  R = 0.5 * (l - r) * slev;
223  break;
224  case 2:
225  l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
226  r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
227  L = l;
228  R = r;
229  break;
230  case 3:
231  R = L;
232  break;
233  case 4:
234  L = R;
235  break;
236  case 5:
237  L = (L + R) * 0.5;
238  R = L;
239  break;
240  case 6:
241  l = L;
242  L = R;
243  R = l;
244  m = (L + R) * 0.5;
245  S = (L - R) * 0.5;
246  l = m * mlev * FFMIN(1., 2. - mpan) + S * slev * FFMIN(1., 2. - sbal);
247  r = m * mlev * FFMIN(1., mpan) - S * slev * FFMIN(1., sbal);
248  L = l;
249  R = r;
250  break;
251  case 7:
252  l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
253  L = l;
254  R = l;
255  break;
256  case 8:
257  r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
258  L = r;
259  R = r;
260  break;
261  case 9:
262  l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
263  r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
264  L = r;
265  R = l;
266  break;
267  case 10:
268  L = (L - R) * 0.5;
269  R = L;
270  break;
271  }
272 
273  L *= 1. - mute_l;
274  R *= 1. - mute_r;
275 
276  L *= (2. * (1. - phase_l)) - 1.;
277  R *= (2. * (1. - phase_r)) - 1.;
278 
279  buffer[s->pos ] = L;
280  buffer[s->pos+1] = R;
281 
282  if (delay > 0.) {
283  R = buffer[(s->pos - (int)nbuf + 1 + length) % length];
284  } else if (delay < 0.) {
285  L = buffer[(s->pos - (int)nbuf + length) % length];
286  }
287 
288  l = L + sb * L - sb * R;
289  r = R + sb * R - sb * L;
290 
291  L = l;
292  R = r;
293 
294  l = L * s->phase_cos_coef - R * s->phase_sin_coef;
295  r = L * s->phase_sin_coef + R * s->phase_cos_coef;
296 
297  L = l;
298  R = r;
299 
300  s->pos = (s->pos + 2) % s->length;
301 
302  gl = 1. - FFMAX(0., balance_out);
303  gr = 1. + FFMIN(0., balance_out);
304  switch (s->bmode_out) {
305  case 1:
306  gd = gl - gr;
307  gl = 1. + gd;
308  gr = 1. - gd;
309  break;
310  case 2:
311  if (balance_out < 0.) {
312  gr = FFMAX(0.5, gr);
313  gl = 1. / gr;
314  } else if (balance_out > 0.) {
315  gl = FFMAX(0.5, gl);
316  gr = 1. / gl;
317  }
318  break;
319  }
320  L *= gl;
321  R *= gr;
322 
323 
324  L *= level_out;
325  R *= level_out;
326 
327  if (ctx->is_disabled) {
328  dst[0] = src[0];
329  dst[1] = src[1];
330  } else {
331  dst[0] = L;
332  dst[1] = R;
333  }
334  }
335 
336  if (out != in)
337  av_frame_free(&in);
338  return ff_filter_frame(outlink, out);
339 }
340 
341 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
342  char *res, int res_len, int flags)
343 {
344  int ret;
345 
346  ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
347  if (ret < 0)
348  return ret;
349 
350  return config_input(ctx->inputs[0]);
351 }
352 
354 {
355  StereoToolsContext *s = ctx->priv;
356 
357  av_freep(&s->buffer);
358 }
359 
360 static const AVFilterPad inputs[] = {
361  {
362  .name = "default",
363  .type = AVMEDIA_TYPE_AUDIO,
364  .filter_frame = filter_frame,
365  .config_props = config_input,
366  },
367  { NULL }
368 };
369 
370 static const AVFilterPad outputs[] = {
371  {
372  .name = "default",
373  .type = AVMEDIA_TYPE_AUDIO,
374  },
375  { NULL }
376 };
377 
379  .name = "stereotools",
380  .description = NULL_IF_CONFIG_SMALL("Apply various stereo tools."),
381  .query_formats = query_formats,
382  .priv_size = sizeof(StereoToolsContext),
383  .priv_class = &stereotools_class,
384  .uninit = uninit,
385  .inputs = inputs,
386  .outputs = outputs,
389 };
static const AVOption stereotools_options[]
#define NULL
Definition: coverity.c:32
This structure describes decoded (raw) audio or video data.
Definition: frame.h:314
AVOption.
Definition: opt.h:248
Main libavfilter public API header.
int ff_set_common_channel_layouts(AVFilterContext *ctx, AVFilterChannelLayouts *channel_layouts)
A helper for query_formats() which sets all links to the same list of channel layouts/sample rates...
Definition: formats.c:569
#define AV_CH_LAYOUT_STEREO
int is_disabled
the enabled state from the last expression evaluation
Definition: avfilter.h:388
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
Definition: mem.c:245
const char * name
Pad name.
Definition: internal.h:60
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:349
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1091
#define av_cold
Definition: attributes.h:88
AVOptions.
#define OFFSET(x)
#define FFALIGN(x, a)
Definition: macros.h:48
#define A
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
A filter pad used for either input or output.
Definition: internal.h:54
#define src
Definition: vp8dsp.c:255
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:588
#define R
Definition: huffyuvdsp.h:34
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
Definition: formats.c:339
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition: audio.c:86
#define S(s, c, i)
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:203
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:115
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:885
const char * r
Definition: vf_curves.c:114
void * priv
private data for use by the filter
Definition: avfilter.h:356
GLsizei GLsizei * length
Definition: opengl_enc.c:114
int ff_add_format(AVFilterFormats **avff, int64_t fmt)
Add fmt to the list of media formats contained in *avff.
Definition: formats.c:333
#define FFMAX(a, b)
Definition: common.h:94
AVFilter ff_af_stereotools
audio channel layout utility functions
static av_cold void uninit(AVFilterContext *ctx)
#define FFMIN(a, b)
Definition: common.h:96
AVFILTER_DEFINE_CLASS(stereotools)
AVFormatContext * ctx
Definition: movenc.c:48
static int query_formats(AVFilterContext *ctx)
#define s(width, name)
Definition: cbs_vp9.c:257
#define L(x)
Definition: vp56_arith.h:36
static const AVFilterPad outputs[]
static int config_input(AVFilterLink *inlink)
A list of supported channel layouts.
Definition: formats.h:86
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
Definition: frame.c:594
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31))))#define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac){}void ff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map){AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);return NULL;}return ac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;}int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){int use_generic=1;int len=in->nb_samples;int p;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:145
const char * name
Filter name.
Definition: avfilter.h:149
#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:134
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:353
AVFilterFormats * ff_all_samplerates(void)
Definition: formats.c:422
#define flags(name, subs,...)
Definition: cbs_av1.c:561
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:328
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
static const AVFilterPad inputs[]
int
A list of supported formats for one end of a filter link.
Definition: formats.h:65
An instance of a filter.
Definition: avfilter.h:341
FILE * out
Definition: movenc.c:54
#define av_freep(p)
#define M_PI
Definition: mathematics.h:52
formats
Definition: signature.h:48
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
mode
Use these values in ebur128_init (or&#39;ed).
Definition: ebur128.h:83
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:380
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 layout
for(j=16;j >0;--j)
int ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:576
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:658
GLuint buffer
Definition: opengl_enc.c:101
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)