summaryrefslogtreecommitdiff
path: root/libavcodec/lpc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-21 00:11:44 +0000
committerMans Rullgard <mans@mansr.com>2011-01-21 19:58:59 +0000
commit56f8952b252f85281317ecd3e0b04c4cae93fd72 (patch)
treea6c8fa8727be01daa6c9200b9dee20ba261b2c05 /libavcodec/lpc.c
parent50196a982bf7c8be9b41053fa0975473c217e709 (diff)
Move lpc_compute_autocorr() from DSPContext to a new struct LPCContext.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r--libavcodec/lpc.c13
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);
+}