| 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 XFA_SRC_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_ | 7 #ifndef XFA_SRC_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_ |
| 8 #define XFA_SRC_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_ | 8 #define XFA_SRC_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_ |
| 9 | 9 |
| 10 #include "core/include/fxcrt/fx_basic.h" |
| 11 #include "xfa/src/fxbarcode/utils.h" |
| 12 |
| 10 class CBC_ReedSolomonGF256Poly; | 13 class CBC_ReedSolomonGF256Poly; |
| 11 class CBC_ReedSolomonGF256 { | 14 class CBC_ReedSolomonGF256 { |
| 12 public: | 15 public: |
| 13 static void Initialize(); | 16 static void Initialize(); |
| 14 static void Finalize(); | 17 static void Finalize(); |
| 15 static CBC_ReedSolomonGF256* QRCodeFild; | 18 static CBC_ReedSolomonGF256* QRCodeFild; |
| 16 static CBC_ReedSolomonGF256* DataMatrixField; | 19 static CBC_ReedSolomonGF256* DataMatrixField; |
| 17 CBC_ReedSolomonGF256(int32_t primitive); | 20 CBC_ReedSolomonGF256(int32_t primitive); |
| 18 virtual ~CBC_ReedSolomonGF256(); | 21 virtual ~CBC_ReedSolomonGF256(); |
| 19 CBC_ReedSolomonGF256Poly* GetZero(); | 22 CBC_ReedSolomonGF256Poly* GetZero(); |
| 20 CBC_ReedSolomonGF256Poly* GetOne(); | 23 CBC_ReedSolomonGF256Poly* GetOne(); |
| 21 CBC_ReedSolomonGF256Poly* BuildMonomial(int32_t degree, | 24 CBC_ReedSolomonGF256Poly* BuildMonomial(int32_t degree, |
| 22 int32_t coefficient, | 25 int32_t coefficient, |
| 23 int32_t& e); | 26 int32_t& e); |
| 24 static int32_t AddOrSubtract(int32_t a, int32_t b); | 27 static int32_t AddOrSubtract(int32_t a, int32_t b); |
| 25 int32_t Exp(int32_t a); | 28 int32_t Exp(int32_t a); |
| 26 int32_t Log(int32_t a, int32_t& e); | 29 int32_t Log(int32_t a, int32_t& e); |
| 27 int32_t Inverse(int32_t a, int32_t& e); | 30 int32_t Inverse(int32_t a, int32_t& e); |
| 28 int32_t Multiply(int32_t a, int32_t b); | 31 int32_t Multiply(int32_t a, int32_t b); |
| 29 virtual void Init(); | 32 virtual void Init(); |
| 30 | 33 |
| 31 private: | 34 private: |
| 32 int32_t m_expTable[256]; | 35 int32_t m_expTable[256]; |
| 33 int32_t m_logTable[256]; | 36 int32_t m_logTable[256]; |
| 34 CBC_ReedSolomonGF256Poly* m_zero; | 37 CBC_ReedSolomonGF256Poly* m_zero; |
| 35 CBC_ReedSolomonGF256Poly* m_one; | 38 CBC_ReedSolomonGF256Poly* m_one; |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 #endif // XFA_SRC_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_ | 41 #endif // XFA_SRC_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_ |
| OLD | NEW |