From 34017c2089d64dec15989b763e36807eac8379b2 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 23 Dec 2001 17:08:33 +0000 Subject: [PATCH] mix2to1 in SSE git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3676 b3059339-0415-0410-9bf9-f77b7e298cf2 --- liba52/downmix.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/liba52/downmix.c b/liba52/downmix.c index e1f70104e6..ac8a4b33fa 100644 --- a/liba52/downmix.c +++ b/liba52/downmix.c @@ -305,8 +305,29 @@ static void mix2to1 (sample_t * dest, sample_t * src, sample_t bias) { int i; +#ifdef HAVE_SSE + asm volatile( + "movlps %2, %%xmm7 \n\t" + "shufps $0x00, %%xmm7, %%xmm7 \n\t" + "movl $-1024, %%esi \n\t" + "1: \n\t" + "movaps (%0, %%esi), %%xmm0 \n\t" + "movaps 16(%0, %%esi), %%xmm1 \n\t" + "addps (%1, %%esi), %%xmm0 \n\t" + "addps 16(%1, %%esi), %%xmm1 \n\t" + "addps %%xmm7, %%xmm0 \n\t" + "addps %%xmm7, %%xmm1 \n\t" + "movaps %%xmm0, (%1, %%esi) \n\t" + "movaps %%xmm1, 16(%1, %%esi) \n\t" + "addl $32, %%esi \n\t" + " jnz 1b \n\t" + :: "r" (src+256), "r" (dest+256), "m" (bias) + : "%esi" + ); +#else for (i = 0; i < 256; i++) dest[i] += src[i] + bias; +#endif } static void mix3to1 (sample_t * samples, sample_t bias)