28 #define ORDER_METHOD_EST 0
29 #define ORDER_METHOD_2LEVEL 1
30 #define ORDER_METHOD_4LEVEL 2
31 #define ORDER_METHOD_8LEVEL 3
32 #define ORDER_METHOD_SEARCH 4
33 #define ORDER_METHOD_LOG 5
35 #define MIN_LPC_ORDER 1
36 #define MAX_LPC_ORDER 32
88 const int32_t *
samples,
int blocksize,
int min_order,
89 int max_order,
int precision,
92 int omethod,
int max_shift,
int zero_shift);
106 #ifdef LPC_USE_DOUBLE
107 #define LPC_TYPE double
109 #define LPC_TYPE float
117 LPC_TYPE *lpc,
int lpc_stride,
int fail,
127 if (fail && (autoc[max_order - 1] == 0 || err <= 0))
130 for(i=0; i<max_order; i++) {
135 r -= lpc_last[j] * autoc[i-j-1];
138 err *= 1.0 - (r *
r);
143 for(j=0; j < (i+1)>>1; j++) {
147 lpc[i-1-j] = b + r *
f;
do not use LPC prediction or use all zero coefficients
struct LPCContext LPCContext
int ff_lpc_init(LPCContext *s, int blocksize, int max_order, enum FFLPCType lpc_type)
Initialize LPCContext.
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 max_shift, int zero_shift)
Calculate LPC coefficients for multiple orders.
void ff_lpc_end(LPCContext *s)
Uninitialize LPCContext.
static int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order, LPC_TYPE *lpc, int lpc_stride, int fail, int normalize)
Levinson-Durbin recursion.
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
Levinson-Durbin recursion.
use the codec default LPC type
double * windowed_samples
FFLPCType
LPC analysis type.
void(* lpc_compute_autocorr)(const double *data, int len, int lag, double *autoc)
Perform autocorrelation on input samples with delay of 0 to lag.
void(* lpc_apply_welch_window)(const int32_t *data, int len, double *w_data)
Apply a Welch window to an array of input samples.
void ff_lpc_init_x86(LPCContext *s)