diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-01 14:37:54 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-01 14:37:54 +0000 |
commit | 1599b465904a312f0d0455cd26cdc9b0fe7b7d0c (patch) | |
tree | 38a7a3c997c642e91fe9a6e00086dfdf34382f73 /core/fxcodec/jbig2/JBig2_HtrdProc.cpp | |
parent | ea603b9f0baf33462b61fa4ee6364e4f4161f55a (diff) | |
download | pdfium-1599b465904a312f0d0455cd26cdc9b0fe7b7d0c.tar.xz |
Add struct CJBig2_GRDProc::ProgressiveArithDecodeState.
Track the decode state in one data structure. Also grab pointers to data
structure members before tight loops when decoding. It turns out
referring to this->foo in tight loops can actually slow down decoding.
Change-Id: I6a09b08ca06ef05968966055b5ad20f8c89896af
Reviewed-on: https://pdfium-review.googlesource.com/31790
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_HtrdProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_HtrdProc.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp index 8618236264..fb2257e853 100644 --- a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp @@ -64,11 +64,15 @@ std::unique_ptr<CJBig2_Image> CJBig2_HTRDProc::DecodeArith( std::vector<std::unique_ptr<CJBig2_Image>> GSPLANES(GSBPP); for (int32_t i = GSBPP - 1; i >= 0; --i) { std::unique_ptr<CJBig2_Image> pImage; - FXCODEC_STATUS status = - GRD.StartDecodeArith(&pImage, pArithDecoder, gbContext, nullptr); + CJBig2_GRDProc::ProgressiveArithDecodeState state; + state.pImage = &pImage; + state.pArithDecoder = pArithDecoder; + state.gbContext = gbContext; + state.pPause = nullptr; + FXCODEC_STATUS status = GRD.StartDecodeArith(&state); + state.pPause = pPause; while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) - status = GRD.ContinueDecode(pPause, pArithDecoder); - + status = GRD.ContinueDecode(&state); if (!pImage) return nullptr; |