fix more trivial cppcheck errors and warnings
This commit is contained in:
@@ -164,9 +164,10 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
*/
|
||||
int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
int unknowndetected=0;
|
||||
char testprefix[CONFIG_MAXOPTLENGTH]="";
|
||||
char testprefix[CONFIG_MAXOPTLENGTH];
|
||||
int finalcheck = 0;
|
||||
|
||||
memset(testpref,0,sizeof(testprefix));
|
||||
if (prefix != NULL) {
|
||||
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
|
||||
finalcheck = 1;
|
||||
|
||||
@@ -270,6 +270,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_re
|
||||
for(int i = 0; i < resp->pnf_phy.number_of_phys; ++i)
|
||||
{
|
||||
phy_info phy;
|
||||
memset(phy,0,sizeof(phy));
|
||||
phy.index = resp->pnf_phy.phy[i].phy_config_index;
|
||||
|
||||
printf("[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
|
||||
@@ -287,6 +288,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_param_re
|
||||
|
||||
for(int i = 0; i < resp->pnf_rf.number_of_rfs; ++i) {
|
||||
rf_info rf;
|
||||
memset(rf,0,sizeof(rf));
|
||||
rf.index = resp->pnf_rf.rf[i].rf_config_index;
|
||||
|
||||
printf("[VNF] (RF:%d) rf_config_idx:%d\n", i, resp->pnf_rf.rf[i].rf_config_index);
|
||||
@@ -897,7 +899,7 @@ int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t
|
||||
|
||||
// for now just 1
|
||||
|
||||
printf("[VNF] %d.%d pnf p7 %s:%d timing %d %d %d %d\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled, p7_vnf->periodic_timing_period);
|
||||
printf("[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled, p7_vnf->periodic_timing_period);
|
||||
|
||||
req->header.message_id = NFAPI_CONFIG_REQUEST;
|
||||
req->header.phy_id = phy->id;
|
||||
@@ -919,7 +921,7 @@ int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t
|
||||
|
||||
req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
|
||||
req->nfapi_config.timing_window.value = p7_vnf->timing_window;
|
||||
printf("[VNF] Timing window:%d\n", p7_vnf->timing_window);
|
||||
printf("[VNF] Timing window:%u\n", p7_vnf->timing_window);
|
||||
req->num_tlv++;
|
||||
|
||||
if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) {
|
||||
|
||||
+118
-180
@@ -26,9 +26,9 @@
|
||||
date: 09.2012
|
||||
*/
|
||||
#ifndef TC_MAIN
|
||||
#include "coding_defs.h"
|
||||
#include "coding_defs.h"
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -66,11 +66,11 @@ struct treillis {
|
||||
union {
|
||||
uint8x8_t systematic_andp1_64[3];
|
||||
char systematic_andp1_8[24];
|
||||
}__attribute__((aligned(64)));
|
||||
} __attribute__((aligned(64)));
|
||||
union {
|
||||
uint8x8_t parity2_64[3];
|
||||
char parity2_8[24];
|
||||
}__attribute__((aligned(64)));
|
||||
} __attribute__((aligned(64)));
|
||||
int exit_state;
|
||||
};
|
||||
#endif
|
||||
@@ -79,23 +79,20 @@ struct treillis all_treillis[8][256];
|
||||
|
||||
int all_treillis_initialized=0;
|
||||
|
||||
static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state)
|
||||
{
|
||||
static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state) {
|
||||
unsigned char output;
|
||||
output = (input ^ (*state>>2) ^ (*state>>1))&1;
|
||||
*state = (((input<<2)^(*state>>1))^((*state>>1)<<2)^((*state)<<2))&7;
|
||||
return(output);
|
||||
}
|
||||
|
||||
static inline void threegpplte_rsc_termination(unsigned char *x,unsigned char *z,unsigned char *state)
|
||||
{
|
||||
static inline void threegpplte_rsc_termination(unsigned char *x,unsigned char *z,unsigned char *state) {
|
||||
*z = ((*state>>2) ^ (*state)) &1;
|
||||
*x = ((*state) ^ (*state>>1)) &1;
|
||||
*state = (*state)>>1;
|
||||
}
|
||||
|
||||
static void treillis_table_init(void)
|
||||
{
|
||||
static void treillis_table_init(void) {
|
||||
//struct treillis t[][]=all_treillis;
|
||||
//t=memalign(16,sizeof(struct treillis)*8*256);
|
||||
int i, j,b;
|
||||
@@ -114,8 +111,8 @@ static void treillis_table_init(void)
|
||||
all_treillis[i][j].systematic_andp1_8[b*3]= (j&(1<<(7-b)))>>(7-b);
|
||||
v=threegpplte_rsc( all_treillis[i][j].systematic_andp1_8[b*3] ,
|
||||
¤t_state);
|
||||
all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1
|
||||
// all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1
|
||||
// all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].parity2_8[b*3+2]=v; // for the yparity2
|
||||
}
|
||||
|
||||
@@ -128,14 +125,12 @@ static void treillis_table_init(void)
|
||||
}
|
||||
|
||||
|
||||
char interleave_compact_byte(short * base_interleaver,unsigned char * input, unsigned char * output, int n)
|
||||
{
|
||||
|
||||
char interleave_compact_byte(short *base_interleaver,unsigned char *input, unsigned char *output, int n) {
|
||||
char expandInput[768*8] __attribute__((aligned(32)));
|
||||
int i,loop=n>>4;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i *i_128=(__m128i *)input, *o_128=(__m128i*)expandInput;
|
||||
__m128i *i_128=(__m128i *)input, *o_128=(__m128i *)expandInput;
|
||||
__m128i tmp1, tmp2, tmp3, tmp4;
|
||||
__m128i BIT_MASK = _mm_set_epi8( 0b00000001,
|
||||
0b00000010,
|
||||
@@ -153,42 +148,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
|
||||
#else
|
||||
__m256i *i_256=(__m256i *)input, *o_256=(__m256i*)expandInput;
|
||||
__m256i *i_256=(__m256i *)input, *o_256=(__m256i *)expandInput;
|
||||
__m256i tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||
__m256i BIT_MASK = _mm256_set_epi8( 0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
uint8x16_t *i_128=(uint8x16_t *)input, *o_128=(uint8x16_t *)expandInput;
|
||||
@@ -196,40 +190,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
uint16x8_t tmp3;
|
||||
uint32x4_t tmp4;
|
||||
uint8x16_t and_tmp;
|
||||
uint8x16_t BIT_MASK = { 0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001,
|
||||
0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001};
|
||||
uint8x16_t BIT_MASK = { 0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001,
|
||||
0b10000000,
|
||||
0b01000000,
|
||||
0b00100000,
|
||||
0b00010000,
|
||||
0b00001000,
|
||||
0b00000100,
|
||||
0b00000010,
|
||||
0b00000001
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __AVX2__
|
||||
|
||||
if ((n&15) > 0)
|
||||
loop++;
|
||||
|
||||
#else
|
||||
loop=n>>5;
|
||||
|
||||
if ((n&31) > 0)
|
||||
loop++;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
for (i=0; i<loop ; i++ ) {
|
||||
// int cur_byte=i<<3;
|
||||
// for (b=0;b<8;b++)
|
||||
// expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b);
|
||||
|
||||
// int cur_byte=i<<3;
|
||||
// for (b=0;b<8;b++)
|
||||
// expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b);
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
tmp1=_mm_load_si128(i_128++); // tmp1 = B0,B1,...,B15
|
||||
@@ -237,29 +232,22 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp2=_mm_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8,B8,B9,B9,...,B15,B15
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B8,B8,B8,B9,B9,B9,B9,B10,B10,B10,B10,B11,B11,B11,B11
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B8,B8,B8,B8,B8,B8,B8,B8,B9,B9,B9,B9,B9,B9,B9,B9
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B10,B10,B10,B10,B10,B10,B10,B10,B11,B11,B11,B11,B11,B11,B11,B11
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12,B12,B12,B12,B13,B13,B13,B13,B14,B14,B14,B14,B15,B15,B15,B15
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12,B12,B12,B12,B12,B12,B12,B12,B13,B13,B13,B13,B13,B13,B13,B13
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B14,B14,B14,B14,B14,B14,B14,B14,B15,B15,B15,B15,B15,B15,B15,B15
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
#else
|
||||
@@ -281,7 +269,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)o_256);
|
||||
o_256[4]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7,B20,B20,B20,B20,...,B23,B23,B23,B23
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5,B20,B20...,B21..,B21
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7,B22...,B22,B23,...,B23
|
||||
@@ -297,7 +284,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)(o_256+1));
|
||||
o_256[5]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp2=_mm256_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8 B9 B10 B11 B12 B13 B14 B15 B25 B26 B27 B28 B29 B30 B31
|
||||
tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B9,B10,B11,B26,B27,B28,B29
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B8,B9,B26,B27
|
||||
@@ -314,11 +300,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)(o_256+2));
|
||||
o_256[6]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12 B13 B14 B15 B28 B29 B30 B31
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12 B13 B28 B29
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15
|
||||
tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B28 B29 B30 B31
|
||||
//print_bytes2("tmp2",(uint8_t*)&tmp2);
|
||||
//print_bytes2("tmp3",(uint8_t*)&tmp3);
|
||||
@@ -330,48 +315,35 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
//print_bytes2("out",(uint8_t*)(o_256+3));
|
||||
o_256[7]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+7));
|
||||
|
||||
o_256+=8;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
tmp1=vld1q_u8((uint8_t*)i_128);
|
||||
tmp1=vld1q_u8((uint8_t *)i_128);
|
||||
//print_bytes("tmp1:",(uint8_t*)&tmp1);
|
||||
|
||||
uint8x16x2_t temp1 = vzipq_u8(tmp1,tmp1);
|
||||
tmp2 = temp1.val[0];
|
||||
|
||||
uint16x8x2_t temp2 = vzipq_u16((uint16x8_t)tmp2,(uint16x8_t)tmp2);
|
||||
tmp3 = temp2.val[0];
|
||||
|
||||
uint32x4x2_t temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //1
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //2
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp3 = temp2.val[1];
|
||||
temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //3
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //4
|
||||
//and_tmp = vandq_u8((uint8x16_t)tmp4,BIT_MASK); print_bytes("and:",and_tmp);
|
||||
//and_tmp = vandq_u8((uint8x16_t)tmp4,BIT_MASK); print_bytes("and:",and_tmp);
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
|
||||
temp1 = vzipq_u8(tmp1,tmp1);
|
||||
tmp2 = temp1.val[1];
|
||||
temp2 = vzipq_u16((uint16x8_t)tmp2,(uint16x8_t)tmp2);
|
||||
@@ -379,52 +351,41 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //5
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //6
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
|
||||
temp2 = vzipq_u16((uint16x8_t)tmp2,(uint16x8_t)tmp2);
|
||||
tmp3 = temp2.val[1];
|
||||
temp3 = vzipq_u32((uint32x4_t)tmp3,(uint32x4_t)tmp3);
|
||||
tmp4 = temp3.val[0];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //7
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
tmp4 = temp3.val[1];
|
||||
//print_bytes("tmp4:",(uint8_t*)&tmp4);
|
||||
|
||||
*o_128++=vceqq_u8(vandq_u8((uint8x16_t)tmp4,BIT_MASK),BIT_MASK); //7
|
||||
//print_bytes("o:",(uint8_t*)(o_128-1));
|
||||
|
||||
i_128++;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
short * ptr_intl=base_interleaver;
|
||||
short *ptr_intl=base_interleaver;
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i tmp;
|
||||
uint16_t *systematic2_ptr=(uint16_t *) output;
|
||||
uint16_t *systematic2_ptr=(uint16_t *) output;
|
||||
#else
|
||||
__m256i tmp;
|
||||
uint32_t *systematic2_ptr=(uint32_t *) output;
|
||||
uint32_t *systematic2_ptr=(uint32_t *) output;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
uint8x16_t tmp;
|
||||
const uint8_t __attribute__ ((aligned (16))) _Powers[16]=
|
||||
{ 1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128 };
|
||||
|
||||
// Set the powers of 2 (do it once for all, if applicable)
|
||||
const uint8_t __attribute__ ((aligned (16))) _Powers[16]=
|
||||
{ 1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128 };
|
||||
// Set the powers of 2 (do it once for all, if applicable)
|
||||
uint8x16_t Powers= vld1q_u8(_Powers);
|
||||
uint8_t *systematic2_ptr=(uint8_t *) output;
|
||||
#endif
|
||||
@@ -435,8 +396,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
#endif
|
||||
|
||||
for ( i=0; i< input_length_words ; i ++ ) {
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7);
|
||||
@@ -465,7 +424,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5);
|
||||
@@ -474,7 +432,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5);
|
||||
@@ -483,7 +440,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5);
|
||||
@@ -492,7 +448,6 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0);
|
||||
|
||||
*systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
@@ -512,11 +467,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,8+2);
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,8+1);
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,8+0);
|
||||
// Compute the mask from the input
|
||||
// Compute the mask from the input
|
||||
uint64x2_t Mask= vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vandq_u8(tmp, Powers))));
|
||||
vst1q_lane_u8(systematic2_ptr++, (uint8x16_t)Mask, 0);
|
||||
vst1q_lane_u8(systematic2_ptr++, (uint8x16_t)Mask, 8);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -537,14 +491,12 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
unsigned short input_length_bytes,
|
||||
unsigned char *output,
|
||||
unsigned char F)
|
||||
{
|
||||
|
||||
unsigned char F) {
|
||||
int i;
|
||||
unsigned char *x;
|
||||
unsigned char state0=0,state1=0;
|
||||
unsigned short input_length_bits = input_length_bytes<<3;
|
||||
short * base_interleaver;
|
||||
short *base_interleaver;
|
||||
|
||||
if ( all_treillis_initialized == 0 ) {
|
||||
treillis_table_init();
|
||||
@@ -560,15 +512,12 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
base_interleaver=il_tb+f1f2mat[i].beg_index;
|
||||
}
|
||||
|
||||
|
||||
unsigned char systematic2[768] __attribute__((aligned(32)));
|
||||
|
||||
interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes);
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m64 *ptr_output=(__m64*) output;
|
||||
__m64 *ptr_output=(__m64 *) output;
|
||||
#elif defined(__arm__)
|
||||
uint8x8_t *ptr_output=(uint8x8_t*)output;
|
||||
uint8x8_t *ptr_output=(uint8x8_t *)output;
|
||||
#endif
|
||||
unsigned char cur_s1, cur_s2;
|
||||
int code_rate;
|
||||
@@ -582,54 +531,45 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
/*
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
|
||||
_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
*/
|
||||
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
*/
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
|
||||
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
#elif defined(__arm__)
|
||||
*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state0][cur_s1].parity2_64[code_rate]);
|
||||
*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state0][cur_s1].parity2_64[code_rate]);
|
||||
#endif
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
x=output+(input_length_bits*3);
|
||||
|
||||
// Trellis termination
|
||||
threegpplte_rsc_termination(&x[0],&x[1],&state0);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state0 %d\n",x[0],x[1],state0);
|
||||
printf("term: x0 %u, x1 %u, state0 %d\n",x[0],x[1],state0);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
|
||||
threegpplte_rsc_termination(&x[2],&x[3],&state0);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state0 %d\n",x[2],x[3],state0);
|
||||
printf("term: x0 %u, x1 %u, state0 %d\n",x[2],x[3],state0);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
|
||||
threegpplte_rsc_termination(&x[4],&x[5],&state0);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state0 %d\n",x[4],x[5],state0);
|
||||
printf("term: x0 %u, x1 %u, state0 %d\n",x[4],x[5],state0);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
|
||||
threegpplte_rsc_termination(&x[6],&x[7],&state1);
|
||||
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state1 %d\n",x[6],x[7],state1);
|
||||
printf("term: x0 %u, x1 %u, state1 %d\n",x[6],x[7],state1);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
threegpplte_rsc_termination(&x[8],&x[9],&state1);
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state1 %d\n",x[8],x[9],state1);
|
||||
printf("term: x0 %u, x1 %u, state1 %d\n",x[8],x[9],state1);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
threegpplte_rsc_termination(&x[10],&x[11],&state1);
|
||||
|
||||
#ifdef DEBUG_TURBO_ENCODER
|
||||
printf("term: x0 %d, x1 %d, state1 %d\n",x[10],x[11],state1);
|
||||
printf("term: x0 %u, x1 %u, state1 %d\n",x[10],x[11],state1);
|
||||
#endif //DEBUG_TURBO_ENCODER
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
@@ -638,32 +578,31 @@ void threegpplte_turbo_encoder_sse(unsigned char *input,
|
||||
}
|
||||
|
||||
void init_encoder_sse (void) {
|
||||
treillis_table_init();
|
||||
treillis_table_init();
|
||||
}
|
||||
/* function which will be called by the shared lib loader, to check shared lib version
|
||||
against main exec version. version mismatch no considered as fatal (interfaces not supposed to change)
|
||||
*/
|
||||
int coding_checkbuildver(char * mainexec_buildversion, char ** shlib_buildversion)
|
||||
{
|
||||
*/
|
||||
int coding_checkbuildver(char *mainexec_buildversion, char **shlib_buildversion) {
|
||||
#ifndef PACKAGE_VERSION
|
||||
#define PACKAGE_VERSION "standalone built: " __DATE__ __TIME__
|
||||
#endif
|
||||
*shlib_buildversion = PACKAGE_VERSION;
|
||||
if (strcmp(mainexec_buildversion, *shlib_buildversion) != 0) {
|
||||
fprintf(stderr,"[CODING] shared lib version %s, doesn't match main version %s, compatibility should be checked\n",
|
||||
mainexec_buildversion,*shlib_buildversion);
|
||||
}
|
||||
return 0;
|
||||
*shlib_buildversion = PACKAGE_VERSION;
|
||||
|
||||
if (strcmp(mainexec_buildversion, *shlib_buildversion) != 0) {
|
||||
fprintf(stderr,"[CODING] shared lib version %s, doesn't match main version %s, compatibility should be checked\n",
|
||||
mainexec_buildversion,*shlib_buildversion);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TC_MAIN
|
||||
#define INPUT_LENGTH 20
|
||||
#define INPUT_LENGTH 20
|
||||
#define F1 21
|
||||
#define F2 120
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
|
||||
int main(int argc,char **argv) {
|
||||
unsigned char input[INPUT_LENGTH+32],state,state2;
|
||||
unsigned char output[12+(3*(INPUT_LENGTH<<3))],x,z;
|
||||
int i;
|
||||
@@ -680,28 +619,27 @@ int main(int argc,char **argv)
|
||||
printf("\n");
|
||||
|
||||
for (state=0; state<8; state++) {
|
||||
|
||||
state2=state;
|
||||
threegpplte_rsc_termination(&x,&z,&state2);
|
||||
printf("Termination: (%d->%d) : (%d,%d)\n",state,state2,x,z);
|
||||
}
|
||||
|
||||
memset((void*)input,0,INPUT_LENGTH+16);
|
||||
memset((void *)input,0,INPUT_LENGTH+16);
|
||||
|
||||
for (i=0; i<INPUT_LENGTH; i++) {
|
||||
input[i] = i*219;
|
||||
printf("Input %d : %d\n",i,input[i]);
|
||||
printf("Input %d : %u\n",i,input[i]);
|
||||
}
|
||||
|
||||
threegpplte_turbo_encoder_sse(&input[0],
|
||||
INPUT_LENGTH,
|
||||
&output[0],
|
||||
0);
|
||||
INPUT_LENGTH,
|
||||
&output[0],
|
||||
0);
|
||||
|
||||
for (i=0; i<12+(INPUT_LENGTH*24); i++)
|
||||
printf("%u",output[i]);
|
||||
|
||||
for (i=0;i<12+(INPUT_LENGTH*24);i++)
|
||||
printf("%d",output[i]);
|
||||
printf("\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -47,27 +47,20 @@ void
|
||||
ccodedot11_encode (unsigned int numbytes,
|
||||
unsigned char *inPtr,
|
||||
unsigned char *outPtr,
|
||||
unsigned char puncturing)
|
||||
{
|
||||
unsigned char puncturing) {
|
||||
unsigned int state;
|
||||
|
||||
unsigned char c, out, shiftbit =0;
|
||||
|
||||
// printf("In ccodedot11_encode (%d,%p,%p,%d)\n",numbytes,inPtr,outPtr,puncturing);
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
unsigned int dummy;
|
||||
#endif //DEBUG_CCODE
|
||||
int bit_index;
|
||||
|
||||
/* The input bit is shifted in position 8 of the state.
|
||||
Shiftbit will take values between 1 and 8 */
|
||||
state = 0;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
dummy = 0;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
/* Do not increment inPtr until we read the next octet */
|
||||
bit_index=0;
|
||||
|
||||
@@ -78,85 +71,75 @@ ccodedot11_encode (unsigned int numbytes,
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
switch (puncturing) {
|
||||
case 0: //rate 1/2
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
case 0: //rate 1/2
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
state >>= 1;
|
||||
|
||||
state >>= 1;
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
out = ccodedot11_table[state];
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%u: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
break;
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
case 1: // rate 3/4
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
|
||||
if (bit_index<2)
|
||||
*outPtr++ = out & 1;
|
||||
|
||||
if (bit_index!=1)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%d: %d -> %d (%d)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
printf("%u: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1: // rate 3/4
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
bit_index=(bit_index==2)?0:(bit_index+1);
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
break;
|
||||
|
||||
if (bit_index<2)
|
||||
case 2: // rate 2/3
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
*outPtr++ = out & 1;
|
||||
|
||||
if (bit_index!=1)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
if (bit_index==0)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%d: %d -> %d (%d)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
printf("%d: %u -> %d (%u)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
bit_index=(bit_index==2)?0:(bit_index+1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: // rate 2/3
|
||||
for (shiftbit = 0; shiftbit<8; shiftbit++) {
|
||||
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
bit_index=(bit_index==0)?1:0;
|
||||
}
|
||||
|
||||
out = ccodedot11_table[state];
|
||||
break;
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
|
||||
if (bit_index==0)
|
||||
*outPtr++ = (out>>1)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("%d: %d -> %d (%d)\n",dummy,state,out,ccodedot11_table[state]);
|
||||
dummy+=2;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
bit_index=(bit_index==0)?1:0;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,8 +164,6 @@ ccodedot11_encode (unsigned int numbytes,
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -197,8 +178,7 @@ ccodedot11_encode (unsigned int numbytes,
|
||||
/* Basic code table initialization for constraint length 7 */
|
||||
/* Input in MSB, followed by state in 6 LSBs */
|
||||
|
||||
void ccodedot11_init(void)
|
||||
{
|
||||
void ccodedot11_init(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -219,8 +199,7 @@ void ccodedot11_init(void)
|
||||
}
|
||||
|
||||
/* Input in LSB, followed by state in 6 MSBs */
|
||||
void ccodedot11_init_inv(void)
|
||||
{
|
||||
void ccodedot11_init_inv(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -251,21 +230,15 @@ void ccodedot11_init_inv(void)
|
||||
#ifdef DEBUG_CCODE
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
unsigned char test[] = "0Thebigredfox";
|
||||
unsigned char output[512], *inPtr, *outPtr;
|
||||
unsigned int i;
|
||||
|
||||
test[0] = 128;
|
||||
test[1] = 0;
|
||||
|
||||
|
||||
ccodedot11_init();
|
||||
|
||||
inPtr = test;
|
||||
outPtr = output;
|
||||
|
||||
ccodedot11_encode(16, inPtr, outPtr,0);
|
||||
|
||||
for (i = 0; i < 32; i++) printf("%x ", output[i]);
|
||||
|
||||
@@ -52,20 +52,16 @@ ccodelte_encode (int32_t numbits,
|
||||
uint8_t add_crc,
|
||||
uint8_t *inPtr,
|
||||
uint8_t *outPtr,
|
||||
uint16_t rnti)
|
||||
{
|
||||
uint16_t rnti) {
|
||||
uint32_t state;
|
||||
|
||||
uint8_t c, out, first_bit;
|
||||
int8_t shiftbit=0;
|
||||
uint16_t c16;
|
||||
uint16_t next_last_byte=0;
|
||||
uint32_t crc=0;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
uint32_t dummy=0;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
/* The input bit is shifted in position 8 of the state.
|
||||
Shiftbit will take values between 1 and 8 */
|
||||
state = 0;
|
||||
@@ -137,17 +133,12 @@ ccodelte_encode (int32_t numbits,
|
||||
#endif //DEBUG_CCODE
|
||||
/* Do not increment inPtr until we read the next octet */
|
||||
|
||||
|
||||
|
||||
|
||||
while (numbits > 0) {
|
||||
|
||||
c = *inPtr++;
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("** %x **\n",c);
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
|
||||
// for (shiftbit = 0; (shiftbit<8) && (numbits>0);shiftbit++,numbits--) {
|
||||
for (shiftbit = 7; (shiftbit>=0) && (numbits>0); shiftbit--,numbits--) {
|
||||
state >>= 1;
|
||||
@@ -157,23 +148,18 @@ ccodelte_encode (int32_t numbits,
|
||||
}
|
||||
|
||||
out = ccodelte_table[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("numbits %d, input %d, outbit %d: %d -> %d (%d%d%d)\n",numbits,state>>6,dummy,state,out,out&1,(out>>1)&1,(out>>2)&1);
|
||||
dummy+=3;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// now code 8-bit CRC for UCI
|
||||
if (add_crc == 1) {
|
||||
|
||||
c = (uint8_t)(crc>>24);
|
||||
|
||||
// for (shiftbit = 0; (shiftbit<8);shiftbit++) {
|
||||
@@ -185,22 +171,18 @@ ccodelte_encode (int32_t numbits,
|
||||
}
|
||||
|
||||
out = ccodelte_table[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%d)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%u)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
dummy+=3;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// now code 16-bit CRC for DCI
|
||||
if (add_crc == 2) {
|
||||
|
||||
c16 = (uint16_t)(crc>>16);
|
||||
|
||||
// for (shiftbit = 0; (shiftbit<16);shiftbit++) {
|
||||
@@ -212,16 +194,13 @@ ccodelte_encode (int32_t numbits,
|
||||
}
|
||||
|
||||
out = ccodelte_table[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
|
||||
#ifdef DEBUG_CCODE
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%d)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
printf("crc bit %d input %d, outbit %d: %d -> %d (%u)\n",shiftbit,state>>6,dummy,state,out,ccodelte_table[state]);
|
||||
dummy+=3;
|
||||
#endif //DEBUG_CCODE
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,8 +217,7 @@ ccodelte_encode (int32_t numbits,
|
||||
/* Basic code table initialization for constraint length 7 */
|
||||
/* Input in MSB, followed by state in 6 LSBs */
|
||||
|
||||
void ccodelte_init(void)
|
||||
{
|
||||
void ccodelte_init(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -260,8 +238,7 @@ void ccodelte_init(void)
|
||||
}
|
||||
|
||||
/* Input in LSB, followed by state in 6 MSBs */
|
||||
void ccodelte_init_inv(void)
|
||||
{
|
||||
void ccodelte_init_inv(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -281,8 +258,7 @@ void ccodelte_init_inv(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ccodedab_init(void)
|
||||
{
|
||||
void ccodedab_init(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -303,8 +279,7 @@ void ccodedab_init(void)
|
||||
}
|
||||
|
||||
/* Input in LSB, followed by state in 6 MSBs */
|
||||
void ccodedab_init_inv(void)
|
||||
{
|
||||
void ccodedab_init_inv(void) {
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -334,21 +309,15 @@ void ccodedab_init_inv(void)
|
||||
#ifdef CCODE_MAIN
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
unsigned char test[] = "Thebigredfox";
|
||||
unsigned char output[512], *inPtr, *outPtr;
|
||||
unsigned int i;
|
||||
|
||||
test[0] = 128;
|
||||
test[1] = 0;
|
||||
|
||||
|
||||
ccodelte_init();
|
||||
|
||||
inPtr = test;
|
||||
outPtr = output;
|
||||
|
||||
ccodelte_encode(21, inPtr, outPtr);
|
||||
|
||||
for (i = 0; i < 21*3; i++) printf("%x ", output[i]);
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
date: 21.10.2009
|
||||
*/
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common.h"
|
||||
@@ -42,9 +42,7 @@ static uint32_t bitrev_cc[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16
|
||||
//#define RM_DEBUG2 1
|
||||
//#define RM_DEBUG_CC 1
|
||||
|
||||
uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w) {
|
||||
uint32_t RTC = (D>>5), ND, ND3;
|
||||
uint32_t row,col,Kpi;
|
||||
uint32_t index3,k,k2;
|
||||
@@ -64,7 +62,6 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
printf("RTC = %d, Kpi=%d, ND=%d\n",RTC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
d[(3*D)+2] = d[2];
|
||||
k=0;
|
||||
@@ -80,12 +77,9 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
index3 = bitrev_x3[col];//3*index;
|
||||
|
||||
for (row=0; row<RTC; row++) {
|
||||
|
||||
w[k] = d1[index3];//d[index3-ND3];
|
||||
w[Kpi+k2] = d2[index3];//d[index3-ND3+1];
|
||||
w[Kpi+1+k2] = d3[index3];//d[index3-ND3+5];
|
||||
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("row %d, index %d, index-Nd %d index-Nd+1 %d (k,Kpi+2k,Kpi+2k+1) (%d,%d,%d) w(%d,%d,%d)\n",row,index,index-ND,((index+1)%Kpi)-ND,k,Kpi+(k<<1),Kpi+(k<<1)+1,w[k],w[Kpi+(k<<1)],w[Kpi+1+(k<<1)]);
|
||||
|
||||
@@ -100,7 +94,8 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
|
||||
#endif
|
||||
index3+=96;
|
||||
k++;k2+=2;
|
||||
k++;
|
||||
k2+=2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +115,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
}
|
||||
|
||||
|
||||
uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w) {
|
||||
uint32_t RCC = (D>>5), ND, ND3;
|
||||
uint32_t row,col,Kpi,index;
|
||||
uint32_t index3,k;
|
||||
@@ -141,7 +134,6 @@ uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
printf("RCC = %d, Kpi=%d, ND=%d\n",RCC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
@@ -180,9 +172,7 @@ uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
return(RCC);
|
||||
}
|
||||
|
||||
void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
{
|
||||
|
||||
void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) {
|
||||
uint32_t RTC = (D>>5), ND, ND3;
|
||||
uint32_t row,col,Kpi,index;
|
||||
uint32_t index3,k,k2;
|
||||
@@ -199,7 +189,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
printf("RTC = %d, Kpi=%d, ND=%d\n",RTC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
k=0;
|
||||
k2=0;
|
||||
@@ -215,7 +204,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
index3 = bitrev_x3[col];//3*index;
|
||||
|
||||
for (row=0; row<RTC; row++) {
|
||||
|
||||
d1[index3] = w[k];
|
||||
d2[index3] = w[Kpi+k2];
|
||||
d3[index3] = w[Kpi+1+k2];
|
||||
@@ -229,12 +217,9 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w)
|
||||
|
||||
// if (ND>0)
|
||||
// d[2] = LTE_NULL;//d[(3*D)+2];
|
||||
|
||||
}
|
||||
|
||||
void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w)
|
||||
{
|
||||
|
||||
void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w) {
|
||||
//WANG_Hao uint32_t RCC = (D>>5), ND, ND3;
|
||||
uint32_t RCC = (D>>5);
|
||||
ptrdiff_t ND, ND3;
|
||||
@@ -251,10 +236,9 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w)
|
||||
ND = Kpi - D;
|
||||
#ifdef RM_DEBUG2
|
||||
printf("sub_block_interleaving_cc : D = %d (%d), d %p, w %p\n",D,D*3,d,w);
|
||||
printf("RCC = %d, Kpi=%d, ND=%d\n",RCC,Kpi,ND);
|
||||
printf("RCC = %d, Kpi=%d, ND=%ld\n",RCC,Kpi,ND);
|
||||
#endif
|
||||
ND3 = ND*3;
|
||||
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
@@ -265,24 +249,20 @@ void sub_block_deinterleaving_cc(uint32_t D,int8_t *d,int8_t *w)
|
||||
index3 = 3*index;
|
||||
|
||||
for (row=0; row<RCC; row++) {
|
||||
|
||||
d[index3-ND3] = w[k];
|
||||
d[index3-ND3+1] = w[Kpi+k];
|
||||
d[index3-ND3+2] = w[(Kpi<<1)+k];
|
||||
#ifdef RM_DEBUG2
|
||||
printf("row %d, index %d k %d index3-ND3 %d w(%d,%d,%d)\n",row,index,k,index3-ND3,w[k],w[Kpi+k],w[(Kpi<<1)+k]);
|
||||
printf("row %d, index %d k %d index3-ND3 %ld w(%d,%d,%d)\n",row,index,k,index3-ND3,w[k],w[Kpi+k],w[(Kpi<<1)+k]);
|
||||
#endif
|
||||
index3+=96;
|
||||
index+=32;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F)
|
||||
{
|
||||
|
||||
uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F) {
|
||||
uint32_t RTC = (D>>5), ND;
|
||||
uint32_t col,Kpi,index;
|
||||
int32_t k,k2;
|
||||
@@ -301,8 +281,6 @@ uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F)
|
||||
printf("dummy sub_block_interleaving_turbo : D = %d (%d)\n",D,D*3);
|
||||
printf("RTC = %d, Kpi=%d, ND=%d, F=%d (Nulled %d)\n",RTC,Kpi,ND,F,(2*F + 3*ND));
|
||||
#endif
|
||||
|
||||
|
||||
k=0;
|
||||
k2=0;
|
||||
wKpi = &w[Kpi];
|
||||
@@ -371,9 +349,7 @@ uint32_t generate_dummy_w(uint32_t D, uint8_t *w,uint8_t F)
|
||||
return(RTC);
|
||||
}
|
||||
|
||||
uint32_t generate_dummy_w_cc(uint32_t D, uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t generate_dummy_w_cc(uint32_t D, uint8_t *w) {
|
||||
uint32_t RCC = (D>>5), ND;
|
||||
uint32_t col,Kpi,index;
|
||||
int32_t k;
|
||||
@@ -392,7 +368,6 @@ uint32_t generate_dummy_w_cc(uint32_t D, uint8_t *w)
|
||||
printf("RCC = %d, Kpi=%d, ND=%d, (Nulled %d)\n",RCC,Kpi,ND,3*ND);
|
||||
#endif
|
||||
// ND3 = ND*3;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
k=0;
|
||||
|
||||
@@ -466,8 +441,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
uint8_t nb_rb)
|
||||
// uint8_t m)
|
||||
{
|
||||
|
||||
|
||||
uint32_t Nir,Ncb,Gp,GpmodC,E,Ncbmod,ind,k;
|
||||
// int cnt=0;
|
||||
uint8_t *e2;
|
||||
@@ -487,11 +460,11 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
if (Mdlharq>0) { // Downlink
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
}
|
||||
else { // Uplink
|
||||
} else { // Uplink
|
||||
Nir=0;
|
||||
Ncb = 3*(RTC<<5); // Kw
|
||||
}
|
||||
|
||||
#ifdef RM_DEBUG_TX
|
||||
|
||||
if (rvidx==0 && r==0) {
|
||||
@@ -518,7 +491,6 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
AssertFatal(Qm>0,"Qm is 0\n");
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
|
||||
#endif
|
||||
@@ -529,16 +501,12 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
E = Nl*Qm * ((GpmodC==0?0:1) + (Gp/C));
|
||||
|
||||
Ncbmod = Ncb%(RTC<<3);
|
||||
|
||||
ind = RTC * (2+(rvidx*(((Ncbmod==0)?0:1) + (Ncb/(RTC<<3)))*2));
|
||||
|
||||
#ifdef RM_DEBUG_TX
|
||||
printf("lte_rate_matching_turbo: E %d, k0 %d, Ncbmod %d, Ncb/(RTC<<3) %d\n",E,ind,Ncbmod,Ncb/(RTC<<3));
|
||||
#endif
|
||||
|
||||
//e2=e+(r*E);
|
||||
e2 = e;
|
||||
|
||||
k=0;
|
||||
|
||||
for (; (ind<Ncb)&&(k<E); ind++) {
|
||||
@@ -633,25 +601,16 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
uint32_t lte_rate_matching_cc(uint32_t RCC,
|
||||
uint16_t E,
|
||||
uint8_t *w,
|
||||
uint8_t *e)
|
||||
{
|
||||
|
||||
|
||||
uint8_t *e) {
|
||||
uint32_t ind=0,k;
|
||||
|
||||
uint16_t Kw = 3*(RCC<<5);
|
||||
|
||||
#ifdef RM_DEBUG_CC
|
||||
uint32_t nulled=0;
|
||||
|
||||
printf("lte_rate_matching_cc: Kw %d, E %d\n",Kw, E);
|
||||
#endif
|
||||
|
||||
for (k=0; k<E; k++) {
|
||||
|
||||
|
||||
while(w[ind] == LTE_NULL) {
|
||||
|
||||
#ifdef RM_DEBUG_CC
|
||||
nulled++;
|
||||
printf("RM_TX_CC : ind %d, NULL\n",ind);
|
||||
@@ -662,7 +621,6 @@ uint32_t lte_rate_matching_cc(uint32_t RCC,
|
||||
ind=0;
|
||||
}
|
||||
|
||||
|
||||
e[k] = w[ind];
|
||||
#ifdef RM_DEBUG_CC
|
||||
// printf("k %d ind %d, w %c(%d)\n",k,ind,w[ind],w[ind]);
|
||||
@@ -695,10 +653,7 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
uint8_t Qm,
|
||||
uint8_t Nl,
|
||||
uint8_t r,
|
||||
uint32_t *E_out)
|
||||
{
|
||||
|
||||
|
||||
uint32_t *E_out) {
|
||||
uint32_t Nir,Ncb,Gp,GpmodC,E,Ncbmod,ind,k;
|
||||
int16_t *soft_input2;
|
||||
// int32_t w_tmp;
|
||||
@@ -708,15 +663,14 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
|
||||
if (Kmimo==0 || C==0 || Qm==0 || Nl==0) {
|
||||
printf("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n",
|
||||
Kmimo,Mdlharq,C,Qm,Nl);
|
||||
Kmimo,Mdlharq,C,Qm,Nl);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (Mdlharq>0) { // Downlink
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
}
|
||||
else { // Uplink
|
||||
} else { // Uplink
|
||||
Nir=0;
|
||||
Ncb = 3*(RTC<<5);
|
||||
}
|
||||
@@ -726,17 +680,13 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
|
||||
|
||||
if (r < (C-(GpmodC)))
|
||||
E = Nl*Qm * (Gp/C);
|
||||
else
|
||||
E = Nl*Qm * ((GpmodC==0?0:1) + (Gp/C));
|
||||
|
||||
Ncbmod = Ncb%(RTC<<3);
|
||||
|
||||
ind = RTC * (2+(rvidx*(((Ncbmod==0)?0:1) + (Ncb/(RTC<<3)))*2));
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("lte_rate_matching_turbo_rx: Clear %d, E %d, Ncb %d, Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",clear,E,Ncb,3*(RTC<<5),rvidx, G, Qm,Nl,r);
|
||||
#endif
|
||||
@@ -751,8 +701,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
if (dummy_w[ind] != LTE_NULL) {
|
||||
/*
|
||||
if ((w[ind]>0 && soft_input2[k]<0) ||
|
||||
(w[ind]<0 && soft_input2[k]>0))
|
||||
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
|
||||
(w[ind]<0 && soft_input2[k]>0))
|
||||
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
|
||||
w[ind] += soft_input2[k++];
|
||||
#ifdef RM_DEBUG
|
||||
printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]);
|
||||
@@ -831,10 +781,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
ind=0;
|
||||
}
|
||||
*/
|
||||
|
||||
*E_out = E;
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -842,28 +790,19 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
uint16_t E,
|
||||
int8_t *w,
|
||||
uint8_t *dummy_w,
|
||||
int8_t *soft_input)
|
||||
{
|
||||
|
||||
|
||||
|
||||
int8_t *soft_input) {
|
||||
uint32_t ind=0,k;
|
||||
uint16_t Kw = 3*(RCC<<5);
|
||||
uint32_t acc=1;
|
||||
int16_t w16[Kw];
|
||||
#ifdef RM_DEBUG_CC
|
||||
uint32_t nulled=0;
|
||||
|
||||
printf("lte_rate_matching_cc_rx: Kw %d, E %d, w %p, soft_input %p\n",3*(RCC<<5),E,w,soft_input);
|
||||
#endif
|
||||
|
||||
|
||||
memset(w,0,Kw);
|
||||
memset(w16,0,Kw*sizeof(int16_t));
|
||||
|
||||
for (k=0; k<E; k++) {
|
||||
|
||||
|
||||
while(dummy_w[ind] == LTE_NULL) {
|
||||
#ifdef RM_DEBUG_CC
|
||||
nulled++;
|
||||
@@ -883,10 +822,7 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
#ifdef RM_DEBUG_CC
|
||||
printf("RM_RX_CC k %d (%d) ind: %d (%d)\n",k,soft_input[k],ind,w16[ind]);
|
||||
#endif
|
||||
|
||||
|
||||
w16[ind] += soft_input[k];
|
||||
|
||||
ind++;
|
||||
|
||||
if (ind==Kw) {
|
||||
@@ -907,7 +843,6 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
}
|
||||
|
||||
#ifdef RM_DEBUG_CC
|
||||
|
||||
printf("Nulled %d\n",nulled);
|
||||
#endif
|
||||
}
|
||||
@@ -915,8 +850,7 @@ void lte_rate_matching_cc_rx(uint32_t RCC,
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
void main()
|
||||
{
|
||||
void main() {
|
||||
uint8_t d[96+3+(3*6144)];
|
||||
uint8_t w[3*6144],e[12*6144];
|
||||
uint32_t RTC,G,rvidx;
|
||||
@@ -924,7 +858,6 @@ void main()
|
||||
uint32_t mod_order = 4;
|
||||
uint32_t first_dlsch_symbol = 2;
|
||||
uint32_t i;
|
||||
|
||||
G = ( nb_rb * (12 * mod_order) * (12-first_dlsch_symbol-3)) ;//( nb_rb * (12 * mod_order) * (14-first_dlsch_symbol-3)) :
|
||||
|
||||
// initialize 96 first positions to "LTE_NULL"
|
||||
|
||||
@@ -38,9 +38,7 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
unsigned int *Cminus,
|
||||
unsigned int *Kplus,
|
||||
unsigned int *Kminus,
|
||||
unsigned int *F)
|
||||
{
|
||||
|
||||
unsigned int *F) {
|
||||
unsigned int L,Bprime,Bprime_by_C,r,Kr,k,s,crc;
|
||||
|
||||
if (B<=6144) {
|
||||
@@ -56,19 +54,19 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
Bprime = B+((*C)*L);
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime %d\n",Bprime);
|
||||
printf("Bprime %u\n",Bprime);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) {
|
||||
LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// Find K+
|
||||
Bprime_by_C = Bprime/(*C);
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime_by_C %d\n",Bprime_by_C);
|
||||
printf("Bprime_by_C %u\n",Bprime_by_C);
|
||||
#endif
|
||||
// Bprime = Bprime_by_C>>3;
|
||||
|
||||
@@ -93,17 +91,16 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
*Kminus = (*Kplus - 32);
|
||||
} else if (Bprime_by_C <=6144 ) { // increase by 8 bytes til here
|
||||
|
||||
*Kplus = (Bprime_by_C>>6)<<6;
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime_by_C_by_C %d , Kplus %d\n",Bprime_by_C,*Kplus);
|
||||
printf("Bprime_by_C_by_C %u , Kplus %u\n",Bprime_by_C,*Kplus);
|
||||
#endif
|
||||
|
||||
if (*Kplus < Bprime_by_C)
|
||||
*Kplus = *Kplus + 64;
|
||||
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Bprime_by_C_by_C %d , Kplus2 %d\n",Bprime_by_C,*Kplus);
|
||||
printf("Bprime_by_C_by_C %u , Kplus2 %u\n",Bprime_by_C,*Kplus);
|
||||
#endif
|
||||
*Kminus = (*Kplus - 64);
|
||||
} else {
|
||||
@@ -116,25 +113,21 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
*Kminus = 0;
|
||||
*Cminus = 0;
|
||||
} else {
|
||||
|
||||
// printf("More than one segment (%d), exiting \n",*C);
|
||||
// exit(-1);
|
||||
*Cminus = ((*C)*(*Kplus) - (Bprime))/((*Kplus) - (*Kminus));
|
||||
*Cplus = (*C) - (*Cminus);
|
||||
}
|
||||
|
||||
|
||||
AssertFatal(Bprime <= (*Cplus)*(*Kplus) + (*Cminus)*(*Kminus),
|
||||
"Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n",
|
||||
Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
|
||||
|
||||
"Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n",
|
||||
Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
|
||||
*F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime));
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("C %d, Cplus %d, Cminus %d, Kplus %d, Kminus %d, Bprime_bytes %d, Bprime %d, F %d\n",*C,*Cplus,*Cminus,*Kplus,*Kminus,Bprime>>3,Bprime,*F);
|
||||
printf("C %u, Cplus %u, Cminus %u, Kplus %u, Kminus %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*Cplus,*Cminus,*Kplus,*Kminus,Bprime>>3,Bprime,*F);
|
||||
#endif
|
||||
|
||||
if ((input_buffer) && (output_buffers)) {
|
||||
|
||||
for (k=0; k<*F>>3; k++) {
|
||||
output_buffers[0][k] = 0;
|
||||
}
|
||||
@@ -142,7 +135,6 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
s=0;
|
||||
|
||||
for (r=0; r<*C; r++) {
|
||||
|
||||
if (r<*Cminus)
|
||||
Kr = *Kminus;
|
||||
else
|
||||
@@ -150,18 +142,18 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
while (k<((Kr - L)>>3)) {
|
||||
output_buffers[r][k] = input_buffer[s];
|
||||
// printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
|
||||
// printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
|
||||
k++;
|
||||
s++;
|
||||
}
|
||||
|
||||
if (*C > 1) { // add CRC
|
||||
crc = crc24b(output_buffers[r],Kr-24)>>8;
|
||||
output_buffers[r][(Kr-24)>>3] = ((uint8_t*)&crc)[2];
|
||||
output_buffers[r][1+((Kr-24)>>3)] = ((uint8_t*)&crc)[1];
|
||||
output_buffers[r][2+((Kr-24)>>3)] = ((uint8_t*)&crc)[0];
|
||||
output_buffers[r][(Kr-24)>>3] = ((uint8_t *)&crc)[2];
|
||||
output_buffers[r][1+((Kr-24)>>3)] = ((uint8_t *)&crc)[1];
|
||||
output_buffers[r][2+((Kr-24)>>3)] = ((uint8_t *)&crc)[0];
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("Segment %d : CRC %x\n",r,crc);
|
||||
printf("Segment %u : CRC %x\n",r,crc);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -175,9 +167,7 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
main()
|
||||
{
|
||||
|
||||
main() {
|
||||
unsigned int Kplus,Kminus,C,Cplus,Cminus,F,Bbytes;
|
||||
|
||||
for (Bbytes=5; Bbytes<2*768; Bbytes++) {
|
||||
|
||||
@@ -34,8 +34,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
unsigned char Ns,
|
||||
unsigned char p,
|
||||
unsigned char l,
|
||||
unsigned char symbol)
|
||||
{
|
||||
unsigned char symbol) {
|
||||
int pilot[2][200] __attribute__((aligned(16)));
|
||||
unsigned char nu,aarx;
|
||||
unsigned short k;
|
||||
@@ -45,16 +44,14 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
// unsigned int n;
|
||||
// int i;
|
||||
static int interpolateS11S12 = 1;
|
||||
|
||||
uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
|
||||
|
||||
uint8_t nushift,pilot0,pilot1,pilot2,pilot3;
|
||||
uint8_t previous_thread_id = ue->current_thread_id[Ns>>1]==0 ? (RX_NB_TH-1):(ue->current_thread_id[Ns>>1]-1);
|
||||
int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset];
|
||||
int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].dl_ch_estimates[eNB_offset];
|
||||
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF;
|
||||
|
||||
pilot0 = 0;
|
||||
|
||||
if (ue->frame_parms.Ncp == 0) { // normal prefix
|
||||
pilot1 = 4;
|
||||
pilot2 = 7;
|
||||
@@ -81,7 +78,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
//ch_offset = (l*(ue->frame_parms.ofdm_symbol_size));
|
||||
if (ue->high_speed_flag == 0) // use second channel estimate position for temporary storage
|
||||
ch_offset = ue->frame_parms.ofdm_symbol_size ;
|
||||
@@ -89,93 +85,88 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
ch_offset = ue->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
symbol_offset = ue->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
k = (nu + nushift)%6;
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("Channel Estimation : ThreadId %d, eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d\n",ue->current_thread_id[Ns>>1], eNB_offset,Nid_cell,ch_offset,ue->frame_parms.ofdm_symbol_size,
|
||||
printf("Channel Estimation : ThreadId %d, eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d\n",ue->current_thread_id[Ns>>1], eNB_offset,Nid_cell,ch_offset,
|
||||
ue->frame_parms.ofdm_symbol_size,
|
||||
ue->frame_parms.Ncp,l,Ns,k);
|
||||
#endif
|
||||
|
||||
switch (k) {
|
||||
case 0 :
|
||||
f=filt24_0; //for first pilot of RB, first half
|
||||
f2=filt24_2; //for second pilot of RB, first half
|
||||
fl=filt24_0; //for first pilot of leftmost RB
|
||||
f2l2=filt24_2;
|
||||
// fr=filt24_2r; //for first pilot of rightmost RB
|
||||
fr=filt24_0r2; //for first pilot of rightmost RB
|
||||
// f2r2=filt24_0r2;
|
||||
f2r2=filt24_2r;
|
||||
case 0 :
|
||||
f=filt24_0; //for first pilot of RB, first half
|
||||
f2=filt24_2; //for second pilot of RB, first half
|
||||
fl=filt24_0; //for first pilot of leftmost RB
|
||||
f2l2=filt24_2;
|
||||
// fr=filt24_2r; //for first pilot of rightmost RB
|
||||
fr=filt24_0r2; //for first pilot of rightmost RB
|
||||
// f2r2=filt24_0r2;
|
||||
f2r2=filt24_2r;
|
||||
f_dc=filt24_0_dcr;
|
||||
f2_dc=filt24_2_dcl;
|
||||
break;
|
||||
|
||||
f_dc=filt24_0_dcr;
|
||||
f2_dc=filt24_2_dcl;
|
||||
case 1 :
|
||||
f=filt24_1;
|
||||
f2=filt24_3;
|
||||
fl=filt24_1l;
|
||||
f2l2=filt24_3l2;
|
||||
fr=filt24_1r2;
|
||||
f2r2=filt24_3r;
|
||||
f_dc=filt24_1_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_3_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
break;
|
||||
case 2 :
|
||||
f=filt24_2;
|
||||
f2=filt24_4;
|
||||
fl=filt24_2l;
|
||||
f2l2=filt24_4l2;
|
||||
fr=filt24_2r2;
|
||||
f2r2=filt24_4r;
|
||||
f_dc=filt24_2_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_4_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
f=filt24_1;
|
||||
f2=filt24_3;
|
||||
fl=filt24_1l;
|
||||
f2l2=filt24_3l2;
|
||||
fr=filt24_1r2;
|
||||
f2r2=filt24_3r;
|
||||
f_dc=filt24_1_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_3_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
case 3 :
|
||||
f=filt24_3;
|
||||
f2=filt24_5;
|
||||
fl=filt24_3l;
|
||||
f2l2=filt24_5l2;
|
||||
fr=filt24_3r2;
|
||||
f2r2=filt24_5r;
|
||||
f_dc=filt24_3_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_5_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
f=filt24_2;
|
||||
f2=filt24_4;
|
||||
fl=filt24_2l;
|
||||
f2l2=filt24_4l2;
|
||||
fr=filt24_2r2;
|
||||
f2r2=filt24_4r;
|
||||
f_dc=filt24_2_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_4_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
case 4 :
|
||||
f=filt24_4;
|
||||
f2=filt24_6;
|
||||
fl=filt24_4l;
|
||||
f2l2=filt24_6l2;
|
||||
fr=filt24_4r2;
|
||||
f2r2=filt24_6r;
|
||||
f_dc=filt24_4_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_6_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
f=filt24_3;
|
||||
f2=filt24_5;
|
||||
fl=filt24_3l;
|
||||
f2l2=filt24_5l2;
|
||||
fr=filt24_3r2;
|
||||
f2r2=filt24_5r;
|
||||
f_dc=filt24_3_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_5_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
case 5 :
|
||||
f=filt24_5;
|
||||
f2=filt24_7;
|
||||
fl=filt24_5l;
|
||||
f2l2=filt24_7l2;
|
||||
fr=filt24_5r2;
|
||||
f2r2=filt24_7r;
|
||||
f_dc=filt24_5_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_7_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
f=filt24_4;
|
||||
f2=filt24_6;
|
||||
fl=filt24_4l;
|
||||
f2l2=filt24_6l2;
|
||||
fr=filt24_4r2;
|
||||
f2r2=filt24_6r;
|
||||
f_dc=filt24_4_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_6_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
f=filt24_5;
|
||||
f2=filt24_7;
|
||||
fl=filt24_5l;
|
||||
f2l2=filt24_7l2;
|
||||
fr=filt24_5r2;
|
||||
f2r2=filt24_7r;
|
||||
f_dc=filt24_5_dcr; //for first pilot of RB, first half
|
||||
f2_dc=filt24_7_dcl; //for first pilot of RB, first half
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"lte_dl_channel_estimation: k=%d -> ERROR\n",k);
|
||||
return(-1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"lte_dl_channel_estimation: k=%d -> ERROR\n",k);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// generate pilot
|
||||
lte_dl_cell_spec_rx(ue,
|
||||
eNB_offset,
|
||||
@@ -184,27 +175,25 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
(l==0)?0:1,
|
||||
p);
|
||||
|
||||
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
pil = (int16_t *)&pilot[p][0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+k+ue->frame_parms.first_carrier_offset))];
|
||||
dl_ch = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
|
||||
|
||||
|
||||
// if (eNb_id==0)
|
||||
memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size));
|
||||
|
||||
if (ue->high_speed_flag==0) // multiply previous channel estimate by ch_est_alpha
|
||||
multadd_complex_vector_real_scalar(dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),
|
||||
ue->ch_est_alpha,dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),
|
||||
1,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("k %d, first_carrier %d\n",k,ue->frame_parms.first_carrier_offset);
|
||||
#endif
|
||||
|
||||
if ((ue->frame_parms.N_RB_DL==6) ||
|
||||
(ue->frame_parms.N_RB_DL==50) ||
|
||||
(ue->frame_parms.N_RB_DL==100)) {
|
||||
|
||||
//First half of pilots
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
@@ -219,7 +208,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
@@ -234,28 +222,22 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
dl_ch+=16;
|
||||
|
||||
for (pilot_cnt=2; pilot_cnt<((ue->frame_parms.N_RB_DL)-1); pilot_cnt+=2) {
|
||||
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); //Re
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); //Im
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
|
||||
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
@@ -264,29 +246,25 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
// printf("Second half\n");
|
||||
// Second half of RBs
|
||||
|
||||
k = (nu + nushift)%6;
|
||||
|
||||
if (k > 6)
|
||||
k -=6;
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))];
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("second half k %d\n",k);
|
||||
#endif
|
||||
|
||||
for (pilot_cnt=0; pilot_cnt<((ue->frame_parms.N_RB_DL)-3); pilot_cnt+=2) {
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
@@ -295,11 +273,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
@@ -308,13 +285,12 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
@@ -323,34 +299,25 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
printf("pilot %u: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2r2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (ue->frame_parms.N_RB_DL==25) {
|
||||
} else if (ue->frame_parms.N_RB_DL==25) {
|
||||
//printf("Channel estimation\n");
|
||||
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -358,17 +325,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2l2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -378,21 +341,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
dl_ch+=16;
|
||||
|
||||
for (pilot_cnt=2; pilot_cnt<24; pilot_cnt+=2) {
|
||||
|
||||
// printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
// printf("rx[%d][%d] -> (%d,%d)\n",p,ue->frame_parms.first_carrier_offset + ue->frame_parms.nushift + 6*rb+(3*p),rxF[0],rxF[1]);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -400,13 +357,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
@@ -417,39 +371,31 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 24: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
|
||||
multadd_real_vector_complex_scalar(f_dc,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
dl_ch+=8;
|
||||
|
||||
// printf("Second half\n");
|
||||
// Second half of RBs
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))];
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 25: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2_dc,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -459,19 +405,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
dl_ch+=16;
|
||||
|
||||
for (pilot_cnt=0; pilot_cnt<22; pilot_cnt+=2) {
|
||||
|
||||
// printf("* pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
// printf("rx[%d][%d] -> (%d,%d)\n",p,ue->frame_parms.first_carrier_offset + ue->frame_parms.nushift + 6*rb+(3*p),rxF[0],rxF[1]);
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",26+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",26+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -479,16 +421,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",27+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
printf("pilot %u : rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",27+pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -496,20 +435,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 49: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -517,28 +451,20 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
|
||||
printf("pilot 50: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
// ch[0] = 1024;
|
||||
// ch[1] = -128;
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(f2r2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
|
||||
} else if (ue->frame_parms.N_RB_DL==15) {
|
||||
|
||||
//printf("First Half\n");
|
||||
for (rb=0; rb<28; rb+=4) {
|
||||
|
||||
//printf("aarx=%d\n",aarx);
|
||||
//printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
//printf("rx[%d][%d] -> (%d,%d)\n",p,
|
||||
@@ -555,7 +481,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
//printf("ch -> (%d,%d)\n",ch[0],ch[1]);
|
||||
@@ -566,7 +491,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
@@ -578,13 +502,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
dl_ch+=8;
|
||||
|
||||
//printf("Second half\n");
|
||||
//Second half of RBs
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p)))];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -602,7 +524,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
// rxF[1]);
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -610,10 +531,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -621,17 +540,14 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"channel estimation not implemented for ue->frame_parms.N_RB_DL = %d\n",ue->frame_parms.N_RB_DL);
|
||||
}
|
||||
|
||||
|
||||
if (ue->perfect_ce == 0) {
|
||||
// Temporal Interpolation
|
||||
// printf("ch_offset %d\n",ch_offset);
|
||||
|
||||
dl_ch = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
|
||||
|
||||
if (ue->high_speed_flag == 0) {
|
||||
@@ -639,182 +555,155 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
32767-ue->ch_est_alpha,
|
||||
dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // high_speed_flag == 1
|
||||
if ((symbol == 0)) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12))
|
||||
{
|
||||
//LOG_I(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if ((symbol == 0)) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12)) {
|
||||
//LOG_I(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
//LOG_I(PHY,"Interpolate s0-->s4 to get s1 s2 and s3 Ns %d \n", Ns);
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
uint8_t previous_subframe;
|
||||
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
|
||||
//LOG_I(PHY,"Interpolate s0-->s4 to get s1 s2 and s3 Ns %d \n", Ns);
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
|
||||
uint8_t previous_subframe;
|
||||
if(Ns>>1 == 0)
|
||||
previous_subframe = 9;
|
||||
else
|
||||
previous_subframe = ((Ns>>1) - 1 )%9;
|
||||
|
||||
if((subframe_select(&ue->frame_parms,previous_subframe) == SF_UL))
|
||||
{
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
}
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
} else if (symbol == pilot2) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // symbol == pilot3
|
||||
// printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
|
||||
{
|
||||
//LOG_I(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
if(Ns>>1 == 0)
|
||||
previous_subframe = 9;
|
||||
else
|
||||
previous_subframe = ((Ns>>1) - 1 )%9;
|
||||
|
||||
if((subframe_select(&ue->frame_parms,previous_subframe) == SF_UL)) {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
} else if (symbol == pilot2) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // symbol == pilot3
|
||||
// printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9)) {
|
||||
//LOG_I(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++) {
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++) {
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (ue->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
|
||||
default:
|
||||
idft = idft512;
|
||||
break;
|
||||
default:
|
||||
idft = idft512;
|
||||
break;
|
||||
}
|
||||
|
||||
if( ((Ns%2) == 0) && (l == pilot0))
|
||||
{
|
||||
// do ifft of channel estimate
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx])
|
||||
{
|
||||
//LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l);
|
||||
idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
}
|
||||
}
|
||||
if( ((Ns%2) == 0) && (l == pilot0)) {
|
||||
// do ifft of channel estimate
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) {
|
||||
//LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l);
|
||||
idft((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
||||
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id),
|
||||
T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].subframe_rx),
|
||||
T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
+399
-397
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user