RQ Query(3)

NAME
rq_query - RaptorQ Query Functions

SYNOPSIS
#include <lcrq.h>

uint8_t rq_Al(const rq_t * const rq);
uint64_t rq_F(const rq_t * const rq);
uint16_t rq_K(const rq_t * const rq);
uint16_t rq_KP(const rq_t * const rq);
uint16_t rq_T(const rq_t * const rq);
uint16_t rq_N(const rq_t * const rq);
uint8_t rq_Z(const rq_t * const rq);

Compile and link with -llcrq.

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)

RETURN VALUE
These functions return the RQ parameters as unsigned integers.

ERRORS
These functions do not return errors.

EXAMPLE

  Program source
    /* 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), 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  %12lu	size of object to encode (40 bits), F);
            printf("T  %12u	symbol (payload) size, T);
            printf("K  %12u	number of original symbols, K);
            printf("K' %12u	number of symbols, including padding symbols, KP);
            printf("N  %12u	number of sub-blocks, N);
            printf("Z  %12u	number of blocks, Z);

            return 0;
    }

    rq_free(rq); /* free context when done */

SEE ALSO
rq_init(3), rq_free(3), rq_decode(3), rq_encode(3), rq_symbol(3), lcrq(7)