Home | History | Annotate | Download | only in jbig2
      1 // Copyright 2014 PDFium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
      6 
      7 #ifndef _JBIG2_HUFFMAN_TABLE_STANDARD_H_
      8 #define _JBIG2_HUFFMAN_TABLE_STANDARD_H_
      9 typedef struct {
     10     int PREFLEN;
     11     int RANDELEN;
     12     int RANGELOW;
     13 } JBig2TableLine;
     14 const FX_BOOL HuffmanTable_HTOOB_B1 = FALSE;
     15 const JBig2TableLine HuffmanTable_B1[] = {
     16     { 1,	4,		0 },
     17     { 2,	8,	   16 },
     18     { 3,   16,	  272 },
     19     { 0,   32,	   -1 },
     20     { 3,   32,	65808 }
     21 };
     22 const FX_BOOL HuffmanTable_HTOOB_B2 = TRUE;
     23 const JBig2TableLine HuffmanTable_B2[] = {
     24     { 1,	0,		0 },
     25     { 2,	0,		1 },
     26     { 3,	0,		2 },
     27     { 4,	3,		3 },
     28     { 5,	6,	   11 },
     29     { 0,   32,	   -1 },
     30     { 6,   32,     75 },
     31     { 6,	0,      0 }
     32 };
     33 const FX_BOOL HuffmanTable_HTOOB_B3 = TRUE;
     34 const JBig2TableLine HuffmanTable_B3[] = {
     35     { 8,	8,   -256 },
     36     { 1,	0,		0 },
     37     { 2,	0,		1 },
     38     { 3,	0,		2 },
     39     { 4,	3,		3 },
     40     { 5,	6,	   11 },
     41     { 8,   32,   -257 },
     42     { 7,   32,     75 },
     43     { 6,	0,		0 }
     44 };
     45 const FX_BOOL HuffmanTable_HTOOB_B4 = FALSE;
     46 const JBig2TableLine HuffmanTable_B4[] = {
     47     { 1,	0,		1 },
     48     { 2,	0,		2 },
     49     { 3,	0,		3 },
     50     { 4,	3,		4 },
     51     { 5,	6,	   12 },
     52     { 0,   32,     -1 },
     53     { 5,   32,	   76 },
     54 };
     55 const FX_BOOL HuffmanTable_HTOOB_B5 = FALSE;
     56 const JBig2TableLine HuffmanTable_B5[] = {
     57     { 7,	8,	 -255 },
     58     { 1,	0,	    1 },
     59     { 2,	0,	    2 },
     60     { 3,    0,      3 },
     61     { 4,	3,	    4 },
     62     { 5,	6,	   12 },
     63     { 7,   32,   -256 },
     64     { 6,   32,     76 }
     65 };
     66 const FX_BOOL HuffmanTable_HTOOB_B6 = FALSE;
     67 const JBig2TableLine HuffmanTable_B6[] = {
     68     { 5,   10,	-2048 },
     69     { 4,    9,	-1024 },
     70     { 4,	8,	 -512 },
     71     { 4,	7,	 -256 },
     72     { 5,	6,	 -128 },
     73     { 5,	5,	  -64 },
     74     { 4,	5,	  -32 },
     75     { 2,	7,		0 },
     76     { 3,	7,	  128 },
     77     { 3,	8,	  256 },
     78     { 4,	9,	  512 },
     79     { 4,   10,	 1024 },
     80     { 6,   32,	-2049 },
     81     { 6,   32,	 2048 }
     82 };
     83 const FX_BOOL HuffmanTable_HTOOB_B7 = FALSE;
     84 const JBig2TableLine HuffmanTable_B7[] = {
     85     { 4,	9,	-1024 },
     86     { 3,	8,	 -512 },
     87     { 4,	7,	 -256 },
     88     { 5,	6,	 -128 },
     89     { 5,	5,	  -64 },
     90     { 4,	5,	  -32 },
     91     { 4,	5,		0 },
     92     { 5,	5,	   32 },
     93     { 5,	6,	   64 },
     94     { 4,	7,	  128 },
     95     { 3,	8,	  256 },
     96     { 3,	9,	  512 },
     97     { 3,   10,	 1024 },
     98     { 5,   32,	-1025 },
     99     { 5,   32,	 2048 },
    100 };
    101 const FX_BOOL HuffmanTable_HTOOB_B8 = TRUE;
    102 const JBig2TableLine HuffmanTable_B8[] = {
    103     { 8,	3,	  -15 },
    104     { 9,	1,	   -7 },
    105     { 8,	1,	   -5 },
    106     { 9,	0,	   -3 },
    107     { 7,	0,	   -2 },
    108     { 4,	0,	   -1 },
    109     { 2,	1,		0 },
    110     { 5,	0,		2 },
    111     { 6,	0,		3 },
    112     { 3,	4,		4 },
    113     { 6,	1,	   20 },
    114     { 4,	4,	   22 },
    115     { 4,	5,	   38 },
    116     { 5,	6,	   70 },
    117     { 5,	7,	  134 },
    118     { 6,	7,	  262 },
    119     { 7,	8,	  390 },
    120     { 6,   10,	  646 },
    121     { 9,   32,	  -16 },
    122     { 9,   32,	 1670 },
    123     { 2,	0,		0 }
    124 };
    125 const FX_BOOL HuffmanTable_HTOOB_B9 = TRUE;
    126 const JBig2TableLine HuffmanTable_B9[] = {
    127     { 8,	4,	  -31 },
    128     { 9,	2,	  -15 },
    129     { 8,	2,	  -11 },
    130     { 9,	1,	   -7 },
    131     { 7,	1,	   -5 },
    132     { 4,	1,	   -3 },
    133     { 3,	1,	   -1 },
    134     { 3,	1,		1 },
    135     { 5,	1,		3 },
    136     { 6,	1,		5 },
    137     { 3,	5,		7 },
    138     { 6,	2,	   39 },
    139     { 4,	5,	   43 },
    140     { 4,	6,	   75 },
    141     { 5,	7,	  139 },
    142     { 5,	8,	  267 },
    143     { 6,	8,	  523 },
    144     { 7,	9,	  779 },
    145     { 6,   11,	 1291 },
    146     { 9,   32,	  -32 },
    147     { 9,   32,	 3339 },
    148     { 2,	0,		0 }
    149 };
    150 const FX_BOOL HuffmanTable_HTOOB_B10 = TRUE;
    151 const JBig2TableLine HuffmanTable_B10[] = {
    152     { 7,	4,	  -21 },
    153     { 8,	0,	   -5 },
    154     { 7,	0,	   -4 },
    155     { 5,	0,	   -3 },
    156     { 2,	2,	   -2 },
    157     { 5,	0,		2 },
    158     { 6,	0,		3 },
    159     { 7,	0,		4 },
    160     { 8,	0,		5 },
    161     { 2,	6,		6 },
    162     { 5,	5,	   70 },
    163     { 6,	5,	  102 },
    164     { 6,	6,	  134 },
    165     { 6,	7,	  198 },
    166     { 6,	8,	  326 },
    167     { 6,	9,	  582 },
    168     { 6,   10,	 1094 },
    169     { 7,   11,	 2118 },
    170     { 8,   32,	  -22 },
    171     { 8,   32,	 4166 },
    172     { 2,	0,		0 }
    173 };
    174 const FX_BOOL HuffmanTable_HTOOB_B11 = FALSE;
    175 const JBig2TableLine HuffmanTable_B11[] = {
    176     { 1,	0,		1 },
    177     { 2,	1,		2 },
    178     { 4,	0,		4 },
    179     { 4,	1,		5 },
    180     { 5,	1,		7 },
    181     { 5,	2,		9 },
    182     { 6,	2,	   13 },
    183     { 7,	2,	   17 },
    184     { 7,	3,	   21 },
    185     { 7,	4,	   29 },
    186     { 7,	5,	   45 },
    187     { 7,	6,	   77 },
    188     { 0,   32,		0 },
    189     { 7,   32,	  141 }
    190 };
    191 const FX_BOOL HuffmanTable_HTOOB_B12 = FALSE;
    192 const JBig2TableLine HuffmanTable_B12[] = {
    193     { 1,	0,		1 },
    194     { 2,	0,		2 },
    195     { 3,	1,		3 },
    196     { 5,	0,		5 },
    197     { 5,	1,		6 },
    198     { 6,	1,		8 },
    199     { 7,	0,	   10 },
    200     { 7,	1,	   11 },
    201     { 7,	2,	   13 },
    202     { 7,	3,	   17 },
    203     { 7,	4,	   25 },
    204     { 8,	5,	   41 },
    205     { 0,   32,		0 },
    206     { 8,   32,	   73 }
    207 };
    208 const FX_BOOL HuffmanTable_HTOOB_B13 = FALSE;
    209 const JBig2TableLine HuffmanTable_B13[] = {
    210     { 1,	0,		1 },
    211     { 3,	0,		2 },
    212     { 4,	0,		3 },
    213     { 5,	0,		4 },
    214     { 4,	1,		5 },
    215     { 3,	3,		7 },
    216     { 6,	1,	   15 },
    217     { 6,	2,	   17 },
    218     { 6,	3,	   21 },
    219     { 6,	4,	   29 },
    220     { 6,	5,	   45 },
    221     { 7,	6,	   77 },
    222     { 0,   32,		0 },
    223     { 7,   32,	  141 }
    224 };
    225 const FX_BOOL HuffmanTable_HTOOB_B14 = FALSE;
    226 const JBig2TableLine HuffmanTable_B14[] = {
    227     { 3,	0,	   -2 },
    228     { 3,	0,	   -1 },
    229     { 1,	0,		0 },
    230     { 3,	0,		1 },
    231     { 3,	0,		2 },
    232     { 0,   32,	   -3 },
    233     { 0,   32,		3 }
    234 };
    235 const FX_BOOL HuffmanTable_HTOOB_B15 = FALSE;
    236 const JBig2TableLine HuffmanTable_B15[] = {
    237     { 7,	4,	  -24 },
    238     { 6,	2,	   -8 },
    239     { 5,	1,	   -4 },
    240     { 4,	0,	   -2 },
    241     { 3,	0,	   -1 },
    242     { 1,	0,		0 },
    243     { 3,	0,		1 },
    244     { 4,	0,		2 },
    245     { 5,	1,		3 },
    246     { 6,	2,		5 },
    247     { 7,	4,		9 },
    248     { 7,   32,	  -25 },
    249     { 7,   32,	   25 }
    250 };
    251 #endif
    252