1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
/* -*- c++ -*- */
/*
* Copyright 2001,2006,2014 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef DTV_INCLUDED_ATSC_TYPES_H
#define DTV_INCLUDED_ATSC_TYPES_H
#include <gnuradio/dtv/atsc_consts.h>
#include <cassert>
#include <cstring>
#include <gnuradio/dtv/atsc_plinfo.h>
namespace gr {
namespace dtv {
class atsc_mpeg_packet
{
public:
static constexpr int NPAD = 68;
unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync
unsigned char _pad_[NPAD]; // pad to power of 2 (256)
// overload equality operator
bool operator==(const atsc_mpeg_packet& other) const
{
return std::memcmp(data, other.data, sizeof(data)) == 0;
};
bool operator!=(const atsc_mpeg_packet& other) const
{
return !(std::memcmp(data, other.data, sizeof(data)) == 0);
};
};
class atsc_mpeg_packet_no_sync
{
public:
static constexpr int NPAD = 65;
plinfo pli;
unsigned char data[ATSC_MPEG_DATA_LENGTH];
unsigned char _pad_[NPAD]; // pad to power of 2 (256)
// overload equality operator
bool operator==(const atsc_mpeg_packet_no_sync& other) const
{
return std::memcmp(data, other.data, sizeof(data)) == 0;
}
bool operator!=(const atsc_mpeg_packet_no_sync& other) const
{
return !(std::memcmp(data, other.data, sizeof(data)) == 0);
}
};
class atsc_mpeg_packet_rs_encoded
{
public:
static constexpr int NPAD = 45;
plinfo pli;
unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH];
unsigned char _pad_[NPAD]; // pad to power of 2 (256)
// overload equality operator
bool operator==(const atsc_mpeg_packet_rs_encoded& other) const
{
return std::memcmp(data, other.data, sizeof(data)) == 0;
}
bool operator!=(const atsc_mpeg_packet_rs_encoded& other) const
{
return !(std::memcmp(data, other.data, sizeof(data)) == 0);
}
};
//! contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol.
class atsc_data_segment
{
public:
static constexpr int NPAD = 188;
plinfo pli;
unsigned char data[ATSC_DATA_SEGMENT_LENGTH];
unsigned char _pad_[NPAD]; // pad to power of 2 (1024)
// overload equality operator
bool operator==(const atsc_data_segment& other) const
{
return std::memcmp(data, other.data, sizeof(data)) == 0;
}
bool operator!=(const atsc_data_segment& other) const
{
return !(std::memcmp(data, other.data, sizeof(data)) == 0);
}
};
/*!
* Contains 832 bipolar floating point symbols.
* Nominal values are +/- {1, 3, 5, 7}.
* This data type represents the input to the viterbi decoder.
*/
class atsc_soft_data_segment
{
public:
static constexpr int NPAD = 764;
plinfo pli;
float data[ATSC_DATA_SEGMENT_LENGTH];
unsigned char _pad_[NPAD]; // pad to power of 2 (4096)
};
} /* namespace dtv */
} /* namespace gr */
#endif /* _ATSC_TYPES_H_ */
|