FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
resample.c File Reference

audio resampling More...

#include "libavutil/log.h"
#include "libavutil/avassert.h"
#include "swresample_internal.h"
#include "resample_template.c"

Go to the source code of this file.

Data Structures

struct  resample_init_func
 

Macros

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

Functions

static double bessel (double x)
 0th order modified bessel function of the first kind.
 
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.
 
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 resample.c.

Macro Definition Documentation

#define TEMPLATE_RESAMPLE_S16

Definition at line 280 of file resample.c.

#define TEMPLATE_RESAMPLE_S32

Definition at line 284 of file resample.c.

#define TEMPLATE_RESAMPLE_FLT

Definition at line 288 of file resample.c.

#define TEMPLATE_RESAMPLE_DBL

Definition at line 292 of file resample.c.

Function Documentation

static double bessel ( double  x)
static

0th order modified bessel function of the first kind.

Definition at line 58 of file 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 resample.c.

Referenced by resample_init().

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 resample.c.

static void resample_free ( ResampleContext **  c)
static

Definition at line 264 of file resample.c.

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

Definition at line 271 of file 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 resample.c.

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

Definition at line 339 of file resample.c.

static int resample_flush ( struct SwrContext s)
static

Definition at line 349 of file resample.c.

Variable Documentation

struct Resampler const swri_resampler
Initial value:

Definition at line 365 of file resample.c.

Referenced by swr_init().