rq_query - RaptorQ Query Functions
Contents
Description
The RaptorQ query functions return the value of their respective RaptorQ parameters.
F Transfer Length (F): 40-bit unsigned integer. A non-negative integer that is at most 946270874880.
This is the transfer length of the object in units of octets.
T Symbol Size (T): 16-bit unsigned integer. A positive integer that is less than 2^^16. This is the
size of a symbol in units of octets. This MUST be a multiple of Al.
Al A symbol alignment parameter (Al): 8-bit unsigned integer.
Z The number of source blocks (Z): 16-bit unsigned integer.
K The number of source symbols.
KP(K') The number of source and padding symbols.
The parameter rq must be a pointer to RaptorQ context initialized with rq_init(3)
Errors
These functions do not return errors.
Example
Programsource
/* params - example program to create RaptorQ context and print derived parameters */
#include <lcrq.h>
#include <stdio.h>
#include <stdlib.h>
int usage(const char *progname)
{
fprintf(stderr, "usage: `%s F T` (F = object size, T = symbol size)0, progname);
}
int main(int argc, char *argv[])
{
rq_t *rq;
uint64_t F;
uint16_t T, K, KP, N, Z;
uint8_t Al;
if (argc != 3) return usage(argv[0]);
F = atoll(argv[1]);
T = atoll(argv[2]);
/* initialize RaptorQ context */
rq = rq_init(F, T);
/* Query parameters */
K = rq_K(rq);
KP = rq_KP(rq);
N = rq_N(rq);
Z = rq_Z(rq);
/* free RaptorQ context */
rq_free(rq);
printf("F %12lusize of object to encode (40 bits)0, F);
printf("T %12usymbol (payload) size0, T);
printf("K %12unumber of original symbols0, K);
printf("K' %12unumber of symbols, including padding symbols0, KP);
printf("N %12unumber of sub-blocks0, N);
printf("Z %12unumber of blocks0, Z);
return 0;
}
rq_free(rq); /* free context when done */
Name
rq_query - RaptorQ Query Functions
Return Value
These functions return the RQ parameters as unsigned integers.
See Also
rq_init(3), rq_free(3), rq_decode(3), rq_encode(3), rq_symbol(3), lcrq(7) LCRQ 2022-07-07 RQQuery(3)
Synopsis
#include<lcrq.h>uint8_trq_Al(constrq_t*constrq);uint64_trq_F(constrq_t*constrq);uint16_trq_K(constrq_t*constrq);uint16_trq_KP(constrq_t*constrq);uint16_trq_T(constrq_t*constrq);uint16_trq_N(constrq_t*constrq);uint8_trq_Z(constrq_t*constrq);
Compile and link with -llcrq.
