| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../../include/fxcodec/fx_codec.h" | 7 #include "../../../include/fxcodec/fx_codec.h" |
| 8 #include "codec_int.h" | 8 #include "codec_int.h" |
| 9 const uint8_t OneLeadPos[256] = { | 9 const uint8_t OneLeadPos[256] = { |
| 10 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, | 10 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 return m_pScanlineBuf; | 583 return m_pScanlineBuf; |
| 584 } | 584 } |
| 585 FX_DWORD CCodec_FaxDecoder::GetSrcOffset() { | 585 FX_DWORD CCodec_FaxDecoder::GetSrcOffset() { |
| 586 FX_DWORD ret = (bitpos + 7) / 8; | 586 FX_DWORD ret = (bitpos + 7) / 8; |
| 587 if (ret > m_SrcSize) { | 587 if (ret > m_SrcSize) { |
| 588 ret = m_SrcSize; | 588 ret = m_SrcSize; |
| 589 } | 589 } |
| 590 return ret; | 590 return ret; |
| 591 } | 591 } |
| 592 extern "C" { | 592 extern "C" { |
| 593 void _FaxG4Decode(void*, | 593 void _FaxG4Decode(const uint8_t* src_buf, |
| 594 const uint8_t* src_buf, | |
| 595 FX_DWORD src_size, | 594 FX_DWORD src_size, |
| 596 int* pbitpos, | 595 int* pbitpos, |
| 597 uint8_t* dest_buf, | 596 uint8_t* dest_buf, |
| 598 int width, | 597 int width, |
| 599 int height, | 598 int height, |
| 600 int pitch) { | 599 int pitch) { |
| 601 if (pitch == 0) { | 600 if (pitch == 0) { |
| 602 pitch = (width + 7) / 8; | 601 pitch = (width + 7) / 8; |
| 603 } | 602 } |
| 604 uint8_t* ref_buf = FX_Alloc(uint8_t, pitch); | 603 uint8_t* ref_buf = FX_Alloc(uint8_t, pitch); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 FX_BOOL EndOfLine, | 807 FX_BOOL EndOfLine, |
| 809 FX_BOOL EncodedByteAlign, | 808 FX_BOOL EncodedByteAlign, |
| 810 FX_BOOL BlackIs1, | 809 FX_BOOL BlackIs1, |
| 811 int Columns, | 810 int Columns, |
| 812 int Rows) { | 811 int Rows) { |
| 813 CCodec_FaxDecoder* pDecoder = new CCodec_FaxDecoder; | 812 CCodec_FaxDecoder* pDecoder = new CCodec_FaxDecoder; |
| 814 pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, | 813 pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, |
| 815 EncodedByteAlign, BlackIs1, Columns, Rows); | 814 EncodedByteAlign, BlackIs1, Columns, Rows); |
| 816 return pDecoder; | 815 return pDecoder; |
| 817 } | 816 } |
| OLD | NEW |