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 #ifndef CORE_SRC_FXCODEC_JBIG2_JBIG2_ARITHDECODER_H_ | 7 #ifndef CORE_FXCODEC_JBIG2_JBIG2_ARITHDECODER_H_ |
8 #define CORE_SRC_FXCODEC_JBIG2_JBIG2_ARITHDECODER_H_ | 8 #define CORE_FXCODEC_JBIG2_JBIG2_ARITHDECODER_H_ |
9 | 9 |
10 class CJBig2_BitStream; | 10 class CJBig2_BitStream; |
11 | 11 |
12 struct JBig2ArithCtx { | 12 struct JBig2ArithCtx { |
13 JBig2ArithCtx() : MPS(0), I(0) {} | 13 JBig2ArithCtx() : MPS(0), I(0) {} |
14 | 14 |
15 unsigned int MPS; | 15 unsigned int MPS; |
16 unsigned int I; | 16 unsigned int I; |
17 }; | 17 }; |
18 | 18 |
19 class CJBig2_ArithDecoder { | 19 class CJBig2_ArithDecoder { |
20 public: | 20 public: |
21 explicit CJBig2_ArithDecoder(CJBig2_BitStream* pStream); | 21 explicit CJBig2_ArithDecoder(CJBig2_BitStream* pStream); |
22 | 22 |
23 ~CJBig2_ArithDecoder(); | 23 ~CJBig2_ArithDecoder(); |
24 | 24 |
25 int DECODE(JBig2ArithCtx* pCX); | 25 int DECODE(JBig2ArithCtx* pCX); |
26 | 26 |
27 private: | 27 private: |
28 void BYTEIN(); | 28 void BYTEIN(); |
29 void ReadValueA(); | 29 void ReadValueA(); |
30 | 30 |
31 unsigned char m_B; | 31 unsigned char m_B; |
32 unsigned int m_C; | 32 unsigned int m_C; |
33 unsigned int m_A; | 33 unsigned int m_A; |
34 unsigned int m_CT; | 34 unsigned int m_CT; |
35 CJBig2_BitStream* const m_pStream; | 35 CJBig2_BitStream* const m_pStream; |
36 }; | 36 }; |
37 | 37 |
38 #endif // CORE_SRC_FXCODEC_JBIG2_JBIG2_ARITHDECODER_H_ | 38 #endif // CORE_FXCODEC_JBIG2_JBIG2_ARITHDECODER_H_ |
OLD | NEW |