diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-27 12:08:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-27 12:08:12 -0700 |
commit | 8d2aae7ee320da3a8ffe01c57e38b3f98443257d (patch) | |
tree | e694c6f82ec72fa46e6172b4475996b30d3f6a3a /core/src/fxcodec/jbig2 | |
parent | ff46aaf499edcf153ee2f57c7016587aa96dcfa0 (diff) | |
download | pdfium-8d2aae7ee320da3a8ffe01c57e38b3f98443257d.tar.xz |
Revert "FX Bool considered harmful, part 3"
This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1255293002 .
Diffstat (limited to 'core/src/fxcodec/jbig2')
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_BitStream.h | 4 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Context.cpp | 30 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Context.h | 4 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp | 114 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h | 40 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp | 10 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_HuffmanTable.h | 10 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h | 30 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Image.cpp | 60 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Image.h | 26 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Page.h | 2 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp | 2 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_SymbolDict.h | 2 |
13 files changed, 167 insertions, 167 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.h b/core/src/fxcodec/jbig2/JBig2_BitStream.h index fcd11f4ddf..ff0b9fcfeb 100644 --- a/core/src/fxcodec/jbig2/JBig2_BitStream.h +++ b/core/src/fxcodec/jbig2/JBig2_BitStream.h @@ -23,7 +23,7 @@ public: int32_t read1Bit(FX_DWORD *dwResult); - int32_t read1Bit(bool *bResult); + int32_t read1Bit(FX_BOOL *bResult); int32_t read1Byte(uint8_t *cResult); @@ -165,7 +165,7 @@ inline int32_t CJBig2_BitStream::read1Bit(FX_DWORD *dwResult) } } -inline int32_t CJBig2_BitStream::read1Bit(bool *bResult) +inline int32_t CJBig2_BitStream::read1Bit(FX_BOOL *bResult) { if(m_dwByteIdx < m_dwLength) { *bResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01; diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp index 0b71c475c2..68c973547c 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp @@ -47,7 +47,7 @@ CJBig2_Context::CJBig2_Context(uint8_t *pGlobalData, FX_DWORD dwGlobalLength, JBIG2_ALLOC(m_pSegmentList, CJBig2_List<CJBig2_Segment>); JBIG2_ALLOC(m_pPageInfoList, CJBig2_List<JBig2PageInfo>(1)); m_pPage = NULL; - m_bBufSpecified = false; + m_bBufSpecified = FALSE; m_pPause = pPause; m_nSegmentDecoded = 0; m_PauseStep = 10; @@ -231,11 +231,11 @@ int32_t CJBig2_Context::getFirstPage(uint8_t *pBuf, int32_t width, int32_t heigh return nRet; } } - m_bFirstPage = true; + m_bFirstPage = TRUE; m_PauseStep = 0; delete m_pPage; JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf)); - m_bBufSpecified = true; + m_bBufSpecified = TRUE; if(m_pPage && pPause && pPause->NeedToPauseNow()) { m_PauseStep = 1; m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; @@ -298,11 +298,11 @@ int32_t CJBig2_Context::Continue(IFX_Pause* pPause) int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause) { int32_t nRet = JBIG2_ERROR_STREAM_TYPE; - m_bFirstPage = false; + m_bFirstPage = FALSE; m_PauseStep = 0; delete m_pPage; JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf)); - m_bBufSpecified = true; + m_bBufSpecified = TRUE; if(m_pPage && pPause && pPause->NeedToPauseNow()) { m_PauseStep = 1; m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; @@ -330,7 +330,7 @@ int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) { int32_t nRet; - m_bFirstPage = true; + m_bFirstPage = TRUE; m_PauseStep = 0; if(m_pGlobalContext) { nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause); @@ -338,14 +338,14 @@ int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) return nRet; } } - m_bBufSpecified = false; + m_bBufSpecified = FALSE; return Continue(pPause); } int32_t CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause) { int32_t nRet; - m_bBufSpecified = false; - m_bFirstPage = false; + m_bBufSpecified = FALSE; + m_bFirstPage = FALSE; m_PauseStep = 0; switch(m_nStreamType) { case JBIG2_FILE_STREAM: @@ -601,14 +601,14 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B2 = NULL, *Table_B3 = NULL, *Table_B4 = NULL, *Table_B5 = NULL; int32_t i, nIndex, nRet; CJBig2_Segment *pSeg = NULL, *pLRSeg = NULL; - bool bUsed; + FX_BOOL bUsed; CJBig2_Image ** SDINSYMS = NULL; CJBig2_SDDProc *pSymbolDictDecoder; JBig2ArithCtx *gbContext = NULL, *grContext = NULL; CJBig2_ArithDecoder *pArithDecoder; JBIG2_ALLOC(pSymbolDictDecoder, CJBig2_SDDProc()); uint8_t *key = pSegment->m_pData; - bool cache_hit = false; + FX_BOOL cache_hit = false; if(m_pStream->readShortInteger(&wFlags) != 0) { m_pModule->JBig2_Error("symbol dictionary segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; @@ -825,16 +825,16 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa } } if(wFlags & 0x0200) { - pSegment->m_Result.sd->m_bContextRetained = true; + pSegment->m_Result.sd->m_bContextRetained = TRUE; if(pSymbolDictDecoder->SDHUFF == 0) { pSegment->m_Result.sd->m_gbContext = gbContext; } if(pSymbolDictDecoder->SDREFAGG == 1) { pSegment->m_Result.sd->m_grContext = grContext; } - bUsed = true; + bUsed = TRUE; } else { - bUsed = false; + bUsed = FALSE; } delete pSymbolDictDecoder; if(SDINSYMS) { @@ -845,7 +845,7 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa delete Table_B3; delete Table_B4; delete Table_B5; - if(bUsed == false) { + if(bUsed == FALSE) { if(gbContext) { m_pModule->JBig2_Free(gbContext); } diff --git a/core/src/fxcodec/jbig2/JBig2_Context.h b/core/src/fxcodec/jbig2/JBig2_Context.h index 02d4192ee9..e6a0d7b3bc 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.h +++ b/core/src/fxcodec/jbig2/JBig2_Context.h @@ -123,13 +123,13 @@ private: CJBig2_Image *m_pPage; - bool m_bBufSpecified; + FX_BOOL m_bBufSpecified; int32_t m_nSegmentDecoded; IFX_Pause* m_pPause; int32_t m_PauseStep; FXCODEC_STATUS m_ProcessiveStatus; - bool m_bFirstPage; + FX_BOOL m_bFirstPage; CJBig2_ArithDecoder *m_pArithDecoder; CJBig2_GRDProc *m_pGRD; JBig2ArithCtx *m_gbContext; diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp index 1e338a5f60..cabcd4c634 100644 --- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp +++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp @@ -101,7 +101,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -146,7 +146,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt(CJBig2_ArithDecoder *pA } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -213,7 +213,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -305,7 +305,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -352,7 +352,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_ArithDecoder * } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -397,7 +397,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt(CJBig2_ArithDecoder *pA } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -464,7 +464,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -555,7 +555,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -600,7 +600,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_ArithDecoder * } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -643,7 +643,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt(CJBig2_ArithDecoder *pA } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -710,7 +710,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -801,7 +801,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -844,7 +844,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_ArithDecoder * } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -883,7 +883,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt(CJBig2_ArithDecoder *pA } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1; @@ -941,7 +941,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1; @@ -1017,7 +1017,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *p } CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2; @@ -1056,7 +1056,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_ArithDecoder * } CJBig2_Image *CJBig2_GRDProc::decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG; FX_DWORD line1, line2, line3; @@ -1195,7 +1195,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder } CJBig2_Image *CJBig2_GRDProc::decode_Arith_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT = 0; CJBig2_Image *GBREG; LTP = 0; @@ -1340,7 +1340,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode(CJBig2_ArithDecoder *pArithDecoder, JBig2A } CJBig2_Image *CJBig2_GRRDProc::decode_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GRREG; FX_DWORD line1, line2, line3, line4, line5; @@ -1424,7 +1424,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_unopt(CJBig2_ArithDecoder *pArit } CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GRREG; FX_DWORD line1, line1_r, line2_r, line3_r; @@ -1459,9 +1459,9 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD } line1 = (h > 0) ? pLine[-nStride] << 4 : 0; int32_t reference_h = h - GRREFERENCEDY; - bool line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1); - bool line2_r_ok = (reference_h > -1 && reference_h < GRHR); - bool line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1); + FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1); + FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR); + FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1); line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0; line2_r = line2_r_ok ? pLineR[nOffset] : 0; line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0; @@ -1555,7 +1555,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD } CJBig2_Image *CJBig2_GRRDProc::decode_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GRREG; FX_DWORD line1, line2, line3, line4, line5; @@ -1633,7 +1633,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_unopt(CJBig2_ArithDecoder *pArit } CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext) { - bool LTP, SLTP, bVal; + FX_BOOL LTP, SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GRREG; FX_DWORD line1, line1_r, line2_r, line3_r; @@ -1668,9 +1668,9 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD } line1 = (h > 0) ? pLine[-nStride] << 1 : 0; int32_t reference_h = h - GRREFERENCEDY; - bool line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1); - bool line2_r_ok = (reference_h > -1 && reference_h < GRHR); - bool line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1); + FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1); + FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR); + FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1); line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0; line2_r = line2_r_ok ? pLineR[nOffset] : 0; line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0; @@ -1758,8 +1758,8 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD } CJBig2_Image *CJBig2_GRRDProc::decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext) { - bool LTP, SLTP, bVal; - bool TPGRPIX, TPGRVAL; + FX_BOOL LTP, SLTP, bVal; + FX_BOOL TPGRPIX, TPGRVAL; FX_DWORD CONTEXT; CJBig2_Image *GRREG; LTP = 0; @@ -1881,12 +1881,12 @@ CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2Ari CJBig2_Image *IBI; FX_DWORD WI, HI; int32_t IDS; - bool RI; + FX_BOOL RI; int32_t RDWI, RDHI, RDXI, RDYI; CJBig2_Image *IBOI; FX_DWORD WOI, HOI; CJBig2_Image *SBREG; - bool bFirst; + FX_BOOL bFirst; FX_DWORD nTmp; int32_t nVal, nBits; CJBig2_HuffmanDecoder *pHuffmanDecoder; @@ -1910,7 +1910,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2Ari } DT *= SBSTRIPS; STRIPT = STRIPT + DT; - bFirst = true; + bFirst = TRUE; for(;;) { if(bFirst) { if(pHuffmanDecoder->decodeAValue(SBHUFFFS, &DFS) != 0) { @@ -1919,7 +1919,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2Ari } FIRSTS = FIRSTS + DFS; CURS = FIRSTS; - bFirst = false; + bFirst = FALSE; } else { nVal = pHuffmanDecoder->decodeAValue(SBHUFFDS, &IDS); if(nVal == JBIG2_OOB) { @@ -2106,7 +2106,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J CJBig2_Image *IBOI; FX_DWORD WOI, HOI; CJBig2_Image *SBREG; - bool bFirst; + FX_BOOL bFirst; int32_t nRet, nVal; int32_t bRetained; CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, *IARDX, *IARDY; @@ -2123,7 +2123,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J IARDX = pIDS->IARDX; IARDY = pIDS->IARDY; IAID = pIDS->IAID; - bRetained = true; + bRetained = TRUE; } else { JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder()); JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder()); @@ -2135,7 +2135,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder()); JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder()); JBIG2_ALLOC(IAID , CJBig2_ArithIaidDecoder(SBSYMCODELEN)); - bRetained = false; + bRetained = FALSE; } JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH)); SBREG->fill(SBDEFPIXEL); @@ -2154,7 +2154,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J } DT *= SBSTRIPS; STRIPT = STRIPT + DT; - bFirst = true; + bFirst = TRUE; for(;;) { if(bFirst) { if(IAFS->decode(pArithDecoder, &DFS) == -1) { @@ -2163,7 +2163,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J } FIRSTS = FIRSTS + DFS; CURS = FIRSTS; - bFirst = false; + bFirst = FALSE; } else { nRet = IADS->decode(pArithDecoder, &IDS); if(nRet == JBIG2_OOB) { @@ -2299,7 +2299,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J NINSTANCES = NINSTANCES + 1; } } - if(bRetained == false) { + if(bRetained == FALSE) { delete IADT; delete IAFS; delete IADS; @@ -2313,7 +2313,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J } return SBREG; failed: - if(bRetained == false) { + if(bRetained == FALSE) { delete IADT; delete IAFS; delete IADS; @@ -2338,9 +2338,9 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod int32_t DW; CJBig2_Image *BS; FX_DWORD I, J, REFAGGNINST; - bool *EXFLAGS; + FX_BOOL *EXFLAGS; FX_DWORD EXINDEX; - bool CUREXFLAG; + FX_BOOL CUREXFLAG; FX_DWORD EXRUNLENGTH; int32_t nVal; FX_DWORD nTmp; @@ -2585,7 +2585,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod } EXINDEX = 0; CUREXFLAG = 0; - EXFLAGS = (bool*)m_pModule->JBig2_Malloc2(sizeof(bool), (SDNUMINSYMS + SDNUMNEWSYMS)); + EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS)); while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) { if(IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH) == -1) { m_pModule->JBig2_Free(EXFLAGS); @@ -2676,9 +2676,9 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream, int32_t DW; CJBig2_Image *BS, *BHC; FX_DWORD I, J, REFAGGNINST; - bool *EXFLAGS; + FX_BOOL *EXFLAGS; FX_DWORD EXINDEX; - bool CUREXFLAG; + FX_BOOL CUREXFLAG; FX_DWORD EXRUNLENGTH; int32_t nVal, nBits; FX_DWORD nTmp; @@ -2976,7 +2976,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream, CUREXFLAG = 0; JBIG2_ALLOC(pTable, CJBig2_HuffmanTable(HuffmanTable_B1, sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1)); - EXFLAGS = (bool*)m_pModule->JBig2_Malloc2(sizeof(bool), (SDNUMINSYMS + SDNUMNEWSYMS)); + EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS)); while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) { if(pHuffmanDecoder->decodeAValue(pTable, (int*)&EXRUNLENGTH) != 0) { delete pTable; @@ -3477,7 +3477,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V2(CJBig2_Image** pImage, CJBi } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V2(IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; CJBig2_Image *GBREG = *m_pImage; FX_DWORD line1, line2, line3; @@ -3650,7 +3650,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V1(CJBig2_Image** pImage, CJBi } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V1(IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT = 0; CJBig2_Image *GBREG = (*m_pImage); for(; m_loopIndex < GBH; m_loopIndex++) { @@ -3799,7 +3799,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Continue_decode(IFX_Pause* pPause) } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; uint8_t *pLine1, *pLine2, cVal; @@ -3891,7 +3891,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage, } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2, line3; for(; m_loopIndex < GBH; m_loopIndex++) { @@ -3940,7 +3940,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_Image * pImag } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; uint8_t *pLine1, *pLine2, cVal; @@ -4031,7 +4031,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage, } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2, line3; for(FX_DWORD h = 0; h < GBH; h++) { @@ -4078,7 +4078,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_Image * pImag } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; uint8_t *pLine1, *pLine2, cVal; @@ -4169,7 +4169,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage, } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2, line3; for(; m_loopIndex < GBH; m_loopIndex++) { @@ -4214,7 +4214,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_Image * pImag } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1; uint8_t *pLine1, cVal; @@ -4290,7 +4290,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage, } FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause) { - bool SLTP, bVal; + FX_BOOL SLTP, bVal; FX_DWORD CONTEXT; FX_DWORD line1, line2; for(; m_loopIndex < GBH; m_loopIndex++) { diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h index f348e96546..2bd2ceac95 100644 --- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h +++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h @@ -76,7 +76,7 @@ private: CJBig2_ArithDecoder *m_pArithDecoder; JBig2ArithCtx *m_gbContext; FX_WORD m_DecodeType; - bool LTP; + FX_BOOL LTP; FX_RECT m_ReplaceRect; private: @@ -112,12 +112,12 @@ private: CJBig2_Image *decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext); public: - bool MMR; + FX_BOOL MMR; FX_DWORD GBW; FX_DWORD GBH; uint8_t GBTEMPLATE; - bool TPGDON; - bool USESKIP; + FX_BOOL TPGDON; + FX_BOOL USESKIP; CJBig2_Image * SKIP; signed char GBAT[8]; }; @@ -139,11 +139,11 @@ public: public: FX_DWORD GRW; FX_DWORD GRH; - bool GRTEMPLATE; + FX_BOOL GRTEMPLATE; CJBig2_Image *GRREFERENCE; int32_t GRREFERENCEDX; int32_t GRREFERENCEDY; - bool TPGRON; + FX_BOOL TPGRON; signed char GRAT[4]; }; typedef struct { @@ -167,8 +167,8 @@ public: CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext, JBig2IntDecoderState *pIDS = NULL); public: - bool SBHUFF; - bool SBREFINE; + FX_BOOL SBHUFF; + FX_BOOL SBREFINE; FX_DWORD SBW; FX_DWORD SBH; FX_DWORD SBNUMINSTANCES; @@ -179,10 +179,10 @@ public: uint8_t SBSYMCODELEN; CJBig2_Image **SBSYMS; - bool SBDEFPIXEL; + FX_BOOL SBDEFPIXEL; JBig2ComposeOp SBCOMBOP; - bool TRANSPOSED; + FX_BOOL TRANSPOSED; JBig2Corner REFCORNER; signed char SBDSOFFSET; @@ -194,7 +194,7 @@ public: *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE; - bool SBRTEMPLATE; + FX_BOOL SBRTEMPLATE; signed char SBRAT[4]; }; class CJBig2_SDDProc : public CJBig2_Object @@ -205,8 +205,8 @@ public: CJBig2_SymbolDict *decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext, IFX_Pause* pPause); public: - bool SDHUFF; - bool SDREFAGG; + FX_BOOL SDHUFF; + FX_BOOL SDREFAGG; FX_DWORD SDNUMINSYMS; CJBig2_Image ** SDINSYMS; FX_DWORD SDNUMNEWSYMS; @@ -217,7 +217,7 @@ public: *SDHUFFAGGINST; uint8_t SDTEMPLATE; signed char SDAT[8]; - bool SDRTEMPLATE; + FX_BOOL SDRTEMPLATE; signed char SDRAT[4]; }; class CJBig2_HTRDProc : public CJBig2_Object @@ -230,13 +230,13 @@ public: public: FX_DWORD HBW, HBH; - bool HMMR; + FX_BOOL HMMR; uint8_t HTEMPLATE; FX_DWORD HNUMPATS; CJBig2_Image **HPATS; - bool HDEFPIXEL; + FX_BOOL HDEFPIXEL; JBig2ComposeOp HCOMBOP; - bool HENABLESKIP; + FX_BOOL HENABLESKIP; FX_DWORD HGW, HGH; int32_t HGX, @@ -254,7 +254,7 @@ public: CJBig2_PatternDict *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause); public: - bool HDMMR; + FX_BOOL HDMMR; uint8_t HDPW, HDPH; FX_DWORD GRAYMAX; @@ -268,8 +268,8 @@ public: FX_DWORD *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause); public: - bool GSMMR; - bool GSUSESKIP; + FX_BOOL GSMMR; + FX_BOOL GSUSESKIP; uint8_t GSBPP; FX_DWORD GSW, GSH; diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp index 4932e571f2..0616123c1e 100644 --- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp +++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp @@ -9,7 +9,7 @@ #include <string.h> CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, - bool bHTOOB) + FX_BOOL bHTOOB) { init(); m_bOK = parseFromStandardTable(pTable, nLines, bHTOOB); @@ -38,14 +38,14 @@ CJBig2_HuffmanTable::~CJBig2_HuffmanTable() } void CJBig2_HuffmanTable::init() { - HTOOB = false; + HTOOB = FALSE; NTEMP = 0; CODES = NULL; PREFLEN = NULL; RANGELEN = NULL; RANGELOW = NULL; } -int CJBig2_HuffmanTable::parseFromStandardTable(const JBig2TableLine *pTable, int nLines, bool bHTOOB) +int CJBig2_HuffmanTable::parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB) { int CURLEN, LENMAX, CURCODE, CURTEMP, i; int *LENCOUNT; @@ -188,7 +188,7 @@ int CJBig2_HuffmanTable::parseFromCodedBuffer(CJBig2_BitStream *pStream) } m_pModule->JBig2_Free(LENCOUNT); m_pModule->JBig2_Free(FIRSTCODE); - return true; + return TRUE; failed: - return false; + return FALSE; } diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h index d6bc3d1c4b..d68ced2fca 100644 --- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h +++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h @@ -13,7 +13,7 @@ class CJBig2_HuffmanTable : public CJBig2_Object { public: - CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, bool bHTOOB); + CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB); CJBig2_HuffmanTable(CJBig2_BitStream *pStream); @@ -21,22 +21,22 @@ public: void init(); - int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, bool bHTOOB); + int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB); int parseFromCodedBuffer(CJBig2_BitStream *pStream); - bool isOK() + FX_BOOL isOK() { return m_bOK; } private: - bool HTOOB; + FX_BOOL HTOOB; int NTEMP; int *CODES; int *PREFLEN; int *RANGELEN; int *RANGELOW; - bool m_bOK; + FX_BOOL m_bOK; friend class CJBig2_HuffmanDecoder; }; #endif diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h index c08d2456d4..428b2c3671 100644 --- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h +++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h @@ -11,7 +11,7 @@ typedef struct { int RANDELEN; int RANGELOW; } JBig2TableLine; -const bool HuffmanTable_HTOOB_B1 = false; +const FX_BOOL HuffmanTable_HTOOB_B1 = FALSE; const JBig2TableLine HuffmanTable_B1[] = { { 1, 4, 0 }, { 2, 8, 16 }, @@ -19,7 +19,7 @@ const JBig2TableLine HuffmanTable_B1[] = { { 0, 32, -1 }, { 3, 32, 65808 } }; -const bool HuffmanTable_HTOOB_B2 = true; +const FX_BOOL HuffmanTable_HTOOB_B2 = TRUE; const JBig2TableLine HuffmanTable_B2[] = { { 1, 0, 0 }, { 2, 0, 1 }, @@ -30,7 +30,7 @@ const JBig2TableLine HuffmanTable_B2[] = { { 6, 32, 75 }, { 6, 0, 0 } }; -const bool HuffmanTable_HTOOB_B3 = true; +const FX_BOOL HuffmanTable_HTOOB_B3 = TRUE; const JBig2TableLine HuffmanTable_B3[] = { { 8, 8, -256 }, { 1, 0, 0 }, @@ -42,7 +42,7 @@ const JBig2TableLine HuffmanTable_B3[] = { { 7, 32, 75 }, { 6, 0, 0 } }; -const bool HuffmanTable_HTOOB_B4 = false; +const FX_BOOL HuffmanTable_HTOOB_B4 = FALSE; const JBig2TableLine HuffmanTable_B4[] = { { 1, 0, 1 }, { 2, 0, 2 }, @@ -52,7 +52,7 @@ const JBig2TableLine HuffmanTable_B4[] = { { 0, 32, -1 }, { 5, 32, 76 }, }; -const bool HuffmanTable_HTOOB_B5 = false; +const FX_BOOL HuffmanTable_HTOOB_B5 = FALSE; const JBig2TableLine HuffmanTable_B5[] = { { 7, 8, -255 }, { 1, 0, 1 }, @@ -63,7 +63,7 @@ const JBig2TableLine HuffmanTable_B5[] = { { 7, 32, -256 }, { 6, 32, 76 } }; -const bool HuffmanTable_HTOOB_B6 = false; +const FX_BOOL HuffmanTable_HTOOB_B6 = FALSE; const JBig2TableLine HuffmanTable_B6[] = { { 5, 10, -2048 }, { 4, 9, -1024 }, @@ -80,7 +80,7 @@ const JBig2TableLine HuffmanTable_B6[] = { { 6, 32, -2049 }, { 6, 32, 2048 } }; -const bool HuffmanTable_HTOOB_B7 = false; +const FX_BOOL HuffmanTable_HTOOB_B7 = FALSE; const JBig2TableLine HuffmanTable_B7[] = { { 4, 9, -1024 }, { 3, 8, -512 }, @@ -98,7 +98,7 @@ const JBig2TableLine HuffmanTable_B7[] = { { 5, 32, -1025 }, { 5, 32, 2048 }, }; -const bool HuffmanTable_HTOOB_B8 = true; +const FX_BOOL HuffmanTable_HTOOB_B8 = TRUE; const JBig2TableLine HuffmanTable_B8[] = { { 8, 3, -15 }, { 9, 1, -7 }, @@ -122,7 +122,7 @@ const JBig2TableLine HuffmanTable_B8[] = { { 9, 32, 1670 }, { 2, 0, 0 } }; -const bool HuffmanTable_HTOOB_B9 = true; +const FX_BOOL HuffmanTable_HTOOB_B9 = TRUE; const JBig2TableLine HuffmanTable_B9[] = { { 8, 4, -31 }, { 9, 2, -15 }, @@ -147,7 +147,7 @@ const JBig2TableLine HuffmanTable_B9[] = { { 9, 32, 3339 }, { 2, 0, 0 } }; -const bool HuffmanTable_HTOOB_B10 = true; +const FX_BOOL HuffmanTable_HTOOB_B10 = TRUE; const JBig2TableLine HuffmanTable_B10[] = { { 7, 4, -21 }, { 8, 0, -5 }, @@ -171,7 +171,7 @@ const JBig2TableLine HuffmanTable_B10[] = { { 8, 32, 4166 }, { 2, 0, 0 } }; -const bool HuffmanTable_HTOOB_B11 = false; +const FX_BOOL HuffmanTable_HTOOB_B11 = FALSE; const JBig2TableLine HuffmanTable_B11[] = { { 1, 0, 1 }, { 2, 1, 2 }, @@ -188,7 +188,7 @@ const JBig2TableLine HuffmanTable_B11[] = { { 0, 32, 0 }, { 7, 32, 141 } }; -const bool HuffmanTable_HTOOB_B12 = false; +const FX_BOOL HuffmanTable_HTOOB_B12 = FALSE; const JBig2TableLine HuffmanTable_B12[] = { { 1, 0, 1 }, { 2, 0, 2 }, @@ -205,7 +205,7 @@ const JBig2TableLine HuffmanTable_B12[] = { { 0, 32, 0 }, { 8, 32, 73 } }; -const bool HuffmanTable_HTOOB_B13 = false; +const FX_BOOL HuffmanTable_HTOOB_B13 = FALSE; const JBig2TableLine HuffmanTable_B13[] = { { 1, 0, 1 }, { 3, 0, 2 }, @@ -222,7 +222,7 @@ const JBig2TableLine HuffmanTable_B13[] = { { 0, 32, 0 }, { 7, 32, 141 } }; -const bool HuffmanTable_HTOOB_B14 = false; +const FX_BOOL HuffmanTable_HTOOB_B14 = FALSE; const JBig2TableLine HuffmanTable_B14[] = { { 3, 0, -2 }, { 3, 0, -1 }, @@ -232,7 +232,7 @@ const JBig2TableLine HuffmanTable_B14[] = { { 0, 32, -3 }, { 0, 32, 3 } }; -const bool HuffmanTable_HTOOB_B15 = false; +const FX_BOOL HuffmanTable_HTOOB_B15 = FALSE; const JBig2TableLine HuffmanTable_B15[] = { { 7, 4, -24 }, { 6, 2, -8 }, diff --git a/core/src/fxcodec/jbig2/JBig2_Image.cpp b/core/src/fxcodec/jbig2/JBig2_Image.cpp index 030b0c2493..9ef4464ef0 100644 --- a/core/src/fxcodec/jbig2/JBig2_Image.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Image.cpp @@ -16,7 +16,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h) m_nHeight = h; if (m_nWidth <= 0 || m_nHeight <= 0 || m_nWidth > INT_MAX - 31) { m_pData = NULL; - m_bNeedFree = false; + m_bNeedFree = FALSE; return; } m_nStride = ((w + 31) >> 5) << 2; @@ -25,7 +25,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h) } else { m_pData = NULL; } - m_bNeedFree = true; + m_bNeedFree = TRUE; } CJBig2_Image::CJBig2_Image(int32_t w, int32_t h, int32_t stride, uint8_t*pBuf) { @@ -33,7 +33,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h, int32_t stride, uint8_t*pBuf) m_nHeight = h; m_nStride = stride; m_pData = pBuf; - m_bNeedFree = false; + m_bNeedFree = FALSE; } CJBig2_Image::CJBig2_Image(CJBig2_Image &im) { @@ -47,7 +47,7 @@ CJBig2_Image::CJBig2_Image(CJBig2_Image &im) } else { m_pData = NULL; } - m_bNeedFree = true; + m_bNeedFree = TRUE; } CJBig2_Image::~CJBig2_Image() { @@ -55,7 +55,7 @@ CJBig2_Image::~CJBig2_Image() m_pModule->JBig2_Free(m_pData); } } -bool CJBig2_Image::getPixel(int32_t x, int32_t y) +FX_BOOL CJBig2_Image::getPixel(int32_t x, int32_t y) { if (!m_pData) { return 0; @@ -72,7 +72,7 @@ bool CJBig2_Image::getPixel(int32_t x, int32_t y) return ((m_pData[m] >> (7 - n)) & 1); } -int32_t CJBig2_Image::setPixel(int32_t x, int32_t y, bool v) +int32_t CJBig2_Image::setPixel(int32_t x, int32_t y, FX_BOOL v) { if (!m_pData) { return 0; @@ -104,31 +104,31 @@ void CJBig2_Image::copyLine(int32_t hTo, int32_t hFrom) JBIG2_memcpy(m_pData + hTo * m_nStride, m_pData + hFrom * m_nStride, m_nStride); } } -void CJBig2_Image::fill(bool v) +void CJBig2_Image::fill(FX_BOOL v) { if (!m_pData) { return; } JBIG2_memset(m_pData, v ? 0xff : 0, m_nStride * m_nHeight); } -bool CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { if (!m_pData) { - return false; + return FALSE; } return composeTo_opt2(pDst, x, y, op); } -bool CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect) +FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect) { if (!m_pData) { - return false; + return FALSE; } if (NULL == pSrcRect || *pSrcRect == FX_RECT(0, 0, m_nWidth, m_nHeight)) { return composeTo_opt2(pDst, x, y, op); } return composeTo_opt2(pDst, x, y, op, pSrcRect); } -bool CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { int32_t w, h, dx, dy; int32_t i, j; @@ -192,17 +192,17 @@ bool CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBi } break; } - return true; + return TRUE; } -bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { int32_t x0, x1, y0, y1, xx, yy; uint8_t *pLineSrc, *pLineDst, *srcPtr, *destPtr; FX_DWORD src0, src1, src, dest, s1, s2, m1, m2, m3; - bool oneByte; + FX_BOOL oneByte; if (!m_pData) { - return false; + return FALSE; } if (y < 0) { y0 = -y; @@ -215,7 +215,7 @@ bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2 y1 = m_nHeight; } if (y0 >= y1) { - return false; + return FALSE; } if (x >= 0) { x0 = x & ~7; @@ -227,7 +227,7 @@ bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2 x1 = pDst->m_nWidth; } if (x0 >= x1) { - return false; + return FALSE; } s1 = x & 7; s2 = 8 - s1; @@ -679,19 +679,19 @@ bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2 } } } - return true; + return TRUE; } -bool CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op) { if (!m_pData) { - return false; + return FALSE; } return pSrc->composeTo(this, x, y, op); } -bool CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect) +FX_BOOL CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect) { if (!m_pData) { - return false; + return FALSE; } return pSrc->composeTo(this, x, y, op, pSrcRect); } @@ -765,7 +765,7 @@ CJBig2_Image *CJBig2_Image::subImage(int32_t x, int32_t y, int32_t w, int32_t h) } return pImage; } -void CJBig2_Image::expand(int32_t h, bool v) +void CJBig2_Image::expand(int32_t h, FX_BOOL v) { if (!m_pData || h <= m_nHeight) { return; @@ -788,7 +788,7 @@ void CJBig2_Image::expand(int32_t h, bool v) JBIG2_memset(m_pData + dwHeight * dwStride, v ? 0xff : 0, (dwH - dwHeight) * dwStride); m_nHeight = h; } -bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) +FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op) { int32_t xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0, yd1 = 0, xx = 0, yy = 0, w = 0, h = 0, middleDwords = 0, lineLeft = 0; @@ -799,10 +799,10 @@ bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig uint8_t *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL; if (!m_pData) { - return false; + return FALSE; } if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) { - return false; + return FALSE; } if(y < 0) { ys0 = -y; @@ -1205,17 +1205,17 @@ bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig } return 1; } -bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect) +FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect) { int32_t xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft; FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM; uint8_t *lineSrc, *lineDst, *sp, *dp; int32_t sw, sh; if (!m_pData) { - return false; + return FALSE; } if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) { - return false; + return FALSE; } sw = pSrcRect->Width(); sh = pSrcRect->Height(); diff --git a/core/src/fxcodec/jbig2/JBig2_Image.h b/core/src/fxcodec/jbig2/JBig2_Image.h index d51d99907d..423bebcede 100644 --- a/core/src/fxcodec/jbig2/JBig2_Image.h +++ b/core/src/fxcodec/jbig2/JBig2_Image.h @@ -28,31 +28,31 @@ public: ~CJBig2_Image(); - bool getPixel(int32_t x, int32_t y); + FX_BOOL getPixel(int32_t x, int32_t y); - int32_t setPixel(int32_t x, int32_t y, bool v); + int32_t setPixel(int32_t x, int32_t y, FX_BOOL v); void copyLine(int32_t hTo, int32_t hFrom); - void fill(bool v); + void fill(FX_BOOL v); - bool composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); - bool composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect); + FX_BOOL composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); + FX_BOOL composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect); - bool composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); + FX_BOOL composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); - bool composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); + FX_BOOL composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); - bool composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); - bool composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect); + FX_BOOL composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op); + FX_BOOL composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect); - bool composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op); - bool composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect); + FX_BOOL composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op); + FX_BOOL composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect); CJBig2_Image *subImage_unopt(int32_t x, int32_t y, int32_t w, int32_t h); CJBig2_Image *subImage(int32_t x, int32_t y, int32_t w, int32_t h); - void expand(int32_t h, bool v); + void expand(int32_t h, FX_BOOL v); public: int32_t m_nWidth; @@ -63,6 +63,6 @@ public: uint8_t *m_pData; - bool m_bNeedFree; + FX_BOOL m_bNeedFree; }; #endif diff --git a/core/src/fxcodec/jbig2/JBig2_Page.h b/core/src/fxcodec/jbig2/JBig2_Page.h index b4e159f2a2..b07eba8a3a 100644 --- a/core/src/fxcodec/jbig2/JBig2_Page.h +++ b/core/src/fxcodec/jbig2/JBig2_Page.h @@ -13,7 +13,7 @@ struct JBig2PageInfo : public CJBig2_Object { FX_DWORD m_dwResolutionX, m_dwResolutionY; uint8_t m_cFlags; - bool m_bIsStriped; + FX_BOOL m_bIsStriped; FX_WORD m_wMaxStripeSize; }; #endif diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp index c10d461623..0e5b92ff5a 100644 --- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp +++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp @@ -9,7 +9,7 @@ CJBig2_SymbolDict::CJBig2_SymbolDict() { SDNUMEXSYMS = 0; SDEXSYMS = NULL; - m_bContextRetained = false; + m_bContextRetained = FALSE; m_gbContext = m_grContext = NULL; } diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.h b/core/src/fxcodec/jbig2/JBig2_SymbolDict.h index 5f94dc7be8..9156e30ea8 100644 --- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.h +++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.h @@ -19,7 +19,7 @@ public: public: FX_DWORD SDNUMEXSYMS; CJBig2_Image **SDEXSYMS; - bool m_bContextRetained; + FX_BOOL m_bContextRetained; JBig2ArithCtx *m_gbContext, *m_grContext; }; |