   YUY2-RGB
  Hy!I need to convert an image stored (in memory) in YUY2 (aka YUYV) format to RGB.Any ideas? This is not file to file conversion, I get the data from a webcam, witch does not have RGB24 support!! Only YUY2 (16bits).THX!   
  You need an appropriate codec.  There are a number of implementations of that codec available.  Which one you use depends on the rest of your infrastructure (eg. platform, codec stack, API).   ;  That's good. But I don't want to use any external codecs. Any other ides?   ;  The alternative is that you write your own codec.  Here is a good place to start you research.  Keep in mind that colourspace conversion is CPU intensive.  You might do well to brush up on advanced techniques in numeric methods and maybe DSP programming techniques if you want to get more than a frame every few seconds.  But certainly you can do it yourself.   ;  It looks good. Thanks!   ;  Some time ago I wrote a code for that. Can't assure you that code is 100% correct. ;)typedef unsigned char byte;void YUY2ToRGB( const byte* src, int len, byte* dst ){// ...for ( int i = 0; i < len; i += 4 ){int C = 298 * ( src - 16 );int D = src[i+1] - 128;int D1 = 516 * D;int E = src[i+3] - 128;int E1 = 208 * E;D *= 100;E *= 409;*dst++ = Clamp( 0, 255, ( ( C + E + 128 ) >> 8 ) );*dst++ = Clamp( 0, 255, ( ( C - D - E1 + 128 ) >> 8 ) );*dst++ = Clamp( 0, 255, ( ( C + D1 + 128 ) >> 8 ) );C = 298 * src[i+2];*dst++ = Clamp( 0, 255, ( ( C + E + 128 ) >> 8 ) );*dst++ = Clamp( 0, 255, ( ( C - D - E1 + 128 ) >> 8 ) );*dst++ = Clamp( 0, 255, ( ( C + D1 + 128 ) >> 8 ) );}}