<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Apr 2, 2007, at 10:51 PM, Luis Ibanez wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BR><BR>Hi David,<BR><BR><BR>            Yeap, an experiment confirms that I'm wrong.<BR><BR><BR>I just ran a profile of the time that it takes to convert YUV to RGB<BR>using the code that you contributed to the vtkWin32VideoSource.cxx .<BR><BR>For the same machine of my previous email, and an image of 1024 x 768 pixels<BR>the timing is:  <BR><BR>                                          32 milliseconds.<BR><BR><BR>Attached is the code that I used for profiling the conversion. <BR><BR>That code produced the following output:<BR><BR><BR style="font-family: courier new,monospace;"><SPAN style="font-family: courier new,monospace;">Probe Tag    Starts    Stops           Time</SPAN><BR style="font-family: courier new,monospace;"> <SPAN style="font-family: courier new,monospace;">Conversion     1         1         0.0319588</SPAN><BR style="font-family: courier new,monospace;"><SPAN style="font-family: courier new,monospace;">FillBuffer     1         1         0.00697708</SPAN><BR style="font-family: courier new,monospace;"><BR><BR><BR><BR>I would insist however in that any discussion related to performance<BR>must be based on numbers that we have measured using repeatable<BR>experiments. Otherwise we will start looking like reviewers of decadent <BR>Journals.<BR></BLOCKQUOTE><DIV>Thanks for the update Luis and David.</DIV><DIV>Point taken Luis, we agree 100% that a decision should be taken based on figures/facts whenever possible.</DIV><DIV>Still, I'm hoping that a discussion can be raised/started without having all the hard data on the table (what an how to measure</DIV><DIV>could be one of the points discussed....).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- Frank </DIV><BR><BLOCKQUOTE type="cite"><BR><BR><BR>    Regards,<BR><BR><BR>         Luis<BR><BR><BR>-----------------------------------------------------------------------------------<BR><DIV><SPAN class="gmail_quote">On 4/2/07, <B class="gmail_sendername"> David Gobbi</B> <<A href="mailto:dgobbi@atamai.com">dgobbi@atamai.com</A>> wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi Luis,<BR><BR>I missed the T-con last Thursday, so I might be a little bit<BR>out-of-context, but the cost of the color conversion will vary<BR>quite a bit depending on exactly which conversion is being<BR>done (as well as on how the conversion code is optimized). <BR><BR>The most expensive conversions are from YUV to RGB and<BR>back again, since they essentially require a 3x3 matrix multiplication<BR>plus 3 clamp operations per pixel.   Also, these conversions<BR>are lossy in both directions. <BR><BR>Conversion from greyscale to YUV or RGB is very cheap,<BR>essentially equivalent to a copy.  Going back to from these to<BR>greyscale is a bit more expensive.<BR><BR>In any case, even 15 milliseconds is longer than we can afford to <BR>color-convert a frame if the computer is also doing other tasks at the<BR>same time, so Frank is probably right that we need the frame buffer<BR>to support different formats in order to eliminate the need for<BR>conversion.  At the GPU end of things, VTK can handle either <BR>gray or RGB/RGBA textures right now.<BR><BR> - David<BR><BR><BR>Luis Ibanez wrote:<BR>><BR>> Just a quick follow up on our discussion regarding the performance<BR>> of conversion between color systems.<BR>> <BR>> Here is a profile that we got for another project where we are using the<BR>> FFMPEG library for compressing and decompressing video sequences.<BR>><BR>><BR>> In  that particular case we have:<BR>> <BR>> 1) Image size 1024 x 768 pixels, greyscale, 1 byte per pixel<BR>><BR>> 2) Computer<BR>> 2.1)  Dell Precision 450 workstation<BR>> 2.2) with dual processor Intel Xeon at 2.4GHz<BR>> 2.3) with 3Gb of RAM <BR>> 2.4) Linux Debian<BR>> 2.5) Using the gcc compiler with -O3<BR>><BR>><BR>> With this configuration it takes 30 milliseconds to do<BR>> the following:<BR>><BR>> 0) Copy the input image into another buffer <BR>> 1) Convert the grayscale image into YUV,<BR>> 2) Compress the image using the Flash video codec<BR>> 3) Decompress the image using the Flash video codec<BR>> 4) Convert the decompressed image back from YUV to grayscale. <BR>><BR>><BR>> We have not profiled the conversion in isolation, but the<BR>> fact that two color format conversions plus video<BR>> compression and decompression fit in 30 milliseconds,<BR>> give us some indication on how much the color format <BR>> conversion alone could take.<BR>><BR>><BR>>      Luis<BR>><BR>><BR>><BR>> ---------------------------------------------------<BR>> On 3/29/07, *Patrick Cheng* < <A href="mailto:cheng@isis.georgetown.edu"> cheng@isis.georgetown.edu</A><BR>> <mailto:<A href="mailto:cheng@isis.georgetown.edu">cheng@isis.georgetown.edu</A>>> wrote:<BR>><BR>>     Hi everybody,<BR>><BR>>     Here is the minutes for discussion on VideoGrabber continued from <BR>>     last week:<BR>><BR>>     <A href="http://public.kitware.com/IGSTKWIKI/index.php/Minutes_032907">http://public.kitware.com/IGSTKWIKI/index.php/Minutes_032907</A><BR>><BR>>     Patrick<BR>>     _______________________________________________ <BR>>     IGSTK-Developers mailing list<BR>>     <A href="mailto:IGSTK-Developers@public.kitware.com">IGSTK-Developers@public.kitware.com</A><BR>>     <mailto:<A href="mailto:IGSTK-Developers@public.kitware.com"> IGSTK-Developers@public.kitware.com</A>><BR>>     <A href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers</A><BR>>     < <A href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers</A>><BR>><BR>><BR>> ------------------------------------------------------------------------ <BR>><BR>> _______________________________________________<BR>> IGSTK-Developers mailing list<BR>> <A href="mailto:IGSTK-Developers@public.kitware.com">IGSTK-Developers@public.kitware.com</A><BR>> <A href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers"> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers</A><BR><BR></BLOCKQUOTE></DIV><BR><SPAN><DIV><colorConversionProfiling.cxx></DIV></SPAN><SPAN><DIV><CMakeLists.txt></DIV></SPAN><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">IGSTK-Developers mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:IGSTK-Developers@public.kitware.com">IGSTK-Developers@public.kitware.com</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>