From fde82ca7e4e72226da99d86a9fa9689136461d14 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 17 Oct 2009 21:00:39 +0000 Subject: Move autocorrelation function from flacenc.c to lpc.c. Also rename the corresponding dsputil functions and remove their dependency on the FLAC encoder. Fixes Issue1486. Originally committed as revision 20266 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/lpc.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'libavcodec/lpc.c') diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c index 896db51759..49e41d8c34 100644 --- a/libavcodec/lpc.c +++ b/libavcodec/lpc.c @@ -26,6 +26,68 @@ #include "lpc.h" +/** + * Apply Welch window function to audio block + */ +static void apply_welch_window(const int32_t *data, int len, double *w_data) +{ + int i, n2; + double w; + double c; + + assert(!(len&1)); //the optimization in r11881 does not support odd len + //if someone wants odd len extend the change in r11881 + + n2 = (len >> 1); + c = 2.0 / (len - 1.0); + + w_data+=n2; + data+=n2; + for(i=0; i= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER && use_lpc > 0); if(use_lpc == 1){ - s->flac_compute_autocorr(samples, blocksize, max_order, autoc); + s->lpc_compute_autocorr(samples, blocksize, max_order, autoc); compute_lpc_coefs(autoc, max_order, &lpc[0][0], MAX_LPC_ORDER, 0, 1); -- cgit v1.2.3