From f116a10de3847a4403c4a9bc167ef6579db6fcf3 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 16 Nov 2016 15:20:18 +0100 Subject: [PATCH] hotfix: turbo decoder should not fail if CRC is 0 The case of a CRC == 0 is legal. After discussion with Raymond, it is also possible to have all bits at 0 (and so a CRC==0) if there is no transmission and thus not much energy. So this hotfix may introduce new problems (false decoding). A future work is to handle this case properly by not calling the turbo decoder if there is not enough energy received. The problem might manifest itself more in the UE part, especially when it tries to decode MIB and/or SIB (if I understood correctly). --- openair1/PHY/CODING/3gpplte_turbo_decoder.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c | 2 +- openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder.c b/openair1/PHY/CODING/3gpplte_turbo_decoder.c index 931758c03b..c6976df164 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder.c @@ -1058,7 +1058,7 @@ unsigned char phy_threegpplte_turbo_decoder_scalar(llr_t *y, break; } - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c index 49bb9d102c..4efd366bed 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -1375,7 +1375,7 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, fprintf(fdavx2b,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2); #endif - if ((crc == oldcrc) && (crc!=0) && (crc_cw2 == oldcrc_cw2) && (crc_cw2!=0)) { + if (crc == oldcrc && crc_cw2 == oldcrc_cw2) { return(iteration_cnt); } } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c index abcdc0521b..085dbb723c 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse.c @@ -2556,7 +2556,7 @@ unsigned char phy_threegpplte_turbo_decoder(short *y, stop_meas(intl2_stats); - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c index dc789d0404..a1e408dcda 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c @@ -1612,7 +1612,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc); #endif - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } } diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c index b56aae4598..4cdfb4f794 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c @@ -1625,7 +1625,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, if (intl2_stats) stop_meas(intl2_stats); - if ((crc == oldcrc) && (crc!=0)) { + if (crc == oldcrc) { return(iteration_cnt); } } -- GitLab