From 502ab21af0ca68f76d6112722c46d2f35c004053 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Tue, 18 Jun 2013 21:30:42 +0000 Subject: x86: lpc: simd av_update_lls 4x-6x faster on sandybridge Signed-off-by: Luca Barbato --- libavutil/lls.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libavutil/lls.c') diff --git a/libavutil/lls.c b/libavutil/lls.c index 5a3e4485c8..f87c2cd153 100644 --- a/libavutil/lls.c +++ b/libavutil/lls.c @@ -46,8 +46,8 @@ static void update_lls(LLSModel *m, double *var) void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order) { int i, j, k; - double (*factor)[MAX_VARS + 1] = (void *) &m->covariance[1][0]; - double (*covar) [MAX_VARS + 1] = (void *) &m->covariance[1][1]; + double (*factor)[MAX_VARS_ALIGN] = (void *) &m->covariance[1][0]; + double (*covar) [MAX_VARS_ALIGN] = (void *) &m->covariance[1][1]; double *covar_y = m->covariance[0]; int count = m->indep_count; @@ -117,6 +117,8 @@ av_cold void avpriv_init_lls(LLSModel *m, int indep_count) m->indep_count = indep_count; m->update_lls = update_lls; m->evaluate_lls = evaluate_lls; + if (ARCH_X86) + ff_init_lls_x86(m); } #if FF_API_LLS_PRIVATE @@ -154,7 +156,7 @@ int main(void) avpriv_init_lls(&m, 3); for (i = 0; i < 100; i++) { - double var[4]; + LOCAL_ALIGNED(32, double, var, [4]); double eval; var[0] = (av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2; -- cgit v1.2.3