diff --git a/srslte/include/srslte/fec/convcoder.h b/srslte/include/srslte/fec/convcoder.h index 820289fcf..1d51cbcbc 100644 --- a/srslte/include/srslte/fec/convcoder.h +++ b/srslte/include/srslte/fec/convcoder.h @@ -43,7 +43,7 @@ typedef struct SRSLTE_API { uint32_t R; uint32_t K; - uint32_t poly[3]; + int poly[3]; bool tail_biting; }srslte_convcoder_t; diff --git a/srslte/include/srslte/fec/viterbi.h b/srslte/include/srslte/fec/viterbi.h index 7493730f5..b00f09788 100644 --- a/srslte/include/srslte/fec/viterbi.h +++ b/srslte/include/srslte/fec/viterbi.h @@ -55,7 +55,6 @@ typedef struct SRSLTE_API{ uint32_t framebits; bool tail_biting; float gain_quant; - uint32_t poly[3]; int (*decode) (void*, uint8_t*, uint8_t*, uint32_t); int (*decode_f) (void*, float*, uint8_t*, uint32_t); void (*free) (void*); @@ -65,7 +64,7 @@ typedef struct SRSLTE_API{ SRSLTE_API int srslte_viterbi_init(srslte_viterbi_t *q, srslte_viterbi_type_t type, - uint32_t poly[3], + int poly[3], uint32_t max_frame_length, bool tail_bitting); @@ -88,7 +87,7 @@ SRSLTE_API int srslte_viterbi_decode_uc(srslte_viterbi_t *q, SRSLTE_API int srslte_viterbi_init_sse(srslte_viterbi_t *q, srslte_viterbi_type_t type, - uint32_t poly[3], + int poly[3], uint32_t max_frame_length, bool tail_bitting); diff --git a/srslte/lib/fec/test/viterbi_test_mex.c b/srslte/lib/fec/test/viterbi_test_mex.c index dfec6a533..9d1862ae5 100644 --- a/srslte/lib/fec/test/viterbi_test_mex.c +++ b/srslte/lib/fec/test/viterbi_test_mex.c @@ -60,7 +60,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) output_data = srslte_vec_malloc(nof_bits * sizeof(uint8_t)); - uint32_t poly[3] = { 0x6D, 0x4F, 0x57 }; + int poly[3] = { 0x6D, 0x4F, 0x57 }; if (srslte_viterbi_init(&viterbi, SRSLTE_VITERBI_37, poly, nof_bits/3, true)) { return; } diff --git a/srslte/lib/fec/viterbi.c b/srslte/lib/fec/viterbi.c index 6deb89903..218e70639 100644 --- a/srslte/lib/fec/viterbi.c +++ b/srslte/lib/fec/viterbi.c @@ -130,7 +130,7 @@ void free37(void *o) { delete_viterbi37_port(q->ptr); } -int init37(srslte_viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool tail_biting) { +int init37(srslte_viterbi_t *q, int poly[3], uint32_t framebits, bool tail_biting) { q->K = 7; q->R = 3; q->framebits = framebits; @@ -166,7 +166,7 @@ int init37(srslte_viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool tail_ } #ifdef LV_HAVE_SSE -int init37_sse(srslte_viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool tail_biting) { +int init37_sse(srslte_viterbi_t *q, int poly[3], uint32_t framebits, bool tail_biting) { q->K = 7; q->R = 3; q->framebits = framebits; @@ -205,7 +205,7 @@ void srslte_viterbi_set_gain_quant(srslte_viterbi_t *q, float gain_quant) { q->gain_quant = gain_quant; } -int srslte_viterbi_init(srslte_viterbi_t *q, srslte_viterbi_type_t type, uint32_t poly[3], uint32_t max_frame_length, bool tail_bitting) +int srslte_viterbi_init(srslte_viterbi_t *q, srslte_viterbi_type_t type, int poly[3], uint32_t max_frame_length, bool tail_bitting) { switch (type) { case SRSLTE_VITERBI_37: @@ -221,7 +221,7 @@ int srslte_viterbi_init(srslte_viterbi_t *q, srslte_viterbi_type_t type, uint32_ } #ifdef LV_HAVE_SSE -int srslte_viterbi_init_sse(srslte_viterbi_t *q, srslte_viterbi_type_t type, uint32_t poly[3], uint32_t max_frame_length, bool tail_bitting) +int srslte_viterbi_init_sse(srslte_viterbi_t *q, srslte_viterbi_type_t type, int poly[3], uint32_t max_frame_length, bool tail_bitting) { return init37_sse(q, poly, max_frame_length, tail_bitting); } diff --git a/srslte/lib/fec/viterbi37.h b/srslte/lib/fec/viterbi37.h index 36585daff..f5f304858 100644 --- a/srslte/lib/fec/viterbi37.h +++ b/srslte/lib/fec/viterbi37.h @@ -26,7 +26,7 @@ #include -void *create_viterbi37_port(uint32_t polys[3], +void *create_viterbi37_port(int polys[3], uint32_t len); int init_viterbi37_port(void *p, @@ -45,7 +45,7 @@ int update_viterbi37_blk_port(void *p, uint32_t *best_state); -void *create_viterbi37_sse(uint32_t polys[3], +void *create_viterbi37_sse(int polys[3], uint32_t len); int init_viterbi37_sse(void *p, diff --git a/srslte/lib/fec/viterbi37_port.c b/srslte/lib/fec/viterbi37_port.c index c55d95b4e..cf05b3c53 100644 --- a/srslte/lib/fec/viterbi37_port.c +++ b/srslte/lib/fec/viterbi37_port.c @@ -54,8 +54,8 @@ int init_viterbi37_port(void *p, int starting_state) { return 0; } -void set_viterbi37_polynomial_port(uint32_t polys[3]) { - uint32_t state; +void set_viterbi37_polynomial_port(int polys[3]) { + int state; for (state = 0; state < 32; state++) { Branchtab37[0].c[state] = @@ -68,7 +68,7 @@ void set_viterbi37_polynomial_port(uint32_t polys[3]) { } /* Create a new instance of a Viterbi decoder */ -void *create_viterbi37_port(uint32_t polys[3], uint32_t len) { +void *create_viterbi37_port(int polys[3], uint32_t len) { struct v37 *vp; set_viterbi37_polynomial_port(polys); diff --git a/srslte/lib/fec/viterbi37_sse.c b/srslte/lib/fec/viterbi37_sse.c index ffafd693d..3ecbfeefc 100644 --- a/srslte/lib/fec/viterbi37_sse.c +++ b/srslte/lib/fec/viterbi37_sse.c @@ -44,7 +44,7 @@ struct v37 { decision_t *decisions; /* Beginning of decisions for block */ }; -void set_viterbi37_polynomial_sse(uint32_t polys[3]) { +void set_viterbi37_polynomial_sse(int polys[3]) { int state; for(state=0;state < 32;state++){ @@ -73,7 +73,7 @@ int init_viterbi37_sse(void *p, int starting_state) { } /* Create a new instance of a Viterbi decoder */ -void *create_viterbi37_sse(uint32_t polys[3], uint32_t len) { +void *create_viterbi37_sse(int polys[3], uint32_t len) { void *p; struct v37 *vp; diff --git a/srslte/lib/phch/cqi.c b/srslte/lib/phch/cqi.c index cbde55177..6de7aa9ac 100644 --- a/srslte/lib/phch/cqi.c +++ b/srslte/lib/phch/cqi.c @@ -71,7 +71,7 @@ int srslte_cqi_format2_subband_pack(srslte_cqi_format2_subband_t *msg, uint8_t b uint8_t *body_ptr = buff; srslte_bit_unpack(msg->subband_cqi, &body_ptr, 4); srslte_bit_unpack(msg->subband_label, &body_ptr, msg->subband_label_2_bits?2:1); - return 4+msg->subband_label_2_bits?2:1; + return 4+(msg->subband_label_2_bits)?2:1; } int srslte_cqi_value_pack(srslte_cqi_value_t *value, uint8_t buff[SRSLTE_CQI_MAX_BITS]) diff --git a/srslte/lib/phch/pbch.c b/srslte/lib/phch/pbch.c index 3dfaa07f1..40f9d4b5b 100644 --- a/srslte/lib/phch/pbch.c +++ b/srslte/lib/phch/pbch.c @@ -158,7 +158,7 @@ int srslte_pbch_init(srslte_pbch_t *q, srslte_cell_t cell) { goto clean; } - uint32_t poly[3] = { 0x6D, 0x4F, 0x57 }; + int poly[3] = { 0x6D, 0x4F, 0x57 }; if (srslte_viterbi_init(&q->decoder, SRSLTE_VITERBI_37, poly, 40, true)) { goto clean; } diff --git a/srslte/lib/phch/pdcch.c b/srslte/lib/phch/pdcch.c index 1123c0192..a6a05decb 100644 --- a/srslte/lib/phch/pdcch.c +++ b/srslte/lib/phch/pdcch.c @@ -88,7 +88,7 @@ int srslte_pdcch_init(srslte_pdcch_t *q, srslte_regs_t *regs, srslte_cell_t cell } } - uint32_t poly[3] = { 0x6D, 0x4F, 0x57 }; + int poly[3] = { 0x6D, 0x4F, 0x57 }; if (srslte_viterbi_init(&q->decoder, SRSLTE_VITERBI_37, poly, SRSLTE_DCI_MAX_BITS + 16, true)) { goto clean; } diff --git a/srslte/lib/phch/prach.c b/srslte/lib/phch/prach.c index af9f71f59..dca6699e6 100644 --- a/srslte/lib/phch/prach.c +++ b/srslte/lib/phch/prach.c @@ -232,7 +232,7 @@ int srslte_prach_gen_seqs(srslte_prach_t *p) uint32_t d_u = 0; uint32_t d_start = 0; uint32_t N_shift = 0; - uint32_t N_neg_shift = 0; + int N_neg_shift = 0; uint32_t N_group = 0; uint32_t C_v = 0; cf_t root[839];