Index: core/src/fxcodec/jbig2/JBig2_Context.cpp |
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp |
index ed26ec683319eceb86c6565fade5249edd53584a..0b71c475c256bad211c7b0d63ec2cda355ec5a9f 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; |
- FX_BOOL bUsed; |
+ 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; |
- FX_BOOL cache_hit = false; |
+ 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); |
} |
@@ -873,7 +873,7 @@ failed: |
return nRet; |
} |
-FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) |
+int32_t CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) |
{ |
FX_DWORD dwTemp; |
FX_WORD wFlags; |
@@ -1239,7 +1239,7 @@ failed: |
return nRet; |
} |
-FX_BOOL CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) |
+int32_t CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) |
{ |
FX_DWORD dwTemp; |
uint8_t cFlags; |
@@ -1293,7 +1293,7 @@ failed: |
delete pPDD; |
return nRet; |
} |
-FX_BOOL CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) |
+int32_t CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) |
{ |
FX_DWORD dwTemp; |
uint8_t cFlags; |
@@ -1387,7 +1387,7 @@ failed: |
return nRet; |
} |
-FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) |
+int32_t CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) |
{ |
FX_DWORD dwTemp; |
uint8_t cFlags; |
@@ -1504,7 +1504,7 @@ failed: |
return nRet; |
} |
-FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment) |
+int32_t CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment) |
{ |
FX_DWORD dwTemp; |
JBig2RegionInfo ri; |
@@ -1591,7 +1591,7 @@ failed: |
delete pGRRD; |
return nRet; |
} |
-FX_BOOL CJBig2_Context::parseTable(CJBig2_Segment *pSegment) |
+int32_t CJBig2_Context::parseTable(CJBig2_Segment *pSegment) |
{ |
pSegment->m_nResultType = JBIG2_HUFFMAN_TABLE_POINTER; |
JBIG2_ALLOC(pSegment->m_Result.ht, CJBig2_HuffmanTable(m_pStream)); |
@@ -1618,9 +1618,15 @@ JBig2HuffmanCode *CJBig2_Context::decodeSymbolIDHuffmanTable(CJBig2_BitStream *p |
FX_DWORD SBNUMSYMS) |
{ |
JBig2HuffmanCode *SBSYMCODES; |
- int32_t runcodes[35], runcodes_len[35], runcode; |
- int32_t i, j, nTemp, nVal, nBits; |
+ int32_t runcodes[35]; |
+ int32_t runcodes_len[35]; |
+ int32_t runcode; |
+ int32_t i; |
+ int32_t j; |
+ int32_t nVal; |
+ int32_t nBits; |
int32_t run; |
+ FX_DWORD nTemp; |
SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(sizeof(JBig2HuffmanCode), SBNUMSYMS); |
for (i = 0; i < 35; i ++) { |
if(pStream->readNBits(4, &runcodes_len[i]) != 0) { |