aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding/openbts/Viterbi.h
blob: 77bd599ae9724ecf64e269dbedc8440b46ea3e16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright 2013, 2014 Range Networks, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * This use of this software may be subject to additional restrictions.
 * See the LEGAL file in the main directory for details.
 */


#ifndef _VITERBI_H_
#define _VITERBI_H_ 1

// (pat) Virtual base class for Viterbi and Turbo coder/decoders.
class ViterbiBase {
	public:
	virtual void encode(const BitVector &in, BitVector& target) const = 0;
	virtual void decode(const SoftVector &in, BitVector& target) = 0;
	// (pat) Return error count from most recent decoder run.
	// If you get -1 from this, the method is not defined in the Viterbi class.
	virtual int getBEC() { return -1; }
	//virtual ~ViterbiBase();   Currently None of these have destructors.

	// These functions are logically part of the Viterbi functionality, even though they do not use any class variables.
	unsigned applyPoly(uint64_t val, uint64_t poly);
	unsigned applyPoly(uint64_t val, uint64_t poly, unsigned order);
};
#endif