Commit a79ccb99 authored by Laurent THOMAS's avatar Laurent THOMAS

fix nr_deinterleaving_ldpc() again, we are now too short in the buffer

parent 9be58373
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
#define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ #define _Assert_(cOND, aCTION, fORMAT, aRGS...) \
do { \ do { \
if (!(cOND)) { \ if (!(cOND)) { \
fprintf(stderr, "\nAssertion ("#cOND") failed!\n" \ fprintf(stderr, "\nAssertion (%s) failed!\n" \
"In %s() %s:%d\n" fORMAT, \ "In %s() %s:%d\n" fORMAT, \
__FUNCTION__, __FILE__, __LINE__, ##aRGS); \ #cOND, __FUNCTION__, __FILE__, __LINE__, ##aRGS); \
aCTION; \ aCTION; \
} \ } \
} while(0) } while(0)
......
...@@ -309,25 +309,28 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f) ...@@ -309,25 +309,28 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f)
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
{ {
switch(Qm) { switch(Qm) {
case 2: case 2:
{ {
int16_t *e1=e+(E/2); AssertFatal(E%4==0,"");
int16_t *end=f+E-4; int16_t *e1=e+(E/2);
while( f<end ){ int16_t *end=f+E-3;
*e++ = *f++; while( f<end ){
*e1++ = *f++; *e++ = *f++;
*e++ = *f++; *e1++ = *f++;
*e1++ = *f++; *e++ = *f++;
} *e1++ = *f++;
}
} }
break; break;
case 4: case 4:
{ {
AssertFatal(E%4==0,"");
int16_t *e1=e+(E/4); int16_t *e1=e+(E/4);
int16_t *e2=e1+(E/4); int16_t *e2=e1+(E/4);
int16_t *e3=e2+(E/4); int16_t *e3=e2+(E/4);
int16_t *end=f+E-4; int16_t *end=f+E-3;
while( f<end ){ while( f<end ){
*e++ = *f++; *e++ = *f++;
*e1++ = *f++; *e1++ = *f++;
...@@ -338,12 +341,13 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) ...@@ -338,12 +341,13 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
break; break;
case 6: case 6:
{ {
AssertFatal(E%6==0,"");
int16_t *e1=e+(E/6); int16_t *e1=e+(E/6);
int16_t *e2=e1+(E/6); int16_t *e2=e1+(E/6);
int16_t *e3=e2+(E/6); int16_t *e3=e2+(E/6);
int16_t *e4=e3+(E/6); int16_t *e4=e3+(E/6);
int16_t *e5=e4+(E/6); int16_t *e5=e4+(E/6);
int16_t *end=f+E-6; int16_t *end=f+E-5;
while( f<end ){ while( f<end ){
*e++ = *f++; *e++ = *f++;
*e1++ = *f++; *e1++ = *f++;
...@@ -356,6 +360,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) ...@@ -356,6 +360,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
break; break;
case 8: case 8:
{ {
AssertFatal(E%8==0,"zob");
int16_t *e1=e+(E/8); int16_t *e1=e+(E/8);
int16_t *e2=e1+(E/8); int16_t *e2=e1+(E/8);
int16_t *e3=e2+(E/8); int16_t *e3=e2+(E/8);
...@@ -363,7 +368,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) ...@@ -363,7 +368,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
int16_t *e5=e4+(E/8); int16_t *e5=e4+(E/8);
int16_t *e6=e5+(E/8); int16_t *e6=e5+(E/8);
int16_t *e7=e6+(E/8); int16_t *e7=e6+(E/8);
int16_t *end=f+E-8; int16_t *end=f+E-7;
while( f<end ){ while( f<end ){
*e++ = *f++; *e++ = *f++;
*e1++ = *f++; *e1++ = *f++;
......
...@@ -483,7 +483,7 @@ int main(int argc, char **argv) ...@@ -483,7 +483,7 @@ int main(int argc, char **argv)
//unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16)));
for (i = 0; i < TBS / 8; i++) for (i = 0; i < TBS / 8; i++)
test_input[i] = (unsigned char) rand(); test_input[i] = (unsigned char) rand();
harq->pdu=test_input; dlsch->harq_process.pdu=test_input;
//estimated_output = harq_process->b; //estimated_output = harq_process->b;
#ifdef DEBUG_NR_DLSCHSIM #ifdef DEBUG_NR_DLSCHSIM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment