summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/fx_codec_fax.cpp
AgeCommit message (Collapse)Author
2018-08-16Remove default arg from CFX_BinaryBuf::EstimateSize().Tom Sepez
Disentangle setting an allocation step from estimating size, these separate concepts can be handled separately. Change-Id: I27bf3e193018a4377ccf266207b889fdb672826c Reviewed-on: https://pdfium-review.googlesource.com/40210 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-05Further improve CCodec_FaxDecoder performance in debug builds.Lei Zhang
BUG=chromium:845117 Change-Id: Id1c97bc40ff776f52011a8ab2d6e5166cd7c64c8 Reviewed-on: https://pdfium-review.googlesource.com/33650 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-05-21Avoid indexing into std::vector inside a tight loop.chromium/3437Lei Zhang
In CCodec_FaxDecoder::v_GetNextLine(), a fixed size vector often needs to be inverted. Doing so without checking bounds on every access makes a big difference in non-optimized builds. BUG=chromium:843899 Change-Id: Iecc0a3da22631a289745245563dab7a7c3c458d0 Reviewed-on: https://pdfium-review.googlesource.com/32744 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-05-16Do more optimizations to make FindBit() faster.chromium/3433Lei Zhang
Change-Id: Ibbc020393e38405f9d1cb0d483ef875777d4e721 Reviewed-on: https://pdfium-review.googlesource.com/32650 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-05-16Avoid a memset() in FindBit() in the fax codec.Lei Zhang
FindBit() is called frequently by other fax codec code. Use 16 more bytes of space to store the two possible values memset() can set. Change-Id: Ibeb549c44928bbb468ac4eb4cef2d9339cf6490d Reviewed-on: https://pdfium-review.googlesource.com/32630 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-05-15Lower the limit of image dimensions for fax codecs.chromium/3432Lei Zhang
Use the same limit as JBIG2 codecs. BUG=chromium:834633 Change-Id: I11d12c841e10ab48fd85df792bf8a034fe40493c Reviewed-on: https://pdfium-review.googlesource.com/32514 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-05-15Read data in bigger chunks in fax codec code.Lei Zhang
In case there are long runs of data to be skipped, FindBit() runs much faster reading and comparing 8 bytes at a time. BUG=chromium:834633 Change-Id: Ifc7b348d123c5a72cf09fbf53d764075f8abfba0 Reviewed-on: https://pdfium-review.googlesource.com/32513 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-25Use a bool in FindBit() in the fax codec.Lei Zhang
Change-Id: If75c0db94d341715e0bc6406f0fd89812f1ea73c Reviewed-on: https://pdfium-review.googlesource.com/31311 Commit-Queue: Lei Zhang <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-09-28Simplify some OS checks to PLATFORM checksDan Sinclair
This CL simplifies the OS == WIN{32|64} checks to be PLATFORM == WINDOWS checks. Change-Id: I1493d316dd457b0228e4ef39db4cf1d2b8abf97d Reviewed-on: https://pdfium-review.googlesource.com/14870 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-27Cleanup FX macrosDan Sinclair
This CL renames the FX_OS defines to have _OS_ in their names and drops the _DESKTOP suffix. The FXM defines have been changed to just FX. Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74 Reviewed-on: https://pdfium-review.googlesource.com/14833 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-20Forward declare codec modules in fx_codec.h.Lei Zhang
Change-Id: I020b862619f3f93f71dbb027b9e799d78744f686 Reviewed-on: https://pdfium-review.googlesource.com/14391 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-20Move CCodec_ScanlineDecoder to its own file.Lei Zhang
Change-Id: Icacf877e2b66ca7d49637dcf9eaec0f99bcdd8bb Reviewed-on: https://pdfium-review.googlesource.com/14390 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-30Move CFX_BinaryBuf out of fx_basicDan Sinclair
This CL splits the CFX_BinaryBuf out of fx_basic into its own files. The various includes have been updated. Change-Id: I0fa616eeb4df6dd229c02dc3a0597b3dced59425 Reviewed-on: https://pdfium-review.googlesource.com/12412 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from mem methodsDan Sinclair
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-17Add pdfium::clamp() as a placeholder for std::clamp().chromium/3046Lei Zhang
Ue it to fix a typo as well. BUG=pdfium:634 Change-Id: I2d686242ffb841aedc2fae6a3cf7a00bea667404 Reviewed-on: https://pdfium-review.googlesource.com/3113 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-13Fix some nits in fx_codec_faxNicolas Pena
Change-Id: I16acba7b3eda26b4edfbfe0cb356267bd536fee8 Reviewed-on: https://pdfium-review.googlesource.com/2964 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-13Check run lengths in FaxG4GetRowNicolas Pena
The spec says a1 is to the right of a0, a2 to the right of a1. I think that means that the run lengths have to be positive, but that certainly means that they cannot be negative. BUG=chromium:699340 Change-Id: Ic07a272e63610f7a66c5073179cdb2768f80e2b8 Reviewed-on: https://pdfium-review.googlesource.com/2963 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-01-06Revert postscript code removal.rbpotter
Revert CL http://crrev.com/2608663003 in preparation for adding postscript generation to Pdfium. Note postscript generation code will not be called until additional patches land. These patches will also include modifications needed to make this code functional (currently missing a few compression functions). BUG= Review-Url: https://codereview.chromium.org/2615703002
2016-12-13Return unique_ptr<>s from fxcodec/chromium/2951tsepez
Review-Url: https://codereview.chromium.org/2572843002
2016-11-02Remove FX_BOOL from coretsepez
Review-Url: https://codereview.chromium.org/2477443002
2016-10-27Fix some FX_BOOL / int noise in core/fx*chromium/2903tsepez
Review-Url: https://codereview.chromium.org/2459673002
2016-10-26Avoid some FX_BOOL/bool noise in fx_codec_fax.cpptsepez
NEXTBIT() is particularly pernicious in that it isn't syntactically an expression, but rather two expressions. Replace it with an inline along the way. Review-Url: https://codereview.chromium.org/2452123002
2016-10-06Fix assertion failure when decoding malform G4 fax imagechromium/2886chromium/2885chromium/2884kcwu
The position indexes of color elements must be monotonic increasing. Bail out if the decoded index is less or equal to the previous index. BUG=pdfium:615 Review-Url: https://codereview.chromium.org/2398033002
2016-09-29Move core/fxcodec/codec/include and core/fxcodec/include files updsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2381063002
2016-09-26Clean up fx_codec_fax.cpp.thestig
Review-Url: https://codereview.chromium.org/2357173005
2016-09-23Bail out on bad width and height in CCodec_FaxDecoder::CreateDecoderkcwu
BUG=648935,649436 Review-Url: https://codereview.chromium.org/2360283004
2016-06-07Get rid of NULLs in core/thestig
Review-Url: https://codereview.chromium.org/2032613003
2016-06-06Remove unused PS generation code.thestig
CFX_PSRenderer, IFX_PSOutput, CPSOutput, CPSPrinterDriver. Also reland commit 2d63eaa. Review-Url: https://codereview.chromium.org/2019603002
2016-06-02Fix all the code which has duplicate variable declarationsweili
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
2016-05-16Convert border style defines to an enum class.dsinclair
There were two defines, BBS_ and PBS_ for the various border styles in the system. They were the same, except PBS_ had an extra SHADOW define which was never used. This CL combines both of those into a single BorderStyle enum class and updates the code as needed. Also, removes ADDBIT, GETBIT unused defines. Updates barcode code to use the util.h defines instead of redefinition. fsdk_baseannot names starting with _ were cleaned up and some #defines moved to constants. Review-Url: https://codereview.chromium.org/1980973002
2016-04-12Remove ICodec_* Interfaces.dsinclair
All of the ICodec_* interfaces had a single implementation. This CL removes the interfaces and uses the concrete classes in their place. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1876023003
2016-04-06Move include/fxcodec to fxcodec/includedsinclair
Review URL: https://codereview.chromium.org/1864153002
2016-04-05Remove dead image decoding/caching code.thestig
Review URL: https://codereview.chromium.org/1860223002
2016-03-25Remove FX_DWORD from core/ and delete definitionchromium/2695chromium/2694chromium/2693chromium/2692tsepez
Review URL: https://codereview.chromium.org/1832173003
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 .