FFmpeg
Functions | Variables
resample.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "resample.h"

Go to the source code of this file.

Functions

static int build_filter (ResampleContext *c, void *filter, double factor, int tap_count, int alloc, int phase_count, int scale, int filter_type, double kaiser_beta)
 builds a polyphase filterbank. More...
 
static void resample_free (ResampleContext **cc)
 
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, double kaiser_beta, double precision, int cheby, int exact_rational)
 
static int rebuild_filter_bank_with_compensation (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 int64_t get_out_samples (struct SwrContext *s, int in_samples)
 
static int resample_flush (struct SwrContext *s)
 
static int invert_initial_buffer (ResampleContext *c, AudioData *dst, const AudioData *src, int in_count, int *out_idx, int *out_sz)
 

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.

Function Documentation

◆ 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,
double  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 41 of file resample.c.

Referenced by rebuild_filter_bank_with_compensation(), and resample_init().

◆ resample_free()

static void resample_free ( ResampleContext **  cc)
static

Definition at line 176 of file resample.c.

Referenced by resample_init().

◆ 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,
double  kaiser_beta,
double  precision,
int  cheby,
int  exact_rational 
)
static

Definition at line 184 of file resample.c.

◆ rebuild_filter_bank_with_compensation()

static int rebuild_filter_bank_with_compensation ( ResampleContext c)
static

Definition at line 280 of file resample.c.

Referenced by set_compensation().

◆ set_compensation()

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

Definition at line 328 of file resample.c.

◆ multiple_resample()

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

Definition at line 349 of file resample.c.

◆ get_delay()

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

Definition at line 408 of file resample.c.

◆ get_out_samples()

static int64_t get_out_samples ( struct SwrContext s,
int  in_samples 
)
static

Definition at line 418 of file resample.c.

◆ resample_flush()

static int resample_flush ( struct SwrContext s)
static

Definition at line 437 of file resample.c.

◆ invert_initial_buffer()

static int invert_initial_buffer ( ResampleContext c,
AudioData dst,
const AudioData src,
int  in_count,
int out_idx,
int out_sz 
)
static

Definition at line 457 of file resample.c.

Variable Documentation

◆ swri_resampler

struct Resampler const swri_resampler
resample_free
static void resample_free(ResampleContext **cc)
Definition: resample.c:176
get_delay
static int64_t get_delay(struct SwrContext *s, int64_t base)
Definition: resample.c:408
invert_initial_buffer
static int invert_initial_buffer(ResampleContext *c, AudioData *dst, const AudioData *src, int in_count, int *out_idx, int *out_sz)
Definition: resample.c:457
get_out_samples
static int64_t get_out_samples(struct SwrContext *s, int in_samples)
Definition: resample.c:418
set_compensation
static int set_compensation(ResampleContext *c, int sample_delta, int compensation_distance)
Definition: resample.c:328
resample_flush
static int resample_flush(struct SwrContext *s)
Definition: resample.c:437
multiple_resample
static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed)
Definition: resample.c:349
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, double kaiser_beta, double precision, int cheby, int exact_rational)
Definition: resample.c:184