summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_GrdProc.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-20 23:20:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-20 23:20:36 +0000
commitb2b00c31f48c86a1bde7f3e6c07752d1c9195cea (patch)
tree72c75e7480ce8f16e247afc38d09ec8cbcd5bdfc /core/fxcodec/jbig2/JBig2_GrdProc.cpp
parent7def3de1d026a7e99017113d0f17556a3130eba5 (diff)
downloadpdfium-b2b00c31f48c86a1bde7f3e6c07752d1c9195cea.tar.xz
Use UnownedPtr<> in JBig2_GrdProc.h
Pack a little tighter while we're at it. Change-Id: I8cbefe5df1b4340cb55ea14a5ae00ebc1ad07114 Reviewed-on: https://pdfium-review.googlesource.com/40774 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
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())