summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_ArithDecoder.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-09-17 18:31:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-17 18:31:47 +0000
commitbff81396b7aee1cc195194d0d1122d8fbec7dfb9 (patch)
tree6659efa22a5f30ca4575ca662e05d90fc35aa536 /core/fxcodec/jbig2/JBig2_ArithDecoder.h
parentcb798258c433bec7087948fcbfff14d1e7683006 (diff)
downloadpdfium-bff81396b7aee1cc195194d0d1122d8fbec7dfb9.tar.xz
Make JBig2ArithCtx a class.
For better encapsulation. Change-Id: Ia6fd8056112d97d672b91a9a521a2978c807060f Reviewed-on: https://pdfium-review.googlesource.com/42605 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_ArithDecoder.h')
-rw-r--r--core/fxcodec/jbig2/JBig2_ArithDecoder.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/core/fxcodec/jbig2/JBig2_ArithDecoder.h b/core/fxcodec/jbig2/JBig2_ArithDecoder.h
index 250e7009ff..0a233237b2 100644
--- a/core/fxcodec/jbig2/JBig2_ArithDecoder.h
+++ b/core/fxcodec/jbig2/JBig2_ArithDecoder.h
@@ -13,11 +13,26 @@
class CJBig2_BitStream;
-struct JBig2ArithCtx {
- JBig2ArithCtx() : MPS(0), I(0) {}
+class JBig2ArithCtx {
+ public:
+ struct JBig2ArithQe {
+ uint16_t Qe;
+ uint8_t NMPS;
+ uint8_t NLPS;
+ uint8_t nSwitch;
+ };
+
+ JBig2ArithCtx();
+
+ int DecodeNLPS(const JBig2ArithQe& qe);
+ int DecodeNMPS(const JBig2ArithQe& qe);
- unsigned int MPS;
- unsigned int I;
+ unsigned int MPS() const { return m_MPS; }
+ unsigned int I() const { return m_I; }
+
+ private:
+ unsigned int m_MPS = 0;
+ unsigned int m_I = 0;
};
class CJBig2_ArithDecoder {