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

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp

Issue 1364083004: Merge to XFA: Split up JBig2_GeneralDecoder.cpp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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/src/fxcodec/jbig2/JBig2_ArithDecoder.cpp ('k') | core/src/fxcodec/jbig2/JBig2_ArithQe.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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 "JBig2_ArithIntDecoder.h" 7 #include "JBig2_ArithIntDecoder.h"
8 8
9 #include "../../../include/fxcrt/fx_memory.h" 9 #include "../../../include/fxcrt/fx_memory.h"
10 #include "JBig2_Define.h"
10 11
11 CJBig2_ArithIntDecoder::CJBig2_ArithIntDecoder() { 12 CJBig2_ArithIntDecoder::CJBig2_ArithIntDecoder() {
12 IAx = FX_Alloc(JBig2ArithCtx, 512); 13 IAx = FX_Alloc(JBig2ArithCtx, 512);
13 JBIG2_memset(IAx, 0, sizeof(JBig2ArithCtx) * 512); 14 JBIG2_memset(IAx, 0, sizeof(JBig2ArithCtx) * 512);
14 } 15 }
15 CJBig2_ArithIntDecoder::~CJBig2_ArithIntDecoder() { 16 CJBig2_ArithIntDecoder::~CJBig2_ArithIntDecoder() {
16 FX_Free(IAx); 17 FX_Free(IAx);
17 } 18 }
18 int CJBig2_ArithIntDecoder::decode(CJBig2_ArithDecoder* pArithDecoder, 19 int CJBig2_ArithIntDecoder::decode(CJBig2_ArithDecoder* pArithDecoder,
19 int* nResult) { 20 int* nResult) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int i; 96 int i;
96 PREV = 1; 97 PREV = 1;
97 for (i = 0; i < SBSYMCODELEN; i++) { 98 for (i = 0; i < SBSYMCODELEN; i++) {
98 D = pArithDecoder->DECODE(IAID + PREV); 99 D = pArithDecoder->DECODE(IAID + PREV);
99 PREV = (PREV << 1) | D; 100 PREV = (PREV << 1) | D;
100 } 101 }
101 PREV = PREV - (1 << SBSYMCODELEN); 102 PREV = PREV - (1 << SBSYMCODELEN);
102 *nResult = PREV; 103 *nResult = PREV;
103 return 0; 104 return 0;
104 } 105 }
OLDNEW
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_ArithDecoder.cpp ('k') | core/src/fxcodec/jbig2/JBig2_ArithQe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698