#include <stdlib.h>\r
\r
#if !defined LOWMEM && defined __GNUC__\r
-static uint8_t filterlut[1 << 20];\r
+uint8_t filterlut[1 << 20];\r
static void __attribute__((constructor)) fill_lut()\r
{\r
- uint32_t i;\r
- for(i = 0; i < 1 << 20; ++i)\r
- filterlut[i] = filter(i);\r
+ uint32_t x;\r
+ uint32_t f;\r
+ for(x = 0; x < 1 << 20; ++x) {\r
+ f = 0xf22c0 >> (x & 0xf) & 16;\r
+ f |= 0x6c9c0 >> (x >> 4 & 0xf) & 8;\r
+ f |= 0x3c8b0 >> (x >> 8 & 0xf) & 4;\r
+ f |= 0x1e458 >> (x >> 12 & 0xf) & 2;\r
+ f |= 0x0d938 >> (x >> 16 & 0xf) & 1;\r
+ filterlut[x] = BIT(0xEC57E80A, f);\r
+ }\r
}\r
-#define filter(x) (filterlut[(x) & 0xfffff])\r
#endif\r
\r
\r