aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/lpc_mmx.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-21 00:11:44 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-01-23 19:32:06 +0100
commit0d8837bdda4cad7e6c280d2648cef8077e54947b (patch)
treedc589b85ee75d3debf012d8a95f18258dc5ba25f /libavcodec/x86/lpc_mmx.c
parentd3058be6eefefe552f3b03820cc949bfa4e4f487 (diff)
downloadffmpeg-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/x86/lpc_mmx.c')
-rw-r--r--libavcodec/x86/lpc_mmx.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavcodec/x86/lpc_mmx.c b/libavcodec/x86/lpc_mmx.c
index 49eb569eea..19aad9860f 100644
--- a/libavcodec/x86/lpc_mmx.c
+++ b/libavcodec/x86/lpc_mmx.c
@@ -20,7 +20,8 @@
*/
#include "libavutil/x86_cpu.h"
-#include "dsputil_mmx.h"
+#include "libavutil/cpu.h"
+#include "libavcodec/lpc.h"
static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data)
{
@@ -68,7 +69,7 @@ static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data
#undef WELCH
}
-void ff_lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
+static void lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
double *autoc)
{
double tmp[len + lag + 2];
@@ -141,3 +142,12 @@ void ff_lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
}
}
}
+
+av_cold void ff_lpc_init_x86(LPCContext *c)
+{
+ int mm_flags = av_get_cpu_flags();
+
+ if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
+ c->lpc_compute_autocorr = lpc_compute_autocorr_sse2;
+ }
+}