Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
fec.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Roc Streaming authors
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
*/
8
9
//! @file roc_packet/fec.h
10
//! @brief FEC packet.
11
12
#ifndef ROC_PACKET_FEC_H_
13
#define ROC_PACKET_FEC_H_
14
15
#include "
roc_core/slice.h
"
16
#include "
roc_core/stddefs.h
"
17
#include "
roc_packet/units.h
"
18
19
namespace
roc
{
20
namespace
packet
{
21
22
//! FECFRAME scheme.
23
enum
FecScheme
{
24
//! No FEC.
25
FEC_None
,
26
27
//! Reed-Solomon (m=8).
28
FEC_ReedSolomon_M8
,
29
30
//! LDPC-Staircase.
31
FEC_LDPC_Staircase
32
};
33
34
//! FECFRAME packet.
35
struct
FEC
{
36
//! The FEC scheme to which the packet belongs to.
37
//! @remarks
38
//! Defines both FEC header or footer format and FEC payalod format.
39
FecScheme
fec_scheme
;
40
41
//! The index number of packet in a block ("esi").
42
//! @remarks
43
//! Source packets are numbered in range [0; k).
44
//! Repair packets are numbered in range [k; k + n), where
45
//! k is a number of source packets per block (source_block_length)
46
//! n is a number of repair packets per block.
47
size_t
encoding_symbol_id
;
48
49
//! Number of a source block in a packet stream ("sbn").
50
//! @remarks
51
//! Source block is formed from the source packets.
52
//! Blocks are numbered sequentially starting from a random number.
53
//! Block number can wrap.
54
blknum_t
source_block_number
;
55
56
//! Number of source packets in block to which this packet belongs ("sblen").
57
//! @remarks
58
//! Different blocks can have different number of source packets.
59
size_t
source_block_length
;
60
61
//! Number of source + repair packets in block to which this packet belongs ("blen").
62
//! @remarks
63
//! Different blocks can have different number of packets.
64
//! Always larger than source_block_length.
65
//! This field is not supported on all FEC schemes.
66
size_t
block_length
;
67
68
//! FECFRAME header or footer.
69
core::Slice<uint8_t>
payload_id
;
70
71
//! FECFRAME payload.
72
//! @remarks
73
//! Doesn't include FECFRAME header or footer.
74
core::Slice<uint8_t>
payload
;
75
76
//! Construct zero FEC packet.
77
FEC
();
78
79
//! Determine packet order.
80
int
compare
(
const
FEC
&)
const
;
81
};
82
83
}
// namespace packet
84
}
// namespace roc
85
86
#endif
// ROC_PACKET_FEC_H_
roc::core::Slice
Slice.
Definition
slice.h:55
roc::packet
Network packets and packet processing.
roc::packet::blknum_t
uint16_t blknum_t
FEC packet block number.
Definition
units.h:130
roc::packet::FecScheme
FecScheme
FECFRAME scheme.
Definition
fec.h:23
roc::packet::FEC_ReedSolomon_M8
@ FEC_ReedSolomon_M8
Reed-Solomon (m=8).
Definition
fec.h:28
roc::packet::FEC_LDPC_Staircase
@ FEC_LDPC_Staircase
LDPC-Staircase.
Definition
fec.h:31
roc::packet::FEC_None
@ FEC_None
No FEC.
Definition
fec.h:25
roc
Root namespace.
slice.h
Slice.
stddefs.h
Commonly used types and functions.
roc::packet::FEC::payload
core::Slice< uint8_t > payload
FECFRAME payload.
Definition
fec.h:74
roc::packet::FEC::encoding_symbol_id
size_t encoding_symbol_id
The index number of packet in a block ("esi").
Definition
fec.h:47
roc::packet::FEC::source_block_length
size_t source_block_length
Number of source packets in block to which this packet belongs ("sblen").
Definition
fec.h:59
roc::packet::FEC::fec_scheme
FecScheme fec_scheme
The FEC scheme to which the packet belongs to.
Definition
fec.h:39
roc::packet::FEC::FEC
FEC()
Construct zero FEC packet.
roc::packet::FEC::block_length
size_t block_length
Number of source + repair packets in block to which this packet belongs ("blen").
Definition
fec.h:66
roc::packet::FEC::source_block_number
blknum_t source_block_number
Number of a source block in a packet stream ("sbn").
Definition
fec.h:54
roc::packet::FEC::payload_id
core::Slice< uint8_t > payload_id
FECFRAME header or footer.
Definition
fec.h:69
roc::packet::FEC::compare
int compare(const FEC &) const
Determine packet order.
units.h
Various units used in packets.
roc_packet
fec.h
Generated by
1.17.0