Speeding up extract_collapse_mask() slightly
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 23 Jan 2014 05:02:12 +0000 (00:02 -0500)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 23 Jan 2014 05:02:12 +0000 (00:02 -0500)
celt/vq.c

index a064df0..6bf9b2b 100644 (file)
--- a/celt/vq.c
+++ b/celt/vq.c
@@ -147,9 +147,11 @@ static unsigned extract_collapse_mask(int *iy, int N, int B)
    collapse_mask = 0;
    i=0; do {
       int j;
+      unsigned tmp=0;
       j=0; do {
-         collapse_mask |= (iy[i*N0+j]!=0)<<i;
+         tmp |= iy[i*N0+j];
       } while (++j<N0);
+      collapse_mask |= (tmp!=0)<<i;
    } while (++i<B);
    return collapse_mask;
 }