title: How to use OpenGL fragment shader to convert RGB to YUV420
body: <p>I know how to code a shader that converts planar data (YUV420 image) to packed one (RGB image) using fragment shader, yet how do I code the RGB to YUV420.
  I do not need the YUV420 image for rendering but to pass it to the h264 compression code.</p>