diff options
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_Context.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_Context.cpp | 70 |
1 files changed, 23 insertions, 47 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp index 37971cec94..f49276444f 100644 --- a/core/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/fxcodec/jbig2/JBig2_Context.cpp @@ -19,7 +19,6 @@ #include "core/fxcodec/jbig2/JBig2_GrdProc.h" #include "core/fxcodec/jbig2/JBig2_GrrdProc.h" #include "core/fxcodec/jbig2/JBig2_HtrdProc.h" -#include "core/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h" #include "core/fxcodec/jbig2/JBig2_PddProc.h" #include "core/fxcodec/jbig2/JBig2_SddProc.h" #include "core/fxcodec/jbig2/JBig2_TrdProc.h" @@ -489,12 +488,10 @@ JBig2_Result CJBig2_Context::ParseSymbolDict(CJBig2_Segment* pSegment) { int32_t nIndex = 0; if (cSDHUFFDH == 0) { - Table_B4 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B4, HuffmanTable_B4_Size, HuffmanTable_HTOOB_B4); + Table_B4 = pdfium::MakeUnique<CJBig2_HuffmanTable>(4); pSymbolDictDecoder->SDHUFFDH = Table_B4.get(); } else if (cSDHUFFDH == 1) { - Table_B5 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B5, HuffmanTable_B5_Size, HuffmanTable_HTOOB_B5); + Table_B5 = pdfium::MakeUnique<CJBig2_HuffmanTable>(5); pSymbolDictDecoder->SDHUFFDH = Table_B5.get(); } else { CJBig2_Segment* pSeg = @@ -504,12 +501,10 @@ JBig2_Result CJBig2_Context::ParseSymbolDict(CJBig2_Segment* pSegment) { pSymbolDictDecoder->SDHUFFDH = pSeg->m_HuffmanTable.get(); } if (cSDHUFFDW == 0) { - Table_B2 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B2, HuffmanTable_B2_Size, HuffmanTable_HTOOB_B2); + Table_B2 = pdfium::MakeUnique<CJBig2_HuffmanTable>(2); pSymbolDictDecoder->SDHUFFDW = Table_B2.get(); } else if (cSDHUFFDW == 1) { - Table_B3 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B3, HuffmanTable_B3_Size, HuffmanTable_HTOOB_B3); + Table_B3 = pdfium::MakeUnique<CJBig2_HuffmanTable>(3); pSymbolDictDecoder->SDHUFFDW = Table_B3.get(); } else { CJBig2_Segment* pSeg = @@ -519,8 +514,7 @@ JBig2_Result CJBig2_Context::ParseSymbolDict(CJBig2_Segment* pSegment) { pSymbolDictDecoder->SDHUFFDW = pSeg->m_HuffmanTable.get(); } if (cSDHUFFBMSIZE == 0) { - Table_B1 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B1, HuffmanTable_B1_Size, HuffmanTable_HTOOB_B1); + Table_B1 = pdfium::MakeUnique<CJBig2_HuffmanTable>(1); pSymbolDictDecoder->SDHUFFBMSIZE = Table_B1.get(); } else { CJBig2_Segment* pSeg = @@ -532,8 +526,7 @@ JBig2_Result CJBig2_Context::ParseSymbolDict(CJBig2_Segment* pSegment) { if (pSymbolDictDecoder->SDREFAGG == 1) { if (cSDHUFFAGGINST == 0) { if (!Table_B1) { - Table_B1 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B1, HuffmanTable_B1_Size, HuffmanTable_HTOOB_B1); + Table_B1 = pdfium::MakeUnique<CJBig2_HuffmanTable>(1); } pSymbolDictDecoder->SDHUFFAGGINST = Table_B1.get(); } else { @@ -761,12 +754,10 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { } int32_t nIndex = 0; if (cSBHUFFFS == 0) { - Table_B6 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B6, HuffmanTable_B6_Size, HuffmanTable_HTOOB_B6); + Table_B6 = pdfium::MakeUnique<CJBig2_HuffmanTable>(6); pTRD->SBHUFFFS = Table_B6.get(); } else if (cSBHUFFFS == 1) { - Table_B7 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B7, HuffmanTable_B7_Size, HuffmanTable_HTOOB_B7); + Table_B7 = pdfium::MakeUnique<CJBig2_HuffmanTable>(7); pTRD->SBHUFFFS = Table_B7.get(); } else { CJBig2_Segment* pSeg = @@ -776,16 +767,13 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { pTRD->SBHUFFFS = pSeg->m_HuffmanTable.get(); } if (cSBHUFFDS == 0) { - Table_B8 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B8, HuffmanTable_B8_Size, HuffmanTable_HTOOB_B8); + Table_B8 = pdfium::MakeUnique<CJBig2_HuffmanTable>(8); pTRD->SBHUFFDS = Table_B8.get(); } else if (cSBHUFFDS == 1) { - Table_B9 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B9, HuffmanTable_B9_Size, HuffmanTable_HTOOB_B9); + Table_B9 = pdfium::MakeUnique<CJBig2_HuffmanTable>(9); pTRD->SBHUFFDS = Table_B9.get(); } else if (cSBHUFFDS == 2) { - Table_B10 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B10, HuffmanTable_B10_Size, HuffmanTable_HTOOB_B10); + Table_B10 = pdfium::MakeUnique<CJBig2_HuffmanTable>(10); pTRD->SBHUFFDS = Table_B10.get(); } else { CJBig2_Segment* pSeg = @@ -795,16 +783,13 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { pTRD->SBHUFFDS = pSeg->m_HuffmanTable.get(); } if (cSBHUFFDT == 0) { - Table_B11 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B11, HuffmanTable_B11_Size, HuffmanTable_HTOOB_B11); + Table_B11 = pdfium::MakeUnique<CJBig2_HuffmanTable>(11); pTRD->SBHUFFDT = Table_B11.get(); } else if (cSBHUFFDT == 1) { - Table_B12 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B12, HuffmanTable_B12_Size, HuffmanTable_HTOOB_B12); + Table_B12 = pdfium::MakeUnique<CJBig2_HuffmanTable>(12); pTRD->SBHUFFDT = Table_B12.get(); } else if (cSBHUFFDT == 2) { - Table_B13 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B13, HuffmanTable_B13_Size, HuffmanTable_HTOOB_B13); + Table_B13 = pdfium::MakeUnique<CJBig2_HuffmanTable>(13); pTRD->SBHUFFDT = Table_B13.get(); } else { CJBig2_Segment* pSeg = @@ -814,12 +799,10 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { pTRD->SBHUFFDT = pSeg->m_HuffmanTable.get(); } if (cSBHUFFRDW == 0) { - Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B14, HuffmanTable_B14_Size, HuffmanTable_HTOOB_B14); + Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>(14); pTRD->SBHUFFRDW = Table_B14.get(); } else if (cSBHUFFRDW == 1) { - Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B15, HuffmanTable_B15_Size, HuffmanTable_HTOOB_B15); + Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>(15); pTRD->SBHUFFRDW = Table_B15.get(); } else { CJBig2_Segment* pSeg = @@ -830,14 +813,12 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { } if (cSBHUFFRDH == 0) { if (!Table_B14) { - Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B14, HuffmanTable_B14_Size, HuffmanTable_HTOOB_B14); + Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>(14); } pTRD->SBHUFFRDH = Table_B14.get(); } else if (cSBHUFFRDH == 1) { if (!Table_B15) { - Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B15, HuffmanTable_B15_Size, HuffmanTable_HTOOB_B15); + Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>(15); } pTRD->SBHUFFRDH = Table_B15.get(); } else { @@ -849,14 +830,12 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { } if (cSBHUFFRDX == 0) { if (!Table_B14) { - Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B14, HuffmanTable_B14_Size, HuffmanTable_HTOOB_B14); + Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>(14); } pTRD->SBHUFFRDX = Table_B14.get(); } else if (cSBHUFFRDX == 1) { if (!Table_B15) { - Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B15, HuffmanTable_B15_Size, HuffmanTable_HTOOB_B15); + Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>(15); } pTRD->SBHUFFRDX = Table_B15.get(); } else { @@ -868,14 +847,12 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { } if (cSBHUFFRDY == 0) { if (!Table_B14) { - Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B14, HuffmanTable_B14_Size, HuffmanTable_HTOOB_B14); + Table_B14 = pdfium::MakeUnique<CJBig2_HuffmanTable>(14); } pTRD->SBHUFFRDY = Table_B14.get(); } else if (cSBHUFFRDY == 1) { if (!Table_B15) { - Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B15, HuffmanTable_B15_Size, HuffmanTable_HTOOB_B15); + Table_B15 = pdfium::MakeUnique<CJBig2_HuffmanTable>(15); } pTRD->SBHUFFRDY = Table_B15.get(); } else { @@ -886,8 +863,7 @@ JBig2_Result CJBig2_Context::ParseTextRegion(CJBig2_Segment* pSegment) { pTRD->SBHUFFRDY = pSeg->m_HuffmanTable.get(); } if (cSBHUFFRSIZE == 0) { - Table_B1 = pdfium::MakeUnique<CJBig2_HuffmanTable>( - HuffmanTable_B1, HuffmanTable_B1_Size, HuffmanTable_HTOOB_B1); + Table_B1 = pdfium::MakeUnique<CJBig2_HuffmanTable>(1); pTRD->SBHUFFRSIZE = Table_B1.get(); } else { CJBig2_Segment* pSeg = |