FFmpeg
af_pan.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002 Anders Johansson <ajh@atri.curtin.edu.au>
3  * Copyright (c) 2011 Clément Bœsch <u pkh me>
4  * Copyright (c) 2011 Nicolas George <nicolas.george@normalesup.org>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * Audio panning filter (channels mixing)
26  * Original code written by Anders Johansson for MPlayer,
27  * reimplemented for FFmpeg.
28  */
29 
30 #include <stdio.h>
31 #include "libavutil/avstring.h"
33 #include "libavutil/opt.h"
35 #include "audio.h"
36 #include "avfilter.h"
37 #include "formats.h"
38 #include "internal.h"
39 
40 #define MAX_CHANNELS 64
41 
42 typedef struct PanContext {
43  const AVClass *class;
44  char *args;
47  int64_t need_renorm;
50 
52  /* channel mapping specific */
54  struct SwrContext *swr;
55 } PanContext;
56 
57 static void skip_spaces(char **arg)
58 {
59  int len = 0;
60 
61  sscanf(*arg, " %n", &len);
62  *arg += len;
63 }
64 
65 static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
66 {
67  char buf[8];
68  int len, i, channel_id = 0;
69  int64_t layout, layout0;
70 
72  /* try to parse a channel name, e.g. "FL" */
73  if (sscanf(*arg, "%7[A-Z]%n", buf, &len)) {
74  layout0 = layout = av_get_channel_layout(buf);
75  /* channel_id <- first set bit in layout */
76  for (i = 32; i > 0; i >>= 1) {
77  if (layout >= (int64_t)1 << i) {
78  channel_id += i;
79  layout >>= i;
80  }
81  }
82  /* reject layouts that are not a single channel */
83  if (channel_id >= MAX_CHANNELS || layout0 != (int64_t)1 << channel_id)
84  return AVERROR(EINVAL);
85  *rchannel = channel_id;
86  *rnamed = 1;
87  *arg += len;
88  return 0;
89  }
90  /* try to parse a channel number, e.g. "c2" */
91  if (sscanf(*arg, "c%d%n", &channel_id, &len) &&
92  channel_id >= 0 && channel_id < MAX_CHANNELS) {
93  *rchannel = channel_id;
94  *rnamed = 0;
95  *arg += len;
96  return 0;
97  }
98  return AVERROR(EINVAL);
99 }
100 
102 {
103  PanContext *const pan = ctx->priv;
104  char *arg, *arg0, *tokenizer, *args = av_strdup(pan->args);
105  int out_ch_id, in_ch_id, len, named, ret, sign = 1;
106  int nb_in_channels[2] = { 0, 0 }; // number of unnamed and named input channels
107  int used_out_ch[MAX_CHANNELS] = {0};
108  double gain;
109 
110  if (!pan->args) {
112  "pan filter needs a channel layout and a set "
113  "of channel definitions as parameter\n");
114  return AVERROR(EINVAL);
115  }
116  if (!args)
117  return AVERROR(ENOMEM);
118  arg = av_strtok(args, "|", &tokenizer);
119  if (!arg) {
120  av_log(ctx, AV_LOG_ERROR, "Channel layout not specified\n");
121  ret = AVERROR(EINVAL);
122  goto fail;
123  }
125  &pan->nb_output_channels, arg, ctx);
126  if (ret < 0)
127  goto fail;
128 
129  /* parse channel specifications */
130  while ((arg = arg0 = av_strtok(NULL, "|", &tokenizer))) {
131  int used_in_ch[MAX_CHANNELS] = {0};
132  /* channel name */
133  if (parse_channel_name(&arg, &out_ch_id, &named)) {
135  "Expected out channel name, got \"%.8s\"\n", arg);
136  ret = AVERROR(EINVAL);
137  goto fail;
138  }
139  if (named) {
140  if (!((pan->out_channel_layout >> out_ch_id) & 1)) {
142  "Channel \"%.8s\" does not exist in the chosen layout\n", arg0);
143  ret = AVERROR(EINVAL);
144  goto fail;
145  }
146  /* get the channel number in the output channel layout:
147  * out_channel_layout & ((1 << out_ch_id) - 1) are all the
148  * channels that come before out_ch_id,
149  * so their count is the index of out_ch_id */
150  out_ch_id = av_get_channel_layout_nb_channels(pan->out_channel_layout & (((int64_t)1 << out_ch_id) - 1));
151  }
152  if (out_ch_id < 0 || out_ch_id >= pan->nb_output_channels) {
154  "Invalid out channel name \"%.8s\"\n", arg0);
155  ret = AVERROR(EINVAL);
156  goto fail;
157  }
158  if (used_out_ch[out_ch_id]) {
160  "Can not reference out channel %d twice\n", out_ch_id);
161  ret = AVERROR(EINVAL);
162  goto fail;
163  }
164  used_out_ch[out_ch_id] = 1;
165  skip_spaces(&arg);
166  if (*arg == '=') {
167  arg++;
168  } else if (*arg == '<') {
169  pan->need_renorm |= (int64_t)1 << out_ch_id;
170  arg++;
171  } else {
173  "Syntax error after channel name in \"%.8s\"\n", arg0);
174  ret = AVERROR(EINVAL);
175  goto fail;
176  }
177  /* gains */
178  sign = 1;
179  while (1) {
180  gain = 1;
181  if (sscanf(arg, "%lf%n *%n", &gain, &len, &len))
182  arg += len;
183  if (parse_channel_name(&arg, &in_ch_id, &named)){
185  "Expected in channel name, got \"%.8s\"\n", arg);
186  ret = AVERROR(EINVAL);
187  goto fail;
188  }
189  nb_in_channels[named]++;
190  if (nb_in_channels[!named]) {
192  "Can not mix named and numbered channels\n");
193  ret = AVERROR(EINVAL);
194  goto fail;
195  }
196  if (used_in_ch[in_ch_id]) {
198  "Can not reference in channel %d twice\n", in_ch_id);
199  ret = AVERROR(EINVAL);
200  goto fail;
201  }
202  used_in_ch[in_ch_id] = 1;
203  pan->gain[out_ch_id][in_ch_id] = sign * gain;
204  skip_spaces(&arg);
205  if (!*arg)
206  break;
207  if (*arg == '-') {
208  sign = -1;
209  } else if (*arg != '+') {
210  av_log(ctx, AV_LOG_ERROR, "Syntax error near \"%.8s\"\n", arg);
211  ret = AVERROR(EINVAL);
212  goto fail;
213  } else {
214  sign = 1;
215  }
216  arg++;
217  }
218  }
219  pan->need_renumber = !!nb_in_channels[1];
220 
221  ret = 0;
222 fail:
223  av_free(args);
224  return ret;
225 }
226 
227 static int are_gains_pure(const PanContext *pan)
228 {
229  int i, j;
230 
231  for (i = 0; i < MAX_CHANNELS; i++) {
232  int nb_gain = 0;
233 
234  for (j = 0; j < MAX_CHANNELS; j++) {
235  double gain = pan->gain[i][j];
236 
237  /* channel mapping is effective only if 0% or 100% of a channel is
238  * selected... */
239  if (gain != 0. && gain != 1.)
240  return 0;
241  /* ...and if the output channel is only composed of one input */
242  if (gain && nb_gain++)
243  return 0;
244  }
245  }
246  return 1;
247 }
248 
250 {
251  PanContext *pan = ctx->priv;
252  AVFilterLink *inlink = ctx->inputs[0];
253  AVFilterLink *outlink = ctx->outputs[0];
255  int ret;
256 
257  pan->pure_gains = are_gains_pure(pan);
258  /* libswr supports any sample and packing formats */
260  return ret;
261 
263  return ret;
264 
265  // inlink supports any channel layout
267  if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0)
268  return ret;
269 
270  // outlink supports only requested output channel layout
271  layouts = NULL;
275  return ret;
277 }
278 
280 {
281  AVFilterContext *ctx = link->dst;
282  PanContext *pan = ctx->priv;
283  char buf[1024], *cur;
284  int i, j, k, r;
285  double t;
286 
287  if (pan->need_renumber) {
288  // input channels were given by their name: renumber them
289  for (i = j = 0; i < MAX_CHANNELS; i++) {
290  if ((link->channel_layout >> i) & 1) {
291  for (k = 0; k < pan->nb_output_channels; k++)
292  pan->gain[k][j] = pan->gain[k][i];
293  j++;
294  }
295  }
296  }
297 
298  // sanity check; can't be done in query_formats since the inlink
299  // channel layout is unknown at that time
300  if (link->channels > MAX_CHANNELS ||
303  "af_pan supports a maximum of %d channels. "
304  "Feel free to ask for a higher limit.\n", MAX_CHANNELS);
305  return AVERROR_PATCHWELCOME;
306  }
307 
308  // init libswresample context
309  pan->swr = swr_alloc_set_opts(pan->swr,
312  0, ctx);
313  if (!pan->swr)
314  return AVERROR(ENOMEM);
315  if (!link->channel_layout) {
316  if (av_opt_set_int(pan->swr, "ich", link->channels, 0) < 0)
317  return AVERROR(EINVAL);
318  }
319  if (!pan->out_channel_layout) {
320  if (av_opt_set_int(pan->swr, "och", pan->nb_output_channels, 0) < 0)
321  return AVERROR(EINVAL);
322  }
323 
324  // gains are pure, init the channel mapping
325  if (pan->pure_gains) {
326 
327  // get channel map from the pure gains
328  for (i = 0; i < pan->nb_output_channels; i++) {
329  int ch_id = -1;
330  for (j = 0; j < link->channels; j++) {
331  if (pan->gain[i][j]) {
332  ch_id = j;
333  break;
334  }
335  }
336  pan->channel_map[i] = ch_id;
337  }
338 
339  av_opt_set_int(pan->swr, "icl", pan->out_channel_layout, 0);
340  av_opt_set_int(pan->swr, "uch", pan->nb_output_channels, 0);
342  } else {
343  // renormalize
344  for (i = 0; i < pan->nb_output_channels; i++) {
345  if (!((pan->need_renorm >> i) & 1))
346  continue;
347  t = 0;
348  for (j = 0; j < link->channels; j++)
349  t += fabs(pan->gain[i][j]);
350  if (t > -1E-5 && t < 1E-5) {
351  // t is almost 0 but not exactly, this is probably a mistake
352  if (t)
354  "Degenerate coefficients while renormalizing\n");
355  continue;
356  }
357  for (j = 0; j < link->channels; j++)
358  pan->gain[i][j] /= t;
359  }
360  av_opt_set_int(pan->swr, "icl", link->channel_layout, 0);
361  av_opt_set_int(pan->swr, "ocl", pan->out_channel_layout, 0);
362  swr_set_matrix(pan->swr, pan->gain[0], pan->gain[1] - pan->gain[0]);
363  }
364 
365  r = swr_init(pan->swr);
366  if (r < 0)
367  return r;
368 
369  // summary
370  for (i = 0; i < pan->nb_output_channels; i++) {
371  cur = buf;
372  for (j = 0; j < link->channels; j++) {
373  r = snprintf(cur, buf + sizeof(buf) - cur, "%s%.3g i%d",
374  j ? " + " : "", pan->gain[i][j], j);
375  cur += FFMIN(buf + sizeof(buf) - cur, r);
376  }
377  av_log(ctx, AV_LOG_VERBOSE, "o%d = %s\n", i, buf);
378  }
379  // add channel mapping summary if possible
380  if (pan->pure_gains) {
381  av_log(ctx, AV_LOG_INFO, "Pure channel mapping detected:");
382  for (i = 0; i < pan->nb_output_channels; i++)
383  if (pan->channel_map[i] < 0)
384  av_log(ctx, AV_LOG_INFO, " M");
385  else
386  av_log(ctx, AV_LOG_INFO, " %d", pan->channel_map[i]);
387  av_log(ctx, AV_LOG_INFO, "\n");
388  return 0;
389  }
390  return 0;
391 }
392 
393 static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
394 {
395  int ret;
396  int n = insamples->nb_samples;
397  AVFilterLink *const outlink = inlink->dst->outputs[0];
398  AVFrame *outsamples = ff_get_audio_buffer(outlink, n);
399  PanContext *pan = inlink->dst->priv;
400 
401  if (!outsamples) {
402  av_frame_free(&insamples);
403  return AVERROR(ENOMEM);
404  }
405  swr_convert(pan->swr, outsamples->extended_data, n,
406  (void *)insamples->extended_data, n);
407  av_frame_copy_props(outsamples, insamples);
408  outsamples->channel_layout = outlink->channel_layout;
409  outsamples->channels = outlink->channels;
410 
411  ret = ff_filter_frame(outlink, outsamples);
412  av_frame_free(&insamples);
413  return ret;
414 }
415 
417 {
418  PanContext *pan = ctx->priv;
419  swr_free(&pan->swr);
420 }
421 
422 #define OFFSET(x) offsetof(PanContext, x)
423 
424 static const AVOption pan_options[] = {
426  { NULL }
427 };
428 
430 
431 static const AVFilterPad pan_inputs[] = {
432  {
433  .name = "default",
434  .type = AVMEDIA_TYPE_AUDIO,
435  .config_props = config_props,
436  .filter_frame = filter_frame,
437  },
438 };
439 
440 static const AVFilterPad pan_outputs[] = {
441  {
442  .name = "default",
443  .type = AVMEDIA_TYPE_AUDIO,
444  },
445 };
446 
448  .name = "pan",
449  .description = NULL_IF_CONFIG_SMALL("Remix channels with coefficients (panning)."),
450  .priv_size = sizeof(PanContext),
451  .priv_class = &pan_class,
452  .init = init,
453  .uninit = uninit,
457 };
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:88
AVFilterChannelLayouts
A list of supported channel layouts.
Definition: formats.h:85
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
r
const char * r
Definition: vf_curves.c:116
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
AVFilterFormatsConfig::channel_layouts
AVFilterChannelLayouts * channel_layouts
Lists of supported channel layouts, only for audio.
Definition: avfilter.h:500
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1018
ff_channel_layouts_ref
int ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
Add *ref as a new reference to f.
Definition: formats.c:550
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
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:112
ff_all_channel_counts
AVFilterChannelLayouts * ff_all_channel_counts(void)
Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.
Definition: formats.c:525
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:303
AVOption
AVOption.
Definition: opt.h:247
config_props
static int config_props(AVFilterLink *link)
Definition: af_pan.c:279
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:168
pan_outputs
static const AVFilterPad pan_outputs[]
Definition: af_pan.c:440
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
ff_set_common_all_samplerates
int ff_set_common_all_samplerates(AVFilterContext *ctx)
Equivalent to ff_set_common_samplerates(ctx, ff_all_samplerates())
Definition: formats.c:689
swr_set_channel_mapping
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
Set a customized input channel mapping.
Definition: swresample.c:52
av_get_channel_layout
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
Definition: channel_layout.c:145
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:153
AV_OPT_FLAG_FILTERING_PARAM
#define AV_OPT_FLAG_FILTERING_PARAM
a generic parameter which can be set by the user for filtering
Definition: opt.h:293
swr_set_matrix
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
Set a customized remix matrix.
Definition: rematrix.c:64
ff_af_pan
const AVFilter ff_af_pan
Definition: af_pan.c:447
formats.h
fail
#define fail()
Definition: checkasm.h:127
ff_all_formats
AVFilterFormats * ff_all_formats(enum AVMediaType type)
Return a list of all formats supported by FFmpeg for the given media type.
Definition: formats.c:439
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:50
PanContext::pure_gains
int pure_gains
Definition: af_pan.c:51
PanContext::swr
struct SwrContext * swr
Definition: af_pan.c:54
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
ff_set_common_formats
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:699
PanContext::out_channel_layout
int64_t out_channel_layout
Definition: af_pan.c:45
swr_init
av_cold int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
Definition: swresample.c:152
ff_add_channel_layout
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
Definition: formats.c:426
PanContext::args
char * args
Definition: af_pan.c:44
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
Definition: af_pan.c:393
AVFrame::channels
int channels
number of audio channels, only used for audio.
Definition: frame.h:592
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_pan.c:249
av_strtok
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
skip_spaces
static void skip_spaces(char **arg)
Definition: af_pan.c:57
swr_convert
int attribute_align_arg swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_count, const uint8_t *in_arg[SWR_CH_MAX], int in_count)
Definition: swresample.c:714
ctx
AVFormatContext * ctx
Definition: movenc.c:48
SwrContext
The libswresample context.
Definition: swresample_internal.h:95
swr_alloc_set_opts
struct SwrContext * swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)
Allocate SwrContext if needed and set/reset common parameters.
Definition: swresample.c:59
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
E
#define E
Definition: avdct.c:32
link
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 link
Definition: filter_design.txt:23
AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:279
arg
const char * arg
Definition: jacosubdec.c:67
PanContext::need_renorm
int64_t need_renorm
Definition: af_pan.c:47
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
fabs
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
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:537
pan_inputs
static const AVFilterPad pan_inputs[]
Definition: af_pan.c:431
are_gains_pure
static int are_gains_pure(const PanContext *pan)
Definition: af_pan.c:227
pan_options
static const AVOption pan_options[]
Definition: af_pan.c:424
PanContext::nb_output_channels
int nb_output_channels
Definition: af_pan.c:49
swresample.h
av_get_channel_layout_nb_channels
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
Definition: channel_layout.c:226
av_opt_set_int
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
Definition: opt.c:589
OFFSET
#define OFFSET(x)
Definition: af_pan.c:422
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:117
ff_parse_channel_layout
int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg, void *log_ctx)
Parse a channel layout or a corresponding integer representation.
Definition: formats.c:789
AVFrame::sample_rate
int sample_rate
Sample rate of the audio data.
Definition: frame.h:458
PanContext::need_renumber
int need_renumber
Definition: af_pan.c:48
swr_free
av_cold void swr_free(SwrContext **ss)
Free the given SwrContext and set the pointer to NULL.
Definition: swresample.c:137
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:376
AVFrame::channel_layout
uint64_t channel_layout
Channel layout of the audio data.
Definition: frame.h:463
PanContext::channel_map
int channel_map[MAX_CHANNELS]
Definition: af_pan.c:53
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:191
internal.h
layout
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
Definition: filter_design.txt:18
AVFrame::nb_samples
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:369
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
AVFrame::extended_data
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: frame.h:350
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
len
int len
Definition: vorbis_enc_data.h:426
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:56
AVFilter
Filter definition.
Definition: avfilter.h:149
ret
ret
Definition: filter_design.txt:187
FF_COUNT2LAYOUT
#define FF_COUNT2LAYOUT(c)
Encode a channel count as a channel layout.
Definition: formats.h:102
channel_layout.h
avfilter.h
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_pan.c:101
AVFilterContext
An instance of a filter.
Definition: avfilter.h:386
av_strdup
char * av_strdup(const char *s)
Duplicate a string.
Definition: mem.c:279
MAX_CHANNELS
#define MAX_CHANNELS
Definition: af_pan.c:40
audio.h
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
PanContext
Definition: af_pan.c:42
parse_channel_name
static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
Definition: af_pan.c:65
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
PanContext::gain
double gain[MAX_CHANNELS][MAX_CHANNELS]
Definition: af_pan.c:46
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(pan)
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_pan.c:416
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
avstring.h
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
snprintf
#define snprintf
Definition: snprintf.h:34