Interleaving init fix

This commit is contained in:
Guy De Souza
2018-11-07 17:02:01 +01:00
parent b6de2aeaaf
commit d5893eeae8
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -190,7 +190,7 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
} }
} }
uint8_t nr_pbch_init_interleaver(uint8_t *interleaver) { uint8_t nr_init_pbch_interleaver(uint8_t *interleaver) {
uint8_t j_sfn=0, j_hrf=10, j_ssb=11, j_other=14; uint8_t j_sfn=0, j_hrf=10, j_ssb=11, j_other=14;
memset((void*)interleaver,0, NR_POLAR_PBCH_PAYLOAD_BITS); memset((void*)interleaver,0, NR_POLAR_PBCH_PAYLOAD_BITS);
@@ -272,15 +272,15 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
for (int i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS; i++) { for (int i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS; i++) {
pbch->pbch_a_interleaved |= ((in>>i)&1)<<(*(interleaver+i)); pbch->pbch_a_interleaved |= ((in>>i)&1)<<(*(interleaver+i));
#ifdef DEBUG_PBCH_ENCODING //#ifdef DEBUG_PBCH_ENCODING
printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) %d\n", i, in, pbch->pbch_a_interleaved, *(interleaver+i), (in>>i)&1); printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) %d\n", i, in, pbch->pbch_a_interleaved, *(interleaver+i), (in>>i)&1);
#endif //#endif
} }
#ifdef DEBUG_PBCH_ENCODING //#ifdef DEBUG_PBCH_ENCODING
printf("Interleaving:\n"); printf("Interleaving:\n");
printf("pbch_a_interleaved: 0x%08x\n", pbch->pbch_a_interleaved); printf("pbch_a_interleaved: 0x%08x\n", pbch->pbch_a_interleaved);
#endif //#endif
// Scrambling // Scrambling
M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3);
+1 -1
View File
@@ -103,6 +103,6 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
@param bit index i of the input payload @param bit index i of the input payload
@returns the bit index of the output @returns the bit index of the output
*/ */
uint8_t nr_pbch_payload_interleaver(uint8_t i); uint8_t nr_init_pbch_interleaver(uint8_t *interleaver);
#endif /*__NR_TRANSPORT__H__*/ #endif /*__NR_TRANSPORT__H__*/