From 6b307e8123ebecba54a9bf49d31f91eedb91d30a Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 23 Apr 2020 19:44:04 +0200 Subject: [PATCH] bugfix in ratematching for higher rv --- openair1/PHY/CODING/nr_rate_matching.c | 9 +++++---- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index 0cffc2d852..5294e79b9f 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -364,8 +364,8 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, if (ind < Foffset) { // case where we have some bits before the filler and the rest after memcpy((void*)e,(void*)(w+ind),Foffset-ind); - if (E + F <= Ncb) { // E+F doesn't contain all coded bits - memcpy((void*)(e+Foffset-ind),(void*)(w+Foffset+F-ind),E-Foffset+ind); + if (E + F <= Ncb-ind) { // E+F doesn't contain all coded bits + memcpy((void*)(e+Foffset-ind),(void*)(w+Foffset+F),E-Foffset+ind); k=E; } else { @@ -375,11 +375,12 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, } else { if (E + F <= Ncb-ind) { //E+F doesn't contain all coded bits - memcpy((void*)(e+Foffset-ind),(void*)(w+Foffset+F-ind),E-Foffset+ind); + memcpy((void*)(e),(void*)(w+ind),E); k=E; } else { - + memcpy((void*)(e),(void*)(w+ind),Ncb-ind); + k=Ncb-ind; } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 856a7863f4..6242008387 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -460,6 +460,9 @@ int nr_dlsch_encoding(unsigned char *a, } + F = dlsch->harq_processes[harq_pid]->F; + + Kr = dlsch->harq_processes[harq_pid]->K; for (r=0; rharq_processes[harq_pid]->C; r++) { if (F>0) {