Commit 8cbe7cf6 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/mmse_receiver' into develop_integration_2018_w29

parents ccdf1aff 340a8850
......@@ -3738,8 +3738,8 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
for (rb=0;rb<nb_rb;rb++) {
//printf("rb %d : ",rb);
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[1],dl_ch128[1]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi32(_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi32(_mm_madd_epi16(dl_ch128[1],dl_ch128[1]),x));
//avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[0], coeff128),15)));
//avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[1], coeff128),15)));
......@@ -3748,7 +3748,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
dl_ch128+=2;
}
else {
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[2],dl_ch128[2]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi32(_mm_madd_epi16(dl_ch128[2],dl_ch128[2]),x));
//avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[2],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[2], coeff128),15)));
dl_ch128+=3;
}
......@@ -3863,8 +3863,8 @@ void dlsch_channel_level_core(int **dl_ch_estimates_ext,
length2 = length>>3;
for (ii=0;ii<length2;ii++) {
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[1],dl_ch128[1]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi32(_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),x));
avg128D = _mm_add_epi32(avg128D,_mm_srai_epi32(_mm_madd_epi16(dl_ch128[1],dl_ch128[1]),x));
dl_ch128+=2;
}
......@@ -3938,6 +3938,112 @@ void dlsch_channel_level_core(int **dl_ch_estimates_ext,
}
void dlsch_channel_level_median(int **dl_ch_estimates_ext,
int32_t *median,
int n_tx,
int n_rx,
int length,
int start_point)
{
#if defined(__x86_64__)||defined(__i386__)
short ii;
int aatx,aarx;
int length_mod4;
int length2;
int max = 0, min=0;
int norm_pack;
__m128i *dl_ch128, norm128D;
int16_t x = factor2(length);
int16_t y = (length)>>x;
for (aatx=0; aatx<n_tx; aatx++){
for (aarx=0; aarx<n_rx; aarx++) {
max = 0;
min = 0;
norm128D = _mm_setzero_si128();
dl_ch128=(__m128i *)&dl_ch_estimates_ext[aatx*n_rx + aarx][start_point];
length_mod4=length&3;
length2 = length>>2;
for (ii=0;ii<length2;ii++) {
norm128D = _mm_srai_epi32( _mm_madd_epi16(dl_ch128[0],dl_ch128[0]), 1);
//print_ints("norm128D",&norm128D[0]);
norm_pack = ((int32_t*)&norm128D)[0] +
((int32_t*)&norm128D)[1] +
((int32_t*)&norm128D)[2] +
((int32_t*)&norm128D)[3];
if (ii<1){
print_ints("norm128D",&norm128D[0]);
printf("norm_pack[%d] %d\n", aatx*n_rx + aarx, norm_pack);
}
if (norm_pack > max)
max = norm_pack;
if (norm_pack < min)
min = norm_pack;
dl_ch128+=1;
}
median[aatx*n_rx + aarx] = (max+min)>>1;
// printf("Channel level median [%d]: %d\n",aatx*n_rx + aarx, median[aatx*n_rx + aarx]);
}
}
_mm_empty();
_m_empty();
#elif defined(__arm__)
short rb;
unsigned char aatx,aarx,nre=12,symbol_mod;
int32x4_t norm128D;
int16x4_t *dl_ch128;
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++){
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
max = 0;
min = 0;
norm128D = vdupq_n_s32(0);
dl_ch128=(int16x4_t *)&dl_ch_estimates_ext[aatx*n_rx + aarx][start_point];
length_mod8=length&3;
length2 = length>>2;
for (ii=0;ii<length2;ii++) {
norm128D = vshrq_n_u32(vmull_s16(dl_ch128[0],dl_ch128[0]), 1);
norm_pack = ((int32_t*)&norm128D)[0] +
((int32_t*)&norm128D)[1] +
((int32_t*)&norm128D)[2] +
((int32_t*)&norm128D)[3];
if (norm_pack > max)
max = norm_pack;
if (norm_pack < min)
min = norm_pack;
dl_ch128+=1;
}
median[aatx*n_rx + aarx] = (max+min)>>1;
//printf("Channel level median [%d]: %d\n",aatx*n_rx + aarx, median[aatx*n_rx + aarx]);
}
}
#endif
}
void mmse_processing_oai(LTE_UE_PDSCH *pdsch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
PHY_MEASUREMENTS *measurements,
......
......@@ -966,6 +966,13 @@ void dlsch_channel_level_core(int32_t **dl_ch_estimates_ext,
int length,
int start_point);
void dlsch_channel_level_median(int **dl_ch_estimates_ext,
int32_t *median,
int n_tx,
int n_rx,
int length,
int start_point);
void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms,
......
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