Commit 5400ad71 authored by Laurent Thomas's avatar Laurent Thomas

fix code review and cross compilation issue

parent 6740ec0c
...@@ -153,22 +153,22 @@ unsigned int crc24a (unsigned char * inptr, ...@@ -153,22 +153,22 @@ unsigned int crc24a (unsigned char * inptr,
{ {
int octetlen = bitlen / 8; /* Change in octets */ int octetlen = bitlen / 8; /* Change in octets */
#ifndef USE_INTEL_CRC if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) {
unsigned int crc = 0; unsigned int crc = 0;
int resbit = (bitlen % 8); int resbit = (bitlen % 8);
while (octetlen-- > 0) { while (octetlen-- > 0) {
// printf("crc24a: in %x => crc %x\n",crc,*inptr); // printf("crc24a: in %x => crc %x\n",crc,*inptr);
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
} }
if (resbit > 0) if (resbit > 0)
crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
return crc; return crc;
#else } else {
return crc32_calc_pclmulqdq(inptr, octetlen, 0, return crc32_calc_pclmulqdq(inptr, octetlen, 0,
&lte_crc24a_pclmulqdq); &lte_crc24a_pclmulqdq);
#endif }
} }
...@@ -186,8 +186,8 @@ unsigned int crc24b (unsigned char * inptr, ...@@ -186,8 +186,8 @@ unsigned int crc24b (unsigned char * inptr,
int bitlen) int bitlen)
{ {
int octetlen = bitlen / 8; /* Change in octets */ int octetlen = bitlen / 8; /* Change in octets */
#ifndef USE_INTEL_CRC if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) {
unsigned int crc = 0; unsigned int crc = 0;
int resbit = (bitlen % 8); int resbit = (bitlen % 8);
...@@ -200,10 +200,10 @@ unsigned int crc24b (unsigned char * inptr, ...@@ -200,10 +200,10 @@ unsigned int crc24b (unsigned char * inptr,
crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
return crc; return crc;
#else } else {
return crc32_calc_pclmulqdq(inptr, octetlen, 0, return crc32_calc_pclmulqdq(inptr, octetlen, 0,
&lte_crc24b_pclmulqdq); &lte_crc24b_pclmulqdq);
#endif }
} }
unsigned int crc24c (unsigned char * inptr, unsigned int crc24c (unsigned char * inptr,
......
...@@ -38,12 +38,12 @@ ...@@ -38,12 +38,12 @@
*/ */
typedef struct { typedef struct {
unsigned int n_segments; // optim8seg unsigned int n_segments; // optim8seg
unsigned int macro_num; // optim8segmulti unsigned int macro_num; // optim8segmulti
unsigned char gen_code; //orig unsigned char gen_code; //orig
time_stats_t *tinput; time_stats_t *tinput;
time_stats_t *tprep; time_stats_t *tprep;
time_stats_t *tparity; time_stats_t *tparity;
time_stats_t *toutput; time_stats_t *toutput;
int Kr; int Kr;
uint32_t Kb; uint32_t Kb;
uint32_t *Zc; uint32_t *Zc;
...@@ -58,10 +58,10 @@ typedef struct { ...@@ -58,10 +58,10 @@ typedef struct {
uint32_t F; uint32_t F;
/// LDPC-code outputs /// LDPC-code outputs
uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
}encoder_implemparams_t; } encoder_implemparams_t;
#define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL}
typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out);
typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *);
//============================================================================================================================ //============================================================================================================================
// decoder interface // decoder interface
/** /**
...@@ -71,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho ...@@ -71,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho
\param p_llrOut Output vector \param p_llrOut Output vector
\param p_profiler LDPC profiler statistics \param p_profiler LDPC profiler statistics
*/ */
typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * );
#endif #endif
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