Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(994)

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_HuffmanTable.h

Issue 1536923002: Cleanup CJBig2_HuffmanTable and friends. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef _JBIG2_HUFFMAN_TABLE_H_ 7 #ifndef CORE_SRC_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_H_
8 #define _JBIG2_HUFFMAN_TABLE_H_ 8 #define CORE_SRC_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_H_
9 9
10 #include "JBig2_HuffmanTable_Standard.h" 10 #include <vector>
11 #include "JBig2_BitStream.h" 11
12 #include "core/include/fxcrt/fx_system.h"
13
14 class CJBig2_BitStream;
15 struct JBig2TableLine;
12 16
13 class CJBig2_HuffmanTable { 17 class CJBig2_HuffmanTable {
14 public: 18 public:
15 CJBig2_HuffmanTable(const JBig2TableLine* pTable, int nLines, FX_BOOL bHTOOB); 19 CJBig2_HuffmanTable(const JBig2TableLine* pTable,
20 FX_DWORD nLines,
21 bool bHTOOB);
16 22
17 explicit CJBig2_HuffmanTable(CJBig2_BitStream* pStream); 23 explicit CJBig2_HuffmanTable(CJBig2_BitStream* pStream);
18 24
19 ~CJBig2_HuffmanTable(); 25 ~CJBig2_HuffmanTable();
20 26
21 int parseFromStandardTable(const JBig2TableLine* pTable, 27 bool IsHTOOB() const { return HTOOB; }
22 int nLines, 28 FX_DWORD Size() const { return NTEMP; }
23 FX_BOOL bHTOOB); 29 const std::vector<int>& GetCODES() const { return CODES; }
24 30 const std::vector<int>& GetPREFLEN() const { return PREFLEN; }
25 int parseFromCodedBuffer(CJBig2_BitStream* pStream); 31 const std::vector<int>& GetRANGELEN() const { return RANGELEN; }
26 32 const std::vector<int>& GetRANGELOW() const { return RANGELOW; }
27 FX_BOOL isOK() const { return m_bOK; } 33 bool IsOK() const { return m_bOK; }
28 34
29 private: 35 private:
30 void init(); 36 void ParseFromStandardTable(const JBig2TableLine* pTable);
37 bool ParseFromCodedBuffer(CJBig2_BitStream* pStream);
38 void InitCodes();
39 void ExtendBuffers();
31 40
32 FX_BOOL HTOOB; 41 bool HTOOB;
33 FX_DWORD NTEMP; 42 FX_DWORD NTEMP;
34 int* CODES; 43 std::vector<int> CODES;
35 int* PREFLEN; 44 std::vector<int> PREFLEN;
36 int* RANGELEN; 45 std::vector<int> RANGELEN;
37 int* RANGELOW; 46 std::vector<int> RANGELOW;
38 FX_BOOL m_bOK; 47 bool m_bOK;
Tom Sepez 2015/12/18 23:48:54 nit: probably packs tighter if this is adjacent to
Lei Zhang 2015/12/19 00:17:22 Done.
39 friend class CJBig2_HuffmanDecoder;
40 }; 48 };
41 #endif 49
50 #endif // CORE_SRC_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698