diff options
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrrdProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GrrdProc.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp index 8622090006..fa4d435a92 100644 --- a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp @@ -13,7 +13,7 @@ #include "core/fxcodec/jbig2/JBig2_Image.h" #include "third_party/base/ptr_util.h" -std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode( +std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::Decode( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { if (!CJBig2_Image::IsValidImageSize(GRW, GRH)) @@ -23,18 +23,18 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode( if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) && (GRAT[3] == -1) && (GRREFERENCEDX == 0) && (GRW == (uint32_t)GRREFERENCE->width())) { - return decode_Template0_opt(pArithDecoder, grContext); + return DecodeTemplate0Opt(pArithDecoder, grContext); } - return decode_Template0_unopt(pArithDecoder, grContext); + return DecodeTemplate0Unopt(pArithDecoder, grContext); } if ((GRREFERENCEDX == 0) && (GRW == (uint32_t)GRREFERENCE->width())) - return decode_Template1_opt(pArithDecoder, grContext); + return DecodeTemplate1Opt(pArithDecoder, grContext); - return decode_Template1_unopt(pArithDecoder, grContext); + return DecodeTemplate1Unopt(pArithDecoder, grContext); } -std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_unopt( +std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::DecodeTemplate0Unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { int LTP = 0; @@ -45,7 +45,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_unopt( if (pArithDecoder->IsComplete()) return nullptr; - LTP = LTP ^ pArithDecoder->DECODE(&grContext[0x0010]); + LTP = LTP ^ pArithDecoder->Decode(&grContext[0x0010]); } uint32_t lines[5]; lines[0] = GRREG->getPixel(1, h - 1); @@ -66,12 +66,12 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_unopt( if (!LTP) { for (uint32_t w = 0; w < GRW; w++) { uint32_t CONTEXT = - decode_Template0_unopt_CalculateContext(*GRREG, lines, w, h); + DecodeTemplate0UnoptCalculateContext(*GRREG, lines, w, h); if (pArithDecoder->IsComplete()) return nullptr; - int bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); - decode_Template0_unopt_SetPixel(GRREG.get(), lines, w, h, bVal); + int bVal = pArithDecoder->Decode(&grContext[CONTEXT]); + DecodeTemplate0UnoptSetPixel(GRREG.get(), lines, w, h, bVal); } } else { for (uint32_t w = 0; w < GRW; w++) { @@ -85,20 +85,20 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_unopt( (bVal == GRREFERENCE->getPixel(w, h + 1)) && (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) { uint32_t CONTEXT = - decode_Template0_unopt_CalculateContext(*GRREG, lines, w, h); + DecodeTemplate0UnoptCalculateContext(*GRREG, lines, w, h); if (pArithDecoder->IsComplete()) return nullptr; - bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + bVal = pArithDecoder->Decode(&grContext[CONTEXT]); } - decode_Template0_unopt_SetPixel(GRREG.get(), lines, w, h, bVal); + DecodeTemplate0UnoptSetPixel(GRREG.get(), lines, w, h, bVal); } } } return GRREG; } -uint32_t CJBig2_GRRDProc::decode_Template0_unopt_CalculateContext( +uint32_t CJBig2_GRRDProc::DecodeTemplate0UnoptCalculateContext( const CJBig2_Image& GRREG, const uint32_t* lines, uint32_t w, @@ -115,11 +115,11 @@ uint32_t CJBig2_GRRDProc::decode_Template0_unopt_CalculateContext( return CONTEXT; } -void CJBig2_GRRDProc::decode_Template0_unopt_SetPixel(CJBig2_Image* GRREG, - uint32_t* lines, - uint32_t w, - uint32_t h, - int bVal) { +void CJBig2_GRRDProc::DecodeTemplate0UnoptSetPixel(CJBig2_Image* GRREG, + uint32_t* lines, + uint32_t w, + uint32_t h, + int bVal) { GRREG->setPixel(w, h, bVal); lines[0] = ((lines[0] << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x03; lines[1] = ((lines[1] << 1) | bVal) & 0x01; @@ -134,7 +134,7 @@ void CJBig2_GRRDProc::decode_Template0_unopt_SetPixel(CJBig2_Image* GRREG, 0x07; } -std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_opt( +std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::DecodeTemplate0Opt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { if (!GRREFERENCE->data()) @@ -161,7 +161,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_opt( if (pArithDecoder->IsComplete()) return nullptr; - LTP = LTP ^ pArithDecoder->DECODE(&grContext[0x0010]); + LTP = LTP ^ pArithDecoder->Decode(&grContext[0x0010]); } uint32_t line1 = (h > 0) ? pLine[-nStride] << 4 : 0; int32_t reference_h = h - GRREFERENCEDY; @@ -207,7 +207,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_opt( if (pArithDecoder->IsComplete()) return nullptr; - int 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) | @@ -256,7 +256,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_opt( if (pArithDecoder->IsComplete()) return nullptr; - bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + bVal = pArithDecoder->Decode(&grContext[CONTEXT]); } cVal |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x0cdb) << 1) | (bVal << 9) | @@ -275,7 +275,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template0_opt( return GRREG; } -std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_unopt( +std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::DecodeTemplate1Unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { int LTP = 0; @@ -286,7 +286,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_unopt( if (pArithDecoder->IsComplete()) return nullptr; - LTP = LTP ^ pArithDecoder->DECODE(&grContext[0x0008]); + LTP = LTP ^ pArithDecoder->Decode(&grContext[0x0008]); } if (!LTP) { uint32_t line1 = GRREG->getPixel(1, h - 1); @@ -313,7 +313,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_unopt( if (pArithDecoder->IsComplete()) return nullptr; - int 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; @@ -364,7 +364,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_unopt( if (pArithDecoder->IsComplete()) return nullptr; - bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + bVal = pArithDecoder->Decode(&grContext[CONTEXT]); } GRREG->setPixel(w, h, bVal); line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07; @@ -387,7 +387,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_unopt( return GRREG; } -std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_opt( +std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::DecodeTemplate1Opt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { if (!GRREFERENCE->data()) @@ -415,7 +415,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_opt( if (pArithDecoder->IsComplete()) return nullptr; - LTP = LTP ^ pArithDecoder->DECODE(&grContext[0x0008]); + LTP = LTP ^ pArithDecoder->Decode(&grContext[0x0008]); } uint32_t line1 = (h > 0) ? pLine[-nStride] << 1 : 0; int32_t reference_h = h - GRREFERENCEDY; @@ -449,7 +449,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_opt( } uint8_t cVal = 0; for (int32_t k = 0; k < nBits; k++) { - int 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) | @@ -495,7 +495,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode_Template1_opt( if (pArithDecoder->IsComplete()) return nullptr; - bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); + bVal = pArithDecoder->Decode(&grContext[CONTEXT]); } cVal |= bVal << (7 - k); CONTEXT = ((CONTEXT & 0x018d) << 1) | (bVal << 6) | |