[xiph-commits] r8832 - trunk/speex/libspeex
jm at motherfish-iii.xiph.org
jm at motherfish-iii.xiph.org
Fri Feb 4 21:36:04 PST 2005
Author: jm
Date: 2005-02-04 21:36:02 -0800 (Fri, 04 Feb 2005)
New Revision: 8832
Modified:
trunk/speex/libspeex/filters.c
Log:
An ARM assembly implementation of filters_mem2 -- work in progress
Modified: trunk/speex/libspeex/filters.c
===================================================================
--- trunk/speex/libspeex/filters.c 2005-02-04 15:48:23 UTC (rev 8831)
+++ trunk/speex/libspeex/filters.c 2005-02-05 05:36:02 UTC (rev 8832)
@@ -187,7 +187,61 @@
return SHR(SHL((spx_word32_t)spx_sqrt(1+DIV32(sum,len)),(sig_shift+3)),SIG_SHIFT);
}
+#ifdef ARM4_ASM
+void filter_mem2(const spx_sig_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
+{
+ int i,j;
+ spx_sig_t xi,yi,nyi;
+ for (i=0;i<N;i++)
+ {
+ int deadm, deadn, deadd, deadidx, x1, y1, dead1, dead2, dead3, dead4, dead5;
+ xi=SATURATE(x[i],805306368);
+ yi = SATURATE(ADD32(xi, SHL(mem[0],2)),805306368);
+ nyi = -yi;
+ y[i] = yi;
+ __asm__ __volatile__ (
+ ".filterloop: \n"
+ "\tldrsh %6, [%1], #2\n"
+ "\tsmull %8, %9, %4, %6\n"
+ "\tldr %10, [%0, #4]\n"
+ "\tmov %8, %8, lsr #15\n"
+ "\tadd %8, %8, %9, lsl #17\n"
+ "\tadd %10, %10, %8\n"
+
+ "\tldrsh %6, [%2], #2\n"
+ "\tsmull %8, %9, %5, %6\n"
+ "\tmov %8, %8, lsr #15\n"
+ "\tadd %8, %8, %9, lsl #17\n"
+ "\tadd %10, %10, %8\n"
+
+ "\tstr %10, [%0], #4 \n"
+ "\tsubs %3, %3, #1\n"
+ "\t bne .filterloop\n"
+
+
+ "\tldrsh %6, [%1], #2\n"
+ "\tsmull %8, %9, %4, %6\n"
+ "\tmov %8, %8, lsr #15\n"
+ "\tadd %10, %8, %9, lsl #17\n"
+
+ "\tldrsh %6, [%2], #2\n"
+ "\tsmull %8, %9, %5, %6\n"
+ "\tmov %8, %8, lsr #15\n"
+ "\tadd %8, %8, %9, lsl #17\n"
+ "\tadd %10, %10, %8\n"
+
+ "\tstr %10, [%0], #4 \n"
+
+ : "=r" (deadm), "=r" (deadn), "=r" (deadd), "=r" (deadidx),
+ "=r" (xi), "=r" (nyi), "=r" (dead1), "=r" (dead2),
+ "=r" (dead3), "=r" (dead4), "=r" (dead5)
+ : "0" (mem), "1" (num+1), "2" (den+1), "3" (ord-1), "4" (xi), "5" (nyi)
+ : "cc", "memory");
+
+ }
+}
+#else
void filter_mem2(const spx_sig_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
int i,j;
@@ -208,6 +262,7 @@
y[i] = yi;
}
}
+#endif
void iir_mem2(const spx_sig_t *x, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
{
More information about the commits
mailing list