summaryrefslogtreecommitdiff
path: root/libavcodec/x86/lpc_mmx.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-21 00:12:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-01-23 19:32:06 +0100
commit7101b1850822c2490cfaf2c5f4addf2ccbf7eab1 (patch)
tree6515ce34a76a082c1bef7cf9c946e4cf676d2a0a /libavcodec/x86/lpc_mmx.c
parent0d8837bdda4cad7e6c280d2648cef8077e54947b (diff)
Separate window function from autocorrelation.
Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 77a78e9bdcc589efac41da4f92a489f4523667c0)
Diffstat (limited to 'libavcodec/x86/lpc_mmx.c')
-rw-r--r--libavcodec/x86/lpc_mmx.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/libavcodec/x86/lpc_mmx.c b/libavcodec/x86/lpc_mmx.c
index 19aad9860f..3a0a1f0f6f 100644
--- a/libavcodec/x86/lpc_mmx.c
+++ b/libavcodec/x86/lpc_mmx.c
@@ -69,21 +69,13 @@ static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data
#undef WELCH
}
-static void lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
+static void lpc_compute_autocorr_sse2(const double *data, int len, int lag,
double *autoc)
{
- double tmp[len + lag + 2];
- double *data1 = tmp + lag;
int j;
- if((x86_reg)data1 & 15)
- data1++;
-
- apply_welch_window_sse2(data, len, data1);
-
- for(j=0; j<lag; j++)
- data1[j-lag]= 0.0;
- data1[len] = 0.0;
+ if((x86_reg)data & 15)
+ data++;
for(j=0; j<lag; j+=2){
x86_reg i = -len*sizeof(double);
@@ -114,7 +106,7 @@ static void lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
"movsd %%xmm1, 8(%1) \n\t"
"movsd %%xmm2, 16(%1) \n\t"
:"+&r"(i)
- :"r"(autoc+j), "r"(data1+len), "r"(data1+len-j)
+ :"r"(autoc+j), "r"(data+len), "r"(data+len-j)
:"memory"
);
} else {
@@ -137,7 +129,7 @@ static void lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
"movsd %%xmm0, %1 \n\t"
"movsd %%xmm1, %2 \n\t"
:"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1])
- :"r"(data1+len), "r"(data1+len-j)
+ :"r"(data+len), "r"(data+len-j)
);
}
}
@@ -148,6 +140,7 @@ 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_apply_welch_window = apply_welch_window_sse2;
c->lpc_compute_autocorr = lpc_compute_autocorr_sse2;
}
}