diff --git a/srslte/include/srslte/phch/pdsch_cfg.h b/srslte/include/srslte/phch/pdsch_cfg.h index 488cfb66e..547bb0a80 100644 --- a/srslte/include/srslte/phch/pdsch_cfg.h +++ b/srslte/include/srslte/phch/pdsch_cfg.h @@ -37,7 +37,7 @@ #define PDSCHCFG_ #include "srslte/phch/ra.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/softbuffer.h" #include "srslte/fec/cbsegm.h" typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/phch/pusch_cfg.h b/srslte/include/srslte/phch/pusch_cfg.h index ad60cd335..bf8286e00 100644 --- a/srslte/include/srslte/phch/pusch_cfg.h +++ b/srslte/include/srslte/phch/pusch_cfg.h @@ -37,7 +37,7 @@ #define PUSCHCFG_ #include "srslte/phch/ra.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/softbuffer.h" #include "srslte/fec/cbsegm.h" typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/srslte.h b/srslte/include/srslte/srslte.h index e6d71e22e..162c4bcdf 100644 --- a/srslte/include/srslte/srslte.h +++ b/srslte/include/srslte/srslte.h @@ -88,7 +88,7 @@ #include "srslte/phch/cqi.h" #include "srslte/phch/dci.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/softbuffer.h" #include "srslte/phch/pbch.h" #include "srslte/phch/pcfich.h" #include "srslte/phch/pdcch.h" diff --git a/srslte/lib/fec/src/rm_turbo.c b/srslte/lib/fec/src/rm_turbo.c index 533fd383a..468753a2a 100644 --- a/srslte/lib/fec/src/rm_turbo.c +++ b/srslte/lib/fec/src/rm_turbo.c @@ -133,8 +133,7 @@ int srslte_rm_turbo_tx(uint8_t *w_buff, uint32_t w_buff_len, uint8_t *input, uin /* Undoes Turbo Code Rate Matching. * 3GPP TS 36.212 v10.1.0 section 5.1.4.1 * - * If rv_idx==0, the w_buff circular buffer is initialized. Every subsequent call - * with rv_idx!=0 will soft-combine the LLRs from input with w_buff + * Soft-combines the data available in w_buff */ int srslte_rm_turbo_rx(float *w_buff, uint32_t w_buff_len, float *input, uint32_t in_len, float *output, uint32_t out_len, uint32_t rv_idx, uint32_t nof_filler_bits) { @@ -164,12 +163,6 @@ int srslte_rm_turbo_rx(float *w_buff, uint32_t w_buff_len, float *input, uint32_ ndummy = 0; } - if (rv_idx == 0) { - for (i = 0; i < 3 * K_p; i++) { - w_buff[i] = SRSLTE_RX_NULL; - } - } - /* Undo bit collection. Account for dummy bits */ N_cb = 3 * K_p; // TODO: Soft buffer size limitation k0 = nrows diff --git a/srslte/lib/fec/src/softbuffer.c b/srslte/lib/fec/src/softbuffer.c index db6fc574f..7508cbcf4 100644 --- a/srslte/lib/fec/src/softbuffer.c +++ b/srslte/lib/fec/src/softbuffer.c @@ -37,7 +37,8 @@ #include "srslte/common/phy_common.h" #include "srslte/phch/ra.h" #include "srslte/fec/turbodecoder.h" -#include "srslte/phch/softbuffer.h" +#include "srslte/fec/rm_turbo.h" +#include "srslte/fec/softbuffer.h" #include "srslte/utils/vector.h" #include "srslte/utils/debug.h" @@ -92,11 +93,12 @@ void srslte_softbuffer_rx_free(srslte_softbuffer_rx_t *q) { } void srslte_softbuffer_rx_reset(srslte_softbuffer_rx_t *q) { - int i; if (q->buffer_f) { - for (i=0;imax_cb;i++) { + for (uint32_t i=0;imax_cb;i++) { if (q->buffer_f[i]) { - bzero(q->buffer_f[i], sizeof(float) * q->buff_size); + for (uint32_t j=0;jbuff_size;j++) { + q->buffer_f[i][j] = SRSLTE_RX_NULL; + } } } }