Piotr Krysik | b9a87a1 | 2017-08-23 15:59:28 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013, 2014 Range Networks, Inc. |
| 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Affero General Public License as published by |
| 6 | * the Free Software Foundation, either version 3 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Affero General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Affero General Public License |
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * This use of this software may be subject to additional restrictions. |
| 18 | * See the LEGAL file in the main directory for details. |
| 19 | */ |
| 20 | |
| 21 | |
| 22 | #ifndef _VITERBI_H_ |
| 23 | #define _VITERBI_H_ 1 |
| 24 | |
| 25 | // (pat) Virtual base class for Viterbi and Turbo coder/decoders. |
| 26 | class ViterbiBase { |
| 27 | public: |
| 28 | virtual void encode(const BitVector &in, BitVector& target) const = 0; |
| 29 | virtual void decode(const SoftVector &in, BitVector& target) = 0; |
| 30 | // (pat) Return error count from most recent decoder run. |
| 31 | // If you get -1 from this, the method is not defined in the Viterbi class. |
| 32 | virtual int getBEC() { return -1; } |
| 33 | //virtual ~ViterbiBase(); Currently None of these have destructors. |
| 34 | |
| 35 | // These functions are logically part of the Viterbi functionality, even though they do not use any class variables. |
| 36 | unsigned applyPoly(uint64_t val, uint64_t poly); |
| 37 | unsigned applyPoly(uint64_t val, uint64_t poly, unsigned order); |
| 38 | }; |
| 39 | #endif |