SAF
Loading...
Searching...
No Matches
resample.c File Reference

Main source file for the Speex resampler. More...

#include "saf_externals.h"
#include "speex_resampler.h"
#include "arch.h"
#include "os_support.h"
#include <math.h>
#include <limits.h>

Go to the source code of this file.

Data Structures

struct  SpeexResamplerState
 
struct  FuncDef
 
struct  QualityMapping
 

Macros

#define SPEEX_USE_CBLAS
 
#define EXPORT
 
#define M_PI   3.14159265358979323846
 
#define IMAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define IMIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define NULL   0
 
#define UINT32_MAX   4294967295U
 
#define FIXED_STACK_ALLOC   1024
 
#define KAISER12   (&kaiser12_funcdef)
 
#define KAISER10   (&kaiser10_funcdef)
 
#define KAISER8   (&kaiser8_funcdef)
 
#define KAISER6   (&kaiser6_funcdef)
 

Typedefs

typedef int(* resampler_basic_func) (SpeexResamplerState *, spx_uint32_t, const spx_word16_t *, spx_uint32_t *, spx_word16_t *, spx_uint32_t *)
 

Functions

static double compute_func (float x, const struct FuncDef *func)
 
static spx_word16_t sinc (float cutoff, float x, int N, const struct FuncDef *window_func)
 
static void cubic_coef (spx_word16_t frac, spx_word16_t interp[4])
 
static int resampler_basic_direct_single (SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
 
static int resampler_basic_direct_double (SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
 
static int resampler_basic_interpolate_single (SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
 
static int resampler_basic_interpolate_double (SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
 
static int resampler_basic_zero (SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
 
static int multiply_frac (spx_uint32_t *result, spx_uint32_t value, spx_uint32_t num, spx_uint32_t den)
 
static int update_filter (SpeexResamplerState *st)
 
EXPORT SpeexResamplerState * speex_resampler_init (spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
 Create a new resampler with integer input and output rates.
 
EXPORT SpeexResamplerState * speex_resampler_init_frac (spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
 Create a new resampler with fractional input/output rates.
 
EXPORT void speex_resampler_destroy (SpeexResamplerState *st)
 Destroy a resampler state.
 
static int speex_resampler_process_native (SpeexResamplerState *st, spx_uint32_t channel_index, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
 
static int speex_resampler_magic (SpeexResamplerState *st, spx_uint32_t channel_index, spx_word16_t **out, spx_uint32_t out_len)
 
EXPORT int speex_resampler_process_float (SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
 Resample a float array.
 
EXPORT int speex_resampler_process_int (SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
 Resample an int array.
 
EXPORT int speex_resampler_process_interleaved_float (SpeexResamplerState *st, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
 Resample an interleaved float array.
 
EXPORT int speex_resampler_process_interleaved_int (SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
 Resample an interleaved int array.
 
EXPORT int speex_resampler_set_rate (SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate)
 Set (change) the input/output sampling rates (integer value).
 
EXPORT void speex_resampler_get_rate (SpeexResamplerState *st, spx_uint32_t *in_rate, spx_uint32_t *out_rate)
 Get the current input/output sampling rates (integer value).
 
static spx_uint32_t compute_gcd (spx_uint32_t a, spx_uint32_t b)
 
EXPORT int speex_resampler_set_rate_frac (SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
 Set (change) the input/output sampling rates and resampling ratio (fractional values in Hz supported).
 
EXPORT void speex_resampler_get_ratio (SpeexResamplerState *st, spx_uint32_t *ratio_num, spx_uint32_t *ratio_den)
 Get the current resampling ratio.
 
EXPORT int speex_resampler_set_quality (SpeexResamplerState *st, int quality)
 Set (change) the conversion quality.
 
EXPORT void speex_resampler_get_quality (SpeexResamplerState *st, int *quality)
 Get the conversion quality.
 
EXPORT void speex_resampler_set_input_stride (SpeexResamplerState *st, spx_uint32_t stride)
 Set (change) the input stride.
 
EXPORT void speex_resampler_get_input_stride (SpeexResamplerState *st, spx_uint32_t *stride)
 Get the input stride.
 
EXPORT void speex_resampler_set_output_stride (SpeexResamplerState *st, spx_uint32_t stride)
 Set (change) the output stride.
 
EXPORT void speex_resampler_get_output_stride (SpeexResamplerState *st, spx_uint32_t *stride)
 Get the output stride.
 
EXPORT int speex_resampler_get_input_latency (SpeexResamplerState *st)
 Get the latency introduced by the resampler measured in input samples.
 
EXPORT int speex_resampler_get_output_latency (SpeexResamplerState *st)
 Get the latency introduced by the resampler measured in output samples.
 
EXPORT int speex_resampler_skip_zeros (SpeexResamplerState *st)
 Make sure that the first samples to go out of the resamplers don't have leading zeros.
 
EXPORT int speex_resampler_reset_mem (SpeexResamplerState *st)
 Reset a resampler so a new (unrelated) stream can be processed.
 
EXPORT const char * speex_resampler_strerror (int err)
 Returns the English meaning for an error code.
 

Variables

static const double kaiser12_table [68]
 
static const double kaiser10_table [36]
 
static const double kaiser8_table [36]
 
static const double kaiser6_table [36]
 
static const struct FuncDef kaiser12_funcdef = {kaiser12_table, 64}
 
static const struct FuncDef kaiser10_funcdef = {kaiser10_table, 32}
 
static const struct FuncDef kaiser8_funcdef = {kaiser8_table, 32}
 
static const struct FuncDef kaiser6_funcdef = {kaiser6_table, 32}
 
static const struct QualityMapping quality_map [11]
 

Detailed Description

Main source file for the Speex resampler.

License
BSD 3-Clause

Definition in file resample.c.

Macro Definition Documentation

◆ EXPORT

#define EXPORT

Definition at line 93 of file resample.c.

◆ FIXED_STACK_ALLOC

#define FIXED_STACK_ALLOC   1024

Definition at line 122 of file resample.c.

◆ IMAX

#define IMAX ( a,
b )   ((a) > (b) ? (a) : (b))

Definition at line 99 of file resample.c.

◆ IMIN

#define IMIN ( a,
b )   ((a) < (b) ? (a) : (b))

Definition at line 100 of file resample.c.

◆ KAISER10

#define KAISER10   (&kaiser10_funcdef)

Definition at line 213 of file resample.c.

◆ KAISER12

#define KAISER12   (&kaiser12_funcdef)

Definition at line 211 of file resample.c.

◆ KAISER6

#define KAISER6   (&kaiser6_funcdef)

Definition at line 217 of file resample.c.

◆ KAISER8

#define KAISER8   (&kaiser8_funcdef)

Definition at line 215 of file resample.c.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 96 of file resample.c.

◆ NULL

#define NULL   0

Definition at line 103 of file resample.c.

◆ SPEEX_USE_CBLAS

#define SPEEX_USE_CBLAS

Definition at line 64 of file resample.c.

◆ UINT32_MAX

#define UINT32_MAX   4294967295U

Definition at line 107 of file resample.c.

Typedef Documentation

◆ resampler_basic_func

typedef int(* resampler_basic_func) (SpeexResamplerState *, spx_uint32_t, const spx_word16_t *, spx_uint32_t *, spx_word16_t *, spx_uint32_t *)

Definition at line 125 of file resample.c.

Function Documentation

◆ compute_func()

static double compute_func ( float x,
const struct FuncDef * func )
static

Definition at line 251 of file resample.c.

◆ compute_gcd()

static spx_uint32_t compute_gcd ( spx_uint32_t a,
spx_uint32_t b )
inlinestatic

Definition at line 1115 of file resample.c.

◆ cubic_coef()

static void cubic_coef ( spx_word16_t frac,
spx_word16_t interp[4] )
static

Definition at line 329 of file resample.c.

◆ multiply_frac()

static int multiply_frac ( spx_uint32_t * result,
spx_uint32_t value,
spx_uint32_t num,
spx_uint32_t den )
static

Definition at line 613 of file resample.c.

◆ resampler_basic_direct_double()

static int resampler_basic_direct_double ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const spx_word16_t * in,
spx_uint32_t * in_len,
spx_word16_t * out,
spx_uint32_t * out_len )
static

Definition at line 405 of file resample.c.

◆ resampler_basic_direct_single()

static int resampler_basic_direct_single ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const spx_word16_t * in,
spx_uint32_t * in_len,
spx_word16_t * out,
spx_uint32_t * out_len )
static

Definition at line 342 of file resample.c.

◆ resampler_basic_interpolate_double()

static int resampler_basic_interpolate_double ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const spx_word16_t * in,
spx_uint32_t * in_len,
spx_word16_t * out,
spx_uint32_t * out_len )
static

Definition at line 521 of file resample.c.

◆ resampler_basic_interpolate_single()

static int resampler_basic_interpolate_single ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const spx_word16_t * in,
spx_uint32_t * in_len,
spx_word16_t * out,
spx_uint32_t * out_len )
static

Definition at line 458 of file resample.c.

◆ resampler_basic_zero()

static int resampler_basic_zero ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const spx_word16_t * in,
spx_uint32_t * in_len,
spx_word16_t * out,
spx_uint32_t * out_len )
static

Definition at line 585 of file resample.c.

◆ sinc()

static spx_word16_t sinc ( float cutoff,
float x,
int N,
const struct FuncDef * window_func )
static

Definition at line 299 of file resample.c.

◆ speex_resampler_destroy()

EXPORT void speex_resampler_destroy ( SpeexResamplerState * st)

Destroy a resampler state.

Parameters
stResampler state

Definition at line 888 of file resample.c.

◆ speex_resampler_get_input_latency()

EXPORT int speex_resampler_get_input_latency ( SpeexResamplerState * st)

Get the latency introduced by the resampler measured in input samples.

Parameters
stResampler state

Definition at line 1210 of file resample.c.

◆ speex_resampler_get_input_stride()

EXPORT void speex_resampler_get_input_stride ( SpeexResamplerState * st,
spx_uint32_t * stride )

Get the input stride.

Parameters
stResampler state
strideInput stride copied

Definition at line 1195 of file resample.c.

◆ speex_resampler_get_output_latency()

EXPORT int speex_resampler_get_output_latency ( SpeexResamplerState * st)

Get the latency introduced by the resampler measured in output samples.

Parameters
stResampler state

Definition at line 1215 of file resample.c.

◆ speex_resampler_get_output_stride()

EXPORT void speex_resampler_get_output_stride ( SpeexResamplerState * st,
spx_uint32_t * stride )

Get the output stride.

Parameters
stResampler state copied
strideOutput stride

Definition at line 1205 of file resample.c.

◆ speex_resampler_get_quality()

EXPORT void speex_resampler_get_quality ( SpeexResamplerState * st,
int * quality )

Get the conversion quality.

Parameters
stResampler state
qualityResampling quality between 0 and 10, where 0 has poor quality and 10 has very high quality.

Definition at line 1185 of file resample.c.

◆ speex_resampler_get_rate()

EXPORT void speex_resampler_get_rate ( SpeexResamplerState * st,
spx_uint32_t * in_rate,
spx_uint32_t * out_rate )

Get the current input/output sampling rates (integer value).

Parameters
stResampler state
in_rateInput sampling rate (integer number of Hz) copied.
out_rateOutput sampling rate (integer number of Hz) copied.

Definition at line 1109 of file resample.c.

◆ speex_resampler_get_ratio()

EXPORT void speex_resampler_get_ratio ( SpeexResamplerState * st,
spx_uint32_t * ratio_num,
spx_uint32_t * ratio_den )

Get the current resampling ratio.

This will be reduced to the least common denominator.

Parameters
stResampler state
ratio_numNumerator of the sampling rate ratio copied
ratio_denDenominator of the sampling rate ratio copied

Definition at line 1167 of file resample.c.

◆ speex_resampler_init()

EXPORT SpeexResamplerState * speex_resampler_init ( spx_uint32_t nb_channels,
spx_uint32_t in_rate,
spx_uint32_t out_rate,
int quality,
int * err )

Create a new resampler with integer input and output rates.

Parameters
nb_channelsNumber of channels to be processed
in_rateInput sampling rate (integer number of Hz).
out_rateOutput sampling rate (integer number of Hz).
qualityResampling quality between 0 and 10, where 0 has poor quality and 10 has very high quality.
Returns
Newly created resampler state
Return values
NULLError: not enough memory

Definition at line 814 of file resample.c.

◆ speex_resampler_init_frac()

EXPORT SpeexResamplerState * speex_resampler_init_frac ( spx_uint32_t nb_channels,
spx_uint32_t ratio_num,
spx_uint32_t ratio_den,
spx_uint32_t in_rate,
spx_uint32_t out_rate,
int quality,
int * err )

Create a new resampler with fractional input/output rates.

The sampling rate ratio is an arbitrary rational number with both the numerator and denominator being 32-bit integers.

Parameters
nb_channelsNumber of channels to be processed
ratio_numNumerator of the sampling rate ratio
ratio_denDenominator of the sampling rate ratio
in_rateInput sampling rate rounded to the nearest integer (in Hz).
out_rateOutput sampling rate rounded to the nearest integer (in Hz).
qualityResampling quality between 0 and 10, where 0 has poor quality and 10 has very high quality.
Returns
Newly created resampler state
Return values
NULLError: not enough memory

Definition at line 819 of file resample.c.

◆ speex_resampler_magic()

static int speex_resampler_magic ( SpeexResamplerState * st,
spx_uint32_t channel_index,
spx_word16_t ** out,
spx_uint32_t out_len )
static

Definition at line 924 of file resample.c.

◆ speex_resampler_process_float()

EXPORT int speex_resampler_process_float ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const float * in,
spx_uint32_t * in_len,
float * out,
spx_uint32_t * out_len )

Resample a float array.

The input and output buffers must not overlap.

Parameters
stResampler state
channel_indexIndex of the channel to process for the multi-channel base (0 otherwise)
inInput buffer
in_lenNumber of input samples in the input buffer. Returns the number of samples processed
outOutput buffer
out_lenSize of the output buffer. Returns the number of samples written

Definition at line 947 of file resample.c.

◆ speex_resampler_process_int()

EXPORT int speex_resampler_process_int ( SpeexResamplerState * st,
spx_uint32_t channel_index,
const spx_int16_t * in,
spx_uint32_t * in_len,
spx_int16_t * out,
spx_uint32_t * out_len )

Resample an int array.

The input and output buffers must not overlap.

Parameters
stResampler state
channel_indexIndex of the channel to process for the multi-channel base (0 otherwise)
inInput buffer
in_lenNumber of input samples in the input buffer. Returns the number of samples processed
outOutput buffer
out_lenSize of the output buffer. Returns the number of samples written

Definition at line 988 of file resample.c.

◆ speex_resampler_process_interleaved_float()

EXPORT int speex_resampler_process_interleaved_float ( SpeexResamplerState * st,
const float * in,
spx_uint32_t * in_len,
float * out,
spx_uint32_t * out_len )

Resample an interleaved float array.

The input and output buffers must not overlap.

Parameters
stResampler state
inInput buffer
in_lenNumber of input samples in the input buffer. Returns the number of samples processed. This is all per-channel.
outOutput buffer
out_lenSize of the output buffer. Returns the number of samples written. This is all per-channel.

Definition at line 1058 of file resample.c.

◆ speex_resampler_process_interleaved_int()

EXPORT int speex_resampler_process_interleaved_int ( SpeexResamplerState * st,
const spx_int16_t * in,
spx_uint32_t * in_len,
spx_int16_t * out,
spx_uint32_t * out_len )

Resample an interleaved int array.

The input and output buffers must not overlap.

Parameters
stResampler state
inInput buffer
in_lenNumber of input samples in the input buffer. Returns the number of samples processed. This is all per-channel.
outOutput buffer
out_lenSize of the output buffer. Returns the number of samples written. This is all per-channel.

Definition at line 1081 of file resample.c.

◆ speex_resampler_process_native()

static int speex_resampler_process_native ( SpeexResamplerState * st,
spx_uint32_t channel_index,
spx_uint32_t * in_len,
spx_word16_t * out,
spx_uint32_t * out_len )
static

Definition at line 898 of file resample.c.

◆ speex_resampler_reset_mem()

EXPORT int speex_resampler_reset_mem ( SpeexResamplerState * st)

Reset a resampler so a new (unrelated) stream can be processed.

Parameters
stResampler state

Definition at line 1228 of file resample.c.

◆ speex_resampler_set_input_stride()

EXPORT void speex_resampler_set_input_stride ( SpeexResamplerState * st,
spx_uint32_t stride )

Set (change) the input stride.

Parameters
stResampler state
strideInput stride

Definition at line 1190 of file resample.c.

◆ speex_resampler_set_output_stride()

EXPORT void speex_resampler_set_output_stride ( SpeexResamplerState * st,
spx_uint32_t stride )

Set (change) the output stride.

Parameters
stResampler state
strideOutput stride

Definition at line 1200 of file resample.c.

◆ speex_resampler_set_quality()

EXPORT int speex_resampler_set_quality ( SpeexResamplerState * st,
int quality )

Set (change) the conversion quality.

Parameters
stResampler state
qualityResampling quality between 0 and 10, where 0 has poor quality and 10 has very high quality.

Definition at line 1173 of file resample.c.

◆ speex_resampler_set_rate()

EXPORT int speex_resampler_set_rate ( SpeexResamplerState * st,
spx_uint32_t in_rate,
spx_uint32_t out_rate )

Set (change) the input/output sampling rates (integer value).

Parameters
stResampler state
in_rateInput sampling rate (integer number of Hz).
out_rateOutput sampling rate (integer number of Hz).

Definition at line 1104 of file resample.c.

◆ speex_resampler_set_rate_frac()

EXPORT int speex_resampler_set_rate_frac ( SpeexResamplerState * st,
spx_uint32_t ratio_num,
spx_uint32_t ratio_den,
spx_uint32_t in_rate,
spx_uint32_t out_rate )

Set (change) the input/output sampling rates and resampling ratio (fractional values in Hz supported).

Parameters
stResampler state
ratio_numNumerator of the sampling rate ratio
ratio_denDenominator of the sampling rate ratio
in_rateInput sampling rate rounded to the nearest integer (in Hz).
out_rateOutput sampling rate rounded to the nearest integer (in Hz).

Definition at line 1127 of file resample.c.

◆ speex_resampler_skip_zeros()

EXPORT int speex_resampler_skip_zeros ( SpeexResamplerState * st)

Make sure that the first samples to go out of the resamplers don't have leading zeros.

This is only useful before starting to use a newly created resampler. It is recommended to use that when resampling an audio file, as it will generate a file with the same length. For real-time processing, it is probably easier not to use this call (so that the output duration is the same for the first frame).

Parameters
stResampler state

Definition at line 1220 of file resample.c.

◆ speex_resampler_strerror()

EXPORT const char * speex_resampler_strerror ( int err)

Returns the English meaning for an error code.

Parameters
errError code
Returns
English string

Definition at line 1242 of file resample.c.

◆ update_filter()

static int update_filter ( SpeexResamplerState * st)
static

Definition at line 625 of file resample.c.

Variable Documentation

◆ kaiser10_funcdef

const struct FuncDef kaiser10_funcdef = {kaiser10_table, 32}
static

Definition at line 212 of file resample.c.

◆ kaiser10_table

const double kaiser10_table[36]
static
Initial value:
= {
0.99537781, 1.00000000, 0.99537781, 0.98162644, 0.95908712, 0.92831446,
0.89005583, 0.84522401, 0.79486424, 0.74011713, 0.68217934, 0.62226347,
0.56155915, 0.50119680, 0.44221549, 0.38553619, 0.33194107, 0.28205962,
0.23636152, 0.19515633, 0.15859932, 0.12670280, 0.09935205, 0.07632451,
0.05731132, 0.04193980, 0.02979584, 0.02044510, 0.01345224, 0.00839739,
0.00488951, 0.00257636, 0.00115101, 0.00035515, 0.00000000, 0.00000000}

Definition at line 181 of file resample.c.

◆ kaiser12_funcdef

const struct FuncDef kaiser12_funcdef = {kaiser12_table, 64}
static

Definition at line 210 of file resample.c.

◆ kaiser12_table

const double kaiser12_table[68]
static
Initial value:
= {
0.99859849, 1.00000000, 0.99859849, 0.99440475, 0.98745105, 0.97779076,
0.96549770, 0.95066529, 0.93340547, 0.91384741, 0.89213598, 0.86843014,
0.84290116, 0.81573067, 0.78710866, 0.75723148, 0.72629970, 0.69451601,
0.66208321, 0.62920216, 0.59606986, 0.56287762, 0.52980938, 0.49704014,
0.46473455, 0.43304576, 0.40211431, 0.37206735, 0.34301800, 0.31506490,
0.28829195, 0.26276832, 0.23854851, 0.21567274, 0.19416736, 0.17404546,
0.15530766, 0.13794294, 0.12192957, 0.10723616, 0.09382272, 0.08164178,
0.07063950, 0.06075685, 0.05193064, 0.04409466, 0.03718069, 0.03111947,
0.02584161, 0.02127838, 0.01736250, 0.01402878, 0.01121463, 0.00886058,
0.00691064, 0.00531256, 0.00401805, 0.00298291, 0.00216702, 0.00153438,
0.00105297, 0.00069463, 0.00043489, 0.00025272, 0.00013031, 0.0000527734,
0.00001000, 0.00000000}

Definition at line 159 of file resample.c.

◆ kaiser6_funcdef

const struct FuncDef kaiser6_funcdef = {kaiser6_table, 32}
static

Definition at line 216 of file resample.c.

◆ kaiser6_table

const double kaiser6_table[36]
static
Initial value:
= {
0.99733006, 1.00000000, 0.99733006, 0.98935595, 0.97618418, 0.95799003,
0.93501423, 0.90755855, 0.87598009, 0.84068475, 0.80211977, 0.76076565,
0.71712752, 0.67172623, 0.62508937, 0.57774224, 0.53019925, 0.48295561,
0.43647969, 0.39120616, 0.34752997, 0.30580127, 0.26632152, 0.22934058,
0.19505503, 0.16360756, 0.13508755, 0.10953262, 0.08693120, 0.06722600,
0.05031820, 0.03607231, 0.02432151, 0.01487334, 0.00752000, 0.00000000}

Definition at line 197 of file resample.c.

◆ kaiser8_funcdef

const struct FuncDef kaiser8_funcdef = {kaiser8_table, 32}
static

Definition at line 214 of file resample.c.

◆ kaiser8_table

const double kaiser8_table[36]
static
Initial value:
= {
0.99635258, 1.00000000, 0.99635258, 0.98548012, 0.96759014, 0.94302200,
0.91223751, 0.87580811, 0.83439927, 0.78875245, 0.73966538, 0.68797126,
0.63451750, 0.58014482, 0.52566725, 0.47185369, 0.41941150, 0.36897272,
0.32108304, 0.27619388, 0.23465776, 0.19672670, 0.16255380, 0.13219758,
0.10562887, 0.08273982, 0.06335451, 0.04724088, 0.03412321, 0.02369490,
0.01563093, 0.00959968, 0.00527363, 0.00233883, 0.00050000, 0.00000000}

Definition at line 189 of file resample.c.

◆ quality_map

const struct QualityMapping quality_map[11]
static
Initial value:
= {
{ 8, 4, 0.830f, 0.860f, KAISER6 },
{ 16, 4, 0.850f, 0.880f, KAISER6 },
{ 32, 4, 0.882f, 0.910f, KAISER6 },
{ 48, 8, 0.895f, 0.917f, KAISER8 },
{ 64, 8, 0.921f, 0.940f, KAISER8 },
{ 80, 16, 0.922f, 0.940f, KAISER10},
{ 96, 16, 0.940f, 0.945f, KAISER10},
{128, 16, 0.950f, 0.950f, KAISER10},
{160, 16, 0.960f, 0.960f, KAISER10},
{192, 32, 0.968f, 0.968f, KAISER12},
{256, 32, 0.975f, 0.975f, KAISER12},
}

Definition at line 237 of file resample.c.