FFmpeg  4.4.9
af_chorus.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1998 Juergen Mueller And Sundry Contributors
3  * This source code is freely redistributable and may be used for
4  * any purpose. This copyright notice must be maintained.
5  * Juergen Mueller And Sundry Contributors are not responsible for
6  * the consequences of using this software.
7  *
8  * Copyright (c) 2015 Paul B Mahol
9  *
10  * This file is part of FFmpeg.
11  *
12  * FFmpeg is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * FFmpeg is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with FFmpeg; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 
27 /**
28  * @file
29  * chorus audio filter
30  */
31 
32 #include "libavutil/avstring.h"
33 #include "libavutil/opt.h"
34 #include "audio.h"
35 #include "avfilter.h"
36 #include "internal.h"
37 #include "generate_wave_table.h"
38 
39 typedef struct ChorusContext {
40  const AVClass *class;
41  float in_gain, out_gain;
42  char *delays_str;
43  char *decays_str;
44  char *speeds_str;
45  char *depths_str;
46  float *delays;
47  float *decays;
48  float *speeds;
49  float *depths;
51  int **phase;
52  int *length;
54  int *counter;
57  int channels;
59  int fade_out;
62 
63 #define OFFSET(x) offsetof(ChorusContext, x)
64 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
65 
66 static const AVOption chorus_options[] = {
67  { "in_gain", "set input gain", OFFSET(in_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A },
68  { "out_gain", "set output gain", OFFSET(out_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A },
69  { "delays", "set delays", OFFSET(delays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
70  { "decays", "set decays", OFFSET(decays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
71  { "speeds", "set speeds", OFFSET(speeds_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
72  { "depths", "set depths", OFFSET(depths_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
73  { NULL }
74 };
75 
77 
78 static void count_items(char *item_str, int *nb_items)
79 {
80  char *p;
81 
82  *nb_items = 1;
83  for (p = item_str; *p; p++) {
84  if (*p == '|')
85  (*nb_items)++;
86  }
87 
88 }
89 
90 static void fill_items(char *item_str, int *nb_items, float *items)
91 {
92  char *p, *saveptr = NULL;
93  int i, new_nb_items = 0;
94 
95  p = item_str;
96  for (i = 0; i < *nb_items; i++) {
97  char *tstr = av_strtok(p, "|", &saveptr);
98  p = NULL;
99  if (tstr)
100  new_nb_items += sscanf(tstr, "%f", &items[new_nb_items]) == 1;
101  }
102 
103  *nb_items = new_nb_items;
104 }
105 
107 {
108  ChorusContext *s = ctx->priv;
109  int nb_delays, nb_decays, nb_speeds, nb_depths;
110 
111  if (!s->delays_str || !s->decays_str || !s->speeds_str || !s->depths_str) {
112  av_log(ctx, AV_LOG_ERROR, "Both delays & decays & speeds & depths must be set.\n");
113  return AVERROR(EINVAL);
114  }
115 
116  count_items(s->delays_str, &nb_delays);
117  count_items(s->decays_str, &nb_decays);
118  count_items(s->speeds_str, &nb_speeds);
119  count_items(s->depths_str, &nb_depths);
120 
121  s->delays = av_realloc_f(s->delays, nb_delays, sizeof(*s->delays));
122  s->decays = av_realloc_f(s->decays, nb_decays, sizeof(*s->decays));
123  s->speeds = av_realloc_f(s->speeds, nb_speeds, sizeof(*s->speeds));
124  s->depths = av_realloc_f(s->depths, nb_depths, sizeof(*s->depths));
125 
126  if (!s->delays || !s->decays || !s->speeds || !s->depths)
127  return AVERROR(ENOMEM);
128 
129  fill_items(s->delays_str, &nb_delays, s->delays);
130  fill_items(s->decays_str, &nb_decays, s->decays);
131  fill_items(s->speeds_str, &nb_speeds, s->speeds);
132  fill_items(s->depths_str, &nb_depths, s->depths);
133 
134  if (nb_delays != nb_decays || nb_delays != nb_speeds || nb_delays != nb_depths) {
135  av_log(ctx, AV_LOG_ERROR, "Number of delays & decays & speeds & depths given must be same.\n");
136  return AVERROR(EINVAL);
137  }
138 
139  s->num_chorus = nb_delays;
140 
141  if (s->num_chorus < 1) {
142  av_log(ctx, AV_LOG_ERROR, "At least one delay & decay & speed & depth must be set.\n");
143  return AVERROR(EINVAL);
144  }
145 
146  for (int n = 0; n < s->num_chorus; n++) {
147  if (!(s->speeds[n] > 0)) {
148  av_log(ctx, AV_LOG_ERROR, "Speeds must be positive.\n");
149  return AVERROR(EINVAL);
150  }
151  }
152 
153  s->length = av_calloc(s->num_chorus, sizeof(*s->length));
154  s->lookup_table = av_calloc(s->num_chorus, sizeof(*s->lookup_table));
155 
156  if (!s->length || !s->lookup_table)
157  return AVERROR(ENOMEM);
158 
159  s->next_pts = AV_NOPTS_VALUE;
160 
161  return 0;
162 }
163 
165 {
168  static const enum AVSampleFormat sample_fmts[] = {
170  };
171  int ret;
172 
174  if (!layouts)
175  return AVERROR(ENOMEM);
177  if (ret < 0)
178  return ret;
179 
181  if (!formats)
182  return AVERROR(ENOMEM);
184  if (ret < 0)
185  return ret;
186 
188  if (!formats)
189  return AVERROR(ENOMEM);
191 }
192 
193 static int config_output(AVFilterLink *outlink)
194 {
195  AVFilterContext *ctx = outlink->src;
196  ChorusContext *s = ctx->priv;
197  float sum_in_volume = 1.0;
198  int n;
199 
200  s->channels = outlink->channels;
201 
202  for (n = 0; n < s->num_chorus; n++) {
203  int samples = (int) ((s->delays[n] + s->depths[n]) * outlink->sample_rate / 1000.0);
204  int depth_samples = (int) (s->depths[n] * outlink->sample_rate / 1000.0);
205 
206  s->length[n] = av_clipd(outlink->sample_rate / s->speeds[n], 0, INT_MAX);
207  if (s->length[n] < 1) {
208  av_log(ctx, AV_LOG_ERROR, "Speed %g is above the sample rate of %d.\n",
209  s->speeds[n], outlink->sample_rate);
210  return AVERROR(EINVAL);
211  }
212 
213  s->lookup_table[n] = av_malloc_array(s->length[n], sizeof(*s->lookup_table[n]));
214  if (!s->lookup_table[n])
215  return AVERROR(ENOMEM);
216 
218  s->length[n], 0., depth_samples, 0);
219  s->max_samples = FFMAX(s->max_samples, samples);
220  }
221 
222  for (n = 0; n < s->num_chorus; n++)
223  sum_in_volume += s->decays[n];
224 
225  if (s->in_gain * (sum_in_volume) > 1.0 / s->out_gain)
226  av_log(ctx, AV_LOG_WARNING, "output gain can cause saturation or clipping of output\n");
227 
228  s->counter = av_calloc(outlink->channels, sizeof(*s->counter));
229  if (!s->counter)
230  return AVERROR(ENOMEM);
231 
232  s->phase = av_calloc(outlink->channels, sizeof(*s->phase));
233  if (!s->phase)
234  return AVERROR(ENOMEM);
235 
236  for (n = 0; n < outlink->channels; n++) {
237  s->phase[n] = av_calloc(s->num_chorus, sizeof(int));
238  if (!s->phase[n])
239  return AVERROR(ENOMEM);
240  }
241 
242  s->fade_out = s->max_samples;
243 
244  return av_samples_alloc_array_and_samples(&s->chorusbuf, NULL,
245  outlink->channels,
246  s->max_samples,
247  outlink->format, 0);
248 }
249 
250 #define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a))
251 
252 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
253 {
254  AVFilterContext *ctx = inlink->dst;
255  ChorusContext *s = ctx->priv;
256  AVFrame *out_frame;
257  int c, i, n;
258 
260  out_frame = frame;
261  } else {
262  out_frame = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
263  if (!out_frame) {
265  return AVERROR(ENOMEM);
266  }
267  av_frame_copy_props(out_frame, frame);
268  }
269 
270  for (c = 0; c < inlink->channels; c++) {
271  const float *src = (const float *)frame->extended_data[c];
272  float *dst = (float *)out_frame->extended_data[c];
273  float *chorusbuf = (float *)s->chorusbuf[c];
274  int *phase = s->phase[c];
275 
276  for (i = 0; i < frame->nb_samples; i++) {
277  float out, in = src[i];
278 
279  out = in * s->in_gain;
280 
281  for (n = 0; n < s->num_chorus; n++) {
282  out += chorusbuf[MOD(s->max_samples + s->counter[c] -
283  s->lookup_table[n][phase[n]],
284  s->max_samples)] * s->decays[n];
285  phase[n] = MOD(phase[n] + 1, s->length[n]);
286  }
287 
288  out *= s->out_gain;
289 
290  dst[i] = out;
291 
292  chorusbuf[s->counter[c]] = in;
293  s->counter[c] = MOD(s->counter[c] + 1, s->max_samples);
294  }
295  }
296 
297  s->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
298 
299  if (frame != out_frame)
301 
302  return ff_filter_frame(ctx->outputs[0], out_frame);
303 }
304 
305 static int request_frame(AVFilterLink *outlink)
306 {
307  AVFilterContext *ctx = outlink->src;
308  ChorusContext *s = ctx->priv;
309  int ret;
310 
311  ret = ff_request_frame(ctx->inputs[0]);
312 
313  if (ret == AVERROR_EOF && !ctx->is_disabled && s->fade_out) {
314  int nb_samples = FFMIN(s->fade_out, 2048);
315  AVFrame *frame;
316 
317  frame = ff_get_audio_buffer(outlink, nb_samples);
318  if (!frame)
319  return AVERROR(ENOMEM);
320  s->fade_out -= nb_samples;
321 
323  frame->nb_samples,
324  outlink->channels,
325  frame->format);
326 
327  frame->pts = s->next_pts;
328  if (s->next_pts != AV_NOPTS_VALUE)
329  s->next_pts += av_rescale_q(nb_samples, (AVRational){1, outlink->sample_rate}, outlink->time_base);
330 
331  ret = filter_frame(ctx->inputs[0], frame);
332  }
333 
334  return ret;
335 }
336 
338 {
339  ChorusContext *s = ctx->priv;
340  int n;
341 
342  av_freep(&s->delays);
343  av_freep(&s->decays);
344  av_freep(&s->speeds);
345  av_freep(&s->depths);
346 
347  if (s->chorusbuf)
348  av_freep(&s->chorusbuf[0]);
349  av_freep(&s->chorusbuf);
350 
351  if (s->phase)
352  for (n = 0; n < s->channels; n++)
353  av_freep(&s->phase[n]);
354  av_freep(&s->phase);
355 
356  av_freep(&s->counter);
357  av_freep(&s->length);
358 
359  if (s->lookup_table)
360  for (n = 0; n < s->num_chorus; n++)
361  av_freep(&s->lookup_table[n]);
362  av_freep(&s->lookup_table);
363 }
364 
365 static const AVFilterPad chorus_inputs[] = {
366  {
367  .name = "default",
368  .type = AVMEDIA_TYPE_AUDIO,
369  .filter_frame = filter_frame,
370  },
371  { NULL }
372 };
373 
374 static const AVFilterPad chorus_outputs[] = {
375  {
376  .name = "default",
377  .type = AVMEDIA_TYPE_AUDIO,
378  .request_frame = request_frame,
379  .config_props = config_output,
380  },
381  { NULL }
382 };
383 
385  .name = "chorus",
386  .description = NULL_IF_CONFIG_SMALL("Add a chorus effect to the audio."),
387  .query_formats = query_formats,
388  .priv_size = sizeof(ChorusContext),
389  .priv_class = &chorus_class,
390  .init = init,
391  .uninit = uninit,
394 };
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:925
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
AVFilter ff_af_chorus
Definition: af_chorus.c:384
static int query_formats(AVFilterContext *ctx)
Definition: af_chorus.c:164
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_chorus.c:252
static int request_frame(AVFilterLink *outlink)
Definition: af_chorus.c:305
static const AVFilterPad chorus_inputs[]
Definition: af_chorus.c:365
#define MOD(a, b)
Definition: af_chorus.c:250
#define A
Definition: af_chorus.c:64
static const AVFilterPad chorus_outputs[]
Definition: af_chorus.c:374
AVFILTER_DEFINE_CLASS(chorus)
static av_cold int init(AVFilterContext *ctx)
Definition: af_chorus.c:106
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_chorus.c:337
static const AVOption chorus_options[]
Definition: af_chorus.c:66
#define OFFSET(x)
Definition: af_chorus.c:63
static int config_output(AVFilterLink *outlink)
Definition: af_chorus.c:193
static void count_items(char *item_str, int *nb_items)
Definition: af_chorus.c:78
static void fill_items(char *item_str, int *nb_items, float *items)
Definition: af_chorus.c:90
#define av_cold
Definition: attributes.h:88
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
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
uint8_t
int32_t
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1099
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition: avfilter.c:411
Main libavfilter public API header.
#define s(width, name)
Definition: cbs_vp9.c:257
#define FFMIN(a, b)
Definition: common.h:105
#define av_clipd
Definition: common.h:173
#define FFMAX(a, b)
Definition: common.h:103
#define NULL
Definition: coverity.c:32
long long int64_t
Definition: coverity.c:34
static AVFrame * frame
int
AVFilterChannelLayouts * ff_all_channel_counts(void)
Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.
Definition: formats.c:436
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:587
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:286
int ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:575
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:568
AVFilterFormats * ff_all_samplerates(void)
Definition: formats.c:421
void ff_generate_wave_table(enum WaveType wave_type, enum AVSampleFormat sample_fmt, void *table, int table_size, double min, double max, double phase)
@ WAVE_SIN
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
#define AVERROR_EOF
End of file.
Definition: error.h:55
#define AVERROR(e)
Definition: error.h:43
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
Definition: frame.c:594
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:203
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:658
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:200
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:194
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Definition: mathematics.c:142
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
Definition: mem.c:245
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition: samplefmt.h:62
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
Definition: samplefmt.c:244
int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and lin...
Definition: samplefmt.c:205
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
Definition: avstring.c:186
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
for(j=16;j >0;--j)
int i
Definition: input.c:407
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
AVOptions.
formats
Definition: signature.h:48
Describe the class of an AVClass context structure.
Definition: log.h:67
A list of supported channel layouts.
Definition: formats.h:86
An instance of a filter.
Definition: avfilter.h:341
A list of supported formats for one end of a filter link.
Definition: formats.h:65
A filter pad used for either input or output.
Definition: internal.h:54
const char * name
Pad name.
Definition: internal.h:60
Filter definition.
Definition: avfilter.h:145
const char * name
Filter name.
Definition: avfilter.h:149
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:384
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:411
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:391
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: frame.h:365
AVOption.
Definition: opt.h:248
Rational number (pair of numerator and denominator).
Definition: rational.h:58
float in_gain
Definition: af_chorus.c:41
int * counter
Definition: af_chorus.c:54
int max_samples
Definition: af_chorus.c:56
int64_t next_pts
Definition: af_chorus.c:60
float * delays
Definition: af_chorus.c:46
float out_gain
Definition: af_chorus.c:41
int ** phase
Definition: af_chorus.c:51
char * depths_str
Definition: af_chorus.c:45
char * delays_str
Definition: af_chorus.c:42
float * decays
Definition: af_chorus.c:47
float * speeds
Definition: af_chorus.c:48
char * speeds_str
Definition: af_chorus.c:44
char * decays_str
Definition: af_chorus.c:43
uint8_t ** chorusbuf
Definition: af_chorus.c:50
int32_t ** lookup_table
Definition: af_chorus.c:53
int num_chorus
Definition: af_chorus.c:55
int * length
Definition: af_chorus.c:52
int modulation
Definition: af_chorus.c:58
float * depths
Definition: af_chorus.c:49
#define av_malloc_array(a, b)
#define av_realloc_f(p, o, n)
#define av_freep(p)
#define av_log(a,...)
#define src
Definition: vp8dsp.c:255
FILE * out
Definition: movenc.c:54
AVFormatContext * ctx
Definition: movenc.c:48
if(ret< 0)
Definition: vf_mcdeint.c:282
static double c[64]