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/mem.h"
23 #include "libavutil/opt.h"
24 #include "avfilter.h"
25 #include "audio.h"
26 #include "filters.h"
27 #include "formats.h"
28 
29 typedef struct StereoToolsContext {
30  const AVClass *class;
31 
32  int softclip;
33  int mute_l;
34  int mute_r;
35  int phase_l;
36  int phase_r;
37  int mode;
38  int bmode_in;
39  int bmode_out;
40  double slev;
41  double sbal;
42  double mlev;
43  double mpan;
44  double phase;
45  double base;
46  double delay;
47  double balance_in;
48  double balance_out;
51  double sc_level;
53  double level_in;
54  double level_out;
55 
56  double *buffer;
57  int length;
58  int pos;
60 
61 #define OFFSET(x) offsetof(StereoToolsContext, x)
62 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
63 
64 static const AVOption stereotools_options[] = {
65  { "level_in", "set level in", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
66  { "level_out", "set level out", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
67  { "balance_in", "set balance in", OFFSET(balance_in), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
68  { "balance_out", "set balance out", OFFSET(balance_out), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
69  { "softclip", "enable softclip", OFFSET(softclip), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
70  { "mutel", "mute L", OFFSET(mute_l), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
71  { "muter", "mute R", OFFSET(mute_r), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
72  { "phasel", "phase L", OFFSET(phase_l), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
73  { "phaser", "phase R", OFFSET(phase_r), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
74  { "mode", "set stereo mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 10, A, .unit = "mode" },
75  { "lr>lr", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, .unit = "mode" },
76  { "lr>ms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, .unit = "mode" },
77  { "ms>lr", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, .unit = "mode" },
78  { "lr>ll", 0, 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, A, .unit = "mode" },
79  { "lr>rr", 0, 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, A, .unit = "mode" },
80  { "lr>l+r", 0, 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, A, .unit = "mode" },
81  { "lr>rl", 0, 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, A, .unit = "mode" },
82  { "ms>ll", 0, 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, A, .unit = "mode" },
83  { "ms>rr", 0, 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, A, .unit = "mode" },
84  { "ms>rl", 0, 0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, A, .unit = "mode" },
85  { "lr>l-r", 0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, A, .unit = "mode" },
86  { "slev", "set side level", OFFSET(slev), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
87  { "sbal", "set side balance", OFFSET(sbal), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
88  { "mlev", "set middle level", OFFSET(mlev), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
89  { "mpan", "set middle pan", OFFSET(mpan), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
90  { "base", "set stereo base", OFFSET(base), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, A },
91  { "delay", "set delay", OFFSET(delay), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -20, 20, A },
92  { "sclevel", "set S/C level", OFFSET(sc_level), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 100, A },
93  { "phase", "set stereo phase", OFFSET(phase), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 360, A },
94  { "bmode_in", "set balance in mode", OFFSET(bmode_in), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, A, .unit = "bmode" },
95  { "balance", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, .unit = "bmode" },
96  { "amplitude", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, .unit = "bmode" },
97  { "power", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, .unit = "bmode" },
98  { "bmode_out", "set balance out mode", OFFSET(bmode_out), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, A, .unit = "bmode" },
99  { NULL }
100 };
101 
102 AVFILTER_DEFINE_CLASS(stereotools);
103 
105  AVFilterFormatsConfig **cfg_in,
106  AVFilterFormatsConfig **cfg_out)
107 {
108  static const enum AVSampleFormat formats[] = {
111  };
112  static const AVChannelLayout layouts[] = {
114  { .nb_channels = 0 },
115  };
116 
117  int ret;
118 
119 
120  ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats);
121  if (ret < 0)
122  return ret;
123 
125  if (ret < 0)
126  return ret;
127 
128  return 0;
129 }
130 
132 {
133  AVFilterContext *ctx = inlink->dst;
134  StereoToolsContext *s = ctx->priv;
135 
136  s->length = FFALIGN((inlink->sample_rate + 9) / 10, 2);
137  if (!s->buffer)
138  s->buffer = av_calloc(s->length, sizeof(*s->buffer));
139  if (!s->buffer)
140  return AVERROR(ENOMEM);
141 
142  s->inv_atan_shape = 1.0 / atan(s->sc_level);
143  s->phase_cos_coef = cos(s->phase / 180 * M_PI);
144  s->phase_sin_coef = sin(s->phase / 180 * M_PI);
145 
146  return 0;
147 }
148 
150 {
151  AVFilterContext *ctx = inlink->dst;
152  AVFilterLink *outlink = ctx->outputs[0];
153  StereoToolsContext *s = ctx->priv;
154  const double *src = (const double *)in->data[0];
155  const double sb = s->base < 0 ? s->base * 0.5 : s->base;
156  const double sbal = 1 + s->sbal;
157  const double mpan = 1 + s->mpan;
158  const double slev = s->slev;
159  const double mlev = s->mlev;
160  const double balance_in = s->balance_in;
161  const double balance_out = s->balance_out;
162  const double level_in = s->level_in;
163  const double level_out = s->level_out;
164  const double sc_level = s->sc_level;
165  const double delay = s->delay;
166  const int length = s->length;
167  const int mute_l = s->mute_l;
168  const int mute_r = s->mute_r;
169  const int phase_l = s->phase_l;
170  const int phase_r = s->phase_r;
171  double *buffer = s->buffer;
172  AVFrame *out;
173  double *dst;
174  int nbuf = inlink->sample_rate * (fabs(delay) / 1000.);
175  int n;
176 
177  nbuf -= nbuf % 2;
178  if (av_frame_is_writable(in)) {
179  out = in;
180  } else {
181  out = ff_get_audio_buffer(outlink, in->nb_samples);
182  if (!out) {
183  av_frame_free(&in);
184  return AVERROR(ENOMEM);
185  }
187  }
188  dst = (double *)out->data[0];
189 
190  for (n = 0; n < in->nb_samples; n++, src += 2, dst += 2) {
191  double L = src[0], R = src[1], l, r, m, S, gl, gr, gd;
192 
193  L *= level_in;
194  R *= level_in;
195 
196  gl = 1. - FFMAX(0., balance_in);
197  gr = 1. + FFMIN(0., balance_in);
198  switch (s->bmode_in) {
199  case 1:
200  gd = gl - gr;
201  gl = 1. + gd;
202  gr = 1. - gd;
203  break;
204  case 2:
205  if (balance_in < 0.) {
206  gr = FFMAX(0.5, gr);
207  gl = 1. / gr;
208  } else if (balance_in > 0.) {
209  gl = FFMAX(0.5, gl);
210  gr = 1. / gl;
211  }
212  break;
213  }
214  L *= gl;
215  R *= gr;
216 
217  if (s->softclip) {
218  R = s->inv_atan_shape * atan(R * sc_level);
219  L = s->inv_atan_shape * atan(L * sc_level);
220  }
221 
222  switch (s->mode) {
223  case 0:
224  m = (L + R) * 0.5;
225  S = (L - R) * 0.5;
226  l = m * mlev * FFMIN(1., 2. - mpan) + S * slev * FFMIN(1., 2. - sbal);
227  r = m * mlev * FFMIN(1., mpan) - S * slev * FFMIN(1., sbal);
228  L = l;
229  R = r;
230  break;
231  case 1:
232  l = L * FFMIN(1., 2. - sbal);
233  r = R * FFMIN(1., sbal);
234  L = 0.5 * (l + r) * mlev;
235  R = 0.5 * (l - r) * slev;
236  break;
237  case 2:
238  l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
239  r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
240  L = l;
241  R = r;
242  break;
243  case 3:
244  R = L;
245  break;
246  case 4:
247  L = R;
248  break;
249  case 5:
250  L = (L + R) * 0.5;
251  R = L;
252  break;
253  case 6:
254  l = L;
255  L = R;
256  R = l;
257  m = (L + R) * 0.5;
258  S = (L - R) * 0.5;
259  l = m * mlev * FFMIN(1., 2. - mpan) + S * slev * FFMIN(1., 2. - sbal);
260  r = m * mlev * FFMIN(1., mpan) - S * slev * FFMIN(1., sbal);
261  L = l;
262  R = r;
263  break;
264  case 7:
265  l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
266  L = l;
267  R = l;
268  break;
269  case 8:
270  r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
271  L = r;
272  R = r;
273  break;
274  case 9:
275  l = L * mlev * FFMIN(1., 2. - mpan) + R * slev * FFMIN(1., 2. - sbal);
276  r = L * mlev * FFMIN(1., mpan) - R * slev * FFMIN(1., sbal);
277  L = r;
278  R = l;
279  break;
280  case 10:
281  L = (L - R) * 0.5;
282  R = L;
283  break;
284  }
285 
286  L *= 1. - mute_l;
287  R *= 1. - mute_r;
288 
289  L *= (2. * (1. - phase_l)) - 1.;
290  R *= (2. * (1. - phase_r)) - 1.;
291 
292  buffer[s->pos ] = L;
293  buffer[s->pos+1] = R;
294 
295  if (delay > 0.) {
296  R = buffer[(s->pos - (int)nbuf + 1 + length) % length];
297  } else if (delay < 0.) {
298  L = buffer[(s->pos - (int)nbuf + length) % length];
299  }
300 
301  l = L + sb * L - sb * R;
302  r = R + sb * R - sb * L;
303 
304  L = l;
305  R = r;
306 
307  l = L * s->phase_cos_coef - R * s->phase_sin_coef;
308  r = L * s->phase_sin_coef + R * s->phase_cos_coef;
309 
310  L = l;
311  R = r;
312 
313  s->pos = (s->pos + 2) % s->length;
314 
315  gl = 1. - FFMAX(0., balance_out);
316  gr = 1. + FFMIN(0., balance_out);
317  switch (s->bmode_out) {
318  case 1:
319  gd = gl - gr;
320  gl = 1. + gd;
321  gr = 1. - gd;
322  break;
323  case 2:
324  if (balance_out < 0.) {
325  gr = FFMAX(0.5, gr);
326  gl = 1. / gr;
327  } else if (balance_out > 0.) {
328  gl = FFMAX(0.5, gl);
329  gr = 1. / gl;
330  }
331  break;
332  }
333  L *= gl;
334  R *= gr;
335 
336 
337  L *= level_out;
338  R *= level_out;
339 
340  if (ctx->is_disabled) {
341  dst[0] = src[0];
342  dst[1] = src[1];
343  } else {
344  dst[0] = L;
345  dst[1] = R;
346  }
347  }
348 
349  if (out != in)
350  av_frame_free(&in);
351  return ff_filter_frame(outlink, out);
352 }
353 
354 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
355  char *res, int res_len, int flags)
356 {
357  int ret;
358 
359  ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
360  if (ret < 0)
361  return ret;
362 
363  return config_input(ctx->inputs[0]);
364 }
365 
367 {
368  StereoToolsContext *s = ctx->priv;
369 
370  av_freep(&s->buffer);
371 }
372 
373 static const AVFilterPad inputs[] = {
374  {
375  .name = "default",
376  .type = AVMEDIA_TYPE_AUDIO,
377  .filter_frame = filter_frame,
378  .config_props = config_input,
379  },
380 };
381 
383  .name = "stereotools",
384  .description = NULL_IF_CONFIG_SMALL("Apply various stereo tools."),
385  .priv_size = sizeof(StereoToolsContext),
386  .priv_class = &stereotools_class,
387  .uninit = uninit,
391  .process_command = process_command,
393 };
formats
formats
Definition: signature.h:47
ff_get_audio_buffer
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition: audio.c:98
StereoToolsContext::mlev
double mlev
Definition: af_stereotools.c:42
r
const char * r
Definition: vf_curves.c:127
AVERROR
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
opt.h
A
#define A
Definition: af_stereotools.c:62
out
FILE * out
Definition: movenc.c:55
AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:393
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: af_stereotools.c:104
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1062
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:335
inputs
static const AVFilterPad inputs[]
Definition: af_stereotools.c:373
StereoToolsContext::delay
double delay
Definition: af_stereotools.c:46
inlink
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
Definition: filter_design.txt:212
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:162
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
StereoToolsContext::buffer
double * buffer
Definition: af_stereotools.c:56
StereoToolsContext::inv_atan_shape
double inv_atan_shape
Definition: af_stereotools.c:52
AVOption
AVOption.
Definition: opt.h:429
StereoToolsContext::mute_l
int mute_l
Definition: af_stereotools.c:33
R
#define R
Definition: huffyuv.h:44
ff_set_common_channel_layouts_from_list2
int ff_set_common_channel_layouts_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const AVChannelLayout *fmts)
Definition: formats.c:920
base
uint8_t base
Definition: vp3data.h:128
StereoToolsContext::sbal
double sbal
Definition: af_stereotools.c:41
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_stereotools.c:366
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:410
formats.h
S
#define S(s, c, i)
Definition: flacdsp_template.c:46
StereoToolsContext::mpan
double mpan
Definition: af_stereotools.c:43
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_stereotools.c:131
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_stereotools.c:354
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
ff_af_stereotools
const AVFilter ff_af_stereotools
Definition: af_stereotools.c:382
av_cold
#define av_cold
Definition: attributes.h:90
StereoToolsContext::softclip
int softclip
Definition: af_stereotools.c:32
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
filters.h
StereoToolsContext::phase_l
int phase_l
Definition: af_stereotools.c:35
StereoToolsContext::base
double base
Definition: af_stereotools.c:45
ctx
AVFormatContext * ctx
Definition: movenc.c:49
StereoToolsContext::phase_cos_coef
double phase_cos_coef
Definition: af_stereotools.c:50
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
StereoToolsContext::balance_out
double balance_out
Definition: af_stereotools.c:48
StereoToolsContext::pos
int pos
Definition: af_stereotools.c:58
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
fabs
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:713
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
AVFilterFormatsConfig
Lists of formats / etc.
Definition: avfilter.h:111
StereoToolsContext::phase
double phase
Definition: af_stereotools.c:44
StereoToolsContext::bmode_out
int bmode_out
Definition: af_stereotools.c:39
StereoToolsContext::phase_r
int phase_r
Definition: af_stereotools.c:36
StereoToolsContext::mode
int mode
Definition: af_stereotools.c:37
OFFSET
#define OFFSET(x)
Definition: af_stereotools.c:61
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:317
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
StereoToolsContext::level_out
double level_out
Definition: af_stereotools.c:54
av_frame_is_writable
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
Definition: frame.c:649
ff_filter_process_command
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:901
StereoToolsContext
Definition: af_stereotools.c:29
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_stereotools.c:149
M_PI
#define M_PI
Definition: mathematics.h:67
StereoToolsContext::balance_in
double balance_in
Definition: af_stereotools.c:47
AVFrame::nb_samples
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:469
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
stereotools_options
static const AVOption stereotools_options[]
Definition: af_stereotools.c:64
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
StereoToolsContext::phase_sin_coef
double phase_sin_coef
Definition: af_stereotools.c:49
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
av_calloc
void * av_calloc(size_t nmemb, size_t size)
Definition: mem.c:264
AVFilter
Filter definition.
Definition: avfilter.h:201
ret
ret
Definition: filter_design.txt:187
ff_set_common_formats_from_list2
int ff_set_common_formats_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const int *fmts)
Definition: formats.c:1016
channel_layout.h
buffer
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
Definition: filter_design.txt:49
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
avfilter.h
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(stereotools)
L
#define L(x)
Definition: vpx_arith.h:36
AVFilterContext
An instance of a filter.
Definition: avfilter.h:457
mem.h
audio.h
StereoToolsContext::length
int length
Definition: af_stereotools.c:57
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#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:190
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
StereoToolsContext::sc_level
double sc_level
Definition: af_stereotools.c:51
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:61
StereoToolsContext::slev
double slev
Definition: af_stereotools.c:40
StereoToolsContext::level_in
double level_in
Definition: af_stereotools.c:53
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
src
#define src
Definition: vp8dsp.c:248
StereoToolsContext::mute_r
int mute_r
Definition: af_stereotools.c:34
StereoToolsContext::bmode_in
int bmode_in
Definition: af_stereotools.c:38