3 * Copyright 2006 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
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)
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.
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.
23 #ifndef INCLUDED_DECODER_H
24 #define INCLUDED_DECODER_H
26 #include "code_types.h"
28 // the 'decoder' class is a virtual class upon which all decoder types
35 virtual ~decoder () {};
37 virtual size_t compute_n_input_metrics (size_t n_output_bits) = 0;
38 virtual size_t compute_n_output_bits (size_t n_input_metrics) = 0;
39 virtual size_t decode (const char** in_buf,
41 size_t n_bits_to_output);
42 virtual size_t decode (const char** in_buf,
43 size_t n_metrics_to_input,
47 virtual void decode_private (const char** in_buf, char** out_buf) = 0;
48 virtual char get_next_input (const char** in_buf, size_t code_input_n) = 0;
49 virtual void output_bit (char t_out_bit, char** out_buf,
50 size_t t_output_stream) = 0;
52 size_t d_block_size_bits, d_n_code_inputs, d_n_code_outputs;
54 size_t d_in_buf_ndx, d_out_buf_ndx;
55 size_t d_in_bit_shift, d_out_bit_shift;
56 size_t d_n_input_metrics_left, d_n_output_bits_left;
59 #endif /* INCLUDED_DECODER_H */