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