Scroll to navigation

RQ_DECODE(3) Librecast Programmer's Manual RQ_DECODE(3)

NAME

rq_decode - decode RaptorQ block

SYNOPSIS

#include <lcrq.h>
int rq_decode(rq_t *rq, uint8_t *dec, uint8_t *enc, uint32_t ESI[], uint32_t nesi);

Compile and link with -llcrq.

DESCRIPTION

Decodes a RaptorQ block using a variation of the method described in 5.4.2 of RFC6330.

rq must be a pointer to valid rq_t context.

dec must be a pointer to a buffer of at least T x K bytes. The decoded data will be written to this buffer.

enc a pointer to the encoded block.

ESI[] ESI index. This is an array of ESIs in the same order as the encoding symbols in enc

nesi The Loch Ness Monster. Or the number of decoding symbols. Preferably the latter.

RETURN VALUE

On success, 0 is returned. If decoding fails, the function returns -1.

EXAMPLE

/* symbols are received into enc, with their respective ESIs written to ESI

* OH is the number of extra (overhead) symbols in addition to the
* required K' (KP) symbols.
* Now we can decode the object into the pre-allocated buffer dec.
*/ for (uint8_t sbn = 0; sbn < rq_Z(rq); sbn++) { rq_decode(rq, dec, enc[sbn], ESI[sbn], KP + OH); }

SEE ALSO

rq_init(3), rq_free(3), rq_encode(3), rq_symbol(3), lcrq(7)

2022-07-07 LCRQ