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_HuffmanTable.h" | 7 #include "JBig2_HuffmanTable.h" |
8 | 8 |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "../../../include/fxcrt/fx_memory.h" | 13 #include "../../../include/fxcrt/fx_memory.h" |
14 #include "JBig2_BitStream.h" | 14 #include "JBig2_BitStream.h" |
| 15 #include "JBig2_Define.h" |
15 | 16 |
16 CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine* pTable, | 17 CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine* pTable, |
17 int nLines, | 18 int nLines, |
18 FX_BOOL bHTOOB) { | 19 FX_BOOL bHTOOB) { |
19 init(); | 20 init(); |
20 m_bOK = parseFromStandardTable(pTable, nLines, bHTOOB); | 21 m_bOK = parseFromStandardTable(pTable, nLines, bHTOOB); |
21 } | 22 } |
22 | 23 |
23 CJBig2_HuffmanTable::CJBig2_HuffmanTable(CJBig2_BitStream* pStream) { | 24 CJBig2_HuffmanTable::CJBig2_HuffmanTable(CJBig2_BitStream* pStream) { |
24 init(); | 25 init(); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 for (int i = 0; i <= LENMAX; ++i) { | 163 for (int i = 0; i <= LENMAX; ++i) { |
163 FIRSTCODE[i] = (FIRSTCODE[i - 1] + LENCOUNT[i - 1]) << 1; | 164 FIRSTCODE[i] = (FIRSTCODE[i - 1] + LENCOUNT[i - 1]) << 1; |
164 int CURCODE = FIRSTCODE[i]; | 165 int CURCODE = FIRSTCODE[i]; |
165 for (int j = 0; j < NTEMP; ++j) { | 166 for (int j = 0; j < NTEMP; ++j) { |
166 if (PREFLEN[j] == i) | 167 if (PREFLEN[j] == i) |
167 CODES[j] = CURCODE++; | 168 CODES[j] = CURCODE++; |
168 } | 169 } |
169 } | 170 } |
170 return TRUE; | 171 return TRUE; |
171 } | 172 } |
OLD | NEW |