br.c

Mon, 26 Aug 2002 05:43:49 +0000

author
eric
date
Mon, 26 Aug 2002 05:43:49 +0000
changeset 47
bfc6aaa089b0
parent 41
2350a4b7393c
permissions
-rw-r--r--

fixed 'middle-endian' output from TIFFReadScanline

     1 #include <stdio.h>
     3 int main (int argc, char *argv[])
     4 {
     5   int i, j;
     7   printf ("static const u8 bit_reverse_byte [0x100] =\n");
     8   printf ("{\n");
     9   for (i = 0; i < 0x100; i++)
    10     {
    11       if ((i & 7) == 0)
    12 	printf ("  ");
    13       j = (((i & 0x01) << 7) |
    14 	   ((i & 0x02) << 5) |
    15 	   ((i & 0x04) << 3) |
    16 	   ((i & 0x08) << 1) |
    17 	   ((i & 0x10) >> 1) |
    18 	   ((i & 0x20) >> 3) |
    19 	   ((i & 0x40) >> 5) |
    20 	   ((i & 0x80) >> 7));
    21       printf ("0x%02x", j);
    22       if (i != 0xff)
    23 	printf (",");
    24       if ((i & 7) == 7)
    25 	printf ("\n");
    26       else
    27 	printf (" ");
    28     }
    29   printf ("};\n");
    30   return (0);
    31 }