This patch replaces Sop_lut8_to_Dacc() with a simpler version which at
least on my system is significantly faster.

-- 
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
--- DirectFB/src/gfx/generic/generic.c  2003-03-19 15:28:43.000000000 +0200
+++ DirectFB/src/gfx/generic/generic.c  2003-03-19 15:32:33.000000000 +0200
@@ -1411,12 +1411,6 @@
 }
 #endif
 
-#define LOOKUP_COLOR(D,S)     \
-     D.a = entries[S].a;      \
-     D.r = entries[S].r;      \
-     D.g = entries[S].g;      \
-     D.b = entries[S].b;
-
 static void Sop_lut8_to_Dacc()
 {
      int          w = Dlength;
@@ -1425,32 +1419,15 @@
 
      DFBColor *entries = Slut->entries;
 
-     while (w) {
-          int l = w & 7;
+     while (w--) {
+          __u8 s = *S++;
+
+          D->a = entries[s].a;
+          D->r = entries[s].r;
+          D->g = entries[s].g;
+          D->b = entries[s].b;
 
-          switch (l) {
-               default:
-                    l = 8;
-                    LOOKUP_COLOR( D[7], S[7] );
-               case 7:
-                    LOOKUP_COLOR( D[6], S[6] );
-               case 6:
-                    LOOKUP_COLOR( D[5], S[5] );
-               case 5:
-                    LOOKUP_COLOR( D[4], S[4] );
-               case 4:
-                    LOOKUP_COLOR( D[3], S[3] );
-               case 3:
-                    LOOKUP_COLOR( D[2], S[2] );
-               case 2:
-                    LOOKUP_COLOR( D[1], S[1] );
-               case 1:
-                    LOOKUP_COLOR( D[0], S[0] );
-          }
-
-          D += l;
-          S += l;
-          w -= l;
+          D++;
      }
 }
 

Reply via email to