The LDPC coder and decoder are implemented in a shared library, dynamically loaded at run-time using the [oai shared library loader](file://../../../../common/utils/DOC/loader.md). The code loading the LDPC library is in [nrLDPC_load.c](file://../nrLDPC_load.c), in function `load_nrLDPClib`, which must be called at init time.
The LDPC coder and decoder are implemented in a shared library, dynamically loaded at run-time using the [oai shared library loader](file://../../../../common/utils/DOC/loader.md).
Two types of library are available with two different interfaces. There are libraries implementing the coder and decoder of code segments and libraries implementing the decoder of slots.
## Selecting the LDPC library at run time
## LDPC segment coder/decoder
The interface of the library is defined in [nrLDPC_defs.h](file://../nrLDPC_defs.h).
The code loading the LDPC library is in [nrLDPC_load.c](file://../nrLDPC_load.c), in function `load_nrLDPClib`, which must be called at init time.
### Selecting the LDPC library at run time
By default the function `int load_nrLDPClib(void)` looks for `libldpc.so`, this default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below:
...
...
@@ -196,4 +201,66 @@ Libraries implementing the LDPC algorithms must be named `libldpc<_version>.so`,
`libldpc_cl.so`is under development.
## LDPC slot decoder
The interface of the library is defined in [nr_ulsch_decoding_interface.h](file://../nr_ulsch_decoding_interface.h).
The code loading the LDPC library is in [nr_ulsch_decoding_interface_load.c](file://../nr_ulsch_decoding_interface_load.c), in function `load_nr_ulsch_decoding_interface`, which must be called at init time.
### Selecting the LDPC library at run time
By default the function `int load_nr_ulsch_decoding_interface(void)` looks for `libnr_ulsch_decoding.so`, this default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below:
#### Examples of ldpc shared lib selection when running nr softmodem's:
loading `libnr_ulsch_decoding_interface_demo.so` instead of `libnr_ulsch_decoding.so`:
#### Examples of ldpc shared lib selection when running ldpctest:
Slot decoding libraries cannot be used within ldpctest.
### LDPC libraries
Libraries implementing the slotwise LDPC decoding must be named `libnr_ulsch_decoding<_version>.so`, they must implement three functions: `nr_ulsch_decoding_init`, `nr_ulsch_decoding_shutdown` and `nr_ulsch_decoding_decoder`. The prototypes for these functions is defined in [nr_ulsch_decoding_interface.h](file://../nr_ulsch_decoding_interface.h).
`libnr_ulsch_decoding_interface_demo.so`has been tested with the `nr_ulsim` and `nr-softmodem` executables.
`libnr_ulsch_decoding_interface_t2.so`is under development.