title: format conversion
body: <p>In OpenGL ES 2.0 after reading the framebuffer and converting it to RGBA frames. I want to convert it to YUV format.</p>
  
  <p>I tried using this <a href="http://www.fourcc.org/fccyvrgb.php" rel="nofollow">table</a>. Which ignore alpha component. When i do that and see the YUV frame generated its distorted.</p>
  
  <p>Can anyone help me please</p>
  
  <pre><code>yuvdata[i * j *1]= (0.257)*memory[i*j*1] + (0.504)*memory[i*j*2]+(0.098)*memory[i*j*3]+16;
  yuvdata[i * j *3]= (0.439)*memory[i*j*1] - (0.368)*memory[i*j*2] -(0.071)*memory[i*j*3]+128;
  yuvdata[i * j *2]= -(0.148)*memory[i*j*1] - (0.291)*memory[i*j*2] +(0.439)*memory[i*j*3]+128;
  </code></pre>
  
  <p>`</p>
  
  <p>Normalization did not help
  memory store rgba
  and yuv is free space to store yuv</p>
  
  <p>i used rgb to yuv conversion ignoring alpha component</p>
  
  <p>Friends this problem is resolved. This article is awesome<a href="http://en.wikipedia.org/wiki/YUV#Converting_between_Y.27UV_and_RGB" rel="nofollow">yuv2rgb</a>. Thanks to Viktor Latypov and Mārtiņš Možeiko</p>