Commit cea0369a authored by Hongzhi Wang's avatar Hongzhi Wang Committed by Florian Kaltenberger

workaround for nr ldpc using lte interleaving

Conflicts:
	openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
	openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
parent 90a35c9d
...@@ -763,7 +763,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -763,7 +763,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
unsigned int A, Z; unsigned int A, Z;
unsigned *pz = &Z; unsigned *pz = &Z;
unsigned char mod_order; unsigned char mod_order;
unsigned int Kr=0,Kr_bytes,r,r_offset=0; unsigned int Kr=0,Kr_bytes,r,r_offset=0,Kr_int=0;
// unsigned short m=dlsch->harq_processes[harq_pid]->mcs; // unsigned short m=dlsch->harq_processes[harq_pid]->mcs;
uint8_t beamforming_mode=0; uint8_t beamforming_mode=0;
double rate = 0.33; double rate = 0.33;
...@@ -832,14 +832,14 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -832,14 +832,14 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
//if (r<dlsch->harq_processes[harq_pid]->Cminus) #ifdef TD_DECODING
// Kr = dlsch->harq_processes[harq_pid]->Kminus; if (r<dlsch->harq_processes[harq_pid]->Cminus)
//else Kr = dlsch->harq_processes[harq_pid]->Kminus;
else
Kr = dlsch->harq_processes[harq_pid]->Kplus; Kr = dlsch->harq_processes[harq_pid]->Kplus;
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
#ifdef TD_DECODING
// get interleaver index for Turbo code (lookup in Table 5.1.3-3 36-212, V8.6 2009-03, p. 13-14) // get interleaver index for Turbo code (lookup in Table 5.1.3-3 36-212, V8.6 2009-03, p. 13-14)
if (Kr_bytes<=64) if (Kr_bytes<=64)
iind = (Kr_bytes-5); iind = (Kr_bytes-5);
...@@ -853,7 +853,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -853,7 +853,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes); printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
return(-1); return(-1);
} }
#endif
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
printf("Generating Code Segment %d (%d bits)\n",r,Kr); printf("Generating Code Segment %d (%d bits)\n",r,Kr);
...@@ -880,7 +879,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -880,7 +879,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
#endif #endif
start_meas(te_stats); start_meas(te_stats);
#ifdef TD_DECODING
threegpplte_turbo_encoder(dlsch->harq_processes[harq_pid]->c[r], threegpplte_turbo_encoder(dlsch->harq_processes[harq_pid]->c[r],
Kr>>3, Kr>>3,
&dlsch->harq_processes[harq_pid]->d[r][96], &dlsch->harq_processes[harq_pid]->d[r][96],
...@@ -888,18 +886,29 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -888,18 +886,29 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
f1f2mat_old[iind*2], // f1 (see 36121-820, page 14) f1f2mat_old[iind*2], // f1 (see 36121-820, page 14)
f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14) f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14)
); );
stop_meas(te_stats);
#else #else
Kr = dlsch->harq_processes[harq_pid]->Kplus;
//workaround for nr ldpc using lte interleaving
Kr_bytes = Kr>>3;
if (dlsch->harq_processes[harq_pid]->C >= 2)
Kr_int = G/(3*dlsch->harq_processes[harq_pid]->C);
else
Kr_int = Kr;
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
printf("start ldpc encoder B %d, rate %f\n",dlsch->harq_processes[harq_pid]->B,rate); printf("start ldpc encoder B %d, rate %f\n",dlsch->harq_processes[harq_pid]->B,rate);
printf("input %d %d %d %d %d \n", dlsch->harq_processes[harq_pid]->c[r][0], dlsch->harq_processes[harq_pid]->c[r][1], dlsch->harq_processes[harq_pid]->c[r][2],dlsch->harq_processes[harq_pid]->c[r][3], dlsch->harq_processes[harq_pid]->c[r][4]); printf("input %d %d %d %d %d \n", dlsch->harq_processes[harq_pid]->c[r][0], dlsch->harq_processes[harq_pid]->c[r][1], dlsch->harq_processes[harq_pid]->c[r][2],dlsch->harq_processes[harq_pid]->c[r][3], dlsch->harq_processes[harq_pid]->c[r][4]);
#endif #endif
start_meas(te_stats);
memset(dlsch->harq_processes[harq_pid]->d[r],0,(96+12+3+3*8448)*sizeof(uint8_t)); memset(dlsch->harq_processes[harq_pid]->d[r],0,(96+12+3+3*8448)*sizeof(uint8_t));
ldpc_encoder((unsigned char*)dlsch->harq_processes[harq_pid]->c[r],(unsigned char*)&dlsch->harq_processes[harq_pid]->d[r][96],Kr,rate); ldpc_encoder((unsigned char*)dlsch->harq_processes[harq_pid]->c[r],(unsigned char*)&dlsch->harq_processes[harq_pid]->d[r][96],Kr,rate);
stop_meas(te_stats);
#endif #endif
stop_meas(te_stats);
#if 0 #if 0
printf("end ldpc encoder -- output\n"); printf("end ldpc encoder -- output\n");
...@@ -920,10 +929,19 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -920,10 +929,19 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
#endif #endif
start_meas(i_stats); start_meas(i_stats);
#ifdef TD_DECODING
dlsch->harq_processes[harq_pid]->RTC[r] = dlsch->harq_processes[harq_pid]->RTC[r] =
sub_block_interleaving_turbo(4+(Kr_bytes*8), sub_block_interleaving_turbo(4+(Kr_bytes*8),
&dlsch->harq_processes[harq_pid]->d[r][96], &dlsch->harq_processes[harq_pid]->d[r][96],
dlsch->harq_processes[harq_pid]->w[r]); dlsch->harq_processes[harq_pid]->w[r]);
#else
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
dlsch->harq_processes[harq_pid]->RTC[r] =
sub_block_interleaving_turbo((Kr_int),
&dlsch->harq_processes[harq_pid]->d[r][96],
dlsch->harq_processes[harq_pid]->w[r]);
}
#endif
stop_meas(i_stats); stop_meas(i_stats);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment