OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "JBig2_GeneralDecoder.h" | 7 #include "JBig2_GeneralDecoder.h" |
8 #include "JBig2_ArithDecoder.h" | 8 #include "JBig2_ArithDecoder.h" |
9 #include "JBig2_ArithIntDecoder.h" | 9 #include "JBig2_ArithIntDecoder.h" |
10 #include "JBig2_HuffmanDecoder.h" | 10 #include "JBig2_HuffmanDecoder.h" |
11 #include "JBig2_HuffmanTable.h" | 11 #include "JBig2_HuffmanTable.h" |
12 #include "JBig2_PatternDict.h" | 12 #include "JBig2_PatternDict.h" |
13 | |
14 extern const JBig2ArithQe QeTable[] = { | |
Bo Xu
2014/12/13 01:47:37
The "extern" keyword may not be necessary in the d
brucedawson
2014/12/13 01:56:25
True, it's only needed on the declaration, as long
Bo Xu
2014/12/13 03:39:55
Fair enough
| |
15 { 0x5601, 1, 1, 1 }, | |
16 { 0x3401, 2, 6, 0 }, | |
17 { 0x1801, 3, 9, 0 }, | |
18 { 0x0AC1, 4, 12, 0 }, | |
19 { 0x0521, 5, 29, 0 }, | |
20 { 0x0221, 38, 33, 0 }, | |
21 { 0x5601, 7, 6, 1 }, | |
22 { 0x5401, 8, 14, 0 }, | |
23 { 0x4801, 9, 14, 0 }, | |
24 { 0x3801, 10, 14, 0 }, | |
25 { 0x3001, 11, 17, 0 }, | |
26 { 0x2401, 12, 18, 0 }, | |
27 { 0x1C01, 13, 20, 0 }, | |
28 { 0x1601, 29, 21, 0 }, | |
29 { 0x5601, 15, 14, 1 }, | |
30 { 0x5401, 16, 14, 0 }, | |
31 { 0x5101, 17, 15, 0 }, | |
32 { 0x4801, 18, 16, 0 }, | |
33 { 0x3801, 19, 17, 0 }, | |
34 { 0x3401, 20, 18, 0 }, | |
35 { 0x3001, 21, 19, 0 }, | |
36 { 0x2801, 22, 19, 0 }, | |
37 { 0x2401, 23, 20, 0 }, | |
38 { 0x2201, 24, 21, 0 }, | |
39 { 0x1C01, 25, 22, 0 }, | |
40 { 0x1801, 26, 23, 0 }, | |
41 { 0x1601, 27, 24, 0 }, | |
42 { 0x1401, 28, 25, 0 }, | |
43 { 0x1201, 29, 26, 0 }, | |
44 { 0x1101, 30, 27, 0 }, | |
45 { 0x0AC1, 31, 28, 0 }, | |
46 { 0x09C1, 32, 29, 0 }, | |
47 { 0x08A1, 33, 30, 0 }, | |
48 { 0x0521, 34, 31, 0 }, | |
49 { 0x0441, 35, 32, 0 }, | |
50 { 0x02A1, 36, 33, 0 }, | |
51 { 0x0221, 37, 34, 0 }, | |
52 { 0x0141, 38, 35, 0 }, | |
53 { 0x0111, 39, 36, 0 }, | |
54 { 0x0085, 40, 37, 0 }, | |
55 { 0x0049, 41, 38, 0 }, | |
56 { 0x0025, 42, 39, 0 }, | |
57 { 0x0015, 43, 40, 0 }, | |
58 { 0x0009, 44, 41, 0 }, | |
59 { 0x0005, 45, 42, 0 }, | |
60 { 0x0001, 45, 43, 0 }, | |
61 { 0x5601, 46, 46, 0 } | |
62 }; | |
63 | |
13 CJBig2_Image *CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J Big2ArithCtx *gbContext) | 64 CJBig2_Image *CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J Big2ArithCtx *gbContext) |
14 { | 65 { |
15 if (GBW == 0 || GBH == 0) { | 66 if (GBW == 0 || GBH == 0) { |
16 CJBig2_Image* pImage; | 67 CJBig2_Image* pImage; |
17 JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH)); | 68 JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH)); |
18 return pImage; | 69 return pImage; |
19 } | 70 } |
20 if(GBTEMPLATE == 0) { | 71 if(GBTEMPLATE == 0) { |
21 if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1) | 72 if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1) |
22 && (GBAT[2] == (signed char) - 3) && (GBAT[3] == (signed char) - 1) | 73 && (GBAT[2] == (signed char) - 3) && (GBAT[3] == (signed char) - 1) |
(...skipping 4258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4281 } | 4332 } |
4282 if(pPause && pPause->NeedToPauseNow()) { | 4333 if(pPause && pPause->NeedToPauseNow()) { |
4283 m_loopIndex++; | 4334 m_loopIndex++; |
4284 m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; | 4335 m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; |
4285 return FXCODEC_STATUS_DECODE_TOBECONTINUE; | 4336 return FXCODEC_STATUS_DECODE_TOBECONTINUE; |
4286 } | 4337 } |
4287 } | 4338 } |
4288 m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; | 4339 m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; |
4289 return FXCODEC_STATUS_DECODE_FINISH; | 4340 return FXCODEC_STATUS_DECODE_FINISH; |
4290 } | 4341 } |
OLD | NEW |