cberner / raptorq

Rust implementation of RaptorQ (RFC6330)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementing Interleaving ?

jblestang opened this issue · comments

Any plane to add data interleaving to handle loss of burst of packets like in figure 9 of Qualcomm paper

If I understand correctly interleaving means running the encoder with subblocks > 1. That's already supported:

raptorq/src/encoder.rs

Lines 205 to 226 in 4bf46ec

if config.sub_blocks() > 1 {
let mut symbols = vec![vec![]; data.len() / config.symbol_size() as usize];
let (tl, ts, nl, ns) = partition(
(config.symbol_size() / config.symbol_alignment() as u16) as u32,
config.sub_blocks(),
);
// Divide the block into sub-blocks and then concatenate the sub-symbols into symbols
// See second to last paragraph in section 4.4.1.2.
let mut offset = 0;
for sub_block in 0..(nl + ns) as u32 {
let bytes = if sub_block < nl {
tl as usize * config.symbol_alignment() as usize
} else {
ts as usize * config.symbol_alignment() as usize
};
for symbol in &mut symbols {
symbol.extend_from_slice(&data[offset..offset + bytes]);
offset += bytes;
}
}
assert_eq!(offset, data.len());
symbols.drain(..).map(Symbol::new).collect()

Please re-open, if it means something else