blob: 7caa30ffd17c6f64c9ca3f26493f93806753243c [file] [log] [blame]
Roman Khassraf059bab92015-05-20 12:49:46 +02001/* -*- c++ -*- */
2/*
3 * @file
4 * @author Piotr Krysik <ptrkrysik@gmail.com>
5 * @section LICENSE
6 *
7 * Gr-gsm 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 3, or (at your option)
10 * any later version.
11 *
12 * Gr-gsm 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 gr-gsm; 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_GSM_TCH_F_DECODER_IMPL_H
24#define INCLUDED_GSM_TCH_F_DECODER_IMPL_H
25
26#include "VocoderFrame.h"
27#include "GSM610Tables.h"
28#include "GSM660Tables.h"
29#include "GSM690Tables.h"
30#include <grgsm/decoding/tch_f_decoder.h>
31
32
33#define DATA_BLOCK_SIZE 184
34#define PARITY_SIZE 40
35#define FLUSH_BITS_SIZE 4
36#define PARITY_OUTPUT_SIZE (DATA_BLOCK_SIZE + PARITY_SIZE + FLUSH_BITS_SIZE)
37
38#define CONV_INPUT_SIZE PARITY_OUTPUT_SIZE
39#define CONV_SIZE (2 * CONV_INPUT_SIZE)
40
41#define BLOCKS 8
42#define iBLOCK_SIZE (CONV_SIZE / BLOCKS)
43
44namespace gr {
45 namespace gsm {
46
47 class tch_f_decoder_impl : public tch_f_decoder
48 {
49 private:
50 unsigned int d_collected_bursts_num;
51 unsigned short interleave_trans[CONV_SIZE];
52 pmt::pmt_t d_bursts[8];
53 FILE * d_speech_file;
54 enum tch_mode d_tch_mode;
55 void decode(pmt::pmt_t msg);
56 public:
57 tch_f_decoder_impl(tch_mode mode, const std::string &file);
58 ~tch_f_decoder_impl();
59 };
60
61 } // namespace gsm
62} // namespace gr
63
64#endif /* INCLUDED_GSM_TCH_F_DECODER_IMPL_H */
65