diff options
author | Nicolas Pena <npm@chromium.org> | 2018-09-21 21:09:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-21 21:09:32 +0000 |
commit | 36f4841d67037ce640273ce357d2d33f3e8567c3 (patch) | |
tree | 69131ec9c480f8b02ca945ced6ff32db07e5eb79 /core/fxcodec/jbig2/JBig2_GrdProc.cpp | |
parent | fbea60879c6a8db4604e6e0f23216c6ee5f238df (diff) | |
download | pdfium-36f4841d67037ce640273ce357d2d33f3e8567c3.tar.xz |
Cleanup in CCodec_FaxModule
This CL moves FaxG4Decode to the class where it's implemented. It should
remain there because it calls FaxG4GetRow, declared and used in the cpp
file. Do some ++ cleanup while at it.
This CL also makes CCodec_FaxModule own some methods that were
namespaced since doing so allows removing a bunch of parameters.
Change-Id: I24787f5668c7273b9bdb4009c3d0b29590c5552f
Reviewed-on: https://pdfium-review.googlesource.com/42950
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrdProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GrdProc.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp index d0fe440b2d..278b5c065d 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp @@ -10,6 +10,7 @@ #include <memory> #include <utility> +#include "core/fxcodec/codec/ccodec_faxmodule.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" #include "core/fxcodec/jbig2/JBig2_BitStream.h" @@ -451,18 +452,18 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArith( FXCODEC_STATUS CJBig2_GRDProc::StartDecodeMMR( std::unique_ptr<CJBig2_Image>* pImage, CJBig2_BitStream* pStream) { - int bitpos, i; auto image = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH); if (!image->data()) { *pImage = nullptr; m_ProssiveStatus = FXCODEC_STATUS_ERROR; return m_ProssiveStatus; } - bitpos = static_cast<int>(pStream->getBitPos()); - FaxG4Decode(pStream->getBuf(), pStream->getLength(), &bitpos, image->data(), - GBW, GBH, image->stride()); + int bitpos = static_cast<int>(pStream->getBitPos()); + bitpos = CCodec_FaxModule::FaxG4Decode(pStream->getBuf(), + pStream->getLength(), bitpos, GBW, GBH, + image->stride(), image->data()); pStream->setBitPos(bitpos); - for (i = 0; (uint32_t)i < image->stride() * GBH; ++i) + for (uint32_t i = 0; i < image->stride() * GBH; ++i) image->data()[i] = ~image->data()[i]; m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; *pImage = std::move(image); |