summaryrefslogtreecommitdiff
path: root/libavcodec/lpc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2010-07-11 16:56:20 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2010-07-11 16:56:20 +0000
commit23940f1405d4c19df69b1fa77c319e9f114c8ef7 (patch)
tree1f98802573d8e6c7ff8f0467bca1a05171d5fe7d /libavcodec/lpc.c
parent31769dad7d182983e2943d519201c24e9cea6f3e (diff)
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
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r--libavcodec/lpc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 41d5e19255..112a78d4b9 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -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;