Updated FSF address in all files. Fixes ticket:51
[debian/gnuradio] / gr-error-correcting-codes / src / lib / libecc / decoder_viterbi_full_block.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef INCLUDED_DECODER_VITERBI_FULL_BLOCK_H
24 #define INCLUDED_DECODER_VITERBI_FULL_BLOCK_H
25
26 #include "decoder_viterbi.h"
27
28 class decoder_viterbi_full_block : public decoder_viterbi
29 {
30 /*!
31  * \brief Decode the incoming streams using a Viterbi-style decoder,
32  *     doing full trellis block decoding before putting out any
33  *     decoded bits.
34  *
35  * input: streams of metrics, two per code output: one for the 0-bit
36  *     metrics and the other for the 1-bit metric.
37  *
38  * output: stream(s) of output bits
39  */
40
41 public:
42   decoder_viterbi_full_block (int sample_precision,
43                               encoder_convolutional* l_encoder);
44
45   virtual ~decoder_viterbi_full_block ();
46
47   virtual size_t compute_n_input_items (size_t n_output_bits);
48   virtual size_t compute_n_output_bits (size_t n_input_items);
49
50 protected:
51   virtual void decode_private ();
52   virtual void update_traceback__up (size_t from_state_ndx,
53                                      size_t to_state_ndx,
54                                      size_t l_input);
55   virtual void update_traceback__middle ();
56   virtual void update_traceback__term ();
57
58 /*
59  * traceback_t: used to store all encode-input bits for
60  *     all possible paths, when computing all trellis bits before
61  *     determining the ML decode-output sequence.
62  *
63  * d_prev: the connection to the previous bit's traceback structure
64  *
65  * d_inputs: the inputs (one per bit) for this connection
66  */
67
68   typedef struct traceback_t {
69     struct traceback_t *d_prev;
70     int d_inputs;
71   } traceback_t, *traceback_t_ptr, **traceback_t_hdl;
72
73 /*
74  * d_n_total_inputs_per_stream: how many bits to store for each
75  *     state to determine the best decoder-output (encoder-input) bits 
76  */
77   size_t d_n_inputs_per_stream;
78   traceback_t_hdl d_out_buf;
79 };
80
81 #endif /* INCLUDED_DECODER_VITERBI_FULL_BLOCK_H */