| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/fxcodec/jbig2/JBig2_GrrdProc.h" | 7 #include "core/fxcodec/jbig2/JBig2_GrrdProc.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" | 11 #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" |
| 12 #include "core/fxcodec/jbig2/JBig2_BitStream.h" | 12 #include "core/fxcodec/jbig2/JBig2_BitStream.h" |
| 13 #include "core/fxcodec/jbig2/JBig2_Image.h" | 13 #include "core/fxcodec/jbig2/JBig2_Image.h" |
| 14 | 14 |
| 15 CJBig2_Image* CJBig2_GRRDProc::decode(CJBig2_ArithDecoder* pArithDecoder, | 15 CJBig2_Image* CJBig2_GRRDProc::decode(CJBig2_ArithDecoder* pArithDecoder, |
| 16 JBig2ArithCtx* grContext) { | 16 JBig2ArithCtx* grContext) { |
| 17 if (GRW == 0 || GRH == 0) | 17 if (GRW == 0 || GRH == 0) |
| 18 return new CJBig2_Image(GRW, GRH); | 18 return new CJBig2_Image(GRW, GRH); |
| 19 | 19 |
| 20 if (GRTEMPLATE == 0) { | 20 if (!GRTEMPLATE) { |
| 21 if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) && | 21 if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) && |
| 22 (GRAT[3] == -1) && (GRREFERENCEDX == 0) && | 22 (GRAT[3] == -1) && (GRREFERENCEDX == 0) && |
| 23 (GRW == (uint32_t)GRREFERENCE->width())) { | 23 (GRW == (uint32_t)GRREFERENCE->width())) { |
| 24 return decode_Template0_opt(pArithDecoder, grContext); | 24 return decode_Template0_opt(pArithDecoder, grContext); |
| 25 } | 25 } |
| 26 return decode_Template0_unopt(pArithDecoder, grContext); | 26 return decode_Template0_unopt(pArithDecoder, grContext); |
| 27 } | 27 } |
| 28 | 28 |
| 29 if ((GRREFERENCEDX == 0) && (GRW == (uint32_t)GRREFERENCE->width())) | 29 if ((GRREFERENCEDX == 0) && (GRW == (uint32_t)GRREFERENCE->width())) |
| 30 return decode_Template1_opt(pArithDecoder, grContext); | 30 return decode_Template1_opt(pArithDecoder, grContext); |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 pLine[w >> 3] = cVal; | 494 pLine[w >> 3] = cVal; |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 pLine += nStride; | 497 pLine += nStride; |
| 498 if (h < GRHR + GRREFERENCEDY) { | 498 if (h < GRHR + GRREFERENCEDY) { |
| 499 pLineR += nStrideR; | 499 pLineR += nStrideR; |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 return GRREG.release(); | 502 return GRREG.release(); |
| 503 } | 503 } |
| OLD | NEW |