| 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 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
| 7 /* | 7 /* |
| 8 * Copyright 2007 ZXing authors | 8 * Copyright 2007 ZXing authors |
| 9 * | 9 * |
| 10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } else { | 63 } else { |
| 64 m_coefficients.Copy(*coefficients); | 64 m_coefficients.Copy(*coefficients); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients() { | 67 CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients() { |
| 68 return &m_coefficients; | 68 return &m_coefficients; |
| 69 } | 69 } |
| 70 int32_t CBC_ReedSolomonGF256Poly::GetDegree() { | 70 int32_t CBC_ReedSolomonGF256Poly::GetDegree() { |
| 71 return m_coefficients.GetSize() - 1; | 71 return m_coefficients.GetSize() - 1; |
| 72 } | 72 } |
| 73 FX_BOOL CBC_ReedSolomonGF256Poly::IsZero() { | 73 bool CBC_ReedSolomonGF256Poly::IsZero() { |
| 74 return m_coefficients[0] == 0; | 74 return m_coefficients[0] == 0; |
| 75 } | 75 } |
| 76 int32_t CBC_ReedSolomonGF256Poly::GetCoefficients(int32_t degree) { | 76 int32_t CBC_ReedSolomonGF256Poly::GetCoefficients(int32_t degree) { |
| 77 return m_coefficients[m_coefficients.GetSize() - 1 - degree]; | 77 return m_coefficients[m_coefficients.GetSize() - 1 - degree]; |
| 78 } | 78 } |
| 79 int32_t CBC_ReedSolomonGF256Poly::EvaluateAt(int32_t a) { | 79 int32_t CBC_ReedSolomonGF256Poly::EvaluateAt(int32_t a) { |
| 80 if (a == 0) { | 80 if (a == 0) { |
| 81 return GetCoefficients(0); | 81 return GetCoefficients(0); |
| 82 } | 82 } |
| 83 int32_t size = m_coefficients.GetSize(); | 83 int32_t size = m_coefficients.GetSize(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*>* tempPtrA = | 238 CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*>* tempPtrA = |
| 239 new CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*>(); | 239 new CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*>(); |
| 240 tempPtrA->Add(quotient.release()); | 240 tempPtrA->Add(quotient.release()); |
| 241 tempPtrA->Add(remainder.release()); | 241 tempPtrA->Add(remainder.release()); |
| 242 return tempPtrA; | 242 return tempPtrA; |
| 243 } | 243 } |
| 244 | 244 |
| 245 CBC_ReedSolomonGF256Poly::~CBC_ReedSolomonGF256Poly() { | 245 CBC_ReedSolomonGF256Poly::~CBC_ReedSolomonGF256Poly() { |
| 246 m_coefficients.RemoveAll(); | 246 m_coefficients.RemoveAll(); |
| 247 } | 247 } |
| OLD | NEW |