<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
<BR>
<BR>
On Thu, 2011-05-12 at 18:09 +0400, Dmitriy K wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Is there any examples of this conversion? 
I've found YUV_TO_RGB1 and YUV_TO_RGB2 in libavcodec/colorspace.h in documentation, but there is no this file in my system.
_______________________________________________
Libav-user mailing list
<A HREF="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</A>
<A HREF="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</A>
</PRE>
</BLOCKQUOTE>
<BR>
<BR>
here's a snippet from our code that does the conversion. Note how we clamp the range from 0 to 255. Sorry about the integer math. Also be careful as I'm not positive we're RGB...I have this vague recollection that the next step in our process expects BGRA  data. Your mileage may vary....<BR>
<BR>
<BR>
        res = ((Y * 1000) + (1574 * Pr)) / 1000;<BR>
        if ( res > 255 ) res = 255;<BR>
        if ( res < 0 ) res = 0;<BR>
        *(bufptr+(i*4))   = res;<BR>
        res = ((Y * 1000) - (187 * Pb) - (468 * Pr)) / 1000; <BR>
        if ( res > 255 ) res = 255;<BR>
        if ( res < 0 ) res = 0;<BR>
        *(bufptr+(i*4)+1) = res;<BR>
        res = ((Y * 1000) + (1855 * Pb)) / 1000;<BR>
        if ( res > 255 ) res = 255;<BR>
        if ( res < 0 ) res = 0;<BR>
        *(bufptr+(i*4)+2) = res;<BR>
<BR>
</BODY>
</HTML>