blob: 8635bf512ecc75aef153f9eb7f8728196b0979e6 [file] [log] [blame]
Roman Khassrafaa8fa992015-06-02 09:20:03 +02001/*
2* Copyright 2013, 2014 Range Networks, Inc.
3*
4* This software is distributed under multiple licenses;
5* see the COPYING file in the main directory for licensing
6* information for this specific distribution.
7*
8* This use of this software may be subject to additional restrictions.
9* See the LEGAL file in the main directory for details.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15*/
16
17
18#ifndef _VITERBI_H_
19#define _VITERBI_H_ 1
20
21// (pat) Virtual base class for Viterbi and Turbo coder/decoders.
22class ViterbiBase {
23 public:
24 virtual void encode(const BitVector &in, BitVector& target) const = 0;
25 virtual void decode(const SoftVector &in, BitVector& target) = 0;
26 // (pat) Return error count from most recent decoder run.
27 // If you get -1 from this, the method is not defined in the Viterbi class.
28 virtual int getBEC() { return -1; }
29 //virtual ~ViterbiBase(); Currently None of these have destructors.
30
31 // These functions are logically part of the Viterbi functionality, even though they do not use any class variables.
32 unsigned applyPoly(uint64_t val, uint64_t poly);
33 unsigned applyPoly(uint64_t val, uint64_t poly, unsigned order);
34};
35#endif