From: Greg Blair X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: sci.image.processing Subject: Re: RGB -> YIQ(4:2:2, 4:2:0) Source Code ? References: <9h1a6l$kfa$1@imsinews.kornet.net> Content-Type: multipart/alternative; boundary="------------1169D20BB161A76B26CB906D" Lines: 441 Date: Sat, 23 Jun 2001 13:54:11 -0400 NNTP-Posting-Host: 64.229.70.68 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 993318593 64.229.70.68 (Sat, 23 Jun 2001 13:49:53 EDT) NNTP-Posting-Date: Sat, 23 Jun 2001 13:49:53 EDT Organization: Bell Sympatico Xref: cyclone.swbell.net sci.image.processing:20873 --------------1169D20BB161A76B26CB906D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello kevin, YIQ is only used in encoding/decoding NTSC composite video. For digital, you most likely need what is commonly referred to as YUV or more correctly Y'CbCr. This is the format used in Rec 609 video, commonly referred to as D1 video. // see http://home.earthlink.net/~janos1/vidpage/color_faq.html // +----------------+---------------+-----------------+----------------+ // | Recommendation | Coef. for red | Coef. for Green | Coef. for Blue | // +----------------+---------------+-----------------+----------------+ // | Rec 601-1 | 0.2989 | 0.5866 | 0.1145 | // | Rec 709 | 0.2125 | 0.7154 | 0.0721 | // | SMPTE 295M-1997| 0.2126 | 0.7152 | 0.0722 | // | ITU | 0.2220 | 0.7067 | 0.0713 | // +----------------+---------------+-----------------+----------------+ // (use Rec 601 for SDTV and SMPTE 295M (4th decimal difference from Rec 709) for HDTV) // RGB -> YCbCr // Y = Coef. for red*Red+Coef. for green*Green+Coef. for blue*Blue // Cb = (Blue-Y)/(2-2*Coef. for blue) // Cr = (Red-Y)/(2-2*Coef. for red) // YCbCr -> RGB // Red = Cr*(2-2*Coef. for red)+Y // Green = (Y-Coef. for blue*Blue-Coef. for red*Red)/Coef. for green // Blue = Cb*(2-2*Coef. for blue)+Y void RGBto422 (unsigned char *rgb, unsigned char *yuv, int width, int height) { int r, g, b, Y1, Cb1, Cr1, Y2, Cb2, Cr2, x, y; for(y = 0; y Dear All! > > I am looking for Source Code of RGB -> YIQ(4:2:2, 4:2:0).