Commit b0f5a37f authored by masayuki.harada's avatar masayuki.harada

Fix indentation, merge miss and remove unnecessary comment.

parent 88699deb
...@@ -33,11 +33,7 @@ ...@@ -33,11 +33,7 @@
*\return the extracted value. *\return the extracted value.
*/ */
static inline uint8_t BIT_STRING_to_uint8(BIT_STRING_t *asn) { static inline uint8_t BIT_STRING_to_uint8(BIT_STRING_t *asn) {
//DevCheck ((asn->size == 1), asn->size, 0, 0); DevCheck ((asn->size == 1), asn->size, 0, 0);
if(!(asn->size == 1)) {
printf("BIT_STRING_to_uint8 size %ld\n", asn->size);
return 0;
}
return asn->buf[0] >> asn->bits_unused; return asn->buf[0] >> asn->bits_unused;
} }
...@@ -51,11 +47,7 @@ static inline uint16_t BIT_STRING_to_uint16(BIT_STRING_t *asn) { ...@@ -51,11 +47,7 @@ static inline uint16_t BIT_STRING_to_uint16(BIT_STRING_t *asn) {
uint16_t result = 0; uint16_t result = 0;
int index = 0; int index = 0;
//DevCheck ((asn->size > 0) && (asn->size <= 2), asn->size, 0, 0); DevCheck ((asn->size > 0) && (asn->size <= 2), asn->size, 0, 0);
if(!((asn->size > 0) && (asn->size <= 2))) {
printf("BIT_STRING_to_uint16 size %ld\n", asn->size);
return 0;
}
switch (asn->size) { switch (asn->size) {
case 2: case 2:
...@@ -82,11 +74,7 @@ static inline uint32_t BIT_STRING_to_uint32(BIT_STRING_t *asn) { ...@@ -82,11 +74,7 @@ static inline uint32_t BIT_STRING_to_uint32(BIT_STRING_t *asn) {
int index; int index;
int shift; int shift;
//DevCheck ((asn->size > 0) && (asn->size <= 4), asn->size, 0, 0); DevCheck ((asn->size > 0) && (asn->size <= 4), asn->size, 0, 0);
if(!((asn->size > 0) && (asn->size <= 4))) {
printf("BIT_STRING_to_uint32 size %ld\n", asn->size);
return 0;
}
shift = ((asn->size - 1) * 8) - asn->bits_unused; shift = ((asn->size - 1) * 8) - asn->bits_unused;
for (index = 0; index < (asn->size - 1); index++) { for (index = 0; index < (asn->size - 1); index++) {
...@@ -109,11 +97,7 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) { ...@@ -109,11 +97,7 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) {
int index; int index;
int shift; int shift;
//DevCheck ((asn->size > 0) && (asn->size <= 8), asn->size, 0, 0); DevCheck ((asn->size > 0) && (asn->size <= 8), asn->size, 0, 0);
if(!((asn->size > 0) && (asn->size <= 8))) {
printf("BIT_STRING_to_uint64 size %ld\n", asn->size);
return 0;
}
shift = ((asn->size - 1) * 8) - asn->bits_unused; shift = ((asn->size - 1) * 8) - asn->bits_unused;
for (index = 0; index < (asn->size - 1); index++) { for (index = 0; index < (asn->size - 1); index++) {
......
...@@ -543,284 +543,284 @@ int16_t dB_table_times10[256] = { ...@@ -543,284 +543,284 @@ int16_t dB_table_times10[256] = {
uint32_t bit_seach_mask[32] = { uint32_t bit_seach_mask[32] = {
0x80000000, 0x40000000, 0x20000000, 0x10000000, 0x80000000, 0x40000000, 0x20000000, 0x10000000,
0x08000000, 0x04000000, 0x02000000, 0x01000000, 0x08000000, 0x04000000, 0x02000000, 0x01000000,
0x00800000, 0x00400000, 0x00200000, 0x00100000, 0x00800000, 0x00400000, 0x00200000, 0x00100000,
0x00080000, 0x00040000, 0x00020000, 0x00010000, 0x00080000, 0x00040000, 0x00020000, 0x00010000,
0x00008000, 0x00004000, 0x00002000, 0x00001000, 0x00008000, 0x00004000, 0x00002000, 0x00001000,
0x00000800, 0x00000400, 0x00000200, 0x00000100, 0x00000800, 0x00000400, 0x00000200, 0x00000100,
0x00000080, 0x00000040, 0x00000020, 0x00000010, 0x00000080, 0x00000040, 0x00000020, 0x00000010,
0x00000008, 0x00000004, 0x00000002, 0x00000001 0x00000008, 0x00000004, 0x00000002, 0x00000001
}; };
uint32_t bit_seach_res[32] = { uint32_t bit_seach_res[32] = {
31, 30, 29, 28, 31, 30, 29, 28,
27, 26, 25, 24, 27, 26, 25, 24,
23, 22, 21, 20, 23, 22, 21, 20,
19, 18, 17, 16, 19, 18, 17, 16,
15, 14, 13, 12, 15, 14, 13, 12,
11, 10, 9, 8, 11, 10, 9, 8,
7, 6, 5, 4, 7, 6, 5, 4,
3, 2, 1, 0 3, 2, 1, 0
}; };
uint32_t dB_fix_x10_tbl[128] = { uint32_t dB_fix_x10_tbl[128] = {
0 , 0 ,
0 , 0 ,
1 , 1 ,
1 , 1 ,
1 , 1 ,
2 , 2 ,
2 , 2 ,
2 , 2 ,
3 , 3 ,
3 , 3 ,
3 , 3 ,
4 , 4 ,
4 , 4 ,
4 , 4 ,
5 , 5 ,
5 , 5 ,
5 , 5 ,
5 , 5 ,
6 , 6 ,
6 , 6 ,
6 , 6 ,
7 , 7 ,
7 , 7 ,
7 , 7 ,
7 , 7 ,
8 , 8 ,
8 , 8 ,
8 , 8 ,
9 , 9 ,
9 , 9 ,
9 , 9 ,
9 , 9 ,
10 , 10 ,
10 , 10 ,
10 , 10 ,
10 , 10 ,
11 , 11 ,
11 , 11 ,
11 , 11 ,
12 , 12 ,
12 , 12 ,
12 , 12 ,
12 , 12 ,
13 , 13 ,
13 , 13 ,
13 , 13 ,
13 , 13 ,
14 , 14 ,
14 , 14 ,
14 , 14 ,
14 , 14 ,
15 , 15 ,
15 , 15 ,
15 , 15 ,
15 , 15 ,
16 , 16 ,
16 , 16 ,
16 , 16 ,
16 , 16 ,
16 , 16 ,
17 , 17 ,
17 , 17 ,
17 , 17 ,
17 , 17 ,
18 , 18 ,
18 , 18 ,
18 , 18 ,
18 , 18 ,
19 , 19 ,
19 , 19 ,
19 , 19 ,
19 , 19 ,
19 , 19 ,
20 , 20 ,
20 , 20 ,
20 , 20 ,
20 , 20 ,
20 , 20 ,
21 , 21 ,
21 , 21 ,
21 , 21 ,
21 , 21 ,
22 , 22 ,
22 , 22 ,
22 , 22 ,
22 , 22 ,
22 , 22 ,
23 , 23 ,
23 , 23 ,
23 , 23 ,
23 , 23 ,
23 , 23 ,
24 , 24 ,
24 , 24 ,
24 , 24 ,
24 , 24 ,
24 , 24 ,
24 , 24 ,
25 , 25 ,
25 , 25 ,
25 , 25 ,
25 , 25 ,
25 , 25 ,
26 , 26 ,
26 , 26 ,
26 , 26 ,
26 , 26 ,
26 , 26 ,
27 , 27 ,
27 , 27 ,
27 , 27 ,
27 , 27 ,
27 , 27 ,
27 , 27 ,
28 , 28 ,
28 , 28 ,
28 , 28 ,
28 , 28 ,
28 , 28 ,
29 , 29 ,
29 , 29 ,
29 , 29 ,
29 , 29 ,
29 , 29 ,
29 , 29 ,
30 , 30 ,
30 , 30 ,
30 30
}; };
uint32_t dB_fix_x10_tbl_low[128] = { uint32_t dB_fix_x10_tbl_low[128] = {
0 , 0 ,
0 , 0 ,
30 , 30 ,
48 , 48 ,
60 , 60 ,
70 , 70 ,
78 , 78 ,
85 , 85 ,
90 , 90 ,
95 , 95 ,
100 , 100 ,
104 , 104 ,
108 , 108 ,
111 , 111 ,
115 , 115 ,
118 , 118 ,
120 , 120 ,
123 , 123 ,
126 , 126 ,
128 , 128 ,
130 , 130 ,
132 , 132 ,
134 , 134 ,
136 , 136 ,
138 , 138 ,
140 , 140 ,
141 , 141 ,
143 , 143 ,
145 , 145 ,
146 , 146 ,
148 , 148 ,
149 , 149 ,
151 , 151 ,
152 , 152 ,
153 , 153 ,
154 , 154 ,
156 , 156 ,
157 , 157 ,
158 , 158 ,
159 , 159 ,
160 , 160 ,
161 , 161 ,
162 , 162 ,
163 , 163 ,
164 , 164 ,
165 , 165 ,
166 , 166 ,
167 , 167 ,
168 , 168 ,
169 , 169 ,
170 , 170 ,
171 , 171 ,
172 , 172 ,
172 , 172 ,
173 , 173 ,
174 , 174 ,
175 , 175 ,
176 , 176 ,
176 , 176 ,
177 , 177 ,
178 , 178 ,
179 , 179 ,
179 , 179 ,
180 , 180 ,
181 , 181 ,
181 , 181 ,
182 , 182 ,
183 , 183 ,
183 , 183 ,
184 , 184 ,
185 , 185 ,
185 , 185 ,
186 , 186 ,
186 , 186 ,
187 , 187 ,
188 , 188 ,
188 , 188 ,
189 , 189 ,
189 , 189 ,
190 , 190 ,
190 , 190 ,
191 , 191 ,
191 , 191 ,
192 , 192 ,
192 , 192 ,
193 , 193 ,
193 , 193 ,
194 , 194 ,
194 , 194 ,
195 , 195 ,
195 , 195 ,
196 , 196 ,
196 , 196 ,
197 , 197 ,
197 , 197 ,
198 , 198 ,
198 , 198 ,
199 , 199 ,
199 , 199 ,
200 , 200 ,
200 , 200 ,
200 , 200 ,
201 , 201 ,
201 , 201 ,
202 , 202 ,
202 , 202 ,
203 , 203 ,
203 , 203 ,
203 , 203 ,
204 , 204 ,
204 , 204 ,
205 , 205 ,
205 , 205 ,
205 , 205 ,
206 , 206 ,
206 , 206 ,
206 , 206 ,
207 , 207 ,
207 , 207 ,
208 , 208 ,
208 , 208 ,
208 , 208 ,
209 , 209 ,
209 , 209 ,
209 , 209 ,
210 , 210 ,
210 , 210 ,
210 210
}; };
/* /*
...@@ -855,35 +855,35 @@ int8_t dB_fixed(int x) { ...@@ -855,35 +855,35 @@ int8_t dB_fixed(int x) {
*/ */
int16_t dB_fixed_x10(uint32_t x) { int16_t dB_fixed_x10(uint32_t x) {
int16_t dB_power = 0; int16_t dB_power = 0;
//for new algorithm //for new algorithm
uint32_t cnt; uint32_t cnt;
uint32_t Exponent; uint32_t Exponent;
uint32_t Mantissa; uint32_t Mantissa;
uint32_t shift_right; uint32_t shift_right;
uint32_t tbl_resolution = 7; uint32_t tbl_resolution = 7;
uint32_t tbl_addr_mask; uint32_t tbl_addr_mask;
if (x < 128){ //OAI alogrithm if (x < 128){ //OAI alogrithm
dB_power = dB_fix_x10_tbl_low[x]; dB_power = dB_fix_x10_tbl_low[x];
} }
else { //new algorithm else { //new algorithm
tbl_addr_mask = 0x0000007Fu; // (1 << tbl_resolution) - 1;//i.e. 0x0000007F tbl_addr_mask = 0x0000007Fu; // (1 << tbl_resolution) - 1;//i.e. 0x0000007F
Mantissa = 0; Mantissa = 0;
Exponent = 0; Exponent = 0;
for (cnt = 0; cnt < 32; cnt++) { for (cnt = 0; cnt < 32; cnt++) {
if ((bit_seach_mask[cnt] & x) != 0) { if ((bit_seach_mask[cnt] & x) != 0) {
Exponent = bit_seach_res[cnt]; Exponent = bit_seach_res[cnt];
Mantissa = x & (~bit_seach_mask[cnt]); Mantissa = x & (~bit_seach_mask[cnt]);
break; break;
} }
} }
shift_right = Exponent - tbl_resolution; shift_right = Exponent - tbl_resolution;
Mantissa = (Mantissa >> shift_right) & tbl_addr_mask; Mantissa = (Mantissa >> shift_right) & tbl_addr_mask;
dB_power = dB_fix_x10_tbl[Mantissa] + Exponent * 30u; dB_power = dB_fix_x10_tbl[Mantissa] + Exponent * 30u;
} }
return dB_power; return dB_power;
} }
int16_t dB_fixed_times10(uint32_t x) int16_t dB_fixed_times10(uint32_t x)
......
...@@ -68,86 +68,39 @@ int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_en ...@@ -68,86 +68,39 @@ int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_en
} }
#endif #endif
//int32_t signal_energy(int32_t *input,uint32_t length)
//{
//
// int32_t i;
// int32_t temp,temp2;
// register __m64 mm0,mm1,mm2,mm3;
// __m64 *in = (__m64 *)input;
//
//
// mm0 = _mm_setzero_si64();//pxor(mm0,mm0);
// mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
//
// for (i=0; i<length>>1; i++) {
//
// mm1 = in[i];
// mm2 = mm1;
// mm1 = _m_pmaddwd(mm1,mm1);
// mm1 = _m_psradi(mm1,shift);// shift any 32 bits blocs of the word by the value shift
// mm0 = _m_paddd(mm0,mm1);// add the two 64 bits words 4 bytes by 4 bytes
// // mm2 = _m_psrawi(mm2,shift_DC);
// mm3 = _m_paddw(mm3,mm2);// add the two 64 bits words 2 bytes by 2 bytes
// }
//
// mm1 = mm0;
// mm0 = _m_psrlqi(mm0,32);
// mm0 = _m_paddd(mm0,mm1);
// temp = _m_to_int(mm0);
// temp/=length;
// temp<<=shift; // this is the average of x^2
//
// // now remove the DC component
//
//
// mm2 = _m_psrlqi(mm3,32);
// mm2 = _m_paddw(mm2,mm3);
// mm2 = _m_pmaddwd(mm2,mm2);
// temp2 = _m_to_int(mm2);
// temp2/=(length*length);
// // temp2<<=(2*shift_DC);
// temp -= temp2;
//
// _mm_empty();
// _m_empty();
//
// return((temp>0)?temp:1);
//----------------------------------------------------------------- //-----------------------------------------------------------------
// Average Power calculation with DC removing // Average Power calculation with DC removing
//----------------------------------------------------------------- //-----------------------------------------------------------------
int32_t signal_energy(int32_t *input,uint32_t length) int32_t signal_energy(int32_t *input,uint32_t length)
{ {
uint32_t i; uint32_t i;
int32_t temp; int32_t temp;
__m128i in, in_clp, i16_min, coe1; __m128i in, in_clp, i16_min, coe1;
__m128 num0, num1, num2, num3, recp1; __m128 num0, num1, num2, num3, recp1;
//init //init
num0 = _mm_setzero_ps(); num0 = _mm_setzero_ps();
num1 = _mm_setzero_ps(); num1 = _mm_setzero_ps();
i16_min = _mm_set1_epi16(SHRT_MIN); i16_min = _mm_set1_epi16(SHRT_MIN);
coe1 = _mm_set1_epi16(1); coe1 = _mm_set1_epi16(1);
recp1 = _mm_rcp_ps(_mm_cvtepi32_ps(_mm_set1_epi32(length))); recp1 = _mm_rcp_ps(_mm_cvtepi32_ps(_mm_set1_epi32(length)));
//Acc //Acc
for (i = 0; i < (length >> 2); i++) { for (i = 0; i < (length >> 2); i++) {
in = _mm_loadu_si128((__m128i *)input); in = _mm_loadu_si128((__m128i *)input);
in_clp = _mm_subs_epi16(in, _mm_cmpeq_epi16(in, i16_min));//if in=SHRT_MIN in+1, else in in_clp = _mm_subs_epi16(in, _mm_cmpeq_epi16(in, i16_min));//if in=SHRT_MIN in+1, else in
num0 = _mm_add_ps(num0, _mm_cvtepi32_ps(_mm_madd_epi16(in_clp, in_clp))); num0 = _mm_add_ps(num0, _mm_cvtepi32_ps(_mm_madd_epi16(in_clp, in_clp)));
num1 = _mm_add_ps(num1, _mm_cvtepi32_ps(_mm_madd_epi16(in, coe1)));//DC num1 = _mm_add_ps(num1, _mm_cvtepi32_ps(_mm_madd_epi16(in, coe1)));//DC
input += 4; input += 4;
} }
//Ave //Ave
num2 = _mm_dp_ps(num0, recp1, 0xFF);//AC power num2 = _mm_dp_ps(num0, recp1, 0xFF);//AC power
num3 = _mm_dp_ps(num1, recp1, 0xFF);//DC num3 = _mm_dp_ps(num1, recp1, 0xFF);//DC
num3 = _mm_mul_ps(num3, num3); //DC power num3 = _mm_mul_ps(num3, num3); //DC power
//remove DC //remove DC
temp = _mm_cvtsi128_si32(_mm_cvttps_epi32(_mm_sub_ps(num2, num3))); temp = _mm_cvtsi128_si32(_mm_cvttps_epi32(_mm_sub_ps(num2, num3)));
return temp;
return temp;
} }
int32_t signal_energy_amp_shift(int32_t *input,uint32_t length) int32_t signal_energy_amp_shift(int32_t *input,uint32_t length)
...@@ -198,64 +151,6 @@ int32_t signal_energy_amp_shift(int32_t *input,uint32_t length) ...@@ -198,64 +151,6 @@ int32_t signal_energy_amp_shift(int32_t *input,uint32_t length)
int32_t signal_energy_nodc(int32_t *input,uint32_t length) int32_t signal_energy_nodc(int32_t *input,uint32_t length)
{ {
// int32_t i;
// int32_t temp;
// register __m64 mm0,mm1;//,mm2,mm3;
// __m64 *in = (__m64 *)input;
//
//#ifdef MAIN
// int16_t *printb;
//#endif
//
// mm0 = _mm_setzero_si64();//_pxor(mm0,mm0);
// // mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
//
// for (i=0; i<length>>1; i++) {
//
// mm1 = in[i];
// mm1 = _m_pmaddwd(mm1,mm1);// SIMD complex multiplication
// mm1 = _m_psradi(mm1,shift);
// mm0 = _m_paddd(mm0,mm1);
// // temp2 = mm0;
// // printf("%d %d\n",((int *)&in[i])[0],((int *)&in[i])[1]);
//
//
// // printb = (int16_t *)&mm2;
// // printf("mm2 %d : %d %d %d %d\n",i,printb[0],printb[1],printb[2],printb[3]);
//
//
// }
//
// /*
// #ifdef MAIN
// printb = (int16_t *)&mm3;
// printf("%d %d %d %d\n",printb[0],printb[1],printb[2],printb[3]);
// #endif
// */
// mm1 = mm0;
//
// mm0 = _m_psrlqi(mm0,32);
//
// mm0 = _m_paddd(mm0,mm1);
//
// temp = _m_to_int(mm0);
//
// temp/=length;
// temp<<=shift; // this is the average of x^2
//
//#ifdef MAIN
// printf("E x^2 = %d\n",temp);
//#endif
// _mm_empty();
// _m_empty();
//
//
//
// return((temp>0)?temp:1);
int32_t i; int32_t i;
int32_t temp; int32_t temp;
...@@ -266,9 +161,9 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length) ...@@ -266,9 +161,9 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length)
mm0 = _mm_setzero_ps(); mm0 = _mm_setzero_ps();
//Acc //Acc
for (i=0; i<(length>>2); i++) { for (i=0; i<(length>>2); i++) {
in = _mm_loadu_si128((__m128i *)input); in = _mm_loadu_si128((__m128i *)input);
mm0 = _mm_add_ps(mm0,_mm_cvtepi32_ps(_mm_madd_epi16(in,in))); mm0 = _mm_add_ps(mm0,_mm_cvtepi32_ps(_mm_madd_epi16(in,in)));
input += 4; input += 4;
} }
//Ave //Ave
temp = (int)((((float*)&mm0)[0] + temp = (int)((((float*)&mm0)[0] +
...@@ -277,8 +172,6 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length) ...@@ -277,8 +172,6 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length)
((float*)&mm0)[3])/(float)length); ((float*)&mm0)[3])/(float)length);
return temp; return temp;
} }
#elif defined(__arm__) #elif defined(__arm__)
...@@ -429,62 +322,62 @@ main(int argc,char **argv) ...@@ -429,62 +322,62 @@ main(int argc,char **argv)
int32_t signal_power(int32_t *input, uint32_t length) int32_t signal_power(int32_t *input, uint32_t length)
{ {
uint32_t i; uint32_t i;
int32_t temp; int32_t temp;
__m128i in, in_clp, i16_min; __m128i in, in_clp, i16_min;
__m128 num0, num1; __m128 num0, num1;
__m128 recp1; __m128 recp1;
//init //init
num0 = _mm_setzero_ps(); num0 = _mm_setzero_ps();
i16_min = _mm_set1_epi16(SHRT_MIN); i16_min = _mm_set1_epi16(SHRT_MIN);
recp1 = _mm_rcp_ps(_mm_cvtepi32_ps(_mm_set1_epi32(length))); recp1 = _mm_rcp_ps(_mm_cvtepi32_ps(_mm_set1_epi32(length)));
//Acc //Acc
for (i = 0; i < (length >> 2); i++) { for (i = 0; i < (length >> 2); i++) {
in = _mm_loadu_si128((__m128i *)input); in = _mm_loadu_si128((__m128i *)input);
in_clp = _mm_subs_epi16(in, _mm_cmpeq_epi16(in, i16_min));//if in=SHRT_MIN in+1, else in in_clp = _mm_subs_epi16(in, _mm_cmpeq_epi16(in, i16_min));//if in=SHRT_MIN in+1, else in
num0 = _mm_add_ps(num0, _mm_cvtepi32_ps(_mm_madd_epi16(in_clp, in_clp))); num0 = _mm_add_ps(num0, _mm_cvtepi32_ps(_mm_madd_epi16(in_clp, in_clp)));
input += 4; input += 4;
} }
//Ave //Ave
num1 = _mm_dp_ps(num0, recp1, 0xFF); num1 = _mm_dp_ps(num0, recp1, 0xFF);
temp = _mm_cvtsi128_si32(_mm_cvttps_epi32(num1)); temp = _mm_cvtsi128_si32(_mm_cvttps_epi32(num1));
return temp; return temp;
} }
int32_t interference_power(int32_t *input, uint32_t length) int32_t interference_power(int32_t *input, uint32_t length)
{ {
uint32_t i; uint32_t i;
int32_t temp; int32_t temp;
__m128i in, in_clp, i16_min; __m128i in, in_clp, i16_min;
__m128i num0, num1, num2, num3; __m128i num0, num1, num2, num3;
__m128 num4, num5, num6; __m128 num4, num5, num6;
__m128 recp1; __m128 recp1;
//init //init
i16_min = _mm_set1_epi16(SHRT_MIN); i16_min = _mm_set1_epi16(SHRT_MIN);
num5 = _mm_setzero_ps(); num5 = _mm_setzero_ps();
recp1 = _mm_rcp_ps(_mm_cvtepi32_ps(_mm_set1_epi32(length>>2)));// 1/n, n= length/4 recp1 = _mm_rcp_ps(_mm_cvtepi32_ps(_mm_set1_epi32(length>>2)));// 1/n, n= length/4
//Acc //Acc
for (i = 0; i < (length >> 2); i++) { for (i = 0; i < (length >> 2); i++) {
in = _mm_loadu_si128((__m128i *)input); in = _mm_loadu_si128((__m128i *)input);
in_clp = _mm_subs_epi16(in, _mm_cmpeq_epi16(in, i16_min)); //if in=SHRT_MIN, in+1, else in in_clp = _mm_subs_epi16(in, _mm_cmpeq_epi16(in, i16_min)); //if in=SHRT_MIN, in+1, else in
num0 = _mm_cvtepi16_epi32(in_clp); //lower 2 complex [0], [1] num0 = _mm_cvtepi16_epi32(in_clp); //lower 2 complex [0], [1]
num1 = _mm_cvtepi16_epi32(_mm_shuffle_epi32(in_clp, 0x4E)); //upper 2 complex [2], [3] num1 = _mm_cvtepi16_epi32(_mm_shuffle_epi32(in_clp, 0x4E)); //upper 2 complex [2], [3]
num2 = _mm_srai_epi32(_mm_add_epi32(num0, num1), 0x01); //average A=complex( [0] + [2] ) / 2, B=complex( [1] + [3] ) / 2 num2 = _mm_srai_epi32(_mm_add_epi32(num0, num1), 0x01); //average A=complex( [0] + [2] ) / 2, B=complex( [1] + [3] ) / 2
num3 = _mm_sub_epi32(num2, _mm_shuffle_epi32(num2, 0x4E)); //complexA-complexB, B-A num3 = _mm_sub_epi32(num2, _mm_shuffle_epi32(num2, 0x4E)); //complexA-complexB, B-A
num4 = _mm_dp_ps(_mm_cvtepi32_ps(num3), _mm_cvtepi32_ps(num3), 0x3F);//C = num3 lower complex power, C, C, C num4 = _mm_dp_ps(_mm_cvtepi32_ps(num3), _mm_cvtepi32_ps(num3), 0x3F);//C = num3 lower complex power, C, C, C
num5 = _mm_add_ps(num5, num4); //Acc Cn, Cn, Cn, Cn, num5 = _mm_add_ps(num5, num4); //Acc Cn, Cn, Cn, Cn,
input += 4; input += 4;
} }
//Interference ve //Interference ve
num6 = _mm_mul_ps(num5, recp1); //Cn / n num6 = _mm_mul_ps(num5, recp1); //Cn / n
temp = _mm_cvtsi128_si32(_mm_cvttps_epi32(num6)); temp = _mm_cvtsi128_si32(_mm_cvttps_epi32(num6));
return temp; return temp;
} }
...@@ -1008,16 +1008,15 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) { ...@@ -1008,16 +1008,15 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
UL_req->ul_config_request_body.number_of_pdus=0; UL_req->ul_config_request_body.number_of_pdus=0;
number_ul_pdu=0; number_ul_pdu=0;
}else if (RC.mac[Mod_id]->scheduler_mode == SCHED_MODE_FAIR_RR) { }else if (RC.mac[Mod_id]->scheduler_mode == SCHED_MODE_FAIR_RR) {
if(ulsch_pdu_num <= RC.rrc[Mod_id]->configuration.radioresourceconfig[CC_id].ue_multiple_max){ if(ulsch_pdu_num <= RC.rrc[Mod_id]->configuration.radioresourceconfig[CC_id].ue_multiple_max){
//LOG_D(PHY, "UL_CONFIG to send to PNF\n"); UL_req->sfn_sf = frame << 4 | subframe;
UL_req->sfn_sf = frame << 4 | subframe; oai_nfapi_ul_config_req(UL_req);
oai_nfapi_ul_config_req(UL_req); UL_req->ul_config_request_body.number_of_pdus=0;
UL_req->ul_config_request_body.number_of_pdus=0; number_ul_pdu=0;
number_ul_pdu=0; }else{
}else{ LOG_E(MAC,"NFAPI: frame %d subframe %d ul_req num %d ul pdu %d\n",
LOG_E(MAC,"NFAPI: frame %d subframe %d ul_req num %d ul pdu %d\n", frame,subframe,number_ul_pdu,ulsch_pdu_num);
frame,subframe,number_ul_pdu,ulsch_pdu_num); }
}
} }
} }
} else { } else {
......
This diff is collapsed.
...@@ -212,13 +212,6 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP, ...@@ -212,13 +212,6 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP, subframeP, sf_ahead_dl); hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP, subframeP, sf_ahead_dl);
hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
//if (NFAPI_MODE != NFAPI_MONOLITHIC) {
// oai_nfapi_hi_dci0_req(hi_dci0_req);
// hi_dci0_req_body->number_of_hi=0;
//}
//LOG_D(MAC, "MSG3: HI_DCI0 SFN/SF:%d number_of_dci:%d number_of_hi:%d\n", NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req_body->number_of_dci, hi_dci0_req_body->number_of_hi);
// save UL scheduling information for preprocessor // save UL scheduling information for preprocessor
for (j = 0; j < ra->msg3_nb_rb; j++) for (j = 0; j < ra->msg3_nb_rb; j++)
cc->vrb_map_UL[ra->msg3_first_rb + j] = 1; cc->vrb_map_UL[ra->msg3_first_rb + j] = 1;
......
...@@ -202,7 +202,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -202,7 +202,7 @@ rx_sdu(const module_id_t enb_mod_idP,
} }
} else { // sduP == NULL => error } else { // sduP == NULL => error
UE_scheduling_control->pusch_rx_error_num[CC_idP]++; UE_scheduling_control->pusch_rx_error_num[CC_idP]++;
LOG_D(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d, UE_id %d, RNTI %x (len %d)\n", LOG_W(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d, UE_id %d, RNTI %x (len %d)\n",
enb_mod_idP, enb_mod_idP,
harq_pid, harq_pid,
CC_idP, CC_idP,
...@@ -1656,11 +1656,9 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1656,11 +1656,9 @@ schedule_ulsch_rnti(module_id_t module_idP,
UE_template_ptr->cshift[harq_pid] = cshift; UE_template_ptr->cshift[harq_pid] = cshift;
/* Setting DCI0 NFAPI struct */ /* Setting DCI0 NFAPI struct */
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[dci_ul_pdu_idx]; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[dci_ul_pdu_idx];
//memset((void *) hi_dci0_pdu, 0,sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu); hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu);
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0;
//hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = UE_template_ptr->pre_first_nb_rb_ul; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = UE_template_ptr->pre_first_nb_rb_ul;
......
...@@ -6711,25 +6711,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -6711,25 +6711,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
); );
} }
} else { // remove LCHAN from MAC/PHY } else { // remove LCHAN from MAC/PHY
#if 0 if (DRB_configList->list.array[i]->logicalChannelIdentity) {
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) {
// DRB has just been removed so remove RLC + PDCP for DRB
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
*/
if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
rrc_rlc_config_req(ctxt_pP,
SRB_FLAG_NO,
MBMS_FLAG_NO,
CONFIG_ACTION_REMOVE,
DRB2LCHAN[i],
Rlc_info_um);
}
}
ue_context_pP->ue_context.DRB_active[drb_id] = 0;
#endif
if (DRB_configList->list.array[i]->logicalChannelIdentity) {
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity; DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
} }
......
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