Commit 2b50af4c authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'polar-decoder-optimizations' of...

Merge branch 'polar-decoder-optimizations' of https://gitlab.eurecom.fr/oai/openairinterface4g into polar-decoder-optimizations

Conflicts:
	openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
parents 6a2dc297 ffc5faf3
...@@ -27,9 +27,9 @@ void nr_polar_init(t_nrPolar_params* polarParams, int messageType) { ...@@ -27,9 +27,9 @@ void nr_polar_init(t_nrPolar_params* polarParams, int messageType) {
uint32_t poly6 = 0x84000000; // 1000100000... -> D^6+D^5+1 uint32_t poly6 = 0x84000000; // 1000100000... -> D^6+D^5+1
uint32_t poly11 = 0x63200000; //11000100001000... -> D^11+D^10+D^9+D^5+1 uint32_t poly11 = 0x63200000; //11000100001000... -> D^11+D^10+D^9+D^5+1
uint32_t poly16 = 0x81080000; //100000010000100... - > D^16+D^12+D^5+1 //uint32_t poly16 = 0x81080000; //100000010000100... - > D^16+D^12+D^5+1
uint32_t poly24a = 0x864cfb00; //100001100100110011111011 -> D^24+D^23+D^18+D^17+D^14+D^11+D^10+D^7+D^6+D^5+D^4+D^3+D+1 //uint32_t poly24a = 0x864cfb00; //100001100100110011111011 -> D^24+D^23+D^18+D^17+D^14+D^11+D^10+D^7+D^6+D^5+D^4+D^3+D+1
uint32_t poly24b = 0x80006300; //100000000000000001100011 -> D^24+D^23+D^6+D^5+D+1 //uint32_t poly24b = 0x80006300; //100000000000000001100011 -> D^24+D^23+D^6+D^5+D+1
uint32_t poly24c = 0xB2B11700; //101100101011000100010111 -> D^24... uint32_t poly24c = 0xB2B11700; //101100101011000100010111 -> D^24...
if (messageType == 0) { //DCI if (messageType == 0) { //DCI
......
...@@ -50,7 +50,6 @@ int16_t llrtab[256][256]; ...@@ -50,7 +50,6 @@ int16_t llrtab[256][256];
void nr_polar_llrtableinit() { void nr_polar_llrtableinit() {
int16_t absA,absB; int16_t absA,absB;
int16_t maska,maskb;
int16_t minabs; int16_t minabs;
for (int a=-128;a<128;a++) { for (int a=-128;a<128;a++) {
...@@ -229,7 +228,6 @@ void updatePathMetric2(decoder_list_t **dlist, uint8_t listSize, uint16_t row, u ...@@ -229,7 +228,6 @@ void updatePathMetric2(decoder_list_t **dlist, uint8_t listSize, uint16_t row, u
void updatePathMetric2_int8(decoder_list_int8_t **dlist, uint8_t listSize, uint16_t row,int generate_optim_code,FILE *fd) { void updatePathMetric2_int8(decoder_list_int8_t **dlist, uint8_t listSize, uint16_t row,int generate_optim_code,FILE *fd) {
int i;
...@@ -303,7 +301,7 @@ decoder_node_t *new_decoder_node(int first_leaf_index,int level) { ...@@ -303,7 +301,7 @@ decoder_node_t *new_decoder_node(int first_leaf_index,int level) {
node->right=(decoder_node_t *)NULL; node->right=(decoder_node_t *)NULL;
node->all_frozen=0; node->all_frozen=0;
node->alpha = (int16_t*)malloc16(node->Nv*sizeof(int16_t)); node->alpha = (int16_t*)malloc16(node->Nv*sizeof(int16_t));
node->beta = (int8_t*)malloc16(node->Nv*sizeof(int16_t)); node->beta = (int16_t*)malloc16(node->Nv*sizeof(int16_t));
memset((void*)node->beta,-1,node->Nv*sizeof(int16_t)); memset((void*)node->beta,-1,node->Nv*sizeof(int16_t));
...@@ -434,9 +432,7 @@ void applyGtoright(t_nrPolar_params *pp,decoder_node_t *node) { ...@@ -434,9 +432,7 @@ void applyGtoright(t_nrPolar_params *pp,decoder_node_t *node) {
int16_t *alpha_r=node->right->alpha; int16_t *alpha_r=node->right->alpha;
int16_t *betal = node->left->beta; int16_t *betal = node->left->beta;
int16_t *betar = node->right->beta; int16_t *betar = node->right->beta;
int8_t frozen_mask=-1;
if (node->Nv == 2) frozen_mask=-pp->information_bit_pattern[node->first_leaf_index+1];
#ifdef DEBUG_NEW_IMPL #ifdef DEBUG_NEW_IMPL
printf("applyGtoright %d, Nv %d (level %d), (leaf %d, AF %d)\n",node->first_leaf_index,node->Nv,node->level,node->right->leaf,node->right->all_frozen); printf("applyGtoright %d, Nv %d (level %d), (leaf %d, AF %d)\n",node->first_leaf_index,node->Nv,node->level,node->right->leaf,node->right->all_frozen);
#endif #endif
......
...@@ -124,6 +124,8 @@ void polar_encoder(uint8_t *input, uint8_t *output, t_nrPolar_params* polarParam ...@@ -124,6 +124,8 @@ void polar_encoder(uint8_t *input, uint8_t *output, t_nrPolar_params* polarParam
void nr_polar_kernal_operation(uint8_t *u, uint8_t *d, uint16_t N); void nr_polar_kernal_operation(uint8_t *u, uint8_t *d, uint16_t N);
void generic_polar_decoder(t_nrPolar_params *,decoder_node_t *);
int8_t polar_decoder(double *input, uint8_t *output, t_nrPolar_params *polarParams, int8_t polar_decoder(double *input, uint8_t *output, t_nrPolar_params *polarParams,
uint8_t listSize, double *aPrioriPayload, uint8_t pathMetricAppr); uint8_t listSize, double *aPrioriPayload, uint8_t pathMetricAppr);
...@@ -136,9 +138,6 @@ int8_t polar_decoder_int8(int16_t *input, ...@@ -136,9 +138,6 @@ int8_t polar_decoder_int8(int16_t *input,
int8_t polar_decoder_int8_new(int16_t *input, int8_t polar_decoder_int8_new(int16_t *input,
uint8_t *output, uint8_t *output,
t_nrPolar_params *polarParams); t_nrPolar_params *polarParams);
void nr_polar_llrtableinit(void); void nr_polar_llrtableinit(void);
void nr_polar_init(t_nrPolar_params* polarParams, int messageType); void nr_polar_init(t_nrPolar_params* polarParams, int messageType);
......
...@@ -219,7 +219,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, ...@@ -219,7 +219,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
uint8_t nushift; uint8_t nushift;
uint8_t *xbyte = pbch->pbch_a; uint8_t *xbyte = pbch->pbch_a;
memset((void*) xbyte, 0, 1); memset((void*) xbyte, 0, 1);
uint8_t pbch_a_b[32]; //uint8_t pbch_a_b[32];
LOG_I(PHY, "PBCH generation started\n"); LOG_I(PHY, "PBCH generation started\n");
...@@ -282,10 +282,10 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, ...@@ -282,10 +282,10 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
printf("pbch_a_prime[%d]: 0x%02x\n", i, pbch->pbch_a_prime[i]); printf("pbch_a_prime[%d]: 0x%02x\n", i, pbch->pbch_a_prime[i]);
#endif #endif
for (int m=0;m<32;m++){ //for (int m=0;m<32;m++){
pbch_a_b[m] = ((pbch->pbch_a_prime[m/8]>>(m&7))&01); //pbch_a_b[m] = ((pbch->pbch_a_prime[m/8]>>(m&7))&01);
//printf("pbch_a_b[%d] %d\n", m, pbch_a_b[m] ); //printf("pbch_a_b[%d] %d\n", m, pbch_a_b[m] );
} //}
/// CRC, coding and rate matching /// CRC, coding and rate matching
polar_encoder (pbch->pbch_a_prime, pbch->pbch_e, &frame_parms->pbch_polar_params); polar_encoder (pbch->pbch_a_prime, pbch->pbch_e, &frame_parms->pbch_polar_params);
......
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