OLD | NEW |
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_GENERAL_DECODER_H_ | 7 #ifndef _JBIG2_GENERAL_DECODER_H_ |
8 #define _JBIG2_GENERAL_DECODER_H_ | 8 #define _JBIG2_GENERAL_DECODER_H_ |
9 | 9 |
10 #include "../../../include/fxcodec/fx_codec_def.h" | 10 #include "../../../include/fxcodec/fx_codec_def.h" |
11 #include "../../../include/fxcrt/fx_coordinates.h" | 11 #include "../../../include/fxcrt/fx_coordinates.h" |
12 #include "JBig2_ArithDecoder.h" | 12 #include "JBig2_ArithDecoder.h" |
13 #include "JBig2_ArithIntDecoder.h" | 13 #include "JBig2_ArithIntDecoder.h" |
14 #include "JBig2_Define.h" | 14 #include "JBig2_Define.h" |
15 #include "JBig2_SymbolDict.h" | 15 #include "JBig2_SymbolDict.h" |
16 | 16 |
17 class CJBig2_HuffmanTable; | 17 class CJBig2_HuffmanTable; |
18 class CJBig2_Image; | 18 class CJBig2_Image; |
19 class CJBig2_PatternDict; | 19 class CJBig2_PatternDict; |
20 | 20 |
21 enum JBig2Corner { | 21 enum JBig2Corner { |
22 JBIG2_CORNER_BOTTOMLEFT = 0, | 22 JBIG2_CORNER_BOTTOMLEFT = 0, |
23 JBIG2_CORNER_TOPLEFT = 1, | 23 JBIG2_CORNER_TOPLEFT = 1, |
24 JBIG2_CORNER_BOTTOMRIGHT = 2, | 24 JBIG2_CORNER_BOTTOMRIGHT = 2, |
25 JBIG2_CORNER_TOPRIGHT = 3 | 25 JBIG2_CORNER_TOPRIGHT = 3 |
26 }; | 26 }; |
27 | 27 |
28 class CJBig2_GRDProc : public CJBig2_Object { | 28 class CJBig2_GRDProc { |
29 public: | 29 public: |
30 CJBig2_GRDProc() { | 30 CJBig2_GRDProc() { |
31 m_loopIndex = 0; | 31 m_loopIndex = 0; |
32 m_pLine = NULL; | 32 m_pLine = NULL; |
33 m_pPause = NULL; | 33 m_pPause = NULL; |
34 m_DecodeType = 0; | 34 m_DecodeType = 0; |
35 LTP = 0; | 35 LTP = 0; |
36 m_ReplaceRect.left = 0; | 36 m_ReplaceRect.left = 0; |
37 m_ReplaceRect.bottom = 0; | 37 m_ReplaceRect.bottom = 0; |
38 m_ReplaceRect.top = 0; | 38 m_ReplaceRect.top = 0; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 IFX_Pause* m_pPause; | 128 IFX_Pause* m_pPause; |
129 FXCODEC_STATUS m_ProssiveStatus; | 129 FXCODEC_STATUS m_ProssiveStatus; |
130 CJBig2_Image** m_pImage; | 130 CJBig2_Image** m_pImage; |
131 CJBig2_ArithDecoder* m_pArithDecoder; | 131 CJBig2_ArithDecoder* m_pArithDecoder; |
132 JBig2ArithCtx* m_gbContext; | 132 JBig2ArithCtx* m_gbContext; |
133 FX_WORD m_DecodeType; | 133 FX_WORD m_DecodeType; |
134 FX_BOOL LTP; | 134 FX_BOOL LTP; |
135 FX_RECT m_ReplaceRect; | 135 FX_RECT m_ReplaceRect; |
136 }; | 136 }; |
137 | 137 |
138 class CJBig2_GRRDProc : public CJBig2_Object { | 138 class CJBig2_GRRDProc { |
139 public: | 139 public: |
140 CJBig2_Image* decode(CJBig2_ArithDecoder* pArithDecoder, | 140 CJBig2_Image* decode(CJBig2_ArithDecoder* pArithDecoder, |
141 JBig2ArithCtx* grContext); | 141 JBig2ArithCtx* grContext); |
142 | 142 |
143 CJBig2_Image* decode_Template0_unopt(CJBig2_ArithDecoder* pArithDecoder, | 143 CJBig2_Image* decode_Template0_unopt(CJBig2_ArithDecoder* pArithDecoder, |
144 JBig2ArithCtx* grContext); | 144 JBig2ArithCtx* grContext); |
145 | 145 |
146 CJBig2_Image* decode_Template0_opt(CJBig2_ArithDecoder* pArithDecoder, | 146 CJBig2_Image* decode_Template0_opt(CJBig2_ArithDecoder* pArithDecoder, |
147 JBig2ArithCtx* grContext); | 147 JBig2ArithCtx* grContext); |
148 | 148 |
(...skipping 12 matching lines...) Expand all Loading... |
161 FX_BOOL TPGRON; | 161 FX_BOOL TPGRON; |
162 int8_t GRAT[4]; | 162 int8_t GRAT[4]; |
163 }; | 163 }; |
164 | 164 |
165 typedef struct { | 165 typedef struct { |
166 CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, | 166 CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, |
167 *IARDX, *IARDY; | 167 *IARDX, *IARDY; |
168 CJBig2_ArithIaidDecoder* IAID; | 168 CJBig2_ArithIaidDecoder* IAID; |
169 } JBig2IntDecoderState; | 169 } JBig2IntDecoderState; |
170 | 170 |
171 class CJBig2_TRDProc : public CJBig2_Object { | 171 class CJBig2_TRDProc { |
172 public: | 172 public: |
173 CJBig2_Image* decode_Huffman(CJBig2_BitStream* pStream, | 173 CJBig2_Image* decode_Huffman(CJBig2_BitStream* pStream, |
174 JBig2ArithCtx* grContext); | 174 JBig2ArithCtx* grContext); |
175 | 175 |
176 CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, | 176 CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
177 JBig2ArithCtx* grContext, | 177 JBig2ArithCtx* grContext, |
178 JBig2IntDecoderState* pIDS = NULL); | 178 JBig2IntDecoderState* pIDS = NULL); |
179 | 179 |
180 public: | 180 public: |
181 FX_BOOL SBHUFF; | 181 FX_BOOL SBHUFF; |
(...skipping 13 matching lines...) Expand all Loading... |
195 JBig2ComposeOp SBCOMBOP; | 195 JBig2ComposeOp SBCOMBOP; |
196 FX_BOOL TRANSPOSED; | 196 FX_BOOL TRANSPOSED; |
197 | 197 |
198 JBig2Corner REFCORNER; | 198 JBig2Corner REFCORNER; |
199 int8_t SBDSOFFSET; | 199 int8_t SBDSOFFSET; |
200 CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, | 200 CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, |
201 *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE; | 201 *SBHUFFRDX, *SBHUFFRDY, *SBHUFFRSIZE; |
202 FX_BOOL SBRTEMPLATE; | 202 FX_BOOL SBRTEMPLATE; |
203 int8_t SBRAT[4]; | 203 int8_t SBRAT[4]; |
204 }; | 204 }; |
205 class CJBig2_SDDProc : public CJBig2_Object { | 205 class CJBig2_SDDProc { |
206 public: | 206 public: |
207 CJBig2_SymbolDict* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, | 207 CJBig2_SymbolDict* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
208 JBig2ArithCtx* gbContext, | 208 JBig2ArithCtx* gbContext, |
209 JBig2ArithCtx* grContext); | 209 JBig2ArithCtx* grContext); |
210 | 210 |
211 CJBig2_SymbolDict* decode_Huffman(CJBig2_BitStream* pStream, | 211 CJBig2_SymbolDict* decode_Huffman(CJBig2_BitStream* pStream, |
212 JBig2ArithCtx* gbContext, | 212 JBig2ArithCtx* gbContext, |
213 JBig2ArithCtx* grContext, | 213 JBig2ArithCtx* grContext, |
214 IFX_Pause* pPause); | 214 IFX_Pause* pPause); |
215 | 215 |
216 public: | 216 public: |
217 FX_BOOL SDHUFF; | 217 FX_BOOL SDHUFF; |
218 FX_BOOL SDREFAGG; | 218 FX_BOOL SDREFAGG; |
219 FX_DWORD SDNUMINSYMS; | 219 FX_DWORD SDNUMINSYMS; |
220 CJBig2_Image** SDINSYMS; | 220 CJBig2_Image** SDINSYMS; |
221 FX_DWORD SDNUMNEWSYMS; | 221 FX_DWORD SDNUMNEWSYMS; |
222 FX_DWORD SDNUMEXSYMS; | 222 FX_DWORD SDNUMEXSYMS; |
223 CJBig2_HuffmanTable *SDHUFFDH, *SDHUFFDW, *SDHUFFBMSIZE, *SDHUFFAGGINST; | 223 CJBig2_HuffmanTable *SDHUFFDH, *SDHUFFDW, *SDHUFFBMSIZE, *SDHUFFAGGINST; |
224 uint8_t SDTEMPLATE; | 224 uint8_t SDTEMPLATE; |
225 int8_t SDAT[8]; | 225 int8_t SDAT[8]; |
226 FX_BOOL SDRTEMPLATE; | 226 FX_BOOL SDRTEMPLATE; |
227 int8_t SDRAT[4]; | 227 int8_t SDRAT[4]; |
228 }; | 228 }; |
229 class CJBig2_HTRDProc : public CJBig2_Object { | 229 class CJBig2_HTRDProc { |
230 public: | 230 public: |
231 CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, | 231 CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
232 JBig2ArithCtx* gbContext, | 232 JBig2ArithCtx* gbContext, |
233 IFX_Pause* pPause); | 233 IFX_Pause* pPause); |
234 | 234 |
235 CJBig2_Image* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); | 235 CJBig2_Image* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); |
236 | 236 |
237 public: | 237 public: |
238 FX_DWORD HBW, HBH; | 238 FX_DWORD HBW, HBH; |
239 FX_BOOL HMMR; | 239 FX_BOOL HMMR; |
240 uint8_t HTEMPLATE; | 240 uint8_t HTEMPLATE; |
241 FX_DWORD HNUMPATS; | 241 FX_DWORD HNUMPATS; |
242 CJBig2_Image** HPATS; | 242 CJBig2_Image** HPATS; |
243 FX_BOOL HDEFPIXEL; | 243 FX_BOOL HDEFPIXEL; |
244 JBig2ComposeOp HCOMBOP; | 244 JBig2ComposeOp HCOMBOP; |
245 FX_BOOL HENABLESKIP; | 245 FX_BOOL HENABLESKIP; |
246 FX_DWORD HGW, HGH; | 246 FX_DWORD HGW, HGH; |
247 int32_t HGX, HGY; | 247 int32_t HGX, HGY; |
248 FX_WORD HRX, HRY; | 248 FX_WORD HRX, HRY; |
249 uint8_t HPW, HPH; | 249 uint8_t HPW, HPH; |
250 }; | 250 }; |
251 class CJBig2_PDDProc : public CJBig2_Object { | 251 class CJBig2_PDDProc { |
252 public: | 252 public: |
253 CJBig2_PatternDict* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, | 253 CJBig2_PatternDict* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
254 JBig2ArithCtx* gbContext, | 254 JBig2ArithCtx* gbContext, |
255 IFX_Pause* pPause); | 255 IFX_Pause* pPause); |
256 | 256 |
257 CJBig2_PatternDict* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); | 257 CJBig2_PatternDict* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); |
258 | 258 |
259 public: | 259 public: |
260 FX_BOOL HDMMR; | 260 FX_BOOL HDMMR; |
261 uint8_t HDPW, HDPH; | 261 uint8_t HDPW, HDPH; |
262 FX_DWORD GRAYMAX; | 262 FX_DWORD GRAYMAX; |
263 uint8_t HDTEMPLATE; | 263 uint8_t HDTEMPLATE; |
264 }; | 264 }; |
265 class CJBig2_GSIDProc : public CJBig2_Object { | 265 class CJBig2_GSIDProc { |
266 public: | 266 public: |
267 FX_DWORD* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, | 267 FX_DWORD* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
268 JBig2ArithCtx* gbContext, | 268 JBig2ArithCtx* gbContext, |
269 IFX_Pause* pPause); | 269 IFX_Pause* pPause); |
270 | 270 |
271 FX_DWORD* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); | 271 FX_DWORD* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); |
272 | 272 |
273 public: | 273 public: |
274 FX_BOOL GSMMR; | 274 FX_BOOL GSMMR; |
275 FX_BOOL GSUSESKIP; | 275 FX_BOOL GSUSESKIP; |
276 uint8_t GSBPP; | 276 uint8_t GSBPP; |
277 FX_DWORD GSW, GSH; | 277 FX_DWORD GSW, GSH; |
278 uint8_t GSTEMPLATE; | 278 uint8_t GSTEMPLATE; |
279 CJBig2_Image* GSKIP; | 279 CJBig2_Image* GSKIP; |
280 }; | 280 }; |
281 #endif | 281 #endif |
OLD | NEW |