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

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_Context.h

Issue 828183002: Remove static declared SymbolDictCache. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 11 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
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 #ifndef _JBIG2_CONTEXT_H_ 7 #ifndef _JBIG2_CONTEXT_H_
8 #define _JBIG2_CONTEXT_H_ 8 #define _JBIG2_CONTEXT_H_
9 #include "JBig2_Module.h" 9 #include "JBig2_Module.h"
10 #include "JBig2_List.h" 10 #include "JBig2_List.h"
11 #include "JBig2_Segment.h" 11 #include "JBig2_Segment.h"
12 #include "JBig2_Page.h" 12 #include "JBig2_Page.h"
13 #include "JBig2_GeneralDecoder.h" 13 #include "JBig2_GeneralDecoder.h"
14 #include "../../../include/fxcodec/fx_codec_def.h" 14 #include "../../../include/fxcodec/fx_codec_def.h"
15 #include "../../../include/fxcrt/fx_basic.h" 15 #include "../../../include/fxcrt/fx_basic.h"
16 typedef std::pair<FX_BYTE*, CJBig2_SymbolDict*> CJBig2_CachePair;
16 typedef enum { 17 typedef enum {
17 JBIG2_OUT_OF_PAGE = 0, 18 JBIG2_OUT_OF_PAGE = 0,
18 JBIG2_IN_PAGE, 19 JBIG2_IN_PAGE,
19 } JBig2State; 20 } JBig2State;
20 #define JBIG2_SUCCESS 0 21 #define JBIG2_SUCCESS 0
21 #define JBIG2_FAILED -1 22 #define JBIG2_FAILED -1
22 #define JBIG2_ERROR_TOO_SHORT -2 23 #define JBIG2_ERROR_TOO_SHORT -2
23 #define JBIG2_ERROR_FETAL -3 24 #define JBIG2_ERROR_FETAL -3
24 #define JBIG2_END_OF_PAGE 2 25 #define JBIG2_END_OF_PAGE 2
25 #define JBIG2_END_OF_FILE 3 26 #define JBIG2_END_OF_FILE 3
26 #define JBIG2_ERROR_FILE_FORMAT -4 27 #define JBIG2_ERROR_FILE_FORMAT -4
27 #define JBIG2_ERROR_STREAM_TYPE -5 28 #define JBIG2_ERROR_STREAM_TYPE -5
28 #define JBIG2_ERROR_LIMIT -6 29 #define JBIG2_ERROR_LIMIT -6
29 #define JBIG2_FILE_STREAM 0 30 #define JBIG2_FILE_STREAM 0
30 #define JBIG2_SQUENTIAL_STREAM 1 31 #define JBIG2_SQUENTIAL_STREAM 1
31 #define JBIG2_RANDOM_STREAM 2 32 #define JBIG2_RANDOM_STREAM 2
32 #define JBIG2_EMBED_STREAM 3 33 #define JBIG2_EMBED_STREAM 3
33 #define JBIG2_MIN_SEGMENT_SIZE 11 34 #define JBIG2_MIN_SEGMENT_SIZE 11
34 class CJBig2_Context : public CJBig2_Object 35 class CJBig2_Context : public CJBig2_Object
35 { 36 {
36 public: 37 public:
37 38
38 static CJBig2_Context *CreateContext(CJBig2_Module *pModule, FX_BYTE *pGloba lData, FX_DWORD dwGlobalLength, 39 static CJBig2_Context *CreateContext(CJBig2_Module *pModule, FX_BYTE *pGloba lData, FX_DWORD dwGlobalLength,
39 FX_BYTE *pData, FX_DWORD dwLength, FX_I NT32 nStreamType, IFX_Pause* pPause = NULL); 40 FX_BYTE *pData, FX_DWORD dwLength, FX_I NT32 nStreamType, std::list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPau se = NULL);
40 41
41 static void DestroyContext(CJBig2_Context *pContext); 42 static void DestroyContext(CJBig2_Context *pContext);
42 43
43 FX_INT32 getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT 32 stride, IFX_Pause* pPause); 44 FX_INT32 getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT 32 stride, IFX_Pause* pPause);
44 45
45 FX_INT32 getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT3 2 stride, IFX_Pause* pPause); 46 FX_INT32 getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT3 2 stride, IFX_Pause* pPause);
46 47
47 FX_INT32 getFirstPage(CJBig2_Image **image, IFX_Pause* pPause); 48 FX_INT32 getFirstPage(CJBig2_Image **image, IFX_Pause* pPause);
48 49
49 FX_INT32 getNextPage(CJBig2_Image **image, IFX_Pause* pPause); 50 FX_INT32 getNextPage(CJBig2_Image **image, IFX_Pause* pPause);
50 FX_INT32 Continue(IFX_Pause* pPause); 51 FX_INT32 Continue(IFX_Pause* pPause);
51 FXCODEC_STATUS GetProcessiveStatus() 52 FXCODEC_STATUS GetProcessiveStatus()
52 { 53 {
53 return m_ProcessiveStatus; 54 return m_ProcessiveStatus;
54 }; 55 };
55 private: 56 private:
56 57
57 CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength, 58 CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
58 FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_ Pause* pPause); 59 FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, std: :list<CJBig2_CachePair>* pSymbolDictCache, IFX_Pause* pPause);
59 60
60 ~CJBig2_Context(); 61 ~CJBig2_Context();
61 62
62 FX_INT32 decodeFile(IFX_Pause* pPause); 63 FX_INT32 decodeFile(IFX_Pause* pPause);
63 64
64 FX_INT32 decode_SquentialOrgnazation(IFX_Pause* pPause); 65 FX_INT32 decode_SquentialOrgnazation(IFX_Pause* pPause);
65 66
66 FX_INT32 decode_EmbedOrgnazation(IFX_Pause* pPause); 67 FX_INT32 decode_EmbedOrgnazation(IFX_Pause* pPause);
67 68
68 FX_INT32 decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause); 69 FX_INT32 decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 IFX_Pause* m_pPause; 125 IFX_Pause* m_pPause;
125 FX_INT32 m_PauseStep; 126 FX_INT32 m_PauseStep;
126 FXCODEC_STATUS m_ProcessiveStatus; 127 FXCODEC_STATUS m_ProcessiveStatus;
127 FX_BOOL m_bFirstPage; 128 FX_BOOL m_bFirstPage;
128 CJBig2_ArithDecoder *m_pArithDecoder; 129 CJBig2_ArithDecoder *m_pArithDecoder;
129 CJBig2_GRDProc *m_pGRD; 130 CJBig2_GRDProc *m_pGRD;
130 JBig2ArithCtx *m_gbContext; 131 JBig2ArithCtx *m_gbContext;
131 CJBig2_Segment *m_pSegment; 132 CJBig2_Segment *m_pSegment;
132 FX_DWORD m_dwOffset; 133 FX_DWORD m_dwOffset;
133 JBig2RegionInfo m_ri; 134 JBig2RegionInfo m_ri;
135 std::list<CJBig2_CachePair>* m_pSymbolDictCache;
134 }; 136 };
135 #endif 137 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698