From 169e0ae9da6e87e89417ff9f3e4f637979f4c986 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 27 Oct 2016 15:09:39 -0700 Subject: Fix FX_BOOL / int noise in JBig2_Grd*Proc Replace most of these with ints since the are used in integer operations. If it walks like a duck, and quacks like a duck ... despite what the hungarian notation might say. Review-Url: https://codereview.chromium.org/2455523005 --- core/fxcodec/jbig2/JBig2_GrdProc.cpp | 100 +++++++++++++++++----------------- core/fxcodec/jbig2/JBig2_GrdProc.h | 2 +- core/fxcodec/jbig2/JBig2_GrrdProc.cpp | 36 ++++++------ 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp index 344367dfa3..8c6d58e511 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp @@ -18,7 +18,7 @@ CJBig2_GRDProc::CJBig2_GRDProc() m_pLine(nullptr), m_pPause(nullptr), m_DecodeType(0), - m_LTP(FALSE) { + m_LTP(0) { m_ReplaceRect.left = 0; m_ReplaceRect.bottom = 0; m_ReplaceRect.top = 0; @@ -69,7 +69,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3( if (!GBREG->m_pData) return nullptr; - FX_BOOL LTP = FALSE; + int LTP = 0; uint8_t* pLine = GBREG->m_pData; int32_t nStride = GBREG->stride(); int32_t nStride2 = nStride << 1; @@ -93,7 +93,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3( line2 = (line2 << 8) | (*pLine2++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | ((line1 >> k) & 0x0800) | ((line2 >> k) & 0x0010)); @@ -104,7 +104,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | @@ -121,7 +121,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3( } uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | ((line2 >> k) & 0x0010)); @@ -131,7 +131,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | (((line2 >> (7 - k))) & 0x0010)); @@ -147,7 +147,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3( CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext) { - FX_BOOL LTP = FALSE; + int LTP = 0; std::unique_ptr GBREG(new CJBig2_Image(GBW, GBH)); GBREG->fill(0); for (uint32_t h = 0; h < GBH; h++) { @@ -163,7 +163,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_unopt( line2 |= GBREG->getPixel(0, h - 1) << 2; uint32_t line3 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, h)) { bVal = 0; } else { @@ -195,7 +195,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3( if (!GBREG->m_pData) return nullptr; - FX_BOOL LTP = FALSE; + int LTP = 0; uint8_t* pLine = GBREG->m_pData; int32_t nStride = GBREG->stride(); int32_t nStride2 = nStride << 1; @@ -218,7 +218,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3( line2 = (line2 << 8) | (*pLine2++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line1 >> k) & 0x0200) | ((line2 >> (k + 1)) & 0x0008); @@ -229,7 +229,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line1 >> (7 - k)) & 0x0200) | @@ -246,7 +246,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3( } uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line2 >> (k + 1)) & 0x0008); @@ -256,7 +256,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line2 >> (8 - k)) & 0x0008); @@ -272,7 +272,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3( CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext) { - FX_BOOL LTP = FALSE; + int LTP = 0; std::unique_ptr GBREG(new CJBig2_Image(GBW, GBH)); GBREG->fill(0); for (uint32_t h = 0; h < GBH; h++) { @@ -289,7 +289,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_unopt( line2 |= GBREG->getPixel(0, h - 1) << 2; uint32_t line3 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, h)) { bVal = 0; } else { @@ -318,7 +318,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3( if (!GBREG->m_pData) return nullptr; - FX_BOOL LTP = FALSE; + int LTP = 0; uint8_t* pLine = GBREG->m_pData; int32_t nStride = GBREG->stride(); int32_t nStride2 = nStride << 1; @@ -341,7 +341,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3( line2 = (line2 << 8) | (*pLine2++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | ((line1 >> k) & 0x0080) | ((line2 >> (k + 3)) & 0x0004); @@ -352,7 +352,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | ((line1 >> (7 - k)) & 0x0080) | @@ -369,7 +369,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3( } uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | ((line2 >> (k + 3)) & 0x0004); @@ -379,7 +379,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | (((line2 >> (10 - k))) & 0x0004); @@ -395,7 +395,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3( CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext) { - FX_BOOL LTP = FALSE; + int LTP = 0; std::unique_ptr GBREG(new CJBig2_Image(GBW, GBH)); GBREG->fill(0); for (uint32_t h = 0; h < GBH; h++) { @@ -410,7 +410,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_unopt( line2 |= GBREG->getPixel(0, h - 1) << 1; uint32_t line3 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, h)) { bVal = 0; } else { @@ -439,7 +439,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3( if (!GBREG->m_pData) return nullptr; - FX_BOOL LTP = FALSE; + int LTP = 0; uint8_t* pLine = GBREG->m_pData; int32_t nStride = GBREG->stride(); int32_t nLineBytes = ((GBW + 7) >> 3) - 1; @@ -458,7 +458,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3( line1 = (line1 << 8) | (*pLine1++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal | ((line1 >> (k + 1)) & 0x0010); @@ -468,7 +468,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3( line1 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal | ((line1 >> (8 - k)) & 0x0010); @@ -479,7 +479,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3( for (int32_t cc = 0; cc < nLineBytes; cc++) { uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal; } @@ -487,7 +487,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3( } uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal; } @@ -502,7 +502,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3( CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext) { - FX_BOOL LTP = FALSE; + int LTP = 0; std::unique_ptr GBREG(new CJBig2_Image(GBW, GBH)); GBREG->fill(0); for (uint32_t h = 0; h < GBH; h++) { @@ -515,7 +515,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_unopt( line1 |= GBREG->getPixel(0, h - 1) << 1; uint32_t line2 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, h)) { bVal = 0; } else { @@ -559,7 +559,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith( (*m_pImage)->fill(0); m_pArithDecoder = pArithDecoder; m_gbContext = gbContext; - m_LTP = FALSE; + m_LTP = 0; m_pLine = nullptr; m_loopIndex = 0; return decode_Arith(pPause); @@ -675,7 +675,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3( line2 = (line2 << 8) | (*pLine2++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | ((line1 >> k) & 0x0800) | ((line2 >> k) & 0x0010)); @@ -686,7 +686,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | @@ -703,7 +703,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3( } uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | ((line2 >> k) & 0x0010)); @@ -713,7 +713,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal | ((line2 >> (7 - k)) & 0x0010)); @@ -750,7 +750,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt( line2 |= pImage->getPixel(0, m_loopIndex - 1) << 2; uint32_t line3 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, m_loopIndex)) { bVal = 0; } else { @@ -812,7 +812,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3( line2 = (line2 << 8) | (*pLine2++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line1 >> k) & 0x0200) | ((line2 >> (k + 1)) & 0x0008); @@ -823,7 +823,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line1 >> (7 - k)) & 0x0200) | @@ -840,7 +840,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3( } uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line2 >> (k + 1)) & 0x0008); @@ -850,7 +850,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal | ((line2 >> (8 - k)) & 0x0008); @@ -888,7 +888,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt( line2 |= pImage->getPixel(0, h - 1) << 2; uint32_t line3 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, h)) { bVal = 0; } else { @@ -945,7 +945,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3( line2 = (line2 << 8) | (*pLine2++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | ((line1 >> k) & 0x0080) | ((line2 >> (k + 3)) & 0x0004); @@ -956,7 +956,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | ((line1 >> (7 - k)) & 0x0080) | @@ -973,7 +973,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3( } uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | ((line2 >> (k + 3)) & 0x0004); @@ -983,7 +983,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3( line2 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal | (((line2 >> (10 - k))) & 0x0004); @@ -1019,7 +1019,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt( line2 |= pImage->getPixel(0, m_loopIndex - 1) << 1; uint32_t line3 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, m_loopIndex)) { bVal = 0; } else { @@ -1074,7 +1074,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3( line1 = (line1 << 8) | (*pLine1++); uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal | ((line1 >> (k + 1)) & 0x0010); @@ -1084,7 +1084,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3( line1 <<= 8; uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal | ((line1 >> (8 - k)) & 0x0010); @@ -1095,7 +1095,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3( for (int32_t cc = 0; cc < nLineBytes; cc++) { uint8_t cVal = 0; for (int32_t k = 7; k >= 0; k--) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal |= bVal << k; CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal; } @@ -1103,7 +1103,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3( } uint8_t cVal1 = 0; for (int32_t k = 0; k < nBitsLeft; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]); cVal1 |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal; } @@ -1136,7 +1136,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_unopt( line1 |= pImage->getPixel(0, m_loopIndex - 1) << 1; uint32_t line2 = 0; for (uint32_t w = 0; w < GBW; w++) { - FX_BOOL bVal; + int bVal; if (USESKIP && SKIP->getPixel(w, m_loopIndex)) { bVal = 0; } else { diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.h b/core/fxcodec/jbig2/JBig2_GrdProc.h index f087afffef..3b334b113c 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.h +++ b/core/fxcodec/jbig2/JBig2_GrdProc.h @@ -117,7 +117,7 @@ class CJBig2_GRDProc { CJBig2_ArithDecoder* m_pArithDecoder; JBig2ArithCtx* m_gbContext; uint16_t m_DecodeType; - FX_BOOL m_LTP; + int m_LTP; FX_RECT m_ReplaceRect; }; diff --git a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp index 672692da54..7ddb522ebc 100644 --- a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp @@ -34,7 +34,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode(CJBig2_ArithDecoder* pArithDecoder, CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { - FX_BOOL LTP = FALSE; + int LTP = 0; std::unique_ptr GRREG(new CJBig2_Image(GRW, GRH)); GRREG->fill(0); for (uint32_t h = 0; h < GRH; h++) { @@ -69,7 +69,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt( CONTEXT |= line2 << 9; CONTEXT |= line1 << 10; CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12; - FX_BOOL bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); GRREG->setPixel(w, h, bVal); line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x03; line2 = ((line2 << 1) | bVal) & 0x01; @@ -106,7 +106,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt( line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2; for (uint32_t w = 0; w < GRW; w++) { - FX_BOOL bVal = GRREFERENCE->getPixel(w, h); + int bVal = GRREFERENCE->getPixel(w, h); if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) && (bVal == GRREFERENCE->getPixel(w, h - 1)) && (bVal == GRREFERENCE->getPixel(w + 1, h - 1)) && @@ -159,7 +159,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( if (!GRREG->m_pData) return nullptr; - FX_BOOL LTP = FALSE; + int LTP = 0; uint8_t* pLine = GRREG->m_pData; uint8_t* pLineR = GRREFERENCE->m_pData; intptr_t nStride = GRREG->stride(); @@ -174,9 +174,9 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( LTP = LTP ^ pArithDecoder->DECODE(&grContext[0x0010]); uint32_t line1 = (h > 0) ? pLine[-nStride] << 4 : 0; int32_t reference_h = h - GRREFERENCEDY; - 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); + 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); uint32_t line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0; uint32_t line2_r = line2_r_ok ? pLineR[nOffset] : 0; uint32_t line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0; @@ -213,7 +213,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( } uint8_t cVal = 0; for (int32_t k = 0; k < nBits; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); cVal |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0cdb) << 1) | (bVal << 9) | ((line1 >> (7 - k)) & 0x0400) | @@ -250,7 +250,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( } uint8_t cVal = 0; for (int32_t k = 0; k < nBits; k++) { - FX_BOOL bVal = GRREFERENCE->getPixel(w + k, h); + int bVal = GRREFERENCE->getPixel(w + k, h); if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w + k - 1, h - 1)) && (bVal == GRREFERENCE->getPixel(w + k, h - 1)) && (bVal == GRREFERENCE->getPixel(w + k + 1, h - 1)) && @@ -282,7 +282,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { - FX_BOOL LTP = FALSE; + int LTP = 0; std::unique_ptr GRREG(new CJBig2_Image(GRW, GRH)); GRREG->fill(0); for (uint32_t h = 0; h < GRH; h++) { @@ -310,7 +310,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt( CONTEXT |= line3 << 5; CONTEXT |= line2 << 6; CONTEXT |= line1 << 7; - FX_BOOL bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); GRREG->setPixel(w, h, bVal); line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07; line2 = ((line2 << 1) | bVal) & 0x01; @@ -344,7 +344,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt( line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1; for (uint32_t w = 0; w < GRW; w++) { - FX_BOOL bVal = GRREFERENCE->getPixel(w, h); + int bVal = GRREFERENCE->getPixel(w, h); if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) && (bVal == GRREFERENCE->getPixel(w, h - 1)) && (bVal == GRREFERENCE->getPixel(w + 1, h - 1)) && @@ -393,7 +393,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( if (!GRREG->m_pData) return nullptr; - FX_BOOL LTP = FALSE; + int LTP = 0; uint8_t* pLine = GRREG->m_pData; uint8_t* pLineR = GRREFERENCE->m_pData; intptr_t nStride = GRREG->stride(); @@ -409,9 +409,9 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( LTP = LTP ^ pArithDecoder->DECODE(&grContext[0x0008]); uint32_t line1 = (h > 0) ? pLine[-nStride] << 1 : 0; int32_t reference_h = h - GRREFERENCEDY; - 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); + 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); uint32_t line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0; uint32_t line2_r = line2_r_ok ? pLineR[nOffset] : 0; uint32_t line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0; @@ -439,7 +439,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( } uint8_t cVal = 0; for (int32_t k = 0; k < nBits; k++) { - FX_BOOL bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + int bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); cVal |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x018d) << 1) | (bVal << 6) | ((line1 >> (7 - k)) & 0x0080) | @@ -473,7 +473,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( } uint8_t cVal = 0; for (int32_t k = 0; k < nBits; k++) { - FX_BOOL bVal = GRREFERENCE->getPixel(w + k, h); + int bVal = GRREFERENCE->getPixel(w + k, h); if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w + k - 1, h - 1)) && (bVal == GRREFERENCE->getPixel(w + k, h - 1)) && (bVal == GRREFERENCE->getPixel(w + k + 1, h - 1)) && -- cgit v1.2.3