libswresample/resample.c File Reference

audio resampling More...

Include dependency graph for libswresample/resample.c:

Go to the source code of this file.

Data Structures

struct  ResampleContext
 

Macros

#define TEMPLATE_RESAMPLE_S16
 
#define TEMPLATE_RESAMPLE_S32
 
#define TEMPLATE_RESAMPLE_FLT
 
#define TEMPLATE_RESAMPLE_DBL
 

Typedefs

typedef struct ResampleContext ResampleContext
 

Functions

static double bessel (double x)
 0th order modified bessel function of the first kind. More...
 
static int build_filter (ResampleContext *c, void *filter, double factor, int tap_count, int alloc, int phase_count, int scale, int filter_type, int kaiser_beta)
 builds a polyphase filterbank. More...
 
static ResampleContextresample_init (ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, double precision, int cheby)
 
static void resample_free (ResampleContext **c)
 
static int set_compensation (ResampleContext *c, int sample_delta, int compensation_distance)
 
static int multiple_resample (ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed)
 
static int64_t get_delay (struct SwrContext *s, int64_t base)
 
static int resample_flush (struct SwrContext *s)
 

Variables

struct Resampler const swri_resampler
 

Detailed Description

audio resampling

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file libswresample/resample.c.

Macro Definition Documentation

#define TEMPLATE_RESAMPLE_DBL

Definition at line 292 of file libswresample/resample.c.

#define TEMPLATE_RESAMPLE_FLT

Definition at line 288 of file libswresample/resample.c.

#define TEMPLATE_RESAMPLE_S16

Definition at line 280 of file libswresample/resample.c.

#define TEMPLATE_RESAMPLE_S32

Definition at line 284 of file libswresample/resample.c.

Typedef Documentation

Function Documentation

static double bessel ( double  x)
static

0th order modified bessel function of the first kind.

Definition at line 58 of file libswresample/resample.c.

Referenced by build_filter().

static int build_filter ( ResampleContext c,
void filter,
double  factor,
int  tap_count,
int  alloc,
int  phase_count,
int  scale,
int  filter_type,
int  kaiser_beta 
)
static

builds a polyphase filterbank.

Parameters
factorresampling factor
scalewanted sum of coefficients for each filter
filter_typefilter type
kaiser_betakaiser window beta
Returns
0 on success, negative on error

Definition at line 94 of file libswresample/resample.c.

Referenced by resample_init().

static int64_t get_delay ( struct SwrContext s,
int64_t  base 
)
static

Definition at line 339 of file libswresample/resample.c.

static int multiple_resample ( ResampleContext c,
AudioData dst,
int  dst_size,
AudioData src,
int  src_size,
int *  consumed 
)
static

Definition at line 313 of file libswresample/resample.c.

static int resample_flush ( struct SwrContext s)
static

Definition at line 349 of file libswresample/resample.c.

static void resample_free ( ResampleContext **  c)
static

Definition at line 264 of file libswresample/resample.c.

static ResampleContext* resample_init ( ResampleContext c,
int  out_rate,
int  in_rate,
int  filter_size,
int  phase_shift,
int  linear,
double  cutoff0,
enum AVSampleFormat  format,
enum SwrFilterType  filter_type,
int  kaiser_beta,
double  precision,
int  cheby 
)
static

Definition at line 198 of file libswresample/resample.c.

static int set_compensation ( ResampleContext c,
int  sample_delta,
int  compensation_distance 
)
static

Definition at line 271 of file libswresample/resample.c.

Variable Documentation

struct Resampler const swri_resampler
Initial value:
={
}
static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed)
static void resample_free(ResampleContext **c)
static int set_compensation(ResampleContext *c, int sample_delta, int compensation_distance)
static int resample_flush(struct SwrContext *s)
static int64_t get_delay(struct SwrContext *s, int64_t base)
static ResampleContext * resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, double precision, int cheby)

Definition at line 365 of file libswresample/resample.c.

Referenced by swr_init().