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 "JBig2_GeneralDecoder.h" | 7 #include "JBig2_GeneralDecoder.h" |
8 #include "JBig2_ArithDecoder.h" | 8 #include "JBig2_ArithDecoder.h" |
9 #include "JBig2_ArithIntDecoder.h" | 9 #include "JBig2_ArithIntDecoder.h" |
10 #include "JBig2_HuffmanDecoder.h" | 10 #include "JBig2_HuffmanDecoder.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 {0x2801, 22, 19, 0}, {0x2401, 23, 20, 0}, {0x2201, 24, 21, 0}, | 22 {0x2801, 22, 19, 0}, {0x2401, 23, 20, 0}, {0x2201, 24, 21, 0}, |
23 {0x1C01, 25, 22, 0}, {0x1801, 26, 23, 0}, {0x1601, 27, 24, 0}, | 23 {0x1C01, 25, 22, 0}, {0x1801, 26, 23, 0}, {0x1601, 27, 24, 0}, |
24 {0x1401, 28, 25, 0}, {0x1201, 29, 26, 0}, {0x1101, 30, 27, 0}, | 24 {0x1401, 28, 25, 0}, {0x1201, 29, 26, 0}, {0x1101, 30, 27, 0}, |
25 {0x0AC1, 31, 28, 0}, {0x09C1, 32, 29, 0}, {0x08A1, 33, 30, 0}, | 25 {0x0AC1, 31, 28, 0}, {0x09C1, 32, 29, 0}, {0x08A1, 33, 30, 0}, |
26 {0x0521, 34, 31, 0}, {0x0441, 35, 32, 0}, {0x02A1, 36, 33, 0}, | 26 {0x0521, 34, 31, 0}, {0x0441, 35, 32, 0}, {0x02A1, 36, 33, 0}, |
27 {0x0221, 37, 34, 0}, {0x0141, 38, 35, 0}, {0x0111, 39, 36, 0}, | 27 {0x0221, 37, 34, 0}, {0x0141, 38, 35, 0}, {0x0111, 39, 36, 0}, |
28 {0x0085, 40, 37, 0}, {0x0049, 41, 38, 0}, {0x0025, 42, 39, 0}, | 28 {0x0085, 40, 37, 0}, {0x0049, 41, 38, 0}, {0x0025, 42, 39, 0}, |
29 {0x0015, 43, 40, 0}, {0x0009, 44, 41, 0}, {0x0005, 45, 42, 0}, | 29 {0x0015, 43, 40, 0}, {0x0009, 44, 41, 0}, {0x0005, 45, 42, 0}, |
30 {0x0001, 45, 43, 0}, {0x5601, 46, 46, 0}}; | 30 {0x0001, 45, 43, 0}, {0x5601, 46, 46, 0}}; |
31 | 31 |
32 extern const unsigned int JBIG2_QE_NUM = sizeof(QeTable) / sizeof(JBig2ArithQe); | 32 extern const unsigned int JBIG2_QE_NUM = FX_ArraySize(QeTable); |
33 | 33 |
34 CJBig2_Image* CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, | 34 CJBig2_Image* CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
35 JBig2ArithCtx* gbContext) { | 35 JBig2ArithCtx* gbContext) { |
36 if (GBW == 0 || GBH == 0) { | 36 if (GBW == 0 || GBH == 0) { |
37 CJBig2_Image* pImage; | 37 CJBig2_Image* pImage; |
38 JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH)); | 38 JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH)); |
39 return pImage; | 39 return pImage; |
40 } | 40 } |
41 if (GBTEMPLATE == 0) { | 41 if (GBTEMPLATE == 0) { |
42 if ((GBAT[0] == 3) && (GBAT[1] == (int8_t)-1) && (GBAT[2] == (int8_t)-3) && | 42 if ((GBAT[0] == 3) && (GBAT[1] == (int8_t)-1) && (GBAT[2] == (int8_t)-3) && |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 FX_DWORD WI, HI; | 1131 FX_DWORD WI, HI; |
1132 int32_t IDS; | 1132 int32_t IDS; |
1133 FX_BOOL RI; | 1133 FX_BOOL RI; |
1134 int32_t RDWI, RDHI, RDXI, RDYI; | 1134 int32_t RDWI, RDHI, RDXI, RDYI; |
1135 CJBig2_Image* IBOI; | 1135 CJBig2_Image* IBOI; |
1136 FX_DWORD WOI, HOI; | 1136 FX_DWORD WOI, HOI; |
1137 CJBig2_Image* SBREG; | 1137 CJBig2_Image* SBREG; |
1138 FX_BOOL bFirst; | 1138 FX_BOOL bFirst; |
1139 FX_DWORD nTmp; | 1139 FX_DWORD nTmp; |
1140 int32_t nVal, nBits; | 1140 int32_t nVal, nBits; |
1141 CJBig2_HuffmanDecoder* pHuffmanDecoder; | |
1142 CJBig2_GRRDProc* pGRRD; | 1141 CJBig2_GRRDProc* pGRRD; |
1143 CJBig2_ArithDecoder* pArithDecoder; | 1142 CJBig2_ArithDecoder* pArithDecoder; |
1144 JBIG2_ALLOC(pHuffmanDecoder, CJBig2_HuffmanDecoder(pStream)); | 1143 CJBig2_HuffmanDecoder* pHuffmanDecoder = new CJBig2_HuffmanDecoder(pStream); |
1145 JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH)); | 1144 JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH)); |
1146 SBREG->fill(SBDEFPIXEL); | 1145 SBREG->fill(SBDEFPIXEL); |
1147 if (pHuffmanDecoder->decodeAValue(SBHUFFDT, &STRIPT) != 0) { | 1146 if (pHuffmanDecoder->decodeAValue(SBHUFFDT, &STRIPT) != 0) { |
1148 m_pModule->JBig2_Error( | 1147 m_pModule->JBig2_Error( |
1149 "text region decoding procedure (huffman): too short."); | 1148 "text region decoding procedure (huffman): too short."); |
1150 goto failed; | 1149 goto failed; |
1151 } | 1150 } |
1152 STRIPT *= SBSTRIPS; | 1151 STRIPT *= SBSTRIPS; |
1153 STRIPT = -STRIPT; | 1152 STRIPT = -STRIPT; |
1154 FIRSTS = 0; | 1153 FIRSTS = 0; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 pGRRD->GRH = HOI + RDHI; | 1258 pGRRD->GRH = HOI + RDHI; |
1260 pGRRD->GRTEMPLATE = SBRTEMPLATE; | 1259 pGRRD->GRTEMPLATE = SBRTEMPLATE; |
1261 pGRRD->GRREFERENCE = IBOI; | 1260 pGRRD->GRREFERENCE = IBOI; |
1262 pGRRD->GRREFERENCEDX = (RDWI >> 2) + RDXI; | 1261 pGRRD->GRREFERENCEDX = (RDWI >> 2) + RDXI; |
1263 pGRRD->GRREFERENCEDY = (RDHI >> 2) + RDYI; | 1262 pGRRD->GRREFERENCEDY = (RDHI >> 2) + RDYI; |
1264 pGRRD->TPGRON = 0; | 1263 pGRRD->TPGRON = 0; |
1265 pGRRD->GRAT[0] = SBRAT[0]; | 1264 pGRRD->GRAT[0] = SBRAT[0]; |
1266 pGRRD->GRAT[1] = SBRAT[1]; | 1265 pGRRD->GRAT[1] = SBRAT[1]; |
1267 pGRRD->GRAT[2] = SBRAT[2]; | 1266 pGRRD->GRAT[2] = SBRAT[2]; |
1268 pGRRD->GRAT[3] = SBRAT[3]; | 1267 pGRRD->GRAT[3] = SBRAT[3]; |
1269 JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(pStream)); | 1268 pArithDecoder = new CJBig2_ArithDecoder(pStream); |
1270 IBI = pGRRD->decode(pArithDecoder, grContext); | 1269 IBI = pGRRD->decode(pArithDecoder, grContext); |
1271 if (IBI == NULL) { | 1270 if (IBI == NULL) { |
1272 delete pGRRD; | 1271 delete pGRRD; |
1273 delete pArithDecoder; | 1272 delete pArithDecoder; |
1274 goto failed; | 1273 goto failed; |
1275 } | 1274 } |
1276 delete pArithDecoder; | 1275 delete pArithDecoder; |
1277 pStream->alignByte(); | 1276 pStream->alignByte(); |
1278 pStream->offset(2); | 1277 pStream->offset(2); |
1279 if ((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) { | 1278 if ((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 IADS = pIDS->IADS; | 1380 IADS = pIDS->IADS; |
1382 IAIT = pIDS->IAIT; | 1381 IAIT = pIDS->IAIT; |
1383 IARI = pIDS->IARI; | 1382 IARI = pIDS->IARI; |
1384 IARDW = pIDS->IARDW; | 1383 IARDW = pIDS->IARDW; |
1385 IARDH = pIDS->IARDH; | 1384 IARDH = pIDS->IARDH; |
1386 IARDX = pIDS->IARDX; | 1385 IARDX = pIDS->IARDX; |
1387 IARDY = pIDS->IARDY; | 1386 IARDY = pIDS->IARDY; |
1388 IAID = pIDS->IAID; | 1387 IAID = pIDS->IAID; |
1389 bRetained = TRUE; | 1388 bRetained = TRUE; |
1390 } else { | 1389 } else { |
1391 JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder()); | 1390 IADT = new CJBig2_ArithIntDecoder(); |
1392 JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder()); | 1391 IAFS = new CJBig2_ArithIntDecoder(); |
1393 JBIG2_ALLOC(IADS, CJBig2_ArithIntDecoder()); | 1392 IADS = new CJBig2_ArithIntDecoder(); |
1394 JBIG2_ALLOC(IAIT, CJBig2_ArithIntDecoder()); | 1393 IAIT = new CJBig2_ArithIntDecoder(); |
1395 JBIG2_ALLOC(IARI, CJBig2_ArithIntDecoder()); | 1394 IARI = new CJBig2_ArithIntDecoder(); |
1396 JBIG2_ALLOC(IARDW, CJBig2_ArithIntDecoder()); | 1395 IARDW = new CJBig2_ArithIntDecoder(); |
1397 JBIG2_ALLOC(IARDH, CJBig2_ArithIntDecoder()); | 1396 IARDH = new CJBig2_ArithIntDecoder(); |
1398 JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder()); | 1397 IARDX = new CJBig2_ArithIntDecoder(); |
1399 JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder()); | 1398 IARDY = new CJBig2_ArithIntDecoder(); |
1400 JBIG2_ALLOC(IAID, CJBig2_ArithIaidDecoder(SBSYMCODELEN)); | 1399 IAID = new CJBig2_ArithIaidDecoder(SBSYMCODELEN); |
1401 bRetained = FALSE; | 1400 bRetained = FALSE; |
1402 } | 1401 } |
1403 JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH)); | 1402 JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH)); |
1404 SBREG->fill(SBDEFPIXEL); | 1403 SBREG->fill(SBDEFPIXEL); |
1405 if (IADT->decode(pArithDecoder, &STRIPT) == -1) { | 1404 if (IADT->decode(pArithDecoder, &STRIPT) == -1) { |
1406 m_pModule->JBig2_Error( | 1405 m_pModule->JBig2_Error( |
1407 "text region decoding procedure (arith): too short."); | 1406 "text region decoding procedure (arith): too short."); |
1408 goto failed; | 1407 goto failed; |
1409 } | 1408 } |
1410 STRIPT *= SBSTRIPS; | 1409 STRIPT *= SBSTRIPS; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1626 int32_t RDXI, RDYI; | 1625 int32_t RDXI, RDYI; |
1627 CJBig2_Image** SBSYMS; | 1626 CJBig2_Image** SBSYMS; |
1628 CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, | 1627 CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, |
1629 *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE; | 1628 *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE; |
1630 CJBig2_GRRDProc* pGRRD; | 1629 CJBig2_GRRDProc* pGRRD; |
1631 CJBig2_GRDProc* pGRD; | 1630 CJBig2_GRDProc* pGRD; |
1632 CJBig2_ArithIntDecoder *IADH, *IADW, *IAAI, *IARDX, *IARDY, *IAEX, *IADT, | 1631 CJBig2_ArithIntDecoder *IADH, *IADW, *IAAI, *IARDX, *IARDY, *IAEX, *IADT, |
1633 *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH; | 1632 *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH; |
1634 CJBig2_ArithIaidDecoder* IAID; | 1633 CJBig2_ArithIaidDecoder* IAID; |
1635 CJBig2_SymbolDict* pDict; | 1634 CJBig2_SymbolDict* pDict; |
1636 JBIG2_ALLOC(IADH, CJBig2_ArithIntDecoder()); | 1635 IADH = new CJBig2_ArithIntDecoder(); |
1637 JBIG2_ALLOC(IADW, CJBig2_ArithIntDecoder()); | 1636 IADW = new CJBig2_ArithIntDecoder(); |
1638 JBIG2_ALLOC(IAAI, CJBig2_ArithIntDecoder()); | 1637 IAAI = new CJBig2_ArithIntDecoder(); |
1639 JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder()); | 1638 IARDX = new CJBig2_ArithIntDecoder(); |
1640 JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder()); | 1639 IARDY = new CJBig2_ArithIntDecoder(); |
1641 JBIG2_ALLOC(IAEX, CJBig2_ArithIntDecoder()); | 1640 IAEX = new CJBig2_ArithIntDecoder(); |
1642 JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder()); | 1641 IADT = new CJBig2_ArithIntDecoder(); |
1643 JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder()); | 1642 IAFS = new CJBig2_ArithIntDecoder(); |
1644 JBIG2_ALLOC(IADS, CJBig2_ArithIntDecoder()); | 1643 IADS = new CJBig2_ArithIntDecoder(); |
1645 JBIG2_ALLOC(IAIT, CJBig2_ArithIntDecoder()); | 1644 IAIT = new CJBig2_ArithIntDecoder(); |
1646 JBIG2_ALLOC(IARI, CJBig2_ArithIntDecoder()); | 1645 IARI = new CJBig2_ArithIntDecoder(); |
1647 JBIG2_ALLOC(IARDW, CJBig2_ArithIntDecoder()); | 1646 IARDW = new CJBig2_ArithIntDecoder(); |
1648 JBIG2_ALLOC(IARDH, CJBig2_ArithIntDecoder()); | 1647 IARDH = new CJBig2_ArithIntDecoder(); |
1649 nTmp = 0; | 1648 nTmp = 0; |
1650 while ((FX_DWORD)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) { | 1649 while ((FX_DWORD)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) { |
1651 nTmp++; | 1650 nTmp++; |
1652 } | 1651 } |
1653 JBIG2_ALLOC(IAID, CJBig2_ArithIaidDecoder((uint8_t)nTmp)); | 1652 IAID = new CJBig2_ArithIaidDecoder((uint8_t)nTmp); |
1654 SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, | 1653 SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, |
1655 sizeof(CJBig2_Image*)); | 1654 sizeof(CJBig2_Image*)); |
1656 FXSYS_memset(SDNEWSYMS, 0, SDNUMNEWSYMS * sizeof(CJBig2_Image*)); | 1655 FXSYS_memset(SDNEWSYMS, 0, SDNUMNEWSYMS * sizeof(CJBig2_Image*)); |
1657 HCHEIGHT = 0; | 1656 HCHEIGHT = 0; |
1658 NSYMSDECODED = 0; | 1657 NSYMSDECODED = 0; |
1659 while (NSYMSDECODED < SDNUMNEWSYMS) { | 1658 while (NSYMSDECODED < SDNUMNEWSYMS) { |
1660 BS = NULL; | 1659 BS = NULL; |
1661 if (IADH->decode(pArithDecoder, &HCDH) == -1) { | 1660 if (IADH->decode(pArithDecoder, &HCDH) == -1) { |
1662 m_pModule->JBig2_Error( | 1661 m_pModule->JBig2_Error( |
1663 "symbol dictionary decoding procedure (arith): too short."); | 1662 "symbol dictionary decoding procedure (arith): too short."); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 SBNUMSYMS, sizeof(CJBig2_Image*)); | 1749 SBNUMSYMS, sizeof(CJBig2_Image*)); |
1751 JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*)); | 1750 JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*)); |
1752 JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, | 1751 JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, |
1753 NSYMSDECODED * sizeof(CJBig2_Image*)); | 1752 NSYMSDECODED * sizeof(CJBig2_Image*)); |
1754 pDecoder->SBSYMS = SBSYMS; | 1753 pDecoder->SBSYMS = SBSYMS; |
1755 pDecoder->SBDEFPIXEL = 0; | 1754 pDecoder->SBDEFPIXEL = 0; |
1756 pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR; | 1755 pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR; |
1757 pDecoder->TRANSPOSED = 0; | 1756 pDecoder->TRANSPOSED = 0; |
1758 pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT; | 1757 pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT; |
1759 pDecoder->SBDSOFFSET = 0; | 1758 pDecoder->SBDSOFFSET = 0; |
1760 JBIG2_ALLOC(SBHUFFFS, CJBig2_HuffmanTable(HuffmanTable_B6, | 1759 SBHUFFFS = new CJBig2_HuffmanTable(HuffmanTable_B6, |
1761 sizeof(HuffmanTable_B6) / | 1760 FX_ArraySize(HuffmanTable_B6), |
1762 sizeof(JBig2TableLine), | 1761 HuffmanTable_HTOOB_B6); |
1763 HuffmanTable_HTOOB_B6)); | 1762 SBHUFFDS = new CJBig2_HuffmanTable(HuffmanTable_B8, |
1764 JBIG2_ALLOC(SBHUFFDS, CJBig2_HuffmanTable(HuffmanTable_B8, | 1763 FX_ArraySize(HuffmanTable_B8), |
1765 sizeof(HuffmanTable_B8) / | 1764 HuffmanTable_HTOOB_B8); |
1766 sizeof(JBig2TableLine), | 1765 SBHUFFDT = new CJBig2_HuffmanTable(HuffmanTable_B11, |
1767 HuffmanTable_HTOOB_B8)); | 1766 FX_ArraySize(HuffmanTable_B11), |
1768 JBIG2_ALLOC(SBHUFFDT, CJBig2_HuffmanTable(HuffmanTable_B11, | 1767 HuffmanTable_HTOOB_B11); |
1769 sizeof(HuffmanTable_B11) / | 1768 SBHUFFRDW = new CJBig2_HuffmanTable(HuffmanTable_B15, |
1770 sizeof(JBig2TableLine), | 1769 FX_ArraySize(HuffmanTable_B15), |
1771 HuffmanTable_HTOOB_B11)); | 1770 HuffmanTable_HTOOB_B15); |
1772 JBIG2_ALLOC(SBHUFFRDW, CJBig2_HuffmanTable(HuffmanTable_B15, | 1771 SBHUFFRDH = new CJBig2_HuffmanTable(HuffmanTable_B15, |
1773 sizeof(HuffmanTable_B15) / | 1772 FX_ArraySize(HuffmanTable_B15), |
1774 sizeof(JBig2TableLine), | 1773 HuffmanTable_HTOOB_B15); |
1775 HuffmanTable_HTOOB_B15)); | 1774 SBHUFFRDX = new CJBig2_HuffmanTable(HuffmanTable_B15, |
1776 JBIG2_ALLOC(SBHUFFRDH, CJBig2_HuffmanTable(HuffmanTable_B15, | 1775 FX_ArraySize(HuffmanTable_B15), |
1777 sizeof(HuffmanTable_B15) / | 1776 HuffmanTable_HTOOB_B15); |
1778 sizeof(JBig2TableLine), | 1777 SBHUFFRDY = new CJBig2_HuffmanTable(HuffmanTable_B15, |
1779 HuffmanTable_HTOOB_B15)); | 1778 FX_ArraySize(HuffmanTable_B15), |
1780 JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15, | 1779 HuffmanTable_HTOOB_B15); |
1781 sizeof(HuffmanTable_B15) / | 1780 SBHUFFRSIZE = new CJBig2_HuffmanTable(HuffmanTable_B1, |
1782 sizeof(JBig2TableLine), | 1781 FX_ArraySize(HuffmanTable_B1), |
1783 HuffmanTable_HTOOB_B15)); | 1782 HuffmanTable_HTOOB_B1); |
1784 JBIG2_ALLOC(SBHUFFRDY, CJBig2_HuffmanTable(HuffmanTable_B15, | |
1785 sizeof(HuffmanTable_B15) / | |
1786 sizeof(JBig2TableLine), | |
1787 HuffmanTable_HTOOB_B15)); | |
1788 JBIG2_ALLOC(SBHUFFRSIZE, | |
1789 CJBig2_HuffmanTable( | |
1790 HuffmanTable_B1, | |
1791 sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), | |
1792 HuffmanTable_HTOOB_B1)); | |
1793 pDecoder->SBHUFFFS = SBHUFFFS; | 1783 pDecoder->SBHUFFFS = SBHUFFFS; |
1794 pDecoder->SBHUFFDS = SBHUFFDS; | 1784 pDecoder->SBHUFFDS = SBHUFFDS; |
1795 pDecoder->SBHUFFDT = SBHUFFDT; | 1785 pDecoder->SBHUFFDT = SBHUFFDT; |
1796 pDecoder->SBHUFFRDW = SBHUFFRDW; | 1786 pDecoder->SBHUFFRDW = SBHUFFRDW; |
1797 pDecoder->SBHUFFRDH = SBHUFFRDH; | 1787 pDecoder->SBHUFFRDH = SBHUFFRDH; |
1798 pDecoder->SBHUFFRDX = SBHUFFRDX; | 1788 pDecoder->SBHUFFRDX = SBHUFFRDX; |
1799 pDecoder->SBHUFFRDY = SBHUFFRDY; | 1789 pDecoder->SBHUFFRDY = SBHUFFRDY; |
1800 pDecoder->SBHUFFRSIZE = SBHUFFRSIZE; | 1790 pDecoder->SBHUFFRSIZE = SBHUFFRSIZE; |
1801 pDecoder->SBRTEMPLATE = SDRTEMPLATE; | 1791 pDecoder->SBRTEMPLATE = SDRTEMPLATE; |
1802 pDecoder->SBRAT[0] = SDRAT[0]; | 1792 pDecoder->SBRAT[0] = SDRAT[0]; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 FX_DWORD BMSIZE; | 1997 FX_DWORD BMSIZE; |
2008 FX_DWORD stride; | 1998 FX_DWORD stride; |
2009 CJBig2_Image** SBSYMS; | 1999 CJBig2_Image** SBSYMS; |
2010 CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, | 2000 CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, |
2011 *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE, *pTable; | 2001 *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE, *pTable; |
2012 CJBig2_HuffmanDecoder* pHuffmanDecoder; | 2002 CJBig2_HuffmanDecoder* pHuffmanDecoder; |
2013 CJBig2_GRRDProc* pGRRD; | 2003 CJBig2_GRRDProc* pGRRD; |
2014 CJBig2_ArithDecoder* pArithDecoder; | 2004 CJBig2_ArithDecoder* pArithDecoder; |
2015 CJBig2_GRDProc* pGRD; | 2005 CJBig2_GRDProc* pGRD; |
2016 CJBig2_SymbolDict* pDict; | 2006 CJBig2_SymbolDict* pDict; |
2017 JBIG2_ALLOC(pHuffmanDecoder, CJBig2_HuffmanDecoder(pStream)); | 2007 pHuffmanDecoder = new CJBig2_HuffmanDecoder(pStream); |
2018 SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, | 2008 SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, |
2019 sizeof(CJBig2_Image*)); | 2009 sizeof(CJBig2_Image*)); |
2020 FXSYS_memset(SDNEWSYMS, 0, SDNUMNEWSYMS * sizeof(CJBig2_Image*)); | 2010 FXSYS_memset(SDNEWSYMS, 0, SDNUMNEWSYMS * sizeof(CJBig2_Image*)); |
2021 SDNEWSYMWIDTHS = NULL; | 2011 SDNEWSYMWIDTHS = NULL; |
2022 BHC = NULL; | 2012 BHC = NULL; |
2023 if (SDREFAGG == 0) { | 2013 if (SDREFAGG == 0) { |
2024 SDNEWSYMWIDTHS = | 2014 SDNEWSYMWIDTHS = |
2025 (FX_DWORD*)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(FX_DWORD)); | 2015 (FX_DWORD*)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(FX_DWORD)); |
2026 FXSYS_memset(SDNEWSYMWIDTHS, 0, SDNUMNEWSYMS * sizeof(FX_DWORD)); | 2016 FXSYS_memset(SDNEWSYMWIDTHS, 0, SDNUMNEWSYMS * sizeof(FX_DWORD)); |
2027 } | 2017 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 SBNUMSYMS, sizeof(CJBig2_Image*)); | 2097 SBNUMSYMS, sizeof(CJBig2_Image*)); |
2108 JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*)); | 2098 JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*)); |
2109 JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, | 2099 JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, |
2110 NSYMSDECODED * sizeof(CJBig2_Image*)); | 2100 NSYMSDECODED * sizeof(CJBig2_Image*)); |
2111 pDecoder->SBSYMS = SBSYMS; | 2101 pDecoder->SBSYMS = SBSYMS; |
2112 pDecoder->SBDEFPIXEL = 0; | 2102 pDecoder->SBDEFPIXEL = 0; |
2113 pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR; | 2103 pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR; |
2114 pDecoder->TRANSPOSED = 0; | 2104 pDecoder->TRANSPOSED = 0; |
2115 pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT; | 2105 pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT; |
2116 pDecoder->SBDSOFFSET = 0; | 2106 pDecoder->SBDSOFFSET = 0; |
2117 JBIG2_ALLOC(SBHUFFFS, CJBig2_HuffmanTable(HuffmanTable_B6, | 2107 SBHUFFFS = new CJBig2_HuffmanTable(HuffmanTable_B6, |
2118 sizeof(HuffmanTable_B6) / | 2108 FX_ArraySize(HuffmanTable_B6), |
2119 sizeof(JBig2TableLine), | 2109 HuffmanTable_HTOOB_B6); |
2120 HuffmanTable_HTOOB_B6)); | 2110 SBHUFFDS = new CJBig2_HuffmanTable(HuffmanTable_B8, |
2121 JBIG2_ALLOC(SBHUFFDS, CJBig2_HuffmanTable(HuffmanTable_B8, | 2111 FX_ArraySize(HuffmanTable_B8), |
2122 sizeof(HuffmanTable_B8) / | 2112 HuffmanTable_HTOOB_B8); |
2123 sizeof(JBig2TableLine), | 2113 SBHUFFDT = new CJBig2_HuffmanTable(HuffmanTable_B11, |
2124 HuffmanTable_HTOOB_B8)); | 2114 FX_ArraySize(HuffmanTable_B11), |
2125 JBIG2_ALLOC(SBHUFFDT, CJBig2_HuffmanTable(HuffmanTable_B11, | 2115 HuffmanTable_HTOOB_B11); |
2126 sizeof(HuffmanTable_B11) / | 2116 SBHUFFRDW = new CJBig2_HuffmanTable(HuffmanTable_B15, |
2127 sizeof(JBig2TableLine), | 2117 FX_ArraySize(HuffmanTable_B15), |
2128 HuffmanTable_HTOOB_B11)); | 2118 HuffmanTable_HTOOB_B15); |
2129 JBIG2_ALLOC(SBHUFFRDW, CJBig2_HuffmanTable(HuffmanTable_B15, | 2119 SBHUFFRDH = new CJBig2_HuffmanTable(HuffmanTable_B15, |
2130 sizeof(HuffmanTable_B15) / | 2120 FX_ArraySize(HuffmanTable_B15), |
2131 sizeof(JBig2TableLine), | 2121 HuffmanTable_HTOOB_B15); |
2132 HuffmanTable_HTOOB_B15)); | 2122 SBHUFFRDX = new CJBig2_HuffmanTable(HuffmanTable_B15, |
2133 JBIG2_ALLOC(SBHUFFRDH, CJBig2_HuffmanTable(HuffmanTable_B15, | 2123 FX_ArraySize(HuffmanTable_B15), |
2134 sizeof(HuffmanTable_B15) / | 2124 HuffmanTable_HTOOB_B15); |
2135 sizeof(JBig2TableLine), | 2125 SBHUFFRDY = new CJBig2_HuffmanTable(HuffmanTable_B15, |
2136 HuffmanTable_HTOOB_B15)); | 2126 FX_ArraySize(HuffmanTable_B15), |
2137 JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15, | 2127 HuffmanTable_HTOOB_B15); |
2138 sizeof(HuffmanTable_B15) / | 2128 SBHUFFRSIZE = new CJBig2_HuffmanTable(HuffmanTable_B1, |
2139 sizeof(JBig2TableLine), | 2129 FX_ArraySize(HuffmanTable_B1), |
2140 HuffmanTable_HTOOB_B15)); | 2130 HuffmanTable_HTOOB_B1); |
2141 JBIG2_ALLOC(SBHUFFRDY, CJBig2_HuffmanTable(HuffmanTable_B15, | |
2142 sizeof(HuffmanTable_B15) / | |
2143 sizeof(JBig2TableLine), | |
2144 HuffmanTable_HTOOB_B15)); | |
2145 JBIG2_ALLOC(SBHUFFRSIZE, | |
2146 CJBig2_HuffmanTable( | |
2147 HuffmanTable_B1, | |
2148 sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), | |
2149 HuffmanTable_HTOOB_B1)); | |
2150 pDecoder->SBHUFFFS = SBHUFFFS; | 2131 pDecoder->SBHUFFFS = SBHUFFFS; |
2151 pDecoder->SBHUFFDS = SBHUFFDS; | 2132 pDecoder->SBHUFFDS = SBHUFFDS; |
2152 pDecoder->SBHUFFDT = SBHUFFDT; | 2133 pDecoder->SBHUFFDT = SBHUFFDT; |
2153 pDecoder->SBHUFFRDW = SBHUFFRDW; | 2134 pDecoder->SBHUFFRDW = SBHUFFRDW; |
2154 pDecoder->SBHUFFRDH = SBHUFFRDH; | 2135 pDecoder->SBHUFFRDH = SBHUFFRDH; |
2155 pDecoder->SBHUFFRDX = SBHUFFRDX; | 2136 pDecoder->SBHUFFRDX = SBHUFFRDX; |
2156 pDecoder->SBHUFFRDY = SBHUFFRDY; | 2137 pDecoder->SBHUFFRDY = SBHUFFRDY; |
2157 pDecoder->SBHUFFRSIZE = SBHUFFRSIZE; | 2138 pDecoder->SBHUFFRSIZE = SBHUFFRSIZE; |
2158 pDecoder->SBRTEMPLATE = SDRTEMPLATE; | 2139 pDecoder->SBRTEMPLATE = SDRTEMPLATE; |
2159 pDecoder->SBRAT[0] = SDRAT[0]; | 2140 pDecoder->SBRAT[0] = SDRAT[0]; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2213 if ((nVal == SBSYMCODES[IDI].code) && | 2194 if ((nVal == SBSYMCODES[IDI].code) && |
2214 (nBits == SBSYMCODES[IDI].codelen)) { | 2195 (nBits == SBSYMCODES[IDI].codelen)) { |
2215 break; | 2196 break; |
2216 } | 2197 } |
2217 } | 2198 } |
2218 if (IDI < SBNUMSYMS) { | 2199 if (IDI < SBNUMSYMS) { |
2219 break; | 2200 break; |
2220 } | 2201 } |
2221 } | 2202 } |
2222 m_pModule->JBig2_Free(SBSYMCODES); | 2203 m_pModule->JBig2_Free(SBSYMCODES); |
2223 JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15, | 2204 SBHUFFRDX = new CJBig2_HuffmanTable(HuffmanTable_B15, |
2224 sizeof(HuffmanTable_B15) / | 2205 FX_ArraySize(HuffmanTable_B15), |
2225 sizeof(JBig2TableLine), | 2206 HuffmanTable_HTOOB_B15); |
2226 HuffmanTable_HTOOB_B15)); | 2207 SBHUFFRSIZE = new CJBig2_HuffmanTable(HuffmanTable_B1, |
2227 JBIG2_ALLOC(SBHUFFRSIZE, | 2208 FX_ArraySize(HuffmanTable_B1), |
2228 CJBig2_HuffmanTable( | 2209 HuffmanTable_HTOOB_B1); |
2229 HuffmanTable_B1, | |
2230 sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), | |
2231 HuffmanTable_HTOOB_B1)); | |
2232 if ((pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDXI) != 0) || | 2210 if ((pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDXI) != 0) || |
2233 (pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDYI) != 0) || | 2211 (pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDYI) != 0) || |
2234 (pHuffmanDecoder->decodeAValue(SBHUFFRSIZE, &nVal) != 0)) { | 2212 (pHuffmanDecoder->decodeAValue(SBHUFFRSIZE, &nVal) != 0)) { |
2235 delete SBHUFFRDX; | 2213 delete SBHUFFRDX; |
2236 delete SBHUFFRSIZE; | 2214 delete SBHUFFRSIZE; |
2237 m_pModule->JBig2_Error( | 2215 m_pModule->JBig2_Error( |
2238 "symbol dictionary decoding procedure (huffman): too short."); | 2216 "symbol dictionary decoding procedure (huffman): too short."); |
2239 goto failed; | 2217 goto failed; |
2240 } | 2218 } |
2241 delete SBHUFFRDX; | 2219 delete SBHUFFRDX; |
(...skipping 10 matching lines...) Expand all Loading... |
2252 pGRRD->GRH = HCHEIGHT; | 2230 pGRRD->GRH = HCHEIGHT; |
2253 pGRRD->GRTEMPLATE = SDRTEMPLATE; | 2231 pGRRD->GRTEMPLATE = SDRTEMPLATE; |
2254 pGRRD->GRREFERENCE = SBSYMS[IDI]; | 2232 pGRRD->GRREFERENCE = SBSYMS[IDI]; |
2255 pGRRD->GRREFERENCEDX = RDXI; | 2233 pGRRD->GRREFERENCEDX = RDXI; |
2256 pGRRD->GRREFERENCEDY = RDYI; | 2234 pGRRD->GRREFERENCEDY = RDYI; |
2257 pGRRD->TPGRON = 0; | 2235 pGRRD->TPGRON = 0; |
2258 pGRRD->GRAT[0] = SDRAT[0]; | 2236 pGRRD->GRAT[0] = SDRAT[0]; |
2259 pGRRD->GRAT[1] = SDRAT[1]; | 2237 pGRRD->GRAT[1] = SDRAT[1]; |
2260 pGRRD->GRAT[2] = SDRAT[2]; | 2238 pGRRD->GRAT[2] = SDRAT[2]; |
2261 pGRRD->GRAT[3] = SDRAT[3]; | 2239 pGRRD->GRAT[3] = SDRAT[3]; |
2262 JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(pStream)); | 2240 pArithDecoder = new CJBig2_ArithDecoder(pStream); |
2263 BS = pGRRD->decode(pArithDecoder, grContext); | 2241 BS = pGRRD->decode(pArithDecoder, grContext); |
2264 if (BS == NULL) { | 2242 if (BS == NULL) { |
2265 m_pModule->JBig2_Free(SBSYMS); | 2243 m_pModule->JBig2_Free(SBSYMS); |
2266 delete pGRRD; | 2244 delete pGRRD; |
2267 delete pArithDecoder; | 2245 delete pArithDecoder; |
2268 goto failed; | 2246 goto failed; |
2269 } | 2247 } |
2270 pStream->alignByte(); | 2248 pStream->alignByte(); |
2271 pStream->offset(2); | 2249 pStream->offset(2); |
2272 if ((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) { | 2250 if ((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 for (I = HCFIRSTSYM; I < NSYMSDECODED; I++) { | 2309 for (I = HCFIRSTSYM; I < NSYMSDECODED; I++) { |
2332 SDNEWSYMS[I] = BHC->subImage(nTmp, 0, SDNEWSYMWIDTHS[I], HCHEIGHT); | 2310 SDNEWSYMS[I] = BHC->subImage(nTmp, 0, SDNEWSYMWIDTHS[I], HCHEIGHT); |
2333 nTmp += SDNEWSYMWIDTHS[I]; | 2311 nTmp += SDNEWSYMWIDTHS[I]; |
2334 } | 2312 } |
2335 delete BHC; | 2313 delete BHC; |
2336 BHC = NULL; | 2314 BHC = NULL; |
2337 } | 2315 } |
2338 } | 2316 } |
2339 EXINDEX = 0; | 2317 EXINDEX = 0; |
2340 CUREXFLAG = 0; | 2318 CUREXFLAG = 0; |
2341 JBIG2_ALLOC(pTable, CJBig2_HuffmanTable( | 2319 pTable = new CJBig2_HuffmanTable( |
2342 HuffmanTable_B1, | 2320 HuffmanTable_B1, FX_ArraySize(HuffmanTable_B1), HuffmanTable_HTOOB_B1); |
2343 sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), | |
2344 HuffmanTable_HTOOB_B1)); | |
2345 EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), | 2321 EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), |
2346 (SDNUMINSYMS + SDNUMNEWSYMS)); | 2322 (SDNUMINSYMS + SDNUMNEWSYMS)); |
2347 while (EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) { | 2323 while (EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) { |
2348 if (pHuffmanDecoder->decodeAValue(pTable, (int*)&EXRUNLENGTH) != 0) { | 2324 if (pHuffmanDecoder->decodeAValue(pTable, (int*)&EXRUNLENGTH) != 0) { |
2349 delete pTable; | 2325 delete pTable; |
2350 m_pModule->JBig2_Free(EXFLAGS); | 2326 m_pModule->JBig2_Free(EXFLAGS); |
2351 m_pModule->JBig2_Error( | 2327 m_pModule->JBig2_Error( |
2352 "symbol dictionary decoding procedure (huffman): too short."); | 2328 "symbol dictionary decoding procedure (huffman): too short."); |
2353 goto failed; | 2329 goto failed; |
2354 } | 2330 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2516 return NULL; | 2492 return NULL; |
2517 } | 2493 } |
2518 CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( | 2494 CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( |
2519 CJBig2_ArithDecoder* pArithDecoder, | 2495 CJBig2_ArithDecoder* pArithDecoder, |
2520 JBig2ArithCtx* gbContext, | 2496 JBig2ArithCtx* gbContext, |
2521 IFX_Pause* pPause) { | 2497 IFX_Pause* pPause) { |
2522 FX_DWORD GRAY; | 2498 FX_DWORD GRAY; |
2523 CJBig2_Image* BHDC = NULL; | 2499 CJBig2_Image* BHDC = NULL; |
2524 CJBig2_PatternDict* pDict; | 2500 CJBig2_PatternDict* pDict; |
2525 CJBig2_GRDProc* pGRD; | 2501 CJBig2_GRDProc* pGRD; |
2526 JBIG2_ALLOC(pDict, CJBig2_PatternDict()); | 2502 pDict = new CJBig2_PatternDict(); |
2527 pDict->NUMPATS = GRAYMAX + 1; | 2503 pDict->NUMPATS = GRAYMAX + 1; |
2528 pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2( | 2504 pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2( |
2529 sizeof(CJBig2_Image*), pDict->NUMPATS); | 2505 sizeof(CJBig2_Image*), pDict->NUMPATS); |
2530 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); | 2506 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); |
2531 JBIG2_ALLOC(pGRD, CJBig2_GRDProc()); | 2507 JBIG2_ALLOC(pGRD, CJBig2_GRDProc()); |
2532 pGRD->MMR = HDMMR; | 2508 pGRD->MMR = HDMMR; |
2533 pGRD->GBW = (GRAYMAX + 1) * HDPW; | 2509 pGRD->GBW = (GRAYMAX + 1) * HDPW; |
2534 pGRD->GBH = HDPH; | 2510 pGRD->GBH = HDPH; |
2535 pGRD->GBTEMPLATE = HDTEMPLATE; | 2511 pGRD->GBTEMPLATE = HDTEMPLATE; |
2536 pGRD->TPGDON = 0; | 2512 pGRD->TPGDON = 0; |
(...skipping 27 matching lines...) Expand all Loading... |
2564 return pDict; | 2540 return pDict; |
2565 failed: | 2541 failed: |
2566 delete pDict; | 2542 delete pDict; |
2567 return NULL; | 2543 return NULL; |
2568 } | 2544 } |
2569 | 2545 |
2570 CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream, | 2546 CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream, |
2571 IFX_Pause* pPause) { | 2547 IFX_Pause* pPause) { |
2572 FX_DWORD GRAY; | 2548 FX_DWORD GRAY; |
2573 CJBig2_Image* BHDC = NULL; | 2549 CJBig2_Image* BHDC = NULL; |
2574 CJBig2_PatternDict* pDict; | |
2575 CJBig2_GRDProc* pGRD; | 2550 CJBig2_GRDProc* pGRD; |
2576 JBIG2_ALLOC(pDict, CJBig2_PatternDict()); | 2551 CJBig2_PatternDict* pDict = new CJBig2_PatternDict(); |
2577 pDict->NUMPATS = GRAYMAX + 1; | 2552 pDict->NUMPATS = GRAYMAX + 1; |
2578 pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2( | 2553 pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2( |
2579 sizeof(CJBig2_Image*), pDict->NUMPATS); | 2554 sizeof(CJBig2_Image*), pDict->NUMPATS); |
2580 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); | 2555 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); |
2581 JBIG2_ALLOC(pGRD, CJBig2_GRDProc()); | 2556 JBIG2_ALLOC(pGRD, CJBig2_GRDProc()); |
2582 pGRD->MMR = HDMMR; | 2557 pGRD->MMR = HDMMR; |
2583 pGRD->GBW = (GRAYMAX + 1) * HDPW; | 2558 pGRD->GBW = (GRAYMAX + 1) * HDPW; |
2584 pGRD->GBH = HDPH; | 2559 pGRD->GBH = HDPH; |
2585 FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHDC, pStream); | 2560 FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHDC, pStream); |
2586 while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) { | 2561 while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) { |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3427 } | 3402 } |
3428 if (pPause && pPause->NeedToPauseNow()) { | 3403 if (pPause && pPause->NeedToPauseNow()) { |
3429 m_loopIndex++; | 3404 m_loopIndex++; |
3430 m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; | 3405 m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; |
3431 return FXCODEC_STATUS_DECODE_TOBECONTINUE; | 3406 return FXCODEC_STATUS_DECODE_TOBECONTINUE; |
3432 } | 3407 } |
3433 } | 3408 } |
3434 m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; | 3409 m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH; |
3435 return FXCODEC_STATUS_DECODE_FINISH; | 3410 return FXCODEC_STATUS_DECODE_FINISH; |
3436 } | 3411 } |
OLD | NEW |