OLD | NEW |
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_GrrdProc.h" | 7 #include "core/fxcodec/jbig2/JBig2_GrrdProc.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" | 11 #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" |
12 #include "core/fxcodec/jbig2/JBig2_BitStream.h" | 12 #include "core/fxcodec/jbig2/JBig2_BitStream.h" |
13 #include "core/fxcodec/jbig2/JBig2_Image.h" | 13 #include "core/fxcodec/jbig2/JBig2_Image.h" |
14 | 14 |
15 CJBig2_Image* CJBig2_GRRDProc::decode(CJBig2_ArithDecoder* pArithDecoder, | 15 CJBig2_Image* CJBig2_GRRDProc::decode(CJBig2_ArithDecoder* pArithDecoder, |
16 JBig2ArithCtx* grContext) { | 16 JBig2ArithCtx* grContext) { |
17 if (GRW == 0 || GRH == 0) | 17 if (GRW == 0 || GRH == 0) |
18 return new CJBig2_Image(GRW, GRH); | 18 return new CJBig2_Image(GRW, GRH); |
19 | 19 |
20 if (GRTEMPLATE == 0) { | 20 if (GRTEMPLATE == 0) { |
21 if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) && | 21 if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) && |
22 (GRAT[3] == -1) && (GRREFERENCEDX == 0) && | 22 (GRAT[3] == -1) && (GRREFERENCEDX == 0) && |
23 (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) { | 23 (GRW == (uint32_t)GRREFERENCE->m_nWidth)) { |
24 return decode_Template0_opt(pArithDecoder, grContext); | 24 return decode_Template0_opt(pArithDecoder, grContext); |
25 } | 25 } |
26 return decode_Template0_unopt(pArithDecoder, grContext); | 26 return decode_Template0_unopt(pArithDecoder, grContext); |
27 } | 27 } |
28 | 28 |
29 if ((GRREFERENCEDX == 0) && (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) | 29 if ((GRREFERENCEDX == 0) && (GRW == (uint32_t)GRREFERENCE->m_nWidth)) |
30 return decode_Template1_opt(pArithDecoder, grContext); | 30 return decode_Template1_opt(pArithDecoder, grContext); |
31 return decode_Template1_unopt(pArithDecoder, grContext); | 31 return decode_Template1_unopt(pArithDecoder, grContext); |
32 } | 32 } |
33 | 33 |
34 CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt( | 34 CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt( |
35 CJBig2_ArithDecoder* pArithDecoder, | 35 CJBig2_ArithDecoder* pArithDecoder, |
36 JBig2ArithCtx* grContext) { | 36 JBig2ArithCtx* grContext) { |
37 FX_BOOL LTP, SLTP, bVal; | 37 FX_BOOL LTP, SLTP, bVal; |
38 FX_DWORD CONTEXT; | 38 uint32_t CONTEXT; |
39 FX_DWORD line1, line2, line3, line4, line5; | 39 uint32_t line1, line2, line3, line4, line5; |
40 LTP = 0; | 40 LTP = 0; |
41 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); | 41 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); |
42 GRREG->fill(0); | 42 GRREG->fill(0); |
43 for (FX_DWORD h = 0; h < GRH; h++) { | 43 for (uint32_t h = 0; h < GRH; h++) { |
44 if (TPGRON) { | 44 if (TPGRON) { |
45 SLTP = pArithDecoder->DECODE(&grContext[0x0010]); | 45 SLTP = pArithDecoder->DECODE(&grContext[0x0010]); |
46 LTP = LTP ^ SLTP; | 46 LTP = LTP ^ SLTP; |
47 } | 47 } |
48 if (LTP == 0) { | 48 if (LTP == 0) { |
49 line1 = GRREG->getPixel(1, h - 1); | 49 line1 = GRREG->getPixel(1, h - 1); |
50 line1 |= GRREG->getPixel(0, h - 1) << 1; | 50 line1 |= GRREG->getPixel(0, h - 1) << 1; |
51 line2 = 0; | 51 line2 = 0; |
52 line3 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY - 1); | 52 line3 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY - 1); |
53 line3 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1) | 53 line3 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1) |
54 << 1; | 54 << 1; |
55 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); | 55 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); |
56 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; | 56 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; |
57 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) | 57 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) |
58 << 2; | 58 << 2; |
59 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); | 59 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); |
60 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) | 60 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) |
61 << 1; | 61 << 1; |
62 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) | 62 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) |
63 << 2; | 63 << 2; |
64 for (FX_DWORD w = 0; w < GRW; w++) { | 64 for (uint32_t w = 0; w < GRW; w++) { |
65 CONTEXT = line5; | 65 CONTEXT = line5; |
66 CONTEXT |= line4 << 3; | 66 CONTEXT |= line4 << 3; |
67 CONTEXT |= line3 << 6; | 67 CONTEXT |= line3 << 6; |
68 CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], | 68 CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], |
69 h - GRREFERENCEDY + GRAT[3]) | 69 h - GRREFERENCEDY + GRAT[3]) |
70 << 8; | 70 << 8; |
71 CONTEXT |= line2 << 9; | 71 CONTEXT |= line2 << 9; |
72 CONTEXT |= line1 << 10; | 72 CONTEXT |= line1 << 10; |
73 CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12; | 73 CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12; |
74 bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); | 74 bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); |
(...skipping 22 matching lines...) Expand all Loading... |
97 << 1; | 97 << 1; |
98 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); | 98 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); |
99 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; | 99 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; |
100 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) | 100 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) |
101 << 2; | 101 << 2; |
102 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); | 102 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); |
103 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) | 103 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) |
104 << 1; | 104 << 1; |
105 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) | 105 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) |
106 << 2; | 106 << 2; |
107 for (FX_DWORD w = 0; w < GRW; w++) { | 107 for (uint32_t w = 0; w < GRW; w++) { |
108 bVal = GRREFERENCE->getPixel(w, h); | 108 bVal = GRREFERENCE->getPixel(w, h); |
109 if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) && | 109 if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) && |
110 (bVal == GRREFERENCE->getPixel(w, h - 1)) && | 110 (bVal == GRREFERENCE->getPixel(w, h - 1)) && |
111 (bVal == GRREFERENCE->getPixel(w + 1, h - 1)) && | 111 (bVal == GRREFERENCE->getPixel(w + 1, h - 1)) && |
112 (bVal == GRREFERENCE->getPixel(w - 1, h)) && | 112 (bVal == GRREFERENCE->getPixel(w - 1, h)) && |
113 (bVal == GRREFERENCE->getPixel(w + 1, h)) && | 113 (bVal == GRREFERENCE->getPixel(w + 1, h)) && |
114 (bVal == GRREFERENCE->getPixel(w - 1, h + 1)) && | 114 (bVal == GRREFERENCE->getPixel(w - 1, h + 1)) && |
115 (bVal == GRREFERENCE->getPixel(w, h + 1)) && | 115 (bVal == GRREFERENCE->getPixel(w, h + 1)) && |
116 (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) { | 116 (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) { |
117 CONTEXT = line5; | 117 CONTEXT = line5; |
(...skipping 28 matching lines...) Expand all Loading... |
146 return GRREG.release(); | 146 return GRREG.release(); |
147 } | 147 } |
148 | 148 |
149 CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( | 149 CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( |
150 CJBig2_ArithDecoder* pArithDecoder, | 150 CJBig2_ArithDecoder* pArithDecoder, |
151 JBig2ArithCtx* grContext) { | 151 JBig2ArithCtx* grContext) { |
152 if (!GRREFERENCE->m_pData) | 152 if (!GRREFERENCE->m_pData) |
153 return nullptr; | 153 return nullptr; |
154 | 154 |
155 FX_BOOL LTP, SLTP, bVal; | 155 FX_BOOL LTP, SLTP, bVal; |
156 FX_DWORD CONTEXT; | 156 uint32_t CONTEXT; |
157 FX_DWORD line1, line1_r, line2_r, line3_r; | 157 uint32_t line1, line1_r, line2_r, line3_r; |
158 uint8_t *pLine, *pLineR, cVal; | 158 uint8_t *pLine, *pLineR, cVal; |
159 intptr_t nStride, nStrideR, nOffset; | 159 intptr_t nStride, nStrideR, nOffset; |
160 int32_t k, nBits; | 160 int32_t k, nBits; |
161 int32_t GRWR, GRHR; | 161 int32_t GRWR, GRHR; |
162 int32_t GRW, GRH; | 162 int32_t GRW, GRH; |
163 GRW = (int32_t)CJBig2_GRRDProc::GRW; | 163 GRW = (int32_t)CJBig2_GRRDProc::GRW; |
164 GRH = (int32_t)CJBig2_GRRDProc::GRH; | 164 GRH = (int32_t)CJBig2_GRRDProc::GRH; |
165 LTP = 0; | 165 LTP = 0; |
166 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); | 166 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); |
167 if (!GRREG->m_pData) | 167 if (!GRREG->m_pData) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 pLineR += nStrideR; | 280 pLineR += nStrideR; |
281 } | 281 } |
282 } | 282 } |
283 return GRREG.release(); | 283 return GRREG.release(); |
284 } | 284 } |
285 | 285 |
286 CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt( | 286 CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt( |
287 CJBig2_ArithDecoder* pArithDecoder, | 287 CJBig2_ArithDecoder* pArithDecoder, |
288 JBig2ArithCtx* grContext) { | 288 JBig2ArithCtx* grContext) { |
289 FX_BOOL LTP, SLTP, bVal; | 289 FX_BOOL LTP, SLTP, bVal; |
290 FX_DWORD CONTEXT; | 290 uint32_t CONTEXT; |
291 FX_DWORD line1, line2, line3, line4, line5; | 291 uint32_t line1, line2, line3, line4, line5; |
292 LTP = 0; | 292 LTP = 0; |
293 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); | 293 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); |
294 GRREG->fill(0); | 294 GRREG->fill(0); |
295 for (FX_DWORD h = 0; h < GRH; h++) { | 295 for (uint32_t h = 0; h < GRH; h++) { |
296 if (TPGRON) { | 296 if (TPGRON) { |
297 SLTP = pArithDecoder->DECODE(&grContext[0x0008]); | 297 SLTP = pArithDecoder->DECODE(&grContext[0x0008]); |
298 LTP = LTP ^ SLTP; | 298 LTP = LTP ^ SLTP; |
299 } | 299 } |
300 if (LTP == 0) { | 300 if (LTP == 0) { |
301 line1 = GRREG->getPixel(1, h - 1); | 301 line1 = GRREG->getPixel(1, h - 1); |
302 line1 |= GRREG->getPixel(0, h - 1) << 1; | 302 line1 |= GRREG->getPixel(0, h - 1) << 1; |
303 line1 |= GRREG->getPixel(-1, h - 1) << 2; | 303 line1 |= GRREG->getPixel(-1, h - 1) << 2; |
304 line2 = 0; | 304 line2 = 0; |
305 line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1); | 305 line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1); |
306 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); | 306 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); |
307 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; | 307 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; |
308 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) | 308 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) |
309 << 2; | 309 << 2; |
310 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); | 310 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); |
311 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) | 311 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) |
312 << 1; | 312 << 1; |
313 for (FX_DWORD w = 0; w < GRW; w++) { | 313 for (uint32_t w = 0; w < GRW; w++) { |
314 CONTEXT = line5; | 314 CONTEXT = line5; |
315 CONTEXT |= line4 << 2; | 315 CONTEXT |= line4 << 2; |
316 CONTEXT |= line3 << 5; | 316 CONTEXT |= line3 << 5; |
317 CONTEXT |= line2 << 6; | 317 CONTEXT |= line2 << 6; |
318 CONTEXT |= line1 << 7; | 318 CONTEXT |= line1 << 7; |
319 bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); | 319 bVal = pArithDecoder->DECODE(&grContext[CONTEXT]); |
320 GRREG->setPixel(w, h, bVal); | 320 GRREG->setPixel(w, h, bVal); |
321 line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07; | 321 line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07; |
322 line2 = ((line2 << 1) | bVal) & 0x01; | 322 line2 = ((line2 << 1) | bVal) & 0x01; |
323 line3 = ((line3 << 1) | | 323 line3 = ((line3 << 1) | |
(...skipping 15 matching lines...) Expand all Loading... |
339 line1 |= GRREG->getPixel(-1, h - 1) << 2; | 339 line1 |= GRREG->getPixel(-1, h - 1) << 2; |
340 line2 = 0; | 340 line2 = 0; |
341 line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1); | 341 line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1); |
342 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); | 342 line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY); |
343 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; | 343 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1; |
344 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) | 344 line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) |
345 << 2; | 345 << 2; |
346 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); | 346 line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1); |
347 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) | 347 line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) |
348 << 1; | 348 << 1; |
349 for (FX_DWORD w = 0; w < GRW; w++) { | 349 for (uint32_t w = 0; w < GRW; w++) { |
350 bVal = GRREFERENCE->getPixel(w, h); | 350 bVal = GRREFERENCE->getPixel(w, h); |
351 if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) && | 351 if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) && |
352 (bVal == GRREFERENCE->getPixel(w, h - 1)) && | 352 (bVal == GRREFERENCE->getPixel(w, h - 1)) && |
353 (bVal == GRREFERENCE->getPixel(w + 1, h - 1)) && | 353 (bVal == GRREFERENCE->getPixel(w + 1, h - 1)) && |
354 (bVal == GRREFERENCE->getPixel(w - 1, h)) && | 354 (bVal == GRREFERENCE->getPixel(w - 1, h)) && |
355 (bVal == GRREFERENCE->getPixel(w + 1, h)) && | 355 (bVal == GRREFERENCE->getPixel(w + 1, h)) && |
356 (bVal == GRREFERENCE->getPixel(w - 1, h + 1)) && | 356 (bVal == GRREFERENCE->getPixel(w - 1, h + 1)) && |
357 (bVal == GRREFERENCE->getPixel(w, h + 1)) && | 357 (bVal == GRREFERENCE->getPixel(w, h + 1)) && |
358 (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) { | 358 (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) { |
359 CONTEXT = line5; | 359 CONTEXT = line5; |
(...skipping 24 matching lines...) Expand all Loading... |
384 return GRREG.release(); | 384 return GRREG.release(); |
385 } | 385 } |
386 | 386 |
387 CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( | 387 CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( |
388 CJBig2_ArithDecoder* pArithDecoder, | 388 CJBig2_ArithDecoder* pArithDecoder, |
389 JBig2ArithCtx* grContext) { | 389 JBig2ArithCtx* grContext) { |
390 if (!GRREFERENCE->m_pData) | 390 if (!GRREFERENCE->m_pData) |
391 return nullptr; | 391 return nullptr; |
392 | 392 |
393 FX_BOOL LTP, SLTP, bVal; | 393 FX_BOOL LTP, SLTP, bVal; |
394 FX_DWORD CONTEXT; | 394 uint32_t CONTEXT; |
395 FX_DWORD line1, line1_r, line2_r, line3_r; | 395 uint32_t line1, line1_r, line2_r, line3_r; |
396 uint8_t *pLine, *pLineR, cVal; | 396 uint8_t *pLine, *pLineR, cVal; |
397 intptr_t nStride, nStrideR, nOffset; | 397 intptr_t nStride, nStrideR, nOffset; |
398 int32_t k, nBits; | 398 int32_t k, nBits; |
399 int32_t GRWR, GRHR; | 399 int32_t GRWR, GRHR; |
400 int32_t GRW, GRH; | 400 int32_t GRW, GRH; |
401 GRW = (int32_t)CJBig2_GRRDProc::GRW; | 401 GRW = (int32_t)CJBig2_GRRDProc::GRW; |
402 GRH = (int32_t)CJBig2_GRRDProc::GRH; | 402 GRH = (int32_t)CJBig2_GRRDProc::GRH; |
403 LTP = 0; | 403 LTP = 0; |
404 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); | 404 std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH)); |
405 if (!GRREG->m_pData) | 405 if (!GRREG->m_pData) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 pLine[w >> 3] = cVal; | 507 pLine[w >> 3] = cVal; |
508 } | 508 } |
509 } | 509 } |
510 pLine += nStride; | 510 pLine += nStride; |
511 if (h < GRHR + GRREFERENCEDY) { | 511 if (h < GRHR + GRREFERENCEDY) { |
512 pLineR += nStrideR; | 512 pLineR += nStrideR; |
513 } | 513 } |
514 } | 514 } |
515 return GRREG.release(); | 515 return GRREG.release(); |
516 } | 516 } |
OLD | NEW |