- const unsigned int *src = src_;
- unsigned int *dst = dst_;
- unsigned int p;
- int x;
-
- for (x = 0; x < bytes / 4; x++) {
- p = src[x];
- p = ((p & 0x7c007c00) >> 10) | ((p & 0x03e003e0) << 1)
- | ((p & 0x001f001f) << 11);
- dst[x] = p;
- }
+ const unsigned int *src = src_;
+ unsigned int *dst = dst_;
+ unsigned int x, p, r, g, b;
+
+ for (x = 0; x < bytes / 4; x++) {
+ p = LE16TOHx2(src[x]);
+
+ r = (p & 0x001f001f) << 11;
+ g = (p & 0x03e003e0) << 1;
+ b = (p & 0x7c007c00) >> 10;
+
+ dst[x] = r | g | b;
+ }