How can I convert RGB16 to BGRA colors using SSE2?

From: Teis Draiby (spamtrap_at_crayne.org)
Date: 02/25/05


Date: Thu, 24 Feb 2005 23:11:44 +0000 (UTC)

How can I convert 16 bit RGB565 colors to 32 bit BGRA colors using SSE2.
Consider a 16 bit RGB565 pixel loaded into the lower part of each of the
four doublewords:

00000000 00000000 RRRRRGGG GGGBBBBB
 (This is one 32 bit doubleword, bitwise)

This should end up like this:

BBBBB000 GGGGGG00 RRRRR000 00000000 (32 bit BGRA)
(The individual order of each of the R, G and B values remains the same)

thank you VERY much, Teis