title: Optimisation of IIR filter
body: <p>Quick question related to IIR filter coefficients. Here is a very typical implementation of a direct form II biquad IIR processor that I found online.</p>
  
  <pre><code>// b0, b1, b2, a1, a2 are filter coefficients
  // m1, m2 are the memory locations
  // dn is the de-denormal coeff (=1.0e-20f) 
  
  void processBiquad(const float* in, float* out, unsigned length)
  {
      for(unsigned i = 0; i &lt; length; ++i)
      {
          register float w = in[i] - a1*m1 - a2*m2 + dn;
          out[i] = b1*m1 + b2*m2 + b0*w;
          m2 = m1; m1 = w;
      }
      dn = -dn;
  }
  </code></pre>
  
  <p>I understand that the "register" is somewhat unnecessary given how smart modern compilers are about this kind of thing. My question is, are there any potential performance benefits to storing the filter coefficients in individual variables rather than using arrays and dereferencing the values? Would the answer to this question depend on the target platform?</p>
  
  <p>i.e.</p>
  
  <pre><code>out[i] = b[1]*m[1] + b[2]*m[2] + b[0]*w;
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>out[i] = b1*m1 + b2*m2 + b0*w;
  </code></pre>