summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_GrdProc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_GrdProc.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
index c1bbc6f903..d0fe440b2d 100644
--- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
@@ -35,9 +35,15 @@ constexpr uint16_t kOptConstant12[] = {0x000f, 0x0007, 0x0003};
} // namespace
-CJBig2_GRDProc::CJBig2_GRDProc() {}
+CJBig2_GRDProc::ProgressiveArithDecodeState::ProgressiveArithDecodeState() =
+ default;
-CJBig2_GRDProc::~CJBig2_GRDProc() {}
+CJBig2_GRDProc::ProgressiveArithDecodeState::~ProgressiveArithDecodeState() =
+ default;
+
+CJBig2_GRDProc::CJBig2_GRDProc() = default;
+
+CJBig2_GRDProc::~CJBig2_GRDProc() = default;
bool CJBig2_GRDProc::UseTemplate0Opt3() const {
return (GBAT[0] == 3) && (GBAT[1] == -1) && (GBAT[2] == -3) &&
@@ -478,8 +484,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ContinueDecode(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate0Opt3(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
if (!m_pLine)
m_pLine = pImage->data();
int32_t nStride = pImage->stride();
@@ -581,8 +587,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate0Opt3(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate0Unopt(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
for (; m_loopIndex < GBH; m_loopIndex++) {
if (TPGDON) {
if (pArithDecoder->IsComplete())
@@ -639,8 +645,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate0Unopt(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate1Opt3(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
if (!m_pLine)
m_pLine = pImage->data();
int32_t nStride = pImage->stride();
@@ -740,8 +746,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate1Opt3(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate1Unopt(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
for (uint32_t h = 0; h < GBH; h++) {
if (TPGDON) {
if (pArithDecoder->IsComplete())
@@ -794,8 +800,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate1Unopt(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate2Opt3(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
if (!m_pLine)
m_pLine = pImage->data();
int32_t nStride = pImage->stride();
@@ -896,8 +902,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate2Opt3(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate2Unopt(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
for (; m_loopIndex < GBH; m_loopIndex++) {
if (TPGDON) {
if (pArithDecoder->IsComplete())
@@ -950,8 +956,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate2Unopt(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate3Opt3(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
if (!m_pLine)
m_pLine = pImage->data();
int32_t nStride = pImage->stride();
@@ -1037,8 +1043,8 @@ FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate3Opt3(
FXCODEC_STATUS CJBig2_GRDProc::ProgressiveDecodeArithTemplate3Unopt(
ProgressiveArithDecodeState* pState) {
CJBig2_Image* pImage = pState->pImage->get();
- JBig2ArithCtx* gbContext = pState->gbContext;
- CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder;
+ JBig2ArithCtx* gbContext = pState->gbContext.Get();
+ CJBig2_ArithDecoder* pArithDecoder = pState->pArithDecoder.Get();
for (; m_loopIndex < GBH; m_loopIndex++) {
if (TPGDON) {
if (pArithDecoder->IsComplete())