FFmpeg
Macros | Functions
lpc.c File Reference
#include "libavutil/common.h"
#include "libavutil/lls.h"
#include "libavutil/mem_internal.h"
#include "lpc.h"
#include "lpc_functions.h"
#include "libavutil/avassert.h"

Go to the source code of this file.

Macros

#define LPC_USE_DOUBLE
 

Functions

static void compute_ref_coefs (const LPC_TYPE *autoc, int max_order, LPC_TYPE *ref, LPC_TYPE *error)
 Schur recursion. More...
 
static void lpc_apply_welch_window_c (const int32_t *data, ptrdiff_t len, double *w_data)
 Apply Welch window function to audio block. More...
 
static void lpc_compute_autocorr_c (const double *data, ptrdiff_t len, int lag, double *autoc)
 Calculate autocorrelation data from audio samples A Welch window function is applied before calculation. More...
 
static void quantize_lpc_coefs (double *lpc_in, int order, int precision, int32_t *lpc_out, int *shift, int min_shift, int max_shift, int zero_shift)
 Quantize LPC coefficients. More...
 
static int estimate_best_order (double *ref, int min_order, int max_order)
 
int ff_lpc_calc_ref_coefs (LPCContext *s, const int32_t *samples, int order, double *ref)
 
double ff_lpc_calc_ref_coefs_f (LPCContext *s, const float *samples, int len, int order, double *ref)
 
int ff_lpc_calc_coefs (LPCContext *s, const int32_t *samples, int blocksize, int min_order, int max_order, int precision, int32_t coefs[][MAX_LPC_ORDER], int *shift, enum FFLPCType lpc_type, int lpc_passes, int omethod, int min_shift, int max_shift, int zero_shift)
 Calculate LPC coefficients for multiple orders. More...
 
av_cold int ff_lpc_init (LPCContext *s, int blocksize, int max_order, enum FFLPCType lpc_type)
 Initialize LPCContext. More...
 
av_cold void ff_lpc_end (LPCContext *s)
 Uninitialize LPCContext. More...
 

Macro Definition Documentation

◆ LPC_USE_DOUBLE

#define LPC_USE_DOUBLE

Definition at line 26 of file lpc.c.

Function Documentation

◆ compute_ref_coefs()

static void compute_ref_coefs ( const LPC_TYPE autoc,
int  max_order,
LPC_TYPE ref,
LPC_TYPE error 
)
inlinestatic

Schur recursion.

Produces reflection coefficients from autocorrelation data.

Definition at line 35 of file lpc.c.

Referenced by ff_lpc_calc_ref_coefs(), and ff_lpc_calc_ref_coefs_f().

◆ lpc_apply_welch_window_c()

static void lpc_apply_welch_window_c ( const int32_t data,
ptrdiff_t  len,
double w_data 
)
static

Apply Welch window function to audio block.

Definition at line 65 of file lpc.c.

Referenced by ff_lpc_init().

◆ lpc_compute_autocorr_c()

static void lpc_compute_autocorr_c ( const double data,
ptrdiff_t  len,
int  lag,
double autoc 
)
static

Calculate autocorrelation data from audio samples A Welch window function is applied before calculation.

Definition at line 105 of file lpc.c.

Referenced by ff_lpc_init().

◆ quantize_lpc_coefs()

static void quantize_lpc_coefs ( double lpc_in,
int  order,
int  precision,
int32_t lpc_out,
int shift,
int  min_shift,
int  max_shift,
int  zero_shift 
)
static

Quantize LPC coefficients.

Definition at line 133 of file lpc.c.

Referenced by ff_lpc_calc_coefs().

◆ estimate_best_order()

static int estimate_best_order ( double ref,
int  min_order,
int  max_order 
)
static

Definition at line 183 of file lpc.c.

Referenced by ff_lpc_calc_coefs().

◆ ff_lpc_calc_ref_coefs()

int ff_lpc_calc_ref_coefs ( LPCContext s,
const int32_t samples,
int  order,
double ref 
)

Definition at line 197 of file lpc.c.

Referenced by cng_encode_frame().

◆ ff_lpc_calc_ref_coefs_f()

double ff_lpc_calc_ref_coefs_f ( LPCContext s,
const float samples,
int  len,
int  order,
double ref 
)

Definition at line 209 of file lpc.c.

Referenced by ff_aac_search_for_tns().

◆ ff_lpc_calc_coefs()

int ff_lpc_calc_coefs ( LPCContext s,
const int32_t samples,
int  blocksize,
int  min_order,
int  max_order,
int  precision,
int32_t  coefs[][MAX_LPC_ORDER],
int shift,
enum FFLPCType  lpc_type,
int  lpc_passes,
int  omethod,
int  min_shift,
int  max_shift,
int  zero_shift 
)

Calculate LPC coefficients for multiple orders.

Parameters
lpc_typeLPC method for determining coefficients, see FFLPCType for details

Definition at line 238 of file lpc.c.

Referenced by calc_predictor_params(), encode_residual_ch(), ra144_encode_frame(), and set_filter().

◆ ff_lpc_init()

av_cold int ff_lpc_init ( LPCContext s,
int  blocksize,
int  max_order,
enum FFLPCType  lpc_type 
)

◆ ff_lpc_end()

av_cold void ff_lpc_end ( LPCContext s)