From 56c07e298914d0533a74bb4ba4be4abc8ea6b245 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 16 Aug 2008 21:24:06 +0000 Subject: [PATCH] use limited range of lpc orders when quantizing coefficients Originally committed as revision 14794 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/flacenc.c | 2 +- libavcodec/lpc.c | 4 ++-- libavcodec/lpc.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 4876895c67..ea104360c1 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -855,7 +855,7 @@ static int encode_residual(FlacEncodeContext *ctx, int ch) } /* LPC */ - opt_order = ff_lpc_calc_coefs(&ctx->dsp, smp, n, max_order, precision, coefs, + opt_order = ff_lpc_calc_coefs(&ctx->dsp, smp, n, min_order, max_order, precision, coefs, shift, ctx->options.use_lpc, omethod, MAX_LPC_SHIFT, 0); if(omethod == ORDER_METHOD_2LEVEL || diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c index bdea026542..792abe4d1c 100644 --- a/libavcodec/lpc.c +++ b/libavcodec/lpc.c @@ -135,7 +135,7 @@ static int estimate_best_order(double *ref, int max_order) * Calculate LPC coefficients for multiple orders */ int ff_lpc_calc_coefs(DSPContext *s, - const int32_t *samples, int blocksize, int max_order, + 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, int omethod, int max_shift, int zero_shift) { @@ -195,7 +195,7 @@ int ff_lpc_calc_coefs(DSPContext *s, i = opt_order-1; quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift); } else { - for(i=0; i