Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1418)

Side by Side Diff: core/fxcodec/jbig2/JBig2_PddProc.cpp

Issue 1832173003: Remove FX_DWORD from core/ and delete definition (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcodec/jbig2/JBig2_PddProc.h ('k') | core/fxcodec/jbig2/JBig2_SddProc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcodec/jbig2/JBig2_PddProc.h" 7 #include "core/fxcodec/jbig2/JBig2_PddProc.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "core/fxcodec/jbig2/JBig2_GrdProc.h" 11 #include "core/fxcodec/jbig2/JBig2_GrdProc.h"
12 #include "core/fxcodec/jbig2/JBig2_Image.h" 12 #include "core/fxcodec/jbig2/JBig2_Image.h"
13 #include "core/fxcodec/jbig2/JBig2_PatternDict.h" 13 #include "core/fxcodec/jbig2/JBig2_PatternDict.h"
14 14
15 CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( 15 CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith(
16 CJBig2_ArithDecoder* pArithDecoder, 16 CJBig2_ArithDecoder* pArithDecoder,
17 JBig2ArithCtx* gbContext, 17 JBig2ArithCtx* gbContext,
18 IFX_Pause* pPause) { 18 IFX_Pause* pPause) {
19 FX_DWORD GRAY; 19 uint32_t GRAY;
20 CJBig2_Image* BHDC = nullptr; 20 CJBig2_Image* BHDC = nullptr;
21 std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict()); 21 std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict());
22 pDict->NUMPATS = GRAYMAX + 1; 22 pDict->NUMPATS = GRAYMAX + 1;
23 pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS); 23 pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS);
24 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); 24 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS);
25 25
26 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc()); 26 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc());
27 pGRD->MMR = HDMMR; 27 pGRD->MMR = HDMMR;
28 pGRD->GBW = (GRAYMAX + 1) * HDPW; 28 pGRD->GBW = (GRAYMAX + 1) * HDPW;
29 pGRD->GBH = HDPH; 29 pGRD->GBH = HDPH;
(...skipping 22 matching lines...) Expand all
52 while (GRAY <= GRAYMAX) { 52 while (GRAY <= GRAYMAX) {
53 pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH); 53 pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH);
54 GRAY = GRAY + 1; 54 GRAY = GRAY + 1;
55 } 55 }
56 delete BHDC; 56 delete BHDC;
57 return pDict.release(); 57 return pDict.release();
58 } 58 }
59 59
60 CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream, 60 CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream,
61 IFX_Pause* pPause) { 61 IFX_Pause* pPause) {
62 FX_DWORD GRAY; 62 uint32_t GRAY;
63 CJBig2_Image* BHDC = nullptr; 63 CJBig2_Image* BHDC = nullptr;
64 std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict()); 64 std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict());
65 pDict->NUMPATS = GRAYMAX + 1; 65 pDict->NUMPATS = GRAYMAX + 1;
66 pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS); 66 pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS);
67 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); 67 JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS);
68 68
69 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc()); 69 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc());
70 pGRD->MMR = HDMMR; 70 pGRD->MMR = HDMMR;
71 pGRD->GBW = (GRAYMAX + 1) * HDPW; 71 pGRD->GBW = (GRAYMAX + 1) * HDPW;
72 pGRD->GBH = HDPH; 72 pGRD->GBH = HDPH;
73 FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHDC, pStream, nullptr); 73 FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHDC, pStream, nullptr);
74 while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) { 74 while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
75 pGRD->Continue_decode(pPause); 75 pGRD->Continue_decode(pPause);
76 } 76 }
77 if (!BHDC) 77 if (!BHDC)
78 return nullptr; 78 return nullptr;
79 79
80 GRAY = 0; 80 GRAY = 0;
81 while (GRAY <= GRAYMAX) { 81 while (GRAY <= GRAYMAX) {
82 pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH); 82 pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH);
83 GRAY = GRAY + 1; 83 GRAY = GRAY + 1;
84 } 84 }
85 delete BHDC; 85 delete BHDC;
86 return pDict.release(); 86 return pDict.release();
87 } 87 }
OLDNEW
« no previous file with comments | « core/fxcodec/jbig2/JBig2_PddProc.h ('k') | core/fxcodec/jbig2/JBig2_SddProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698