diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-01-21 00:11:44 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-23 19:32:06 +0100 |
commit | 0d8837bdda4cad7e6c280d2648cef8077e54947b (patch) | |
tree | dc589b85ee75d3debf012d8a95f18258dc5ba25f /libavcodec/lpc.c | |
parent | d3058be6eefefe552f3b03820cc949bfa4e4f487 (diff) | |
download | ffmpeg-0d8837bdda4cad7e6c280d2648cef8077e54947b.tar.gz |
Move lpc_compute_autocorr() from DSPContext to a new struct LPCContext.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 56f8952b252f85281317ecd3e0b04c4cae93fd72)
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r-- | libavcodec/lpc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c index 112a78d4b9..3a93c9f673 100644 --- a/libavcodec/lpc.c +++ b/libavcodec/lpc.c @@ -20,7 +20,6 @@ */ #include "libavutil/lls.h" -#include "dsputil.h" #define LPC_USE_DOUBLE #include "lpc.h" @@ -55,7 +54,7 @@ static void apply_welch_window(const int32_t *data, int len, double *w_data) * Calculate autocorrelation data from audio samples * A Welch window function is applied before calculation. */ -void ff_lpc_compute_autocorr(const int32_t *data, int len, int lag, +static void lpc_compute_autocorr_c(const int32_t *data, int len, int lag, double *autoc) { int i, j; @@ -162,7 +161,7 @@ static int estimate_best_order(double *ref, int min_order, int max_order) * 1 = LPC with coeffs determined by Levinson-Durbin recursion * 2+ = LPC with coeffs determined by Cholesky factorization using (use_lpc-1) passes. */ -int ff_lpc_calc_coefs(DSPContext *s, +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, @@ -236,3 +235,11 @@ int ff_lpc_calc_coefs(DSPContext *s, return opt_order; } + +av_cold void ff_lpc_init(LPCContext *s) +{ + s->lpc_compute_autocorr = lpc_compute_autocorr_c; + + if (HAVE_MMX) + ff_lpc_init_x86(s); +} |