From 8adffcea3ad8b72fa37997c094e5b5fa47662bd1 Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Mon, 13 Jun 2016 11:50:56 +0200
Subject: [PATCH] small bugfix in turbo-encoder (both SSE4 and AVX2) which
 affected short block-lengths

---
 openair1/PHY/CODING/3gpplte_sse.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c
index 50c084d2a8..34fcbef6d6 100755
--- a/openair1/PHY/CODING/3gpplte_sse.c
+++ b/openair1/PHY/CODING/3gpplte_sse.c
@@ -438,10 +438,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
   uint8_t *systematic2_ptr=(uint8_t *) output;
 #endif
 #ifndef __AVX2__
-  int input_length_words=n>>1;
+  int input_length_words=1+((n-1)>>1);
 #else
-  int input_length_words=n>>2;
-#endif
+  int input_length_words=1+((n-1)>>2);
+#endif 
   for ( i=0; i<  input_length_words ; i ++ ) {
 
 #if defined(__x86_64__) || defined(__i386__)
-- 
GitLab