Added LDPC decoder RM interface

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent fa691bb8e3
commit 794d1b5c4b

@ -132,6 +132,19 @@ srslte_ldpc_decoder_decode_f(srslte_ldpc_decoder_t* q, const float* llrs, uint8_
SRSLTE_API int
srslte_ldpc_decoder_decode_s(srslte_ldpc_decoder_t* q, const int16_t* llrs, uint8_t* message, uint32_t cdwd_rm_length);
/*!
* Carries out the actual decoding with 8-bit integer-valued LLRs. It is
* recommended to use a 7-bit representation for the LLRs, given that all
* values exceeding \f$ 2^{7}-1 \f$ (in magnitude) will be considered as infinity.
* \param[in] q A pointer to the LDPC decoder (a srslte_ldpc_decoder_t structure
* instance) that carries out the decoding.
* \param[in] llrs The LLRs obtained from the channel samples that correspond to
* the codeword to be decoded.
* \param[out] message The message (uncoded bits) resulting from the decoding
* operation.
*/
SRSLTE_API int srslte_ldpc_decoder_decode_c(srslte_ldpc_decoder_t* q, const int8_t* llrs, uint8_t* message);
/*!
* Carries out the actual decoding with 8-bit integer-valued LLRs. It is
* recommended to use a 7-bit representation for the LLRs, given that all
@ -144,7 +157,9 @@ srslte_ldpc_decoder_decode_s(srslte_ldpc_decoder_t* q, const int16_t* llrs, uint
* operation.
* \param[in] cdwd_rm_length The number of bits forming the codeword (after rate matching).
*/
SRSLTE_API int
srslte_ldpc_decoder_decode_c(srslte_ldpc_decoder_t* q, const int8_t* llrs, uint8_t* message, uint32_t cdwd_rm_length);
SRSLTE_API int srslte_ldpc_decoder_decode_rm_c(srslte_ldpc_decoder_t* q,
const int8_t* llrs,
uint8_t* message,
uint32_t cdwd_rm_length);
#endif // SRSLTE_LDPCDECODER_H

@ -776,7 +776,12 @@ int srslte_ldpc_decoder_decode_s(srslte_ldpc_decoder_t* q,
return q->decode_s(q, llrs, message, cdwd_rm_length);
}
int srslte_ldpc_decoder_decode_c(srslte_ldpc_decoder_t* q,
int srslte_ldpc_decoder_decode_c(srslte_ldpc_decoder_t* q, const int8_t* llrs, uint8_t* message)
{
return q->decode_c(q, llrs, message, q->liftN - 2 * q->ls);
}
int srslte_ldpc_decoder_decode_rm_c(srslte_ldpc_decoder_t* q,
const int8_t* llrs,
uint8_t* message,
uint32_t cdwd_rm_length)

@ -526,39 +526,61 @@ void srslte_ldpc_rm_tx_free(srslte_ldpc_rm_t* q)
{
if (q != NULL) {
struct pRM_tx* qq = q->ptr;
if (qq != NULL) {
if (qq->tmp_rm_codeword != NULL) {
free(qq->tmp_rm_codeword);
}
free(qq);
}
}
}
void srslte_ldpc_rm_rx_free_f(srslte_ldpc_rm_t* q)
{
if (q != NULL) {
struct pRM_rx_f* qq = q->ptr;
if (qq != NULL) {
if (qq->tmp_rm_symbol != NULL) {
free(qq->tmp_rm_symbol);
}
if (qq->indices != NULL) {
free(qq->indices);
}
free(qq);
}
}
}
void srslte_ldpc_rm_rx_free_s(srslte_ldpc_rm_t* q)
{
if (q != NULL) {
struct pRM_rx_s* qq = q->ptr;
if (qq != NULL) {
if (qq->tmp_rm_symbol != NULL) {
free(qq->tmp_rm_symbol);
}
if (qq->indices != NULL) {
free(qq->indices);
}
free(qq);
}
}
}
void srslte_ldpc_rm_rx_free_c(srslte_ldpc_rm_t* q)
{
if (q != NULL) {
struct pRM_rx_c* qq = q->ptr;
if (qq != NULL) {
if (qq->tmp_rm_symbol != NULL) {
free(qq->tmp_rm_symbol);
}
if (qq->indices != NULL) {
free(qq->indices);
}
free(qq);
}
}
}
int srslte_ldpc_rm_tx(srslte_ldpc_rm_t* q,

@ -399,7 +399,8 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(&decoder_c, symbols_c + j * finalN, messages_sim_c + j * finalK, n_useful_symbols);
srslte_ldpc_decoder_decode_rm_c(
&decoder_c, symbols_c + j * finalN, messages_sim_c + j * finalK, n_useful_symbols);
}
gettimeofday(&t[2], NULL);
get_time_interval(t);
@ -420,7 +421,7 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(
srslte_ldpc_decoder_decode_rm_c(
&decoder_c_flood, symbols_c + j * finalN, messages_sim_c_flood + j * finalK, n_useful_symbols);
}
gettimeofday(&t[2], NULL);
@ -443,7 +444,7 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(
srslte_ldpc_decoder_decode_rm_c(
&decoder_avx, symbols_c + j * finalN, messages_sim_avx + j * finalK, n_useful_symbols);
}
gettimeofday(&t[2], NULL);
@ -465,7 +466,7 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(
srslte_ldpc_decoder_decode_rm_c(
&decoder_avx_flood, symbols_c + j * finalN, messages_sim_avx_flood + j * finalK, n_useful_symbols);
}
gettimeofday(&t[2], NULL);

@ -206,7 +206,7 @@ int main(int argc, char** argv)
gettimeofday(&t[1], NULL);
for (j = 0; j < NOF_MESSAGES; j++) {
printf(" codeword %d\n", j);
srslte_ldpc_decoder_decode_c(&decoder, symbols + j * finalN, messages_sim + j * finalK, finalN);
srslte_ldpc_decoder_decode_rm_c(&decoder, symbols + j * finalN, messages_sim + j * finalK, finalN);
}
gettimeofday(&t[2], NULL);
get_time_interval(t);

@ -205,7 +205,7 @@ int main(int argc, char** argv)
gettimeofday(&t[1], NULL);
for (j = 0; j < NOF_MESSAGES; j++) {
printf(" codeword %d\n", j);
srslte_ldpc_decoder_decode_c(&decoder, symbols + j * finalN, messages_sim + j * finalK, finalN);
srslte_ldpc_decoder_decode_rm_c(&decoder, symbols + j * finalN, messages_sim + j * finalK, finalN);
}
gettimeofday(&t[2], NULL);
get_time_interval(t);

@ -505,7 +505,7 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(&decoder_c, symbols_c + j * finalN, messages_sim_c + j * finalK, finalN);
srslte_ldpc_decoder_decode_rm_c(&decoder_c, symbols_c + j * finalN, messages_sim_c + j * finalK, finalN);
}
gettimeofday(&t[2], NULL);
get_time_interval(t);
@ -526,7 +526,8 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(&decoder_c_flood, symbols_c + j * finalN, messages_sim_c_flood + j * finalK, finalN);
srslte_ldpc_decoder_decode_rm_c(
&decoder_c_flood, symbols_c + j * finalN, messages_sim_c_flood + j * finalK, finalN);
}
gettimeofday(&t[2], NULL);
get_time_interval(t);
@ -548,7 +549,7 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(&decoder_avx, symbols_c + j * finalN, messages_sim_avx + j * finalK, finalN);
srslte_ldpc_decoder_decode_rm_c(&decoder_avx, symbols_c + j * finalN, messages_sim_avx + j * finalK, finalN);
}
gettimeofday(&t[2], NULL);
get_time_interval(t);
@ -569,7 +570,7 @@ int main(int argc, char** argv)
// Recover messages
gettimeofday(&t[1], NULL);
for (j = 0; j < batch_size; j++) {
srslte_ldpc_decoder_decode_c(
srslte_ldpc_decoder_decode_rm_c(
&decoder_avx_flood, symbols_c + j * finalN, messages_sim_avx_flood + j * finalK, finalN);
}
gettimeofday(&t[2], NULL);

Loading…
Cancel
Save