title: Fastest approximative methods to convert YUV to RGBA?
body: <p>I am looking for a fastest method to convert one <a href="http://en.wikipedia.org/wiki/YUV" rel="nofollow">YUV</a> array into <a href="http://en.wikipedia.org/wiki/RGBA" rel="nofollow">RGBA</a> array. For example, given a YCbYCr array, which is a sequence of bytes:</p>
  
  <pre><code>YCbYCr = Luma0, Cb0, Luma1, Cr0, Luma2, ...
  </code></pre>
  
  <p>where 8-bit blue- and 8-bit red- difference chroma components are sampled with period 2, but 8-bit luma is sampled with period 1. For example: </p>
  
  <ol>
  <li>image pixel (0,0) has luma0, Cr0 red-difference chroma, Cb0 blue-difference chroma</li>
  <li>image pixel (0,1) has luma1, Cr0 red-difference chroma, Cb0 blue-difference chroma</li>
  <li>image pixel (0,2) has luma2, Cr1 red-difference chroma, Cb1 blue-difference chroma</li>
  <li>image pixel (0,3) has luma3, Cr1 red-difference chroma, Cb1 blue-difference chroma</li>
  <li>etc.</li>
  </ol>
  
  <p>RGBA array should be produced which is:</p>
  
  <pre><code>RGBA = R0, G0, B0, A0, R1, G1, ...
  </code></pre>
  
  <p>where all elements are unsigned chars and all bits of each A# are zero.</p>
  
  <p>Luma component in YCbYCr is 0..255 unsigned char, Cb and Cr are -127..+126 signed chars. There is a standard approach --- matrix multiplication, but it's very slow for real time apps and it operates with floating point numbers. I am looking for a fast approximate numerical method.</p>