00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef TABLES_H
00040 #define TABLES_H
00041
00042
00043
00044
00045
00046 const int SIZE_BYTE = 8;
00047 const int SIZE_INT = sizeof(int);
00048 const int SIZE_UINT = sizeof(unsigned int);
00049 const int SIZE_USHORT = sizeof(unsigned short);
00050
00051 const int SHORT_PER_INT = SIZE_UINT / SIZE_USHORT;
00052 const int BITS_PER_INT = SIZE_UINT * SIZE_BYTE;
00053 const int BITS_PER_SHORT = SIZE_USHORT * SIZE_BYTE;
00054
00055
00056
00057 const unsigned int Bit32Table[32] =
00058 {
00059 2147483648UL, 1073741824UL, 536870912UL, 268435456UL,
00060 134217728, 67108864, 33554432, 16777216,
00061 8388608, 4194304, 2097152, 1048576,
00062 524288, 262144, 131072, 65536,
00063 32768, 16384, 8192, 4096,
00064 2048, 1024, 512, 256,
00065 128, 64, 32, 16,
00066 8, 4, 2, 1
00067 };
00068
00069
00070 const int Bit16Table[16] =
00071 {
00072 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1
00073 };
00074
00075
00076
00077 const char CountTable[256] =
00078 {
00079 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1,
00080 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1,
00081 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2,
00082 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
00083 };
00084
00085
00086
00087 #endif