Commit b153d2d1 authored by Laurent THOMAS's avatar Laurent THOMAS

fix bug in nr_rate_matching

parent 288c29da
...@@ -309,60 +309,71 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f) ...@@ -309,60 +309,71 @@ 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)
{ {
int16_t *e1,*e2,*e3,*e4,*e5,*e6,*e7;
switch(Qm) { switch(Qm) {
case 2: case 2:
e1=e+(E/2); {
for (int j = 0,j2=0; j< E/2; j+=2,j2+=4){ int16_t *e1=e+(E/2);
e[j] = f[j2]; int16_t *end=f+E-4;
e1[j] = f[j2+1]; while( f<end ){
e[j+1] = f[j2+2]; *e++ = *f++;
e1[j+1] = f[j2+3]; *e1++ = *f++;
*e++ = *f++;
*e1++ = *f++;
}
} }
break; break;
case 4: case 4:
e1=e+(E/4); {
e2=e1+(E/4); int16_t *e1=e+(E/4);
e3=e2+(E/4); int16_t *e2=e1+(E/4);
for (int j = 0,j2=0; j< E/4; j++,j2+=4){ int16_t *e3=e2+(E/4);
e[j] = f[j2]; int16_t *end=f+E-4;
e1[j] = f[j2+1]; while( f<end ){
e2[j] = f[j2+2]; *e++ = *f++;
e3[j] = f[j2+3]; *e1++ = *f++;
*e2++ = *f++;
*e3++ = *f++;
}
} }
break; break;
case 6: case 6:
e1=e+(E/6); {
e2=e1+(E/6); int16_t *e1=e+(E/6);
e3=e2+(E/6); int16_t *e2=e1+(E/6);
e4=e3+(E/6); int16_t *e3=e2+(E/6);
e5=e4+(E/6); int16_t *e4=e3+(E/6);
for (int j = 0,j2=0; j< E/6; j++,j2+=6){ int16_t *e5=e4+(E/6);
e[j] = f[j2]; int16_t *end=f+E-6;
e1[j] = f[j2+1]; while( f<end ){
e2[j] = f[j2+2]; *e++ = *f++;
e3[j] = f[j2+3]; *e1++ = *f++;
e4[j] = f[j2+4]; *e2++ = *f++;
e5[j] = f[j2+5]; *e3++ = *f++;
*e4++ = *f++;
*e5++ = *f++;
}
} }
break; break;
case 8: case 8:
e1=e+(E/8); {
e2=e1+(E/8); int16_t *e1=e+(E/8);
e3=e2+(E/8); int16_t *e2=e1+(E/8);
e4=e3+(E/8); int16_t *e3=e2+(E/8);
e5=e4+(E/8); int16_t *e4=e3+(E/8);
e6=e5+(E/8); int16_t *e5=e4+(E/8);
e7=e6+(E/8); int16_t *e6=e5+(E/8);
for (int j = 0,j2=0; j< E/8; j++,j2+=8){ int16_t *e7=e6+(E/8);
e[j] = f[j2]; int16_t *end=f+E-8;
e1[j] = f[j2+1]; while( f<end ){
e2[j] = f[j2+2]; *e++ = *f++;
e3[j] = f[j2+3]; *e1++ = *f++;
e4[j] = f[j2+4]; *e2++ = *f++;
e5[j] = f[j2+5]; *e3++ = *f++;
e6[j] = f[j2+6]; *e4++ = *f++;
e7[j] = f[j2+7]; *e5++ = *f++;
*e6++ = *f++;
*e7++ = *f++;
}
} }
break; break;
default: default:
......
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