Houston, we have a trunk.
[debian/gnuradio] / gr-error-correcting-codes / src / lib / libecc / encoder_convolutional_ic1_ic1.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., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef INCLUDED_ENCODER_CONVOLUTIONAL_IC1_IC1_H
24 #define INCLUDED_ENCODER_CONVOLUTIONAL_IC1_IC1_H
25
26 #include "encoder_convolutional.h"
27
28 class encoder_convolutional_ic1_ic1 : public encoder_convolutional
29 {
30 public:
31 /*!
32  * class encoder_convolutional_ic1_ic1 : public encoder_convolutional
33  *
34  * Encode the incoming streams using a convolutional encoder,
35  *     "feedforward" or feedback.  Optional termination, data
36  *     streaming, and starting and ending memory states.
37  *
38  * input is "ic1": streams of char, one stream per input as defined by the
39  *     instantiated code, using only the right-most justified bit as
40  *     the single input bit per input item.
41  *
42  * output is "ic1": streams of char, one stream per output as defined by the
43  *     instantiated code, using only the right-most justified bit as
44  *     the single output bit per output item.
45  */
46
47   encoder_convolutional_ic1_ic1
48   (int frame_size_bits,
49    int n_code_inputs,
50    int n_code_outputs,
51    const std::vector<int> &code_generators,
52    bool do_termination = true,
53    int start_memory_state = 0,
54    int end_memory_state = 0)
55     : encoder_convolutional (frame_size_bits,
56                              n_code_inputs,
57                              n_code_outputs,
58                              code_generators,
59                              do_termination,
60                              start_memory_state,
61                              end_memory_state) {};
62
63   encoder_convolutional_ic1_ic1
64   (int frame_size_bits,
65    int n_code_inputs,
66    int n_code_outputs,
67    const std::vector<int> &code_generators,
68    const std::vector<int> &code_feedback,
69    bool do_termination = true,
70    int start_memory_state = 0,
71    int end_memory_state = 0)
72     : encoder_convolutional (frame_size_bits,
73                              n_code_inputs,
74                              n_code_outputs,
75                              code_generators,
76                              code_feedback,
77                              do_termination,
78                              start_memory_state,
79                              end_memory_state) {};
80
81   virtual ~encoder_convolutional_ic1_ic1 () {};
82
83   virtual size_t compute_n_input_bits (size_t n_output_bits);
84   virtual size_t compute_n_output_bits (size_t n_input_bits);
85
86 protected:
87   virtual void get_next_inputs__input (const char** in_buf);
88   virtual void write_output_bits (char** out_buf);
89 };
90
91 #endif /* INCLUDED_ENCODER_CONVOLUTIONAL_IC1_IC1_H */