[xiph-commits] r9367 - trunk/speex/libspeex

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Sun Jun 5 22:22:33 PDT 2005


Author: jm
Date: 2005-06-05 22:22:32 -0700 (Sun, 05 Jun 2005)
New Revision: 9367

Modified:
   trunk/speex/libspeex/vq_bfin.h
Log:
Special case for complexity 1


Modified: trunk/speex/libspeex/vq_bfin.h
===================================================================
--- trunk/speex/libspeex/vq_bfin.h	2005-06-06 04:14:33 UTC (rev 9366)
+++ trunk/speex/libspeex/vq_bfin.h	2005-06-06 05:22:32 UTC (rev 9367)
@@ -34,6 +34,37 @@
 #define OVERRIDE_VQ_NBEST
 void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack)
 {
+   if (N==1)
+   {
+      best_dist[0] = 2147483647;
+      spx_word32_t dist;
+      __asm__ __volatile__
+         (
+            "LC0 = %8;\n\t"
+            "R2 = 0;\n\t"
+            "LOOP entries_loop%= LC0;\n\t"
+            "LOOP_BEGIN entries_loop%=;\n\t"
+               "%0 = [%4++];\n\t"
+               "%0 >>= 1;\n\t"
+               "A0 = %0;\n\t"
+               "I0 = %6;\n\t"
+               "L0 = 0;\n\t"
+               "R0.L = W[%1++%7] || R1.L = W[I0++];\n\t"
+               "LOOP vq_loop%= LC0 = %5;\n\t"
+               "LOOP_BEGIN vq_loop%=;\n\t"
+                  "%0 = (A0 -= R0.L*R1.L) (IS) || R0.L = W[%1++%7] || R1.L = W[I0++];\n\t"
+               "LOOP_END vq_loop%=;\n\t"
+               "%0 = (A0 -= R0.L*R1.L) (IS);\n\t"
+               "cc = %0 < %2;\n\t"
+               "if cc %2 = %0;\n\t"
+               "if cc %3 = R2;\n\t"
+               "R2 += 1;\n\t"
+            "LOOP_END entries_loop%=;\n\t"
+            : "=D" (dist), "=a" (codebook), "=d" (best_dist[0]), "=d" (nbest[0]), "=a" (E)
+            : "a" (len-1), "a" (in), "a" (2), "d" (entries), "1" (codebook), "4" (E), "2" (best_dist[0]), "3" (nbest[0])
+            : "R0", "R1", "R2", "I0", "L0", "A0", "cc", "memory"
+         );
+   } else {
    int i,k,used;
    used = 0;
    for (i=0;i<entries;i++)
@@ -67,5 +98,5 @@
          used++;
       }
    }
-
+   }
 }



More information about the commits mailing list