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

Side by Side Diff: core/fxcodec/jbig2/JBig2_GsidProc.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_GsidProc.h ('k') | core/fxcodec/jbig2/JBig2_HtrdProc.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_GsidProc.h" 7 #include "core/fxcodec/jbig2/JBig2_GsidProc.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "core/fxcodec/jbig2/JBig2_BitStream.h" 11 #include "core/fxcodec/jbig2/JBig2_BitStream.h"
12 #include "core/fxcodec/jbig2/JBig2_GrdProc.h" 12 #include "core/fxcodec/jbig2/JBig2_GrdProc.h"
13 #include "core/fxcodec/jbig2/JBig2_Image.h" 13 #include "core/fxcodec/jbig2/JBig2_Image.h"
14 #include "core/fxcodec/jbig2/JBig2_List.h" 14 #include "core/fxcodec/jbig2/JBig2_List.h"
15 #include "core/fxcrt/include/fx_basic.h" 15 #include "core/fxcrt/include/fx_basic.h"
16 16
17 FX_DWORD* CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, 17 uint32_t* CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
18 JBig2ArithCtx* gbContext, 18 JBig2ArithCtx* gbContext,
19 IFX_Pause* pPause) { 19 IFX_Pause* pPause) {
20 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc()); 20 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc());
21 pGRD->MMR = GSMMR; 21 pGRD->MMR = GSMMR;
22 pGRD->GBW = GSW; 22 pGRD->GBW = GSW;
23 pGRD->GBH = GSH; 23 pGRD->GBH = GSH;
24 pGRD->GBTEMPLATE = GSTEMPLATE; 24 pGRD->GBTEMPLATE = GSTEMPLATE;
25 pGRD->TPGDON = 0; 25 pGRD->TPGDON = 0;
26 pGRD->USESKIP = GSUSESKIP; 26 pGRD->USESKIP = GSUSESKIP;
27 pGRD->SKIP = GSKIP; 27 pGRD->SKIP = GSKIP;
(...skipping 21 matching lines...) Expand all
49 pGRD->Continue_decode(pPause); 49 pGRD->Continue_decode(pPause);
50 50
51 if (!pImage) 51 if (!pImage)
52 return nullptr; 52 return nullptr;
53 53
54 GSPLANES.set(i, pImage); 54 GSPLANES.set(i, pImage);
55 55
56 if (i < GSBPP - 1) 56 if (i < GSBPP - 1)
57 pImage->composeFrom(0, 0, GSPLANES.get(i + 1), JBIG2_COMPOSE_XOR); 57 pImage->composeFrom(0, 0, GSPLANES.get(i + 1), JBIG2_COMPOSE_XOR);
58 } 58 }
59 std::unique_ptr<FX_DWORD, FxFreeDeleter> GSVALS( 59 std::unique_ptr<uint32_t, FxFreeDeleter> GSVALS(
60 FX_Alloc2D(FX_DWORD, GSW, GSH)); 60 FX_Alloc2D(uint32_t, GSW, GSH));
61 JBIG2_memset(GSVALS.get(), 0, sizeof(FX_DWORD) * GSW * GSH); 61 JBIG2_memset(GSVALS.get(), 0, sizeof(uint32_t) * GSW * GSH);
62 for (FX_DWORD y = 0; y < GSH; ++y) { 62 for (uint32_t y = 0; y < GSH; ++y) {
63 for (FX_DWORD x = 0; x < GSW; ++x) { 63 for (uint32_t x = 0; x < GSW; ++x) {
64 for (int32_t i = 0; i < GSBPP; ++i) { 64 for (int32_t i = 0; i < GSBPP; ++i) {
65 GSVALS.get()[y * GSW + x] |= GSPLANES.get(i)->getPixel(x, y) << i; 65 GSVALS.get()[y * GSW + x] |= GSPLANES.get(i)->getPixel(x, y) << i;
66 } 66 }
67 } 67 }
68 } 68 }
69 return GSVALS.release(); 69 return GSVALS.release();
70 } 70 }
71 71
72 FX_DWORD* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream, 72 uint32_t* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream,
73 IFX_Pause* pPause) { 73 IFX_Pause* pPause) {
74 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc()); 74 std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc());
75 pGRD->MMR = GSMMR; 75 pGRD->MMR = GSMMR;
76 pGRD->GBW = GSW; 76 pGRD->GBW = GSW;
77 pGRD->GBH = GSH; 77 pGRD->GBH = GSH;
78 78
79 std::unique_ptr<CJBig2_Image*> GSPLANES(FX_Alloc(CJBig2_Image*, GSBPP)); 79 std::unique_ptr<CJBig2_Image*> GSPLANES(FX_Alloc(CJBig2_Image*, GSBPP));
80 JBIG2_memset(GSPLANES.get(), 0, sizeof(CJBig2_Image*) * GSBPP); 80 JBIG2_memset(GSPLANES.get(), 0, sizeof(CJBig2_Image*) * GSBPP);
81 FXCODEC_STATUS status = 81 FXCODEC_STATUS status =
82 pGRD->Start_decode_MMR(&GSPLANES.get()[GSBPP - 1], pStream, nullptr); 82 pGRD->Start_decode_MMR(&GSPLANES.get()[GSBPP - 1], pStream, nullptr);
(...skipping 16 matching lines...) Expand all
99 for (int32_t K = GSBPP - 1; K > J; --K) 99 for (int32_t K = GSBPP - 1; K > J; --K)
100 delete GSPLANES.get()[K]; 100 delete GSPLANES.get()[K];
101 return nullptr; 101 return nullptr;
102 } 102 }
103 pStream->alignByte(); 103 pStream->alignByte();
104 pStream->offset(3); 104 pStream->offset(3);
105 GSPLANES.get()[J]->composeFrom(0, 0, GSPLANES.get()[J + 1], 105 GSPLANES.get()[J]->composeFrom(0, 0, GSPLANES.get()[J + 1],
106 JBIG2_COMPOSE_XOR); 106 JBIG2_COMPOSE_XOR);
107 J = J - 1; 107 J = J - 1;
108 } 108 }
109 std::unique_ptr<FX_DWORD> GSVALS(FX_Alloc2D(FX_DWORD, GSW, GSH)); 109 std::unique_ptr<uint32_t> GSVALS(FX_Alloc2D(uint32_t, GSW, GSH));
110 JBIG2_memset(GSVALS.get(), 0, sizeof(FX_DWORD) * GSW * GSH); 110 JBIG2_memset(GSVALS.get(), 0, sizeof(uint32_t) * GSW * GSH);
111 for (FX_DWORD y = 0; y < GSH; ++y) { 111 for (uint32_t y = 0; y < GSH; ++y) {
112 for (FX_DWORD x = 0; x < GSW; ++x) { 112 for (uint32_t x = 0; x < GSW; ++x) {
113 for (J = 0; J < GSBPP; ++J) { 113 for (J = 0; J < GSBPP; ++J) {
114 GSVALS.get()[y * GSW + x] |= GSPLANES.get()[J]->getPixel(x, y) << J; 114 GSVALS.get()[y * GSW + x] |= GSPLANES.get()[J]->getPixel(x, y) << J;
115 } 115 }
116 } 116 }
117 } 117 }
118 for (J = 0; J < GSBPP; ++J) { 118 for (J = 0; J < GSBPP; ++J) {
119 delete GSPLANES.get()[J]; 119 delete GSPLANES.get()[J];
120 } 120 }
121 return GSVALS.release(); 121 return GSVALS.release();
122 } 122 }
OLDNEW
« no previous file with comments | « core/fxcodec/jbig2/JBig2_GsidProc.h ('k') | core/fxcodec/jbig2/JBig2_HtrdProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698