title: Fastest way of bitwise AND between two arrays on iPhone?
body: <p>I have two image blocks stored as 1D arrays and have do the following bitwise AND operations among the elements of them. </p>
  
  <pre><code>int compare(unsigned char *a, int a_pitch, 
              unsigned char *b, int b_pitch, int a_lenx, int a_leny) 
  {
      int overlap =0 ;
  
      for(int y=0; y&lt;a_leny; y++) 
          for(int x=0; x&lt;a_lenx; x++) 
          {
              if(a[x + y * a_pitch] &amp; b[x+y*b_pitch]) 
                  overlap++ ;
          }
      return overlap ;
  }
  </code></pre>
  
  <p>Actually, I have to do this job about 220,000 times, so it becomes very slow on iphone devices. </p>
  
  <p>How could I accelerate this job on iPhone ? </p>
  
  <p>I heard that NEON could be useful, but I'm not really familiar with it. In addition it seems that NEON doesn't have bitwise AND... </p>