Add AVCodecContext.lpc_type and Add AVCodecContext.lpc_passes fields.

Add AVLPCType enum.
Deprecate AVCodecContext.use_lpc.

Originally committed as revision 24199 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Justin Ruggles
2010-07-11 16:56:20 +00:00
parent 31769dad7d
commit 23940f1405
8 changed files with 129 additions and 38 deletions

View File

@@ -165,7 +165,8 @@ static int estimate_best_order(double *ref, int min_order, int max_order)
int ff_lpc_calc_coefs(DSPContext *s,
const int32_t *samples, int blocksize, int min_order,
int max_order, int precision,
int32_t coefs[][MAX_LPC_ORDER], int *shift, int use_lpc,
int32_t coefs[][MAX_LPC_ORDER], int *shift,
enum AVLPCType lpc_type, int lpc_passes,
int omethod, int max_shift, int zero_shift)
{
double autoc[MAX_LPC_ORDER+1];
@@ -174,20 +175,21 @@ int ff_lpc_calc_coefs(DSPContext *s,
int i, j, pass;
int opt_order;
assert(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER && use_lpc > 0);
assert(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER &&
lpc_type > AV_LPC_TYPE_FIXED);
if(use_lpc == 1){
if (lpc_type == AV_LPC_TYPE_LEVINSON) {
s->lpc_compute_autocorr(samples, blocksize, max_order, autoc);
compute_lpc_coefs(autoc, max_order, &lpc[0][0], MAX_LPC_ORDER, 0, 1);
for(i=0; i<max_order; i++)
ref[i] = fabs(lpc[i][i]);
}else{
} else if (lpc_type == AV_LPC_TYPE_CHOLESKY) {
LLSModel m[2];
double var[MAX_LPC_ORDER+1], av_uninit(weight);
for(pass=0; pass<use_lpc-1; pass++){
for(pass=0; pass<lpc_passes; pass++){
av_init_lls(&m[pass&1], max_order);
weight=0;