Back to index

tetex-bin  3.0
Stream-CCITT.h
Go to the documentation of this file.
00001 //========================================================================
00002 //
00003 // Stream-CCITT.h
00004 //
00005 // Tables for CCITT Fax decoding.
00006 //
00007 // Copyright 1996-2003 Glyph & Cog, LLC
00008 //
00009 //========================================================================
00010 
00011 struct CCITTCode {
00012   short bits;
00013   short n;
00014 };
00015 
00016 #define ccittEOL -2
00017 
00018 //------------------------------------------------------------------------
00019 // 2D codes
00020 //------------------------------------------------------------------------
00021 
00022 #define twoDimPass   0
00023 #define twoDimHoriz  1
00024 #define twoDimVert0  2
00025 #define twoDimVertR1 3
00026 #define twoDimVertL1 4
00027 #define twoDimVertR2 5
00028 #define twoDimVertL2 6
00029 #define twoDimVertR3 7
00030 #define twoDimVertL3 8
00031 
00032 // 1-7 bit codes
00033 static CCITTCode twoDimTab1[128] = {
00034   {-1, -1}, {-1, -1},                      // 000000x
00035   {7, twoDimVertL3},                // 0000010
00036   {7, twoDimVertR3},                // 0000011
00037   {6, twoDimVertL2}, {6, twoDimVertL2},   // 000010x
00038   {6, twoDimVertR2}, {6, twoDimVertR2},   // 000011x
00039   {4, twoDimPass}, {4, twoDimPass},     // 0001xxx
00040     {4, twoDimPass}, {4, twoDimPass},
00041     {4, twoDimPass}, {4, twoDimPass},
00042     {4, twoDimPass}, {4, twoDimPass},
00043   {3, twoDimHoriz}, {3, twoDimHoriz},     // 001xxxx
00044     {3, twoDimHoriz}, {3, twoDimHoriz},
00045     {3, twoDimHoriz}, {3, twoDimHoriz},
00046     {3, twoDimHoriz}, {3, twoDimHoriz},
00047     {3, twoDimHoriz}, {3, twoDimHoriz},
00048     {3, twoDimHoriz}, {3, twoDimHoriz},
00049     {3, twoDimHoriz}, {3, twoDimHoriz},
00050     {3, twoDimHoriz}, {3, twoDimHoriz},
00051   {3, twoDimVertL1}, {3, twoDimVertL1},   // 010xxxx
00052     {3, twoDimVertL1}, {3, twoDimVertL1},
00053     {3, twoDimVertL1}, {3, twoDimVertL1},
00054     {3, twoDimVertL1}, {3, twoDimVertL1},
00055     {3, twoDimVertL1}, {3, twoDimVertL1},
00056     {3, twoDimVertL1}, {3, twoDimVertL1},
00057     {3, twoDimVertL1}, {3, twoDimVertL1},
00058     {3, twoDimVertL1}, {3, twoDimVertL1},
00059   {3, twoDimVertR1}, {3, twoDimVertR1},   // 011xxxx
00060     {3, twoDimVertR1}, {3, twoDimVertR1},
00061     {3, twoDimVertR1}, {3, twoDimVertR1},
00062     {3, twoDimVertR1}, {3, twoDimVertR1},
00063     {3, twoDimVertR1}, {3, twoDimVertR1},
00064     {3, twoDimVertR1}, {3, twoDimVertR1},
00065     {3, twoDimVertR1}, {3, twoDimVertR1},
00066     {3, twoDimVertR1}, {3, twoDimVertR1},
00067   {1, twoDimVert0}, {1, twoDimVert0},     // 1xxxxxx
00068     {1, twoDimVert0}, {1, twoDimVert0},
00069     {1, twoDimVert0}, {1, twoDimVert0},
00070     {1, twoDimVert0}, {1, twoDimVert0},
00071     {1, twoDimVert0}, {1, twoDimVert0},
00072     {1, twoDimVert0}, {1, twoDimVert0},
00073     {1, twoDimVert0}, {1, twoDimVert0},
00074     {1, twoDimVert0}, {1, twoDimVert0},
00075     {1, twoDimVert0}, {1, twoDimVert0},
00076     {1, twoDimVert0}, {1, twoDimVert0},
00077     {1, twoDimVert0}, {1, twoDimVert0},
00078     {1, twoDimVert0}, {1, twoDimVert0},
00079     {1, twoDimVert0}, {1, twoDimVert0},
00080     {1, twoDimVert0}, {1, twoDimVert0},
00081     {1, twoDimVert0}, {1, twoDimVert0},
00082     {1, twoDimVert0}, {1, twoDimVert0},
00083     {1, twoDimVert0}, {1, twoDimVert0},
00084     {1, twoDimVert0}, {1, twoDimVert0},
00085     {1, twoDimVert0}, {1, twoDimVert0},
00086     {1, twoDimVert0}, {1, twoDimVert0},
00087     {1, twoDimVert0}, {1, twoDimVert0},
00088     {1, twoDimVert0}, {1, twoDimVert0},
00089     {1, twoDimVert0}, {1, twoDimVert0},
00090     {1, twoDimVert0}, {1, twoDimVert0},
00091     {1, twoDimVert0}, {1, twoDimVert0},
00092     {1, twoDimVert0}, {1, twoDimVert0},
00093     {1, twoDimVert0}, {1, twoDimVert0},
00094     {1, twoDimVert0}, {1, twoDimVert0},
00095     {1, twoDimVert0}, {1, twoDimVert0},
00096     {1, twoDimVert0}, {1, twoDimVert0},
00097     {1, twoDimVert0}, {1, twoDimVert0},
00098     {1, twoDimVert0}, {1, twoDimVert0}
00099 };
00100 
00101 //------------------------------------------------------------------------
00102 // white run lengths
00103 //------------------------------------------------------------------------
00104 
00105 // 11-12 bit codes (upper 7 bits are 0)
00106 static CCITTCode whiteTab1[32] = {
00107   {-1, -1},                               // 00000
00108   {12, ccittEOL},                         // 00001
00109   {-1, -1}, {-1, -1},                            // 0001x
00110   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 001xx
00111   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 010xx
00112   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 011xx
00113   {11, 1792}, {11, 1792},                 // 1000x
00114   {12, 1984},                             // 10010
00115   {12, 2048},                             // 10011
00116   {12, 2112},                             // 10100
00117   {12, 2176},                             // 10101
00118   {12, 2240},                             // 10110
00119   {12, 2304},                             // 10111
00120   {11, 1856}, {11, 1856},                 // 1100x
00121   {11, 1920}, {11, 1920},                 // 1101x
00122   {12, 2368},                             // 11100
00123   {12, 2432},                             // 11101
00124   {12, 2496},                             // 11110
00125   {12, 2560}                              // 11111
00126 };
00127 
00128 // 1-9 bit codes
00129 static CCITTCode whiteTab2[512] = {
00130   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 0000000xx
00131   {8, 29}, {8, 29},                       // 00000010x
00132   {8, 30}, {8, 30},                       // 00000011x
00133   {8, 45}, {8, 45},                       // 00000100x
00134   {8, 46}, {8, 46},                       // 00000101x
00135   {7, 22}, {7, 22}, {7, 22}, {7, 22},            // 0000011xx
00136   {7, 23}, {7, 23}, {7, 23}, {7, 23},            // 0000100xx
00137   {8, 47}, {8, 47},                       // 00001010x
00138   {8, 48}, {8, 48},                       // 00001011x
00139   {6, 13}, {6, 13}, {6, 13}, {6, 13},            // 000011xxx
00140     {6, 13}, {6, 13}, {6, 13}, {6, 13},
00141   {7, 20}, {7, 20}, {7, 20}, {7, 20},            // 0001000xx
00142   {8, 33}, {8, 33},                       // 00010010x
00143   {8, 34}, {8, 34},                       // 00010011x
00144   {8, 35}, {8, 35},                       // 00010100x
00145   {8, 36}, {8, 36},                       // 00010101x
00146   {8, 37}, {8, 37},                       // 00010110x
00147   {8, 38}, {8, 38},                       // 00010111x
00148   {7, 19}, {7, 19}, {7, 19}, {7, 19},            // 0001100xx
00149   {8, 31}, {8, 31},                       // 00011010x
00150   {8, 32}, {8, 32},                       // 00011011x
00151   {6, 1}, {6, 1}, {6, 1}, {6, 1},         // 000111xxx
00152     {6, 1}, {6, 1}, {6, 1}, {6, 1},
00153   {6, 12}, {6, 12}, {6, 12}, {6, 12},            // 001000xxx
00154     {6, 12}, {6, 12}, {6, 12}, {6, 12},
00155   {8, 53}, {8, 53},                       // 00100100x
00156   {8, 54}, {8, 54},                       // 00100101x
00157   {7, 26}, {7, 26}, {7, 26}, {7, 26},            // 0010011xx
00158   {8, 39}, {8, 39},                       // 00101000x
00159   {8, 40}, {8, 40},                       // 00101001x
00160   {8, 41}, {8, 41},                       // 00101010x
00161   {8, 42}, {8, 42},                       // 00101011x
00162   {8, 43}, {8, 43},                       // 00101100x
00163   {8, 44}, {8, 44},                       // 00101101x
00164   {7, 21}, {7, 21}, {7, 21}, {7, 21},            // 0010111xx
00165   {7, 28}, {7, 28}, {7, 28}, {7, 28},            // 0011000xx
00166   {8, 61}, {8, 61},                       // 00110010x
00167   {8, 62}, {8, 62},                       // 00110011x
00168   {8, 63}, {8, 63},                       // 00110100x
00169   {8, 0}, {8, 0},                         // 00110101x
00170   {8, 320}, {8, 320},                            // 00110110x
00171   {8, 384}, {8, 384},                            // 00110111x
00172   {5, 10}, {5, 10}, {5, 10}, {5, 10},            // 00111xxxx
00173     {5, 10}, {5, 10}, {5, 10}, {5, 10},
00174     {5, 10}, {5, 10}, {5, 10}, {5, 10},
00175     {5, 10}, {5, 10}, {5, 10}, {5, 10},
00176   {5, 11}, {5, 11}, {5, 11}, {5, 11},            // 01000xxxx
00177     {5, 11}, {5, 11}, {5, 11}, {5, 11},
00178     {5, 11}, {5, 11}, {5, 11}, {5, 11},
00179     {5, 11}, {5, 11}, {5, 11}, {5, 11},
00180   {7, 27}, {7, 27}, {7, 27}, {7, 27},            // 0100100xx
00181   {8, 59}, {8, 59},                       // 01001010x
00182   {8, 60}, {8, 60},                       // 01001011x
00183   {9, 1472},                              // 010011000
00184   {9, 1536},                              // 010011001
00185   {9, 1600},                              // 010011010
00186   {9, 1728},                              // 010011011
00187   {7, 18}, {7, 18}, {7, 18}, {7, 18},            // 0100111xx
00188   {7, 24}, {7, 24}, {7, 24}, {7, 24},            // 0101000xx
00189   {8, 49}, {8, 49},                       // 01010010x
00190   {8, 50}, {8, 50},                       // 01010011x
00191   {8, 51}, {8, 51},                       // 01010100x
00192   {8, 52}, {8, 52},                       // 01010101x
00193   {7, 25}, {7, 25}, {7, 25}, {7, 25},            // 0101011xx
00194   {8, 55}, {8, 55},                       // 01011000x
00195   {8, 56}, {8, 56},                       // 01011001x
00196   {8, 57}, {8, 57},                       // 01011010x
00197   {8, 58}, {8, 58},                       // 01011011x
00198   {6, 192}, {6, 192}, {6, 192}, {6, 192}, // 010111xxx
00199     {6, 192}, {6, 192}, {6, 192}, {6, 192},
00200   {6, 1664}, {6, 1664}, {6, 1664}, {6, 1664},    // 011000xxx
00201     {6, 1664}, {6, 1664}, {6, 1664}, {6, 1664},
00202   {8, 448}, {8, 448},                            // 01100100x
00203   {8, 512}, {8, 512},                            // 01100101x
00204   {9, 704},                               // 011001100
00205   {9, 768},                               // 011001101
00206   {8, 640}, {8, 640},                            // 01100111x
00207   {8, 576}, {8, 576},                            // 01101000x
00208   {9, 832},                               // 011010010
00209   {9, 896},                               // 011010011
00210   {9, 960},                               // 011010100
00211   {9, 1024},                              // 011010101
00212   {9, 1088},                              // 011010110
00213   {9, 1152},                              // 011010111
00214   {9, 1216},                              // 011011000
00215   {9, 1280},                              // 011011001
00216   {9, 1344},                              // 011011010
00217   {9, 1408},                              // 011011011
00218   {7, 256}, {7, 256}, {7, 256}, {7, 256}, // 0110111xx
00219   {4, 2}, {4, 2}, {4, 2}, {4, 2},         // 0111xxxxx
00220     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00221     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00222     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00223     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00224     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00225     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00226     {4, 2}, {4, 2}, {4, 2}, {4, 2},
00227   {4, 3}, {4, 3}, {4, 3}, {4, 3},         // 1000xxxxx
00228     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00229     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00230     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00231     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00232     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00233     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00234     {4, 3}, {4, 3}, {4, 3}, {4, 3},
00235   {5, 128}, {5, 128}, {5, 128}, {5, 128}, // 10010xxxx
00236     {5, 128}, {5, 128}, {5, 128}, {5, 128},
00237     {5, 128}, {5, 128}, {5, 128}, {5, 128},
00238     {5, 128}, {5, 128}, {5, 128}, {5, 128},
00239   {5, 8}, {5, 8}, {5, 8}, {5, 8},         // 10011xxxx
00240     {5, 8}, {5, 8}, {5, 8}, {5, 8},
00241     {5, 8}, {5, 8}, {5, 8}, {5, 8},
00242     {5, 8}, {5, 8}, {5, 8}, {5, 8},
00243   {5, 9}, {5, 9}, {5, 9}, {5, 9},         // 10100xxxx
00244     {5, 9}, {5, 9}, {5, 9}, {5, 9},
00245     {5, 9}, {5, 9}, {5, 9}, {5, 9},
00246     {5, 9}, {5, 9}, {5, 9}, {5, 9},
00247   {6, 16}, {6, 16}, {6, 16}, {6, 16},            // 101010xxx
00248     {6, 16}, {6, 16}, {6, 16}, {6, 16},
00249   {6, 17}, {6, 17}, {6, 17}, {6, 17},            // 101011xxx
00250     {6, 17}, {6, 17}, {6, 17}, {6, 17},
00251   {4, 4}, {4, 4}, {4, 4}, {4, 4},         // 1011xxxxx
00252     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00253     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00254     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00255     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00256     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00257     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00258     {4, 4}, {4, 4}, {4, 4}, {4, 4},
00259   {4, 5}, {4, 5}, {4, 5}, {4, 5},         // 1100xxxxx
00260     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00261     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00262     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00263     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00264     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00265     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00266     {4, 5}, {4, 5}, {4, 5}, {4, 5},
00267   {6, 14}, {6, 14}, {6, 14}, {6, 14},            // 110100xxx
00268     {6, 14}, {6, 14}, {6, 14}, {6, 14},
00269   {6, 15}, {6, 15}, {6, 15}, {6, 15},            // 110101xxx
00270     {6, 15}, {6, 15}, {6, 15}, {6, 15},
00271   {5, 64}, {5, 64}, {5, 64}, {5, 64},            // 11011xxxx
00272     {5, 64}, {5, 64}, {5, 64}, {5, 64},
00273     {5, 64}, {5, 64}, {5, 64}, {5, 64},
00274     {5, 64}, {5, 64}, {5, 64}, {5, 64},
00275   {4, 6}, {4, 6}, {4, 6}, {4, 6},         // 1110xxxxx
00276     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00277     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00278     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00279     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00280     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00281     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00282     {4, 6}, {4, 6}, {4, 6}, {4, 6},
00283   {4, 7}, {4, 7}, {4, 7}, {4, 7},         // 1111xxxxx
00284     {4, 7}, {4, 7}, {4, 7}, {4, 7},
00285     {4, 7}, {4, 7}, {4, 7}, {4, 7},
00286     {4, 7}, {4, 7}, {4, 7}, {4, 7},
00287     {4, 7}, {4, 7}, {4, 7}, {4, 7},
00288     {4, 7}, {4, 7}, {4, 7}, {4, 7},
00289     {4, 7}, {4, 7}, {4, 7}, {4, 7},
00290     {4, 7}, {4, 7}, {4, 7}, {4, 7}
00291 };
00292 
00293 //------------------------------------------------------------------------
00294 // black run lengths
00295 //------------------------------------------------------------------------
00296 
00297 // 10-13 bit codes (upper 6 bits are 0)
00298 static CCITTCode blackTab1[128] = {
00299   {-1, -1}, {-1, -1},                                   // 000000000000x
00300   {12, ccittEOL}, {12, ccittEOL},                // 000000000001x
00301   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000001xx
00302   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000010xx
00303   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000011xx
00304   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000100xx
00305   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000101xx
00306   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000110xx
00307   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 00000000111xx
00308   {11, 1792}, {11, 1792}, {11, 1792}, {11, 1792},       // 00000001000xx
00309   {12, 1984}, {12, 1984},                        // 000000010010x
00310   {12, 2048}, {12, 2048},                        // 000000010011x
00311   {12, 2112}, {12, 2112},                        // 000000010100x
00312   {12, 2176}, {12, 2176},                        // 000000010101x
00313   {12, 2240}, {12, 2240},                        // 000000010110x
00314   {12, 2304}, {12, 2304},                        // 000000010111x
00315   {11, 1856}, {11, 1856}, {11, 1856}, {11, 1856},       // 00000001100xx
00316   {11, 1920}, {11, 1920}, {11, 1920}, {11, 1920},       // 00000001101xx
00317   {12, 2368}, {12, 2368},                        // 000000011100x
00318   {12, 2432}, {12, 2432},                        // 000000011101x
00319   {12, 2496}, {12, 2496},                        // 000000011110x
00320   {12, 2560}, {12, 2560},                        // 000000011111x
00321   {10, 18}, {10, 18}, {10, 18}, {10, 18},        // 0000001000xxx
00322     {10, 18}, {10, 18}, {10, 18}, {10, 18},
00323   {12, 52}, {12, 52},                                   // 000000100100x
00324   {13, 640},                                     // 0000001001010
00325   {13, 704},                                     // 0000001001011
00326   {13, 768},                                     // 0000001001100
00327   {13, 832},                                     // 0000001001101
00328   {12, 55}, {12, 55},                                   // 000000100111x
00329   {12, 56}, {12, 56},                                   // 000000101000x
00330   {13, 1280},                                    // 0000001010010
00331   {13, 1344},                                    // 0000001010011
00332   {13, 1408},                                    // 0000001010100
00333   {13, 1472},                                    // 0000001010101
00334   {12, 59}, {12, 59},                                   // 000000101011x
00335   {12, 60}, {12, 60},                                   // 000000101100x
00336   {13, 1536},                                    // 0000001011010
00337   {13, 1600},                                    // 0000001011011
00338   {11, 24}, {11, 24}, {11, 24}, {11, 24},        // 00000010111xx
00339   {11, 25}, {11, 25}, {11, 25}, {11, 25},        // 00000011000xx
00340   {13, 1664},                                    // 0000001100100
00341   {13, 1728},                                    // 0000001100101
00342   {12, 320}, {12, 320},                                 // 000000110011x
00343   {12, 384}, {12, 384},                                 // 000000110100x
00344   {12, 448}, {12, 448},                                 // 000000110101x
00345   {13, 512},                                     // 0000001101100
00346   {13, 576},                                     // 0000001101101
00347   {12, 53}, {12, 53},                                   // 000000110111x
00348   {12, 54}, {12, 54},                                   // 000000111000x
00349   {13, 896},                                     // 0000001110010
00350   {13, 960},                                     // 0000001110011
00351   {13, 1024},                                    // 0000001110100
00352   {13, 1088},                                    // 0000001110101
00353   {13, 1152},                                    // 0000001110110
00354   {13, 1216},                                    // 0000001110111
00355   {10, 64}, {10, 64}, {10, 64}, {10, 64},        // 0000001111xxx
00356     {10, 64}, {10, 64}, {10, 64}, {10, 64}
00357 };
00358 
00359 // 7-12 bit codes (upper 4 bits are 0)
00360 static CCITTCode blackTab2[192] = {
00361   {8, 13}, {8, 13}, {8, 13}, {8, 13},                   // 00000100xxxx
00362     {8, 13}, {8, 13}, {8, 13}, {8, 13},
00363     {8, 13}, {8, 13}, {8, 13}, {8, 13},
00364     {8, 13}, {8, 13}, {8, 13}, {8, 13},
00365   {11, 23}, {11, 23},                                   // 00000101000x
00366   {12, 50},                                      // 000001010010
00367   {12, 51},                                      // 000001010011
00368   {12, 44},                                      // 000001010100
00369   {12, 45},                                      // 000001010101
00370   {12, 46},                                      // 000001010110
00371   {12, 47},                                      // 000001010111
00372   {12, 57},                                      // 000001011000
00373   {12, 58},                                      // 000001011001
00374   {12, 61},                                      // 000001011010
00375   {12, 256},                                     // 000001011011
00376   {10, 16}, {10, 16}, {10, 16}, {10, 16},        // 0000010111xx
00377   {10, 17}, {10, 17}, {10, 17}, {10, 17},        // 0000011000xx
00378   {12, 48},                                      // 000001100100
00379   {12, 49},                                      // 000001100101
00380   {12, 62},                                      // 000001100110
00381   {12, 63},                                      // 000001100111
00382   {12, 30},                                      // 000001101000
00383   {12, 31},                                      // 000001101001
00384   {12, 32},                                      // 000001101010
00385   {12, 33},                                      // 000001101011
00386   {12, 40},                                      // 000001101100
00387   {12, 41},                                      // 000001101101
00388   {11, 22}, {11, 22},                                   // 00000110111x
00389   {8, 14}, {8, 14}, {8, 14}, {8, 14},                   // 00000111xxxx
00390     {8, 14}, {8, 14}, {8, 14}, {8, 14},
00391     {8, 14}, {8, 14}, {8, 14}, {8, 14},
00392     {8, 14}, {8, 14}, {8, 14}, {8, 14},
00393   {7, 10}, {7, 10}, {7, 10}, {7, 10},                   // 0000100xxxxx
00394     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00395     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00396     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00397     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00398     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00399     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00400     {7, 10}, {7, 10}, {7, 10}, {7, 10},
00401   {7, 11}, {7, 11}, {7, 11}, {7, 11},                   // 0000101xxxxx
00402     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00403     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00404     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00405     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00406     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00407     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00408     {7, 11}, {7, 11}, {7, 11}, {7, 11},
00409   {9, 15}, {9, 15}, {9, 15}, {9, 15},                   // 000011000xxx
00410     {9, 15}, {9, 15}, {9, 15}, {9, 15},
00411   {12, 128},                                     // 000011001000
00412   {12, 192},                                     // 000011001001
00413   {12, 26},                                      // 000011001010
00414   {12, 27},                                      // 000011001011
00415   {12, 28},                                      // 000011001100
00416   {12, 29},                                      // 000011001101
00417   {11, 19}, {11, 19},                                   // 00001100111x
00418   {11, 20}, {11, 20},                                   // 00001101000x
00419   {12, 34},                                      // 000011010010
00420   {12, 35},                                      // 000011010011
00421   {12, 36},                                      // 000011010100
00422   {12, 37},                                      // 000011010101
00423   {12, 38},                                      // 000011010110
00424   {12, 39},                                      // 000011010111
00425   {11, 21}, {11, 21},                                   // 00001101100x
00426   {12, 42},                                      // 000011011010
00427   {12, 43},                                      // 000011011011
00428   {10, 0}, {10, 0}, {10, 0}, {10, 0},                   // 0000110111xx
00429   {7, 12}, {7, 12}, {7, 12}, {7, 12},                   // 0000111xxxxx
00430     {7, 12}, {7, 12}, {7, 12}, {7, 12},
00431     {7, 12}, {7, 12}, {7, 12}, {7, 12},
00432     {7, 12}, {7, 12}, {7, 12}, {7, 12},
00433     {7, 12}, {7, 12}, {7, 12}, {7, 12},
00434     {7, 12}, {7, 12}, {7, 12}, {7, 12},
00435     {7, 12}, {7, 12}, {7, 12}, {7, 12},
00436     {7, 12}, {7, 12}, {7, 12}, {7, 12}
00437 };
00438 
00439 // 2-6 bit codes
00440 static CCITTCode blackTab3[64] = {
00441   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},        // 0000xx
00442   {6, 9},                                        // 000100
00443   {6, 8},                                        // 000101
00444   {5, 7}, {5, 7},                                // 00011x
00445   {4, 6}, {4, 6}, {4, 6}, {4, 6},                // 0010xx
00446   {4, 5}, {4, 5}, {4, 5}, {4, 5},                // 0011xx
00447   {3, 1}, {3, 1}, {3, 1}, {3, 1},                // 010xxx
00448     {3, 1}, {3, 1}, {3, 1}, {3, 1},
00449   {3, 4}, {3, 4}, {3, 4}, {3, 4},                // 011xxx
00450     {3, 4}, {3, 4}, {3, 4}, {3, 4},
00451   {2, 3}, {2, 3}, {2, 3}, {2, 3},                // 10xxxx
00452     {2, 3}, {2, 3}, {2, 3}, {2, 3},
00453     {2, 3}, {2, 3}, {2, 3}, {2, 3},
00454     {2, 3}, {2, 3}, {2, 3}, {2, 3},
00455   {2, 2}, {2, 2}, {2, 2}, {2, 2},                // 11xxxx
00456     {2, 2}, {2, 2}, {2, 2}, {2, 2},
00457     {2, 2}, {2, 2}, {2, 2}, {2, 2},
00458     {2, 2}, {2, 2}, {2, 2}, {2, 2}
00459 };