GNU Radio 3.6.4.1 C++ API
atsci_viterbi_decoder.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2002 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 3, 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 _ATSC_VITERBI_DECODER_H_
24
#define _ATSC_VITERBI_DECODER_H_
25
26
#define USE_SIMPLE_SLICER 0
27
28
#include <
atsc_api.h
>
29
#include <
atsc_types.h
>
30
#include <
interleaver_fifo.h
>
31
32
#if (USE_SIMPLE_SLICER)
33
#include <
atsci_fake_single_viterbi.h
>
34
typedef
atsci_fake_single_viterbi
single_viterbi_t
;
35
#else
36
#include <
atsci_single_viterbi.h
>
37
typedef
atsci_single_viterbi
single_viterbi_t
;
38
#endif
39
40
/*!
41
* \brief fancy, schmancy 12-way interleaved viterbi decoder for ATSC
42
*/
43
44
class
ATSC_API
atsci_viterbi_decoder
{
45
public
:
46
static
const
int
NCODERS = 12;
47
48
atsci_viterbi_decoder
();
49
~
atsci_viterbi_decoder
();
50
51
//! reset all decoder states
52
void
reset ();
53
54
/*!
55
* Take 12 data segments of soft decisions (floats) and
56
* produce 12 RS encoded data segments. We work in groups of 12
57
* because that's the smallest number of segments that composes a
58
* single full cycle of the decoder mux.
59
*/
60
void
decode (
atsc_mpeg_packet_rs_encoded
out[NCODERS],
61
const
atsc_soft_data_segment
in[NCODERS]);
62
63
64
65
protected
:
66
typedef
interleaver_fifo<unsigned char>
fifo_t
;
67
68
static
const
int
SEGMENT_SIZE =
ATSC_MPEG_RS_ENCODED_LENGTH
;
// 207
69
static
const
int
OUTPUT_SIZE = (SEGMENT_SIZE * 12);
70
static
const
int
INPUT_SIZE = (
ATSC_DATA_SEGMENT_LENGTH
* 12);
71
72
void
decode_helper (
unsigned
char
out[OUTPUT_SIZE],
73
const
float
in[INPUT_SIZE]);
74
75
76
single_viterbi_t
viterbi[NCODERS];
77
fifo_t
*fifo[NCODERS];
78
bool
debug;
79
80
};
81
82
83
84
#endif
/* _ATSC_VITERBI_DECODER_H_ */
gr-atsc
src
lib
atsci_viterbi_decoder.h
Generated on Sun Apr 28 2013 20:26:34 for GNU Radio 3.6.4.1 C++ API by
1.8.3.1