32#define RDFT_BITS_MIN 4
33#define RDFT_BITS_MAX 16
57#define NB_GAIN_ENTRY_MAX 4096
127#define OFFSET(x) offsetof(FIREqualizerContext, x)
128#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
129#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
173 s->analysis_rdft =
s->analysis_irdft =
s->rdft =
s->irdft =
NULL;
175 s->cepstrum_rdft =
NULL;
176 s->cepstrum_irdft =
NULL;
203 if (nsamples <= s->nsamples_max) {
204 float *buf = conv_buf + idx->buf_idx *
s->rdft_len;
205 float *obuf = conv_buf + !idx->buf_idx *
s->rdft_len + idx->overlap_idx;
206 float *tbuf =
s->tx_buf;
207 int center =
s->fir_len/2;
210 memset(buf, 0, center *
sizeof(*
data));
211 memcpy(buf + center,
data, nsamples *
sizeof(*
data));
212 memset(buf + center + nsamples, 0, (
s->rdft_len - nsamples - center) *
sizeof(*
data));
213 s->rdft_fn(
s->rdft, tbuf, buf,
sizeof(
float));
215 for (k = 0; k <=
s->rdft_len/2; k++) {
216 tbuf[2*k] *= kernel_buf[k];
217 tbuf[2*k+1] *= kernel_buf[k];
221 for (k = 0; k <
s->rdft_len - idx->overlap_idx; k++)
223 memcpy(
data, buf, nsamples *
sizeof(*
data));
224 idx->buf_idx = !idx->buf_idx;
225 idx->overlap_idx = nsamples;
227 while (nsamples >
s->nsamples_max * 2) {
229 data +=
s->nsamples_max;
230 nsamples -=
s->nsamples_max;
239 float *restrict
data,
int nsamples)
241 if (nsamples <= s->nsamples_max) {
242 float *buf = conv_buf + idx->buf_idx *
s->rdft_len;
243 float *obuf = conv_buf + !idx->buf_idx *
s->rdft_len + idx->overlap_idx;
244 float *tbuf =
s->tx_buf;
247 memcpy(buf,
data, nsamples *
sizeof(*
data));
248 memset(buf + nsamples, 0, (
s->rdft_len - nsamples) *
sizeof(*
data));
249 s->rdft_fn(
s->rdft, tbuf, buf,
sizeof(
float));
251 for (k = 0; k <
s->rdft_len + 2; k += 2) {
253 re = tbuf[k] * kernel_buf[k] - tbuf[k+1] * kernel_buf[k+1];
254 im = tbuf[k] * kernel_buf[k+1] + tbuf[k+1] * kernel_buf[k];
260 for (k = 0; k <
s->rdft_len - idx->overlap_idx; k++)
262 memcpy(
data, buf, nsamples *
sizeof(*
data));
263 idx->buf_idx = !idx->buf_idx;
264 idx->overlap_idx = nsamples;
266 while (nsamples >
s->nsamples_max * 2) {
268 data +=
s->nsamples_max;
269 nsamples -=
s->nsamples_max;
277 OverlapIndex *restrict idx,
float *restrict data0,
float *restrict data1,
int nsamples)
279 if (nsamples <= s->nsamples_max) {
281 AVComplexFloat *obuf = conv_buf + !idx->buf_idx *
s->rdft_len + idx->overlap_idx;
283 int center =
s->fir_len/2;
287 memset(buf, 0, center *
sizeof(*buf));
288 for (k = 0; k < nsamples; k++) {
289 buf[center+k].
re = data0[k];
290 buf[center+k].
im = data1[k];
292 memset(buf + center + nsamples, 0, (
s->rdft_len - nsamples - center) *
sizeof(*buf));
298 tbuf[0].
re = 0.5f * kernel_buf[0] * tbuf[0].
im;
299 tbuf[0].
im = 0.5f * kernel_buf[0] *
tmp;
300 for (k = 1; k <
s->rdft_len/2; k++) {
301 int m =
s->rdft_len - k;
303 tbuf[k].
re = 0.5f * kernel_buf[k] * tbuf[k].
im;
304 tbuf[k].
im = 0.5f * kernel_buf[k] *
tmp;
306 tbuf[m].
re = 0.5f * kernel_buf[k] * tbuf[m].
im;
307 tbuf[m].
im = 0.5f * kernel_buf[k] *
tmp;
310 tbuf[k].
re = 0.5f * kernel_buf[k] * tbuf[k].
im;
311 tbuf[k].
im = 0.5f * kernel_buf[k] *
tmp;
315 for (k = 0; k <
s->rdft_len - idx->overlap_idx; k++) {
316 buf[k].
re += obuf[k].
re;
317 buf[k].
im += obuf[k].
im;
321 for (k = 0; k < nsamples; k++) {
322 data0[k] = buf[k].
im;
323 data1[k] = buf[k].
re;
325 idx->buf_idx = !idx->buf_idx;
326 idx->overlap_idx = nsamples;
328 while (nsamples >
s->nsamples_max * 2) {
330 data0 +=
s->nsamples_max;
331 data1 +=
s->nsamples_max;
332 nsamples -=
s->nsamples_max;
335 fast_convolute2(
s, kernel_buf, conv_buf, idx, data0 + nsamples/2, data1 + nsamples/2, nsamples - nsamples/2);
342 int rate =
ctx->inputs[0]->sample_rate;
346 int center =
s->fir_len / 2;
347 double delay =
s->zero_phase ? 0.0 : (
double) center / rate;
351 s->analysis_buf[0] *=
s->rdft_len/2;
352 for (x = 1; x <= center; x++) {
353 s->analysis_buf[x] *=
s->rdft_len/2;
354 s->analysis_buf[
s->analysis_rdft_len - x] *=
s->rdft_len/2;
357 for (x = 0; x <
s->fir_len; x++)
358 s->analysis_buf[x] *=
s->rdft_len/2;
364 fprintf(fp,
"# time[%d] (time amplitude)\n", ch);
367 for (x = center; x > 0; x--)
368 fprintf(fp,
"%15.10f %15.10f\n", delay - (
double) x / rate, (
double)
s->analysis_buf[
s->analysis_rdft_len - x]);
370 for (x = 0; x <= center; x++)
371 fprintf(fp,
"%15.10f %15.10f\n", delay + (
double)x / rate , (
double)
s->analysis_buf[x]);
373 for (x = 0; x <
s->fir_len; x++)
374 fprintf(fp,
"%15.10f %15.10f\n", (
double)x / rate, (
double)
s->analysis_buf[x]);
377 s->analysis_rdft_fn(
s->analysis_rdft,
s->analysis_tbuf,
s->analysis_buf,
sizeof(
float));
379 fprintf(fp,
"\n\n# freq[%d] (frequency desired_gain actual_gain)\n", ch);
381 for (x = 0; x <=
s->analysis_rdft_len/2; x++) {
383 vx = (
double)x * rate /
s->analysis_rdft_len;
387 yb =
s->min_phase ? hypotf(
s->analysis_tbuf[
i],
s->analysis_tbuf[
i+1]) :
s->analysis_tbuf[
i];
391 ya = 20.0 * log10(
fabs(ya));
392 yb = 20.0 * log10(
fabs(yb));
394 fprintf(fp,
"%17.10f %17.10f %17.10f\n", vx, ya, yb);
405 s->gain_entry_err =
AVERROR(EINVAL);
411 s->gain_entry_err =
AVERROR(EINVAL);
415 if (
s->nb_gain_entry > 0 && freq <= s->gain_entry_tbl[
s->nb_gain_entry - 1].freq) {
417 s->gain_entry_err =
AVERROR(EINVAL);
421 s->gain_entry_tbl[
s->nb_gain_entry].freq = freq;
422 s->gain_entry_tbl[
s->nb_gain_entry].gain = gain;
429 const double *freq =
key;
432 if (*freq <
entry[0].freq)
434 if (*freq >
entry[1].freq)
449 if (!
s->nb_gain_entry)
452 if (freq <= s->gain_entry_tbl[0].freq)
453 return s->gain_entry_tbl[0].gain;
455 if (freq >=
s->gain_entry_tbl[
s->nb_gain_entry-1].freq)
456 return s->gain_entry_tbl[
s->nb_gain_entry-1].gain;
458 res = bsearch(&freq, &
s->gain_entry_tbl,
s->nb_gain_entry - 1,
sizeof(*res),
gain_entry_compare);
462 d0 = freq - res[0].
freq;
463 d1 = res[1].
freq - freq;
466 return (d0 * res[1].gain + d1 * res[0].gain) / d;
481 double m0, m1, m2, msum, unit;
483 if (!
s->nb_gain_entry)
486 if (freq <= s->gain_entry_tbl[0].freq)
487 return s->gain_entry_tbl[0].gain;
489 if (freq >=
s->gain_entry_tbl[
s->nb_gain_entry-1].freq)
490 return s->gain_entry_tbl[
s->nb_gain_entry-1].gain;
492 res = bsearch(&freq, &
s->gain_entry_tbl,
s->nb_gain_entry - 1,
sizeof(*res),
gain_entry_compare);
496 m0 = res !=
s->gain_entry_tbl ?
497 unit * (res[0].
gain - res[-1].
gain) / (res[0].freq - res[-1].freq) : 0;
499 m2 = res !=
s->gain_entry_tbl +
s->nb_gain_entry - 2 ?
500 unit * (res[2].
gain - res[1].
gain) / (res[2].freq - res[1].freq) : 0;
503 m0 = msum > 0 ? (
fabs(m0) * m1 +
fabs(m1) * m0) / msum : 0;
505 m1 = msum > 0 ? (
fabs(m1) * m2 +
fabs(m2) * m1) / msum : 0;
509 b = 3 * res[1].
gain - m1 - 2 *
c - 3 * d;
512 x = (freq - res[0].
freq) / unit;
516 return a * x3 +
b * x2 +
c * x + d;
541 int k, cepstrum_len =
s->cepstrum_len, rdft_len =
s->rdft_len;
542 double norm = 2.0 / cepstrum_len;
543 double minval = 1e-7 / rdft_len;
545 memset(
s->cepstrum_buf, 0, cepstrum_len *
sizeof(*
s->cepstrum_buf));
546 memset(
s->cepstrum_tbuf, 0, (cepstrum_len + 2) *
sizeof(*
s->cepstrum_tbuf));
547 memcpy(
s->cepstrum_buf, rdft_buf, rdft_len/2 *
sizeof(*rdft_buf));
548 memcpy(
s->cepstrum_buf + cepstrum_len - rdft_len/2, rdft_buf + rdft_len/2, rdft_len/2 *
sizeof(*rdft_buf));
550 s->cepstrum_rdft_fn(
s->cepstrum_rdft,
s->cepstrum_tbuf,
s->cepstrum_buf,
sizeof(
float));
552 for (k = 0; k < cepstrum_len + 2; k += 2) {
553 s->cepstrum_tbuf[k] = log(
FFMAX(
s->cepstrum_tbuf[k], minval));
554 s->cepstrum_tbuf[k+1] = 0;
557 s->cepstrum_irdft_fn(
s->cepstrum_irdft,
s->cepstrum_buf,
s->cepstrum_tbuf,
sizeof(
AVComplexFloat));
559 memset(
s->cepstrum_buf + cepstrum_len/2 + 1, 0, (cepstrum_len/2 - 1) *
sizeof(*
s->cepstrum_buf));
560 for (k = 1; k <= cepstrum_len/2; k++)
561 s->cepstrum_buf[k] *= 2;
563 s->cepstrum_rdft_fn(
s->cepstrum_rdft,
s->cepstrum_tbuf,
s->cepstrum_buf,
sizeof(
float));
565 for (k = 0; k < cepstrum_len + 2; k += 2) {
566 double mag =
exp(
s->cepstrum_tbuf[k] * norm) * norm;
567 double ph =
s->cepstrum_tbuf[k+1] * norm;
568 s->cepstrum_tbuf[k] = mag * cos(
ph);
569 s->cepstrum_tbuf[k+1] = mag * sin(
ph);
572 s->cepstrum_irdft_fn(
s->cepstrum_irdft,
s->cepstrum_buf,
s->cepstrum_tbuf,
sizeof(
AVComplexFloat));
573 memset(rdft_buf, 0,
s->rdft_len *
sizeof(*rdft_buf));
574 memcpy(rdft_buf,
s->cepstrum_buf,
s->fir_len *
sizeof(*rdft_buf));
577 memset(
s->analysis_buf, 0, (
s->analysis_rdft_len + 2) *
sizeof(*
s->analysis_buf));
578 memcpy(
s->analysis_buf,
s->cepstrum_buf,
s->fir_len *
sizeof(*
s->analysis_buf));
586 const char *gain_entry_func_names[] = {
"entry",
NULL };
587 const char *gain_func_names[] = {
"gain_interpolate",
"cubic_interpolate",
NULL };
592 int ret, k, center, ch;
595 FILE *dump_fp =
NULL;
597 s->nb_gain_entry = 0;
598 s->gain_entry_err = 0;
602 gain_entry_func_names, gain_entry_funcs,
ctx, 0,
ctx);
605 if (
s->gain_entry_err < 0)
606 return s->gain_entry_err;
616 if (
s->dumpfile && (!
s->dump_buf || !
s->analysis_rdft || !(dump_fp =
avpriv_fopen_utf8(
s->dumpfile,
"w"))))
624 float *rdft_buf =
s->kernel_tmp_buf + ch * (
s->rdft_len * 2);
625 float *rdft_tbuf =
s->kernel_tmp_tbuf;
630 for (k = 0; k <=
s->analysis_rdft_len/2; k++) {
635 s->analysis_tbuf[2*k] = ylog ? pow(10.0, 0.05 * result) :
s->min_phase ?
fabs(result) : result;
636 s->analysis_tbuf[2*k+1] = 0.0;
640 memcpy(
s->dump_buf,
s->analysis_tbuf, (
s->analysis_rdft_len + 2) *
sizeof(*
s->analysis_tbuf));
642 s->analysis_irdft_fn(
s->analysis_irdft,
s->analysis_buf,
s->analysis_tbuf,
sizeof(
AVComplexFloat));
643 center =
s->fir_len / 2;
645 for (k = 0; k <= center; k++) {
646 double u = k * (
M_PI/center);
653 win = 0.5 + 0.5 * cos(
u);
656 win = 0.53836 + 0.46164 * cos(
u);
659 win = 0.42 + 0.5 * cos(
u) + 0.08 * cos(2*
u);
662 win = 0.40897 + 0.5 * cos(
u) + 0.09103 * cos(2*
u);
665 win = 0.4243801 + 0.4973406 * cos(
u) + 0.0782793 * cos(2*
u);
668 win = 0.355768 + 0.487396 * cos(
u) + 0.144232 * cos(2*
u) + 0.012604 * cos(3*
u);
671 win = 0.3635819 + 0.4891775 * cos(
u) + 0.1365995 * cos(2*
u) + 0.0106411 * cos(3*
u);
674 win = 0.35875 + 0.48829 * cos(
u) + 0.14128 * cos(2*
u) + 0.01168 * cos(3*
u);
677 win = (
u <= 0.5 *
M_PI) ? 1.0 : (0.5 + 0.5 * cos(2*
u -
M_PI));
682 s->analysis_buf[k] *= (2.0/
s->analysis_rdft_len) * (2.0/
s->rdft_len) *
win;
684 s->analysis_buf[
s->analysis_rdft_len - k] =
s->analysis_buf[k];
687 memset(
s->analysis_buf + center + 1, 0, (
s->analysis_rdft_len -
s->fir_len) *
sizeof(*
s->analysis_buf));
688 memcpy(rdft_tbuf,
s->analysis_buf,
s->rdft_len/2 *
sizeof(*
s->analysis_buf));
689 memcpy(rdft_tbuf +
s->rdft_len/2,
s->analysis_buf +
s->analysis_rdft_len -
s->rdft_len/2,
s->rdft_len/2 *
sizeof(*
s->analysis_buf));
692 s->rdft_fn(
s->rdft, rdft_buf, rdft_tbuf,
sizeof(
float));
694 for (k = 0; k <
s->rdft_len + 2; k++) {
695 if (
isnan(rdft_buf[k]) ||
isinf(rdft_buf[k])) {
705 for (k = 0; k <=
s->rdft_len/2; k++)
706 rdft_buf[k] = rdft_buf[2*k];
716 memcpy(
s->kernel_buf,
s->kernel_tmp_buf, (
s->multi ? inlink->
ch_layout.
nb_channels : 1) * (
s->rdft_len * 2) *
sizeof(*
s->kernel_buf));
723#define SELECT_GAIN(s) (s->gain_cmd ? s->gain_cmd : s->gain)
724#define SELECT_GAIN_ENTRY(s) (s->gain_entry_cmd ? s->gain_entry_cmd : s->gain_entry)
731 float iscale,
scale = 1.f;
737 s->frame_nsamples_max = 0;
740 s->remaining =
s->fir_len - 1;
743 s->rdft_len = 1 << rdft_bits;
744 s->nsamples_max =
s->rdft_len -
s->fir_len + 1;
745 if (
s->nsamples_max * 2 >=
s->fir_len)
765 int cepstrum_bits = rdft_bits + 2;
782 s->cepstrum_len = 1 << cepstrum_bits;
784 if (!
s->cepstrum_buf)
787 if (!
s->cepstrum_tbuf)
792 s->analysis_rdft_len = 1 << rdft_bits;
793 if (inlink->
sample_rate <=
s->accuracy *
s->analysis_rdft_len)
815 s->analysis_buf =
av_malloc_array((
s->analysis_rdft_len + 2),
sizeof(*
s->analysis_buf));
816 s->analysis_tbuf =
av_malloc_array(
s->analysis_rdft_len + 2,
sizeof(*
s->analysis_tbuf));
823 if (!
s->analysis_buf || !
s->analysis_tbuf || !
s->kernel_tmp_buf || !
s->kernel_buf || !
s->conv_buf || !
s->conv_idx || !
s->kernel_tmp_tbuf || !
s->tx_buf)
826 av_log(
ctx,
AV_LOG_DEBUG,
"sample_rate = %d, channels = %d, analysis_rdft_len = %d, rdft_len = %d, fir_len = %d, nsamples_max = %d.\n",
844 s->conv_idx + ch, (
float *)
frame->extended_data[ch],
845 (
float *)
frame->extended_data[ch+1],
frame->nb_samples);
850 s->conv_buf + 2 * ch *
s->rdft_len,
s->conv_idx + ch,
851 (
float *)
frame->extended_data[ch],
frame->nb_samples);
856 s->conv_buf + 2 * ch *
s->rdft_len,
s->conv_idx + ch,
857 (
float *)
frame->extended_data[ch],
frame->nb_samples);
864 if (
s->zero_phase && !
s->min_phase)
867 s->frame_nsamples_max =
FFMAX(
s->frame_nsamples_max,
frame->nb_samples);
878 if (ret ==
AVERROR_EOF &&
s->remaining > 0 &&
s->frame_nsamples_max > 0) {
886 s->remaining -=
frame->nb_samples;
894 char *res,
int res_len,
int flags)
899 if (!strcmp(cmd,
"gain")) {
914 s->gain_cmd = gain_cmd;
918 }
else if (!strcmp(cmd,
"gain_entry")) {
919 char *gain_entry_cmd;
933 s->gain_entry_cmd = gain_entry_cmd;
961 .p.name =
"firequalizer",
963 .p.priv_class = &firequalizer_class,
static int config_input(AVFilterLink *inlink)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static int request_frame(AVFilterLink *outlink)
static void fast_convolute_nonlinear(FIREqualizerContext *restrict s, const float *restrict kernel_buf, float *restrict conv_buf, OverlapIndex *restrict idx, float *restrict data, int nsamples)
static const AVOption firequalizer_options[]
static double cubic_interpolate_func(void *p, double freq)
static void generate_min_phase_kernel(FIREqualizerContext *s, float *rdft_buf)
#define SELECT_GAIN_ENTRY(s)
static double entry_func(void *p, double freq, double gain)
static const AVFilterPad firequalizer_outputs[]
static int config_input(AVFilterLink *inlink)
static void fast_convolute(FIREqualizerContext *restrict s, const float *restrict kernel_buf, float *restrict conv_buf, OverlapIndex *restrict idx, float *restrict data, int nsamples)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static int gain_entry_compare(const void *key, const void *memb)
static int request_frame(AVFilterLink *outlink)
static void common_uninit(FIREqualizerContext *s)
static void dump_fir(AVFilterContext *ctx, FILE *fp, int ch)
#define NB_GAIN_ENTRY_MAX
static int generate_kernel(AVFilterContext *ctx, const char *gain, const char *gain_entry)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static av_cold void uninit(AVFilterContext *ctx)
static void fast_convolute2(FIREqualizerContext *restrict s, const float *restrict kernel_buf, AVComplexFloat *restrict conv_buf, OverlapIndex *restrict idx, float *restrict data0, float *restrict data1, int nsamples)
const FFFilter ff_af_firequalizer
static double gain_interpolate_func(void *p, double freq)
static const AVFilterPad firequalizer_inputs[]
static float win(SuperEqualizerContext *s, float n, int N)
static AVFormatContext * ctx
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Main libavfilter public API header.
static const uint8_t vars[2][12]
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int FUNC ph(CodedBitstreamContext *ctx, RWContext *rw, H266RawPH *current)
Public libavutil channel layout APIs header.
static __device__ float fabs(float a)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
simple arithmetic expression evaluator
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
@ AV_CHANNEL_ORDER_NATIVE
The native channel order, i.e.
#define AVERROR_EOF
End of file.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static AVRational av_make_q(int num, int den)
Create an AVRational.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AV_SAMPLE_FMT_FLTP
float, planar
int av_samples_set_silence(uint8_t *const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define fixed(width, name, value)
#define u(width, name, range_min, range_max)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
static FilterLink * ff_filter_link(AVFilterLink *link)
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
#define AVFILTER_DEFINE_CLASS(fname)
FILE * avpriv_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static const char *const var_names[]
enum AVChannelOrder order
Channel order used in this layout.
uint64_t mask
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC ...
union AVChannelLayout::@162063043056170047076125117143030261346263330336 u
Details about which channels are present in this layout.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
AVTXContext * cepstrum_rdft
AVTXContext * analysis_irdft
av_tx_fn analysis_irdft_fn
av_tx_fn cepstrum_irdft_fn
av_tx_fn analysis_rdft_fn
GainEntry gain_entry_tbl[NB_GAIN_ENTRY_MAX]
av_tx_fn cepstrum_rdft_fn
AVTXContext * analysis_rdft
AVTXContext * cepstrum_irdft
Link properties exposed to filter code, but not external callers.
int min_samples
Minimum number of samples to filter at once.
int max_samples
Maximum number of samples to filter at once.
#define av_malloc_array(a, b)
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.
av_cold int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
Initialize a transform context with the given configuration (i)MDCTs with an odd length are currently...
@ AV_TX_FLOAT_FFT
Standard complex to complex FFT with sample data type of AVComplexFloat, AVComplexDouble or AVComplex...
@ AV_TX_FLOAT_RDFT
Real to complex and complex to real DFTs.
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.