How ka9q/libfec works
libfec is a C library providing forward-error-correction codecs and DSP primitives. Its user-facing workflow is to supply encoded-channel symbols to a decoder and receive corrected data; encoding is the corresponding transmit-side operation. The major branches are convolutional-code decoding, general and CCSDS Reed–Solomon coding, and signal-processing helpers. Portable C and architecture-specific SIMD implementations provide alternate execution paths, with runtime selection documented by the README. The README establishes those capabilities and selection behavior; source excerpts confirm selected codec implementations, but not all dispatch wiring.
Main entry points: fec.h Viterbi API · encode_rs_ccsds.c CCSDS encoder · decode_rs_ccsds.c CCSDS decoder · code.h Code definitions
Components 23
Convolutional Decoding
- Viterbi API
fec.h - K=7 decoder
viterbi27.c - K=9 decoder
viterbi29.c - K=15 decoder
viterbi615.c - K=24 decoder
viterbi224_port.c - Code definitions
code.h
Reed-Solomon Coding
- RS API
fec.h - RS core
rs.c - RS encoders
encode_rs_8.c - RS decoders
decode_rs.c - RS definitions
rs.h - CCSDS encoder
encode_rs_ccsds.c - CCSDS decoder
decode_rs_ccsds.c - CCSDS definitions
ccsds.h
DSP Primitives
- Dot product
dotprod.c - Sum of squares
sumsq_port.c - Peak value
peakval_port.c
SIMD Implementations
- Runtime selection
fec.c - SIMD Viterbi variants
viterbi615_av.c - SIMD DSP variants
dotprod_av.c
Fano Decoding
- Fano decoder
fano.c - Fano definitions
fano.h
Other components
- Library caller
Connections 28
- Library caller → Viterbi API: uses
README - Library caller → RS API: uses
README - Library caller → CCSDS encoder: encodes CCSDS
README - Library caller → CCSDS decoder: decodes CCSDS
README - Library caller → Dot product: computes product
README - Library caller → Sum of squares: computes energy
README - Library caller → Peak value: finds peak
README - Library caller → Fano decoder: uses
- Viterbi API → K=7 decoder: exposes
fec.h - Viterbi API → K=9 decoder: exposes
fec.h - Viterbi API → K=15 decoder: exposes
fec.h - Viterbi API → K=24 decoder: exposes
viterbi224_port.c - K=7 decoder → Code definitions: uses polynomials
- K=9 decoder → Code definitions: uses polynomials
- K=15 decoder → Code definitions: uses polynomials
- Viterbi API → Runtime selection: selects implementation
README - RS API → RS encoders: exposes
fec.h - RS API → RS decoders: exposes
fec.h - RS core → RS definitions: implements definitions
rs.c - RS API → CCSDS encoder: exposes
fec.h - RS API → CCSDS decoder: exposes
fec.h - CCSDS encoder → CCSDS definitions: uses format
- CCSDS decoder → CCSDS definitions: uses format
- Fano decoder → Fano definitions: implements API
fano.c - Viterbi API → SIMD Viterbi variants: may select
README - Dot product → SIMD DSP variants: may select
README - Sum of squares → SIMD DSP variants: may select
README - Peak value → SIMD DSP variants: may select
README