Convert from BGRA to RGBA using MMX

From: Pedro Ferreira (spamtrap_at_crayne.org)
Date: 02/22/05


Date: Tue, 22 Feb 2005 19:41:57 +0000 (UTC)

Is there a simple (optimized) way to convert an image in BGRA to RGBA?
>>From the initial value:
B G R A
exchange only the first byte with the third:
R G B A

My friend Chris sugested this method:
1. exchange first byte with second and third byte with fourth
result -> G B A R
2. right rotation of one byte
result -> R G B A

How can I do this with MMX instructions?

Many thanks in advance,
Pedro