FFmpeg
Loading...
Searching...
No Matches
af_mcompand.c File Reference

audio multiband compand filter More...

#include "libavutil/avstring.h"
#include "libavutil/ffmath.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  CompandSegment
 
struct  CompandT
 
struct  PrevCrossover
 
struct  Crossover
 
struct  CompBand
 
struct  MCompandContext
 

Macros

#define N   4
 
#define OFFSET(x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define S(x)
 
#define S(x)
 
#define L(x)
 
#define CONVOLVE   _ _ _ _
 
#define _
 
#define _
 

Functions

 AVFILTER_DEFINE_CLASS (mcompand)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static void count_items (char *item_str, int *nb_items, char delimiter)
 
static void update_volume (CompBand *cb, double in, int ch)
 
static double get_volume (CompandT *s, double in_lin)
 
static int parse_points (char *points, int nb_points, double radius, CompandT *s, AVFilterContext *ctx)
 
static void square_quadratic (double const *x, double *y)
 
static int crossover_setup (AVFilterLink *outlink, Crossover *p, double frequency)
 
static int config_output (AVFilterLink *outlink)
 
static void crossover (int ch, Crossover *p, double *ibuf, double *obuf_low, double *obuf_high, size_t len)
 
static int mcompand_channel (MCompandContext *c, CompBand *l, double *ibuf, double *obuf, int len, int ch)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption mcompand_options []
 
static const AVFilterPad mcompand_inputs []
 
static const AVFilterPad mcompand_outputs []
 
const FFFilter ff_af_mcompand
 

Detailed Description

audio multiband compand filter

Definition in file af_mcompand.c.

Macro Definition Documentation

◆ N

#define N   4

Definition at line 54 of file af_mcompand.c.

Referenced by ac_denorm_dblp(), ac_denorm_fltp(), biquad(), build_map(), butterworth_bp_filter(), celt_alg_quant(), celt_alg_unquant(), celt_calc_theta(), celt_compute_qn(), celt_cwrsi(), celt_decode_pulses(), celt_deinterleave_hadamard(), celt_encode_pulses(), celt_extract_collapse_mask(), celt_fir5(), celt_icwrsi(), celt_inner_prod(), celt_interleave_hadamard(), celt_normalize_residual(), celt_renormalize_vector(), celt_stereo_is_decouple(), celt_stereo_merge(), celt_stereo_ms_decouple(), chebyshev1_bp_filter(), chebyshev2_bp_filter(), check_loop_filter(), check_loop_filter_intra(), coef_sf2zf(), compute_dense(), compute_gru(), config_input(), convert_coeffs(), crossover(), decode_spectrum_ac(), decode_usac_core_coder(), dual_inner_prod(), epic_decode_component_pred(), epic_decode_pixel_pred(), epic_decode_run_length(), evolve(), evolve(), ff_aac_ac_finish(), ff_aac_ac_get_context(), ff_aac_ac_map_process(), ff_pvq_search_approx_sse2(), ff_pvq_search_approx_sse4(), ff_pvq_search_exact_avx(), filter_channel(), filter_frame(), flux(), fluxlr(), generate_window_func(), get_centere(), get_final(), hybrid4_8_12_cx(), hybrid6_cx(), iir_mem(), init(), lup_decompose(), lup_invert(), main(), predictor(), process_new(), process_old(), ps_denorm_dblp(), ps_denorm_fltp(), qmf_synth(), quant_band_template(), quant_dn(), QUANT_FN(), QUANT_FN(), remove_doubling(), run_channel_fft(), sq_denorm_dblp(), sq_denorm_fltp(), test_hybrid_analysis(), test_lfe_fir_fixed(), test_lfe_fir_float(), unwrap(), win(), and z_scan_block_avail().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 94 of file af_mcompand.c.

◆ A

Definition at line 95 of file af_mcompand.c.

◆ S [1/2]

#define S ( x)
Value:
s->segments[2 * ((x) + 1)]
#define s(width, name)
Definition cbs_vp9.c:198

Referenced by parse_points().

◆ S [2/2]

#define S ( x)
Value:
s->segments[2 * (x)]

◆ L

#define L ( x)
Value:
s->segments[i - (x)]
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63

Referenced by parse_points().

◆ CONVOLVE

#define CONVOLVE   _ _ _ _

Definition at line 467 of file af_mcompand.c.

Referenced by crossover().

◆ _ [1/2]

#define _
Value:
out_low += p->coefs[j] * p->previous[ch][p->pos + j].in \
- p->coefs[2*N+2 + j] * p->previous[ch][p->pos + j].out_low, j++;
#define N
Definition af_mcompand.c:54

◆ _ [2/2]

#define _
Value:
out_high += p->coefs[j+N+1] * p->previous[ch][p->pos + j].in \
- p->coefs[2*N+2 + j] * p->previous[ch][p->pos + j].out_high, j++;

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( mcompand )

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 104 of file af_mcompand.c.

◆ count_items()

static void count_items ( char * item_str,
int * nb_items,
char delimiter )
static

Definition at line 126 of file af_mcompand.c.

Referenced by config_output().

◆ update_volume()

static void update_volume ( CompBand * cb,
double in,
int ch )
static

Definition at line 137 of file af_mcompand.c.

Referenced by mcompand_channel().

◆ get_volume()

static double get_volume ( CompandT * s,
double in_lin )
static

Definition at line 147 of file af_mcompand.c.

Referenced by mcompand_channel().

◆ parse_points()

static int parse_points ( char * points,
int nb_points,
double radius,
CompandT * s,
AVFilterContext * ctx )
static

Definition at line 168 of file af_mcompand.c.

Referenced by config_output().

◆ square_quadratic()

static void square_quadratic ( double const * x,
double * y )
static

Definition at line 270 of file af_mcompand.c.

Referenced by crossover_setup().

◆ crossover_setup()

static int crossover_setup ( AVFilterLink * outlink,
Crossover * p,
double frequency )
static

Definition at line 279 of file af_mcompand.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 313 of file af_mcompand.c.

◆ crossover()

static void crossover ( int ch,
Crossover * p,
double * ibuf,
double * obuf_low,
double * obuf_high,
size_t len )
static

Definition at line 469 of file af_mcompand.c.

Referenced by filter_frame().

◆ mcompand_channel()

static int mcompand_channel ( MCompandContext * c,
CompBand * l,
double * ibuf,
double * obuf,
int len,
int ch )
static

Definition at line 500 of file af_mcompand.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 553 of file af_mcompand.c.

◆ request_frame()

static int request_frame ( AVFilterLink * outlink)
static

Definition at line 609 of file af_mcompand.c.

Variable Documentation

◆ mcompand_options

const AVOption mcompand_options[]
static
Initial value:
= {
{ "args", "set parameters for each band", OFFSET(args), AV_OPT_TYPE_STRING, { .str = "0.005,0.1 6 -47/-40,-34/-34,-17/-33 100 | 0.003,0.05 6 -47/-40,-34/-34,-17/-33 400 | 0.000625,0.0125 6 -47/-40,-34/-34,-15/-33 1600 | 0.0001,0.025 6 -47/-40,-34/-34,-31/-31,-0/-30 6400 | 0,0.025 6 -38/-31,-28/-28,-0/-25 22000" }, 0, 0, A },
{ NULL }
}
#define A(x)
Definition vpx_arith.h:28
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ 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...
Definition opt.h:275

Definition at line 97 of file af_mcompand.c.

◆ mcompand_inputs

const AVFilterPad mcompand_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201

Definition at line 619 of file af_mcompand.c.

◆ mcompand_outputs

const AVFilterPad mcompand_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
}
static int request_frame(AVFilterLink *outlink)
Definition af_aecho.c:272
static int config_output(AVBitStreamFilterLink *outlink)

Definition at line 627 of file af_mcompand.c.

◆ ff_af_mcompand

const FFFilter ff_af_mcompand
Initial value:
= {
.p.name = "mcompand",
.p.description = NULL_IF_CONFIG_SMALL(
"Multiband Compress or expand audio dynamic range."),
.p.priv_class = &mcompand_class,
.priv_size = sizeof(MCompandContext),
}
static const AVFilterPad mcompand_outputs[]
static const AVFilterPad mcompand_inputs[]
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition samplefmt.h:67
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition filters.h:257
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 637 of file af_mcompand.c.