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/x86 | |
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/x86')
-rw-r--r-- | libavcodec/x86/dsputil_mmx.h | 3 | ||||
-rw-r--r-- | libavcodec/x86/dsputilenc_mmx.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/lpc_mmx.c | 14 |
3 files changed, 12 insertions, 9 deletions
diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h index c57bbbf3a7..a095e1ef3d 100644 --- a/libavcodec/x86/dsputil_mmx.h +++ b/libavcodec/x86/dsputil_mmx.h @@ -200,9 +200,6 @@ void ff_vc1dsp_init_mmx(DSPContext* dsp, AVCodecContext *avctx); void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd); void ff_avg_vc1_mspel_mc00_mmx2(uint8_t *dst, const uint8_t *src, int stride, int rnd); -void ff_lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag, - double *autoc); - void ff_mmx_idct(DCTELEM *block); void ff_mmxext_idct(DCTELEM *block); diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index cb8080aa0a..bd31205a6b 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -1166,10 +1166,6 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) #endif } - if (CONFIG_LPC && mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) { - c->lpc_compute_autocorr = ff_lpc_compute_autocorr_sse2; - } - #if HAVE_SSSE3 if(mm_flags & AV_CPU_FLAG_SSSE3){ if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ 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; + } +} |