summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
AgeCommit message (Collapse)Author
2018-05-22Fix method style in JBig2_Image.Lei Zhang
Rename fooBar() to FooBar(). Change-Id: I87775fa14ce7e4f4a5897780d0d02fb61c7693ff Reviewed-on: https://pdfium-review.googlesource.com/32739 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-17Expose CJBig2_Image::ComposeTo() as a public method.Lei Zhang
CJBig2_Image::ComposeFrom() wraps a call to ComposeTo() and does an extra validity check. In tight loops where the validity check will always succeed, this is wasteful. Change existing callers of ComposeFrom() to ComposeTo() when the validity check has already been done. BUG=chromium:840728 Change-Id: I39fb42eea49b92b7804cbd42c3d8a0329edeb58d Reviewed-on: https://pdfium-review.googlesource.com/32637 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-09Make memory usage in CJBig2_HTRDProc::DecodeImage() O(1).Lei Zhang
Instead of allocating an N-pixel array to store some temporary values, just use a single integer. BUG=chromium:840728 Change-Id: I7a0ff83d814eff127033f25020a7c398db3c2062 Reviewed-on: https://pdfium-review.googlesource.com/32290 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-04Check CJBig2_Image is valid before filling.chromium/3423chromium/3422chromium/3421Lei Zhang
Skip a lot of work that will all fail anyway. BUG=chromium:838347 Change-Id: Iba45120e436b5547e106feb27dadea92cc948258 Reviewed-on: https://pdfium-review.googlesource.com/32053 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-01Add struct CJBig2_GRDProc::ProgressiveArithDecodeState.Lei Zhang
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>
2018-05-01Clean up CJBig2_Image compose methods.Lei Zhang
- Mark them private when possible. - Disambiguate method names. - Make method names match the style guide. - Pass in rects by reference. Change-Id: I0bf848756e81a92d20e46a81cd6260b660eaf482 Reviewed-on: https://pdfium-review.googlesource.com/31772 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-27Fix style for many jbig2 methods.chromium/3412Lei Zhang
Change-Id: Ie700e132f13f2cb4851ea59b68c891e3c42af243 Reviewed-on: https://pdfium-review.googlesource.com/31531 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-06Rename core/fxcrt IFX files to IfaceDan Sinclair
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-31Split IFX_Pause out of fx_basicDan Sinclair
This CL moves IFX_Pause out to its own class from fx_basic and updates includes as needed. Change-Id: Iebdd183d8c85aa17570f190f1a7d1602c0af3c8b Reviewed-on: https://pdfium-review.googlesource.com/12491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-20Create helper method in CJBig2_HTRDProcNicolas Pena
This CL creates CJBig2_HTRDProc::decode_image to reduce duplicated code in the class. Change-Id: Ie348179c96ff534f95cba401c4b9bd46e1c4e6ac Reviewed-on: https://pdfium-review.googlesource.com/8410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-07-19Remove JBig2_GsidProc classNicolas Pena
This CL removes the JBig2_GsidProc since it is only used as a single instance in each of the methods in CJBig2_HTRDProc, so it is completely unnecessary. Change-Id: I69d0a4a059b9eb6ebcbbb79b92ea1cd6c22cb1cb Reviewed-on: https://pdfium-review.googlesource.com/7930 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-14More unique_ptrs in JBIG2 code part 2Nicolas Pena
This CL makes HDPATS in CJBig2_PatternDict be a vector of unique_ptr. Change-Id: Ib23aed6323d4a988b2eedc4bfe95f2098d32c188 Reviewed-on: https://pdfium-review.googlesource.com/7871 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-13More unique_ptrs in JBig2 codeNicolas Pena
This CL makes CJBig2_Segment own the results: symbol, pattern, huffman, and huffman. This causes a lot more unique_ptr usage in JBig2 code. Change-Id: I1f0a5bfaaf85053658b467bef5325c72d1f496c7 Reviewed-on: https://pdfium-review.googlesource.com/7690 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-05-05More unused IFX_Pause parameters removedchromium/3091Dan Sinclair
Remove IFX_Pause parameters which are passed but not used. Change-Id: I51a491c7f9a429676d114a387390fac3ae65e187 Reviewed-on: https://pdfium-review.googlesource.com/4950 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-30Add some calls to MakeUniqueDan Sinclair
This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-12-14Avoid the ptr.reset(new XXX()) anti-patterntsepez
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003
2016-03-25Remove FX_DWORD from core/ and delete definitionchromium/2695chromium/2694chromium/2693chromium/2692tsepez
Review URL: https://codereview.chromium.org/1832173003
2016-03-23Move core/include/fxcrt to core/fxcrt/include.Dan Sinclair
This CL moves the fxcrt code into the core/fxcrt directory. The only exception was fx_bidi.h which was moved into core/fxcrt as it is not used outside of core/. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1825953002 .
2016-03-14Move core/src/ up to core/.Dan Sinclair
This CL moves the core/src/ files up to core/ and fixes up the include guards, includes and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1800523005 .