10 bit? why not 16?
"Greg Blair" <[email protected]> Fri, 24 Oct 2008 11:32:07 -0400
| Newsgroups | gmane.comp.video.cinepaint.devel |
|---|---|
| Message-ID | <[email protected]> |
Using OpenGL, it is so easy to use GL_UNSIGNED_INT_2_10_10_10_REV for
10 bit but just as easy to use GL_RGBA with GL_UNSIGNED_SHORT or
GL_FLOAT for 16 or 32 bit support.
Using GL_RGBA in place of GL_UNSIGNED_INT_2_10_10_10_REV avoids all
those slow bit shifting and masking operations.
Instead of using something like
typedef {unsigned short r:10, g:10, b:10, a:2} pix10bit;
use
typedef {unsigned short r, g, b, a} pix16bit;
Look at the assembler code generated with both methods and you with
see the nasty bit shift and mask operations with the pix10bit
approach. Benchmarking, pix10bit is several time slower compared to
pix16bit.
Greg Blair
--
Please update your address book. My email address has changed.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/