remove precomputed turbo codec interleaver table, remove useless F1 and F2 parameters to turbo codec (also remove global var dependancy between libraries)
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
|
||||
//#define DEBUG_TURBO_ENCODER 1
|
||||
|
||||
@@ -110,9 +109,7 @@ uint32_t bit_byte_lut[2048];
|
||||
void threegpplte_turbo_encoder(uint8_t *input,
|
||||
uint16_t input_length_bytes,
|
||||
uint8_t *output,
|
||||
uint8_t F,
|
||||
uint16_t interleaver_f1,
|
||||
uint16_t interleaver_f2)
|
||||
uint8_t F)
|
||||
{
|
||||
|
||||
int i,k=0;
|
||||
@@ -256,6 +253,217 @@ inline short threegpp_interleaver_parameters(uint16_t bytes_per_codeword)
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
const interleaver_TS_36_212_t f1f2[188] = {
|
||||
{ 40, 3, 10 },
|
||||
{ 48, 7, 12 },
|
||||
{ 56, 19, 42 },
|
||||
{ 64, 7, 16 },
|
||||
{ 72, 7, 18 },
|
||||
{ 80, 11, 20 },
|
||||
{ 88, 5, 22 },
|
||||
{ 96, 11, 24 },
|
||||
{ 104, 7, 26 },
|
||||
{ 112, 41, 84 },
|
||||
{ 120, 103, 90 },
|
||||
{ 128, 15, 32 },
|
||||
{ 136, 9, 34 },
|
||||
{ 144, 17, 108 },
|
||||
{ 152, 9, 38 },
|
||||
{ 160, 21, 120 },
|
||||
{ 168, 101, 84 },
|
||||
{ 176, 21, 44 },
|
||||
{ 184, 57, 46 },
|
||||
{ 192, 23, 48 },
|
||||
{ 200, 13, 50 },
|
||||
{ 208, 27, 52 },
|
||||
{ 216, 11, 36 },
|
||||
{ 224, 27, 56 },
|
||||
{ 232, 85, 58 },
|
||||
{ 240, 29, 60 },
|
||||
{ 248, 33, 62 },
|
||||
{ 256, 15, 32 },
|
||||
{ 264, 17, 198 },
|
||||
{ 272, 33, 68 },
|
||||
{ 280, 103, 210 },
|
||||
{ 288, 19, 36 },
|
||||
{ 296, 19, 74 },
|
||||
{ 304, 37, 76 },
|
||||
{ 312, 19, 78 },
|
||||
{ 320, 21, 120 },
|
||||
{ 328, 21, 82 },
|
||||
{ 336, 115, 84 },
|
||||
{ 344, 193, 86 },
|
||||
{ 352, 21, 44 },
|
||||
{ 360, 133, 90 },
|
||||
{ 368, 81, 46 },
|
||||
{ 376, 45, 94 },
|
||||
{ 384, 23, 48 },
|
||||
{ 392, 243, 98 },
|
||||
{ 400, 151, 40 },
|
||||
{ 408, 155, 102 },
|
||||
{ 416, 25, 52 },
|
||||
{ 424, 51, 106 },
|
||||
{ 432, 47, 72 },
|
||||
{ 440, 91, 110 },
|
||||
{ 448, 29, 168 },
|
||||
{ 456, 29, 114 },
|
||||
{ 464, 247, 58 },
|
||||
{ 472, 29, 118 },
|
||||
{ 480, 89, 180 },
|
||||
{ 488, 91, 122 },
|
||||
{ 496, 157, 62 },
|
||||
{ 504, 55, 84 },
|
||||
{ 512, 31, 64 },
|
||||
{ 528, 17, 66 },
|
||||
{ 544, 35, 68 },
|
||||
{ 560, 227, 420 },
|
||||
{ 576, 65, 96 },
|
||||
{ 592, 19, 74 },
|
||||
{ 608, 37, 76 },
|
||||
{ 624, 41, 234 },
|
||||
{ 640, 39, 80 },
|
||||
{ 656, 185, 82 },
|
||||
{ 672, 43, 252 },
|
||||
{ 688, 21, 86 },
|
||||
{ 704, 155, 44 },
|
||||
{ 720, 79, 120 },
|
||||
{ 736, 139, 92 },
|
||||
{ 752, 23, 94 },
|
||||
{ 768, 217, 48 },
|
||||
{ 784, 25, 98 },
|
||||
{ 800, 17, 80 },
|
||||
{ 816, 127, 102 },
|
||||
{ 832, 25, 52 },
|
||||
{ 848, 239, 106 },
|
||||
{ 864, 17, 48 },
|
||||
{ 880, 137, 110 },
|
||||
{ 896, 215, 112 },
|
||||
{ 912, 29, 114 },
|
||||
{ 928, 15, 58 },
|
||||
{ 944, 147, 118 },
|
||||
{ 960, 29, 60 },
|
||||
{ 976, 59, 122 },
|
||||
{ 992, 65, 124 },
|
||||
{ 1008, 55, 84 },
|
||||
{ 1024, 31, 64 },
|
||||
{ 1056, 17, 66 },
|
||||
{ 1088, 171, 204 },
|
||||
{ 1120, 67, 140 },
|
||||
{ 1152, 35, 72 },
|
||||
{ 1184, 19, 74 },
|
||||
{ 1216, 39, 76 },
|
||||
{ 1248, 19, 78 },
|
||||
{ 1280, 199, 240 },
|
||||
{ 1312, 21, 82 },
|
||||
{ 1344, 211, 252 },
|
||||
{ 1376, 21, 86 },
|
||||
{ 1408, 43, 88 },
|
||||
{ 1440, 149, 60 },
|
||||
{ 1472, 45, 92 },
|
||||
{ 1504, 49, 846 },
|
||||
{ 1536, 71, 48 },
|
||||
{ 1568, 13, 28 },
|
||||
{ 1600, 17, 80 },
|
||||
{ 1632, 25, 102 },
|
||||
{ 1664, 183, 104 },
|
||||
{ 1696, 55, 954 },
|
||||
{ 1728, 127, 96 },
|
||||
{ 1760, 27, 110 },
|
||||
{ 1792, 29, 112 },
|
||||
{ 1824, 29, 114 },
|
||||
{ 1856, 57, 116 },
|
||||
{ 1888, 45, 354 },
|
||||
{ 1920, 31, 120 },
|
||||
{ 1952, 59, 610 },
|
||||
{ 1984, 185, 124 },
|
||||
{ 2016, 113, 420 },
|
||||
{ 2048, 31, 64 },
|
||||
{ 2112, 17, 66 },
|
||||
{ 2176, 171, 136 },
|
||||
{ 2240, 209, 420 },
|
||||
{ 2304, 253, 216 },
|
||||
{ 2368, 367, 444 },
|
||||
{ 2432, 265, 456 },
|
||||
{ 2496, 181, 468 },
|
||||
{ 2560, 39, 80 },
|
||||
{ 2624, 27, 164 },
|
||||
{ 2688, 127, 504 },
|
||||
{ 2752, 143, 172 },
|
||||
{ 2816, 43, 88 },
|
||||
{ 2880, 29, 300 },
|
||||
{ 2944, 45, 92 },
|
||||
{ 3008, 157, 188 },
|
||||
{ 3072, 47, 96 },
|
||||
{ 3136, 13, 28 },
|
||||
{ 3200, 111, 240 },
|
||||
{ 3264, 443, 204 },
|
||||
{ 3328, 51, 104 },
|
||||
{ 3392, 51, 212 },
|
||||
{ 3456, 451, 192 },
|
||||
{ 3520, 257, 220 },
|
||||
{ 3584, 57, 336 },
|
||||
{ 3648, 313, 228 },
|
||||
{ 3712, 271, 232 },
|
||||
{ 3776, 179, 236 },
|
||||
{ 3840, 331, 120 },
|
||||
{ 3904, 363, 244 },
|
||||
{ 3968, 375, 248 },
|
||||
{ 4032, 127, 168 },
|
||||
{ 4096, 31, 64 },
|
||||
{ 4160, 33, 130 },
|
||||
{ 4224, 43, 264 },
|
||||
{ 4288, 33, 134 },
|
||||
{ 4352, 477, 408 },
|
||||
{ 4416, 35, 138 },
|
||||
{ 4480, 233, 280 },
|
||||
{ 4544, 357, 142 },
|
||||
{ 4608, 337, 480 },
|
||||
{ 4672, 37, 146 },
|
||||
{ 4736, 71, 444 },
|
||||
{ 4800, 71, 120 },
|
||||
{ 4864, 37, 152 },
|
||||
{ 4928, 39, 462 },
|
||||
{ 4992, 127, 234 },
|
||||
{ 5056, 39, 158 },
|
||||
{ 5120, 39, 80 },
|
||||
{ 5184, 31, 96 },
|
||||
{ 5248, 113, 902 },
|
||||
{ 5312, 41, 166 },
|
||||
{ 5376, 251, 336 },
|
||||
{ 5440, 43, 170 },
|
||||
{ 5504, 21, 86 },
|
||||
{ 5568, 43, 174 },
|
||||
{ 5632, 45, 176 },
|
||||
{ 5696, 45, 178 },
|
||||
{ 5760, 161, 120 },
|
||||
{ 5824, 89, 182 },
|
||||
{ 5888, 323, 184 },
|
||||
{ 5952, 47, 186 },
|
||||
{ 6016, 23, 94 },
|
||||
{ 6080, 47, 190 },
|
||||
{ 6144, 263, 480 },
|
||||
};
|
||||
|
||||
|
||||
t_interleaver_codebook *f1f2mat;
|
||||
short *il_tb;
|
||||
__attribute__((constructor)) static void init_interleaver(void) {
|
||||
int totSize=0;
|
||||
f1f2mat=(t_interleaver_codebook*) malloc(sizeof(*f1f2mat) * sizeof(f1f2) / sizeof(*f1f2));
|
||||
for (int i=0; i < sizeof(f1f2)/sizeof(*f1f2) ; i++) {
|
||||
f1f2mat[i].nb_bits=f1f2[i].nb_bits;
|
||||
f1f2mat[i].f1=f1f2[i].f1;
|
||||
f1f2mat[i].f2=f1f2[i].f2;
|
||||
f1f2mat[i].beg_index=totSize;
|
||||
totSize+=f1f2mat[i].nb_bits;
|
||||
}
|
||||
il_tb=(short*)malloc(sizeof(*il_tb)*totSize);
|
||||
int idx=0;
|
||||
for (int i=0; i < sizeof(f1f2)/sizeof(*f1f2) ; i++)
|
||||
for (uint64_t j=0; j<f1f2[i].nb_bits; j++)
|
||||
il_tb[idx++]=(j*f1f2[i].f1+j*j*f1f2[i].f2)%f1f2[i].nb_bits;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
@@ -296,9 +504,7 @@ int main(int argc,char **argv)
|
||||
|
||||
threegpplte_turbo_encoder(&input[0],
|
||||
5,
|
||||
&output[0],
|
||||
F1,
|
||||
F2);
|
||||
&output[0]);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
*/
|
||||
#ifndef TC_MAIN
|
||||
#include "coding_defs.h"
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
#else
|
||||
#include "coding_vars.h"
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
@@ -539,9 +537,7 @@ 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 short interleaver_f1,
|
||||
unsigned short interleaver_f2)
|
||||
unsigned char F)
|
||||
{
|
||||
|
||||
int i;
|
||||
@@ -699,9 +695,7 @@ int main(int argc,char **argv)
|
||||
threegpplte_turbo_encoder_sse(&input[0],
|
||||
INPUT_LENGTH,
|
||||
&output[0],
|
||||
0,
|
||||
F1,
|
||||
F2);
|
||||
0);
|
||||
|
||||
|
||||
for (i=0;i<12+(INPUT_LENGTH*24);i++)
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
#else
|
||||
|
||||
#include "defs.h"
|
||||
@@ -893,8 +892,6 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint16_t f1,
|
||||
uint16_t f2,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
@@ -1287,8 +1284,6 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint16_t f1,
|
||||
uint16_t f2,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/CODING/defs.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
#else
|
||||
|
||||
#include "defs.h"
|
||||
@@ -1983,8 +1982,6 @@ void init_td()
|
||||
unsigned char phy_threegpplte_turbo_decoder(short *y,
|
||||
unsigned char *decoded_bytes,
|
||||
unsigned short n,
|
||||
unsigned short f1,
|
||||
unsigned short f2,
|
||||
unsigned char max_iterations,
|
||||
unsigned char crc_type,
|
||||
unsigned char F,
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
#else
|
||||
|
||||
#include "defs.h"
|
||||
@@ -1162,24 +1161,21 @@ void init_td16(void)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
short *y2,
|
||||
unsigned char *decoded_bytes,
|
||||
unsigned char *decoded_bytes2,
|
||||
unsigned short n,
|
||||
unsigned short f1,
|
||||
unsigned short f2,
|
||||
unsigned char max_iterations,
|
||||
unsigned char crc_type,
|
||||
unsigned char F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats)
|
||||
{
|
||||
uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats) {
|
||||
|
||||
/* y is a pointer to the input
|
||||
decoded_bytes is a pointer to the decoded output
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
#else
|
||||
|
||||
#include "defs.h"
|
||||
@@ -836,25 +835,21 @@ void init_td8(void)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char phy_threegpplte_turbo_decoder8(short *y,
|
||||
short y2,
|
||||
unsigned char *decoded_bytes,
|
||||
unsigned char *decoded_bytes2,
|
||||
unsigned short n,
|
||||
unsigned short f1,
|
||||
unsigned short f2,
|
||||
unsigned char max_iterations,
|
||||
unsigned char crc_type,
|
||||
unsigned char F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats)
|
||||
{
|
||||
|
||||
uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats) {
|
||||
/* y is a pointer to the input
|
||||
decoded_bytes is a pointer to the decoded output
|
||||
n is the size in bits of the coded block, with the tail */
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
|
||||
//#include "PHY/CODING/lte_interleaver.h"
|
||||
//#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
#include "PHY/CODING/defs.h"
|
||||
//#include "PHY/CODING/lte_interleaver.h"
|
||||
//#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,24 @@
|
||||
#define MAX_TURBO_ITERATIONS_MBSFN 8
|
||||
#define MAX_TURBO_ITERATIONS max_turbo_iterations
|
||||
|
||||
typedef struct {
|
||||
unsigned short nb_bits;
|
||||
unsigned short f1;
|
||||
unsigned short f2;
|
||||
} interleaver_TS_36_212_t;
|
||||
|
||||
extern const interleaver_TS_36_212_t f1f2[188];
|
||||
|
||||
#define LTE_NULL 2
|
||||
typedef struct interleaver_codebook {
|
||||
unsigned long nb_bits;
|
||||
unsigned short f1;
|
||||
unsigned short f2;
|
||||
unsigned int beg_index;
|
||||
} t_interleaver_codebook;
|
||||
extern t_interleaver_codebook *f1f2mat;
|
||||
extern short *il_tb;
|
||||
|
||||
|
||||
/** @addtogroup _PHY_CODING_BLOCKS_
|
||||
* @{
|
||||
@@ -420,4 +437,8 @@ uint32_t crcbit (uint8_t * ,
|
||||
int16_t reverseBits(int32_t ,int32_t);
|
||||
void phy_viterbi_dot11(int8_t *,uint8_t *,uint16_t);
|
||||
|
||||
decoder_if_t phy_threegpplte_turbo_decoder;
|
||||
decoder_if_t phy_threegpplte_turbo_decoder8;
|
||||
decoder_if_t phy_threegpplte_turbo_decoder16;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,10 +19,9 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
extern unsigned short f1f2mat_old[2*188];
|
||||
extern double cpuf;
|
||||
extern decoder_if_t decoder16;
|
||||
extern decoder_if_t decoder8;
|
||||
extern encoder_if_t encoder;
|
||||
extern decoder_if_t *decoder16;
|
||||
extern decoder_if_t *decoder8;
|
||||
extern encoder_if_t *encoder;
|
||||
extern int load_codinglib(void);
|
||||
extern int free_codinglib(void);
|
||||
extern void free_codinglib(void);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
#include "common/utils/telnetsrv/telnetsrv.h"
|
||||
|
||||
@@ -55,28 +56,26 @@ loader_shlibfunc_t shlib_fdesc[DECODE_NUM_FPTR];
|
||||
|
||||
/* encoding decoding functions pointers, filled here and used when encoding/decoding */
|
||||
/*defined as extern in PHY?CODING/extern.h */
|
||||
decoder_if_t decoder16;
|
||||
decoder_if_t decoder8;
|
||||
encoder_if_t encoder;
|
||||
decoder_if_t *decoder16;
|
||||
decoder_if_t *decoder8;
|
||||
encoder_if_t *encoder;
|
||||
|
||||
extern int _may_i_use_cpu_feature(unsigned __int64);
|
||||
uint8_t nodecod(short *y,
|
||||
short *y2,
|
||||
unsigned char *decoded_bytes,
|
||||
unsigned char *decoded_bytes2,
|
||||
unsigned short n,
|
||||
unsigned short f1,
|
||||
unsigned short f2,
|
||||
unsigned char max_iterations,
|
||||
unsigned char crc_type,
|
||||
unsigned char F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats)
|
||||
uint8_t nodecod(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats)
|
||||
{
|
||||
return max_iterations+1;
|
||||
};
|
||||
@@ -86,24 +85,24 @@ void decoding_setmode (int mode) {
|
||||
case MODE_DECODE_NONE:
|
||||
decoder8=nodecod;
|
||||
decoder16=nodecod;
|
||||
encoder=(encoder_if_t)shlib_fdesc[ENCODE_C_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t*)shlib_fdesc[ENCODE_C_FPTRIDX].fptr;
|
||||
break;
|
||||
case MODE_DECODE_C:
|
||||
decoder16=(decoder_if_t)shlib_fdesc[DECODE_TD_C_FPTRIDX].fptr;
|
||||
decoder8=(decoder_if_t)shlib_fdesc[DECODE_TD_C_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t)shlib_fdesc[ENCODE_C_FPTRIDX].fptr;
|
||||
decoder16=(decoder_if_t*)shlib_fdesc[DECODE_TD_C_FPTRIDX].fptr;
|
||||
decoder8=(decoder_if_t*)shlib_fdesc[DECODE_TD_C_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t*)shlib_fdesc[ENCODE_C_FPTRIDX].fptr;
|
||||
break;
|
||||
case MODE_DECODE_AVX2:
|
||||
decoder16=(decoder_if_t)shlib_fdesc[DECODE_TD16_AVX2_FPTRIDX].fptr;
|
||||
decoder8=(decoder_if_t)shlib_fdesc[DECODE_TD8_SSE_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t)shlib_fdesc[ENCODE_SSE_FPTRIDX].fptr;
|
||||
decoder16=(decoder_if_t*)shlib_fdesc[DECODE_TD16_AVX2_FPTRIDX].fptr;
|
||||
decoder8=(decoder_if_t*)shlib_fdesc[DECODE_TD8_SSE_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t*)shlib_fdesc[ENCODE_SSE_FPTRIDX].fptr;
|
||||
break;
|
||||
default:
|
||||
mode=MODE_DECODE_SSE;
|
||||
case MODE_DECODE_SSE:
|
||||
decoder8=(decoder_if_t)shlib_fdesc[DECODE_TD8_SSE_FPTRIDX].fptr;
|
||||
decoder16=(decoder_if_t)shlib_fdesc[DECODE_TD16_SSE_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t)shlib_fdesc[ENCODE_SSE_FPTRIDX].fptr;
|
||||
decoder8=(decoder_if_t*)shlib_fdesc[DECODE_TD8_SSE_FPTRIDX].fptr;
|
||||
decoder16=(decoder_if_t*)shlib_fdesc[DECODE_TD16_SSE_FPTRIDX].fptr;
|
||||
encoder=(encoder_if_t*)shlib_fdesc[ENCODE_SSE_FPTRIDX].fptr;
|
||||
break;
|
||||
}
|
||||
curmode=mode;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "lte_interleaver.h"
|
||||
#include "lte_interleaver2.h"
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
typedef struct interleaver_codebook {
|
||||
unsigned long nb_bits;
|
||||
unsigned short f1;
|
||||
unsigned short f2;
|
||||
unsigned int beg_index;
|
||||
} t_interleaver_codebook;
|
||||
#ifndef INCL_INTERLEAVE
|
||||
extern t_interleaver_codebook f1f2mat[];
|
||||
extern short il_tb[];
|
||||
extern short reverse_il_tl[];
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,210 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
unsigned short f1f2mat_old[2*188] = {3, 10,
|
||||
7, 12,
|
||||
19, 42,
|
||||
7, 16,
|
||||
7, 18,
|
||||
11, 20,
|
||||
5, 22,
|
||||
11, 24,
|
||||
7, 26,
|
||||
41, 84,
|
||||
103, 90,
|
||||
15, 32,
|
||||
9, 34,
|
||||
17, 108,
|
||||
9, 38,
|
||||
21, 120,
|
||||
101, 84,
|
||||
21, 44,
|
||||
57, 46,
|
||||
23, 48,
|
||||
13, 50,
|
||||
27, 52,
|
||||
11, 36,
|
||||
27, 56,
|
||||
85, 58,
|
||||
29, 60,
|
||||
33, 62,
|
||||
15, 32,
|
||||
17, 198,
|
||||
33, 68,
|
||||
103, 210,
|
||||
19, 36,
|
||||
19, 74,
|
||||
37, 76,
|
||||
19, 78,
|
||||
21, 120,
|
||||
21, 82,
|
||||
115, 84,
|
||||
193, 86,
|
||||
21, 44,
|
||||
133, 90,
|
||||
81, 46,
|
||||
45, 94,
|
||||
23, 48,
|
||||
243, 98,
|
||||
151, 40,
|
||||
155, 102,
|
||||
25, 52,
|
||||
51, 106,
|
||||
47, 72,
|
||||
91, 110,
|
||||
29, 168,
|
||||
29, 114,
|
||||
247, 58,
|
||||
29, 118,
|
||||
89, 180,
|
||||
91, 122,
|
||||
157, 62,
|
||||
55, 84,
|
||||
31, 64,
|
||||
17, 66,
|
||||
35, 68,
|
||||
227, 420,
|
||||
65, 96,
|
||||
19, 74,
|
||||
37, 76,
|
||||
41, 234,
|
||||
39, 80,
|
||||
185, 82,
|
||||
43, 252,
|
||||
21, 86,
|
||||
155, 44,
|
||||
79, 120,
|
||||
139, 92,
|
||||
23, 94,
|
||||
217, 48,
|
||||
25, 98,
|
||||
17, 80,
|
||||
127, 102,
|
||||
25, 52,
|
||||
239, 106,
|
||||
17, 48,
|
||||
137, 110,
|
||||
215, 112,
|
||||
29, 114,
|
||||
15, 58,
|
||||
147, 118,
|
||||
29, 60,
|
||||
59, 122,
|
||||
65, 124,
|
||||
55, 84,
|
||||
31, 64,
|
||||
17, 66,
|
||||
171, 204,
|
||||
67, 140,
|
||||
35, 72,
|
||||
19, 74,
|
||||
39, 76,
|
||||
19, 78,
|
||||
199, 240,
|
||||
21, 82,
|
||||
211, 252,
|
||||
21, 86,
|
||||
43, 88,
|
||||
149, 60,
|
||||
45, 92,
|
||||
49, 846,
|
||||
71, 48,
|
||||
13, 28,
|
||||
17, 80,
|
||||
25, 102,
|
||||
183, 104,
|
||||
55, 954,
|
||||
127, 96,
|
||||
27, 110,
|
||||
29, 112,
|
||||
29, 114,
|
||||
57, 116,
|
||||
45, 354,
|
||||
31, 120,
|
||||
59, 610,
|
||||
185, 124,
|
||||
113, 420,
|
||||
31, 64,
|
||||
17, 66,
|
||||
171, 136,
|
||||
209, 420,
|
||||
253, 216,
|
||||
367, 444,
|
||||
265, 456,
|
||||
181, 468,
|
||||
39, 80,
|
||||
27, 164,
|
||||
127, 504,
|
||||
143, 172,
|
||||
43, 88,
|
||||
29, 300,
|
||||
45, 92,
|
||||
157, 188,
|
||||
47, 96,
|
||||
13, 28,
|
||||
111, 240,
|
||||
443, 204,
|
||||
51, 104,
|
||||
51, 212,
|
||||
451, 192,
|
||||
257, 220,
|
||||
57, 336,
|
||||
313, 228,
|
||||
271, 232,
|
||||
179, 236,
|
||||
331, 120,
|
||||
363, 244,
|
||||
375, 248,
|
||||
127, 168,
|
||||
31, 64,
|
||||
33, 130,
|
||||
43, 264,
|
||||
33, 134,
|
||||
477, 408,
|
||||
35, 138,
|
||||
233, 280,
|
||||
357, 142,
|
||||
337, 480,
|
||||
37, 146,
|
||||
71, 444,
|
||||
71, 120,
|
||||
37, 152,
|
||||
39, 462,
|
||||
127, 234,
|
||||
39, 158,
|
||||
39, 80,
|
||||
31, 96,
|
||||
113, 902,
|
||||
41, 166,
|
||||
251, 336,
|
||||
43, 170,
|
||||
21, 86,
|
||||
43, 174,
|
||||
45, 176,
|
||||
45, 178,
|
||||
161, 120,
|
||||
89, 182,
|
||||
323, 184,
|
||||
47, 186,
|
||||
23, 94,
|
||||
47, 190,
|
||||
263, 480
|
||||
};
|
||||
@@ -265,8 +265,6 @@ int dlsch_encoding_2threads0(te_params *tep) {
|
||||
unsigned int total_worker = tep->total_worker;
|
||||
unsigned int current_worker = tep->current_worker;
|
||||
|
||||
unsigned short iind;
|
||||
|
||||
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
|
||||
unsigned int Kr=0,Kr_bytes,r,r_offset=0;
|
||||
// unsigned short m=dlsch->harq_processes[harq_pid]->mcs;
|
||||
@@ -285,28 +283,10 @@ int dlsch_encoding_2threads0(te_params *tep) {
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// 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)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
encoder(dlsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&dlsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36121-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14)
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0
|
||||
);
|
||||
dlsch->harq_processes[harq_pid]->RTC[r] =
|
||||
sub_block_interleaving_turbo(4+(Kr_bytes*8),
|
||||
@@ -416,7 +396,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
unsigned int G;
|
||||
unsigned int crc=1;
|
||||
unsigned short iind;
|
||||
|
||||
unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
if(harq_pid >= dlsch->Mdlharq) {
|
||||
@@ -505,28 +484,11 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// 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)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
start_meas(te_stats);
|
||||
encoder(dlsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&dlsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36121-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14)
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
|
||||
@@ -738,7 +700,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
|
||||
unsigned int G;
|
||||
unsigned int crc=1;
|
||||
unsigned short iind;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
@@ -813,21 +774,6 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// 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)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||
// generate codewords
|
||||
@@ -839,16 +785,11 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
||||
#endif
|
||||
start_meas(te_stats);
|
||||
encoder(dlsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&dlsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36121-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14)
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
|
||||
@@ -228,7 +228,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
int harq_pid = tdp->harq_pid;
|
||||
int llr8_flag = tdp->llr8_flag;
|
||||
|
||||
unsigned int r,r_offset=0,Kr,Kr_bytes,iind;
|
||||
unsigned int r,r_offset=0,Kr,Kr_bytes;
|
||||
uint8_t crc_type;
|
||||
int offset = 0;
|
||||
int ret = 1;
|
||||
@@ -240,7 +240,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
uint32_t E=0;
|
||||
uint32_t Gp,GpmodC,Nl=1;
|
||||
uint32_t C = ulsch_harq->C;
|
||||
decoder_if_t tc;
|
||||
decoder_if_t *tc;
|
||||
|
||||
if (llr8_flag == 0)
|
||||
tc = decoder16;
|
||||
@@ -260,18 +260,6 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
AssertFatal(1==0,"ulsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
}
|
||||
|
||||
// This is stolen from rate-matching algorithm to get the value of E
|
||||
|
||||
Gp = G/Nl/Q_m;
|
||||
@@ -304,23 +292,6 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
LOG_E(PHY,"ulsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? ulsch_harq->F : 0);
|
||||
#endif
|
||||
|
||||
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
|
||||
ulsch_harq->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
|
||||
(uint8_t*)&dummy_w[r][0],
|
||||
@@ -372,8 +343,6 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
ulsch_harq->c[r],
|
||||
NULL,
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
ulsch->max_turbo_iterations,//MAX_TURBO_ITERATIONS,
|
||||
crc_type,
|
||||
(r==0) ? ulsch_harq->F : 0,
|
||||
@@ -444,7 +413,7 @@ void *td_thread(void *param) {
|
||||
int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) {
|
||||
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
unsigned int r,r_offset=0,Kr,Kr_bytes,iind;
|
||||
unsigned int r,r_offset=0,Kr,Kr_bytes;
|
||||
uint8_t crc_type;
|
||||
int offset = 0;
|
||||
int ret = 1;
|
||||
@@ -455,7 +424,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
|
||||
int G = ulsch_harq->G;
|
||||
unsigned int E;
|
||||
int Cby2;
|
||||
decoder_if_t tc;
|
||||
decoder_if_t *tc;
|
||||
|
||||
struct timespec wait;
|
||||
|
||||
@@ -516,23 +485,6 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
LOG_E(PHY,"ulsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? ulsch_harq->F : 0);
|
||||
#endif
|
||||
|
||||
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
|
||||
ulsch_harq->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
|
||||
(uint8_t*)&dummy_w[r][0],
|
||||
@@ -589,8 +541,6 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
|
||||
ulsch_harq->c[r],
|
||||
NULL,
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
ulsch->max_turbo_iterations,//MAX_TURBO_ITERATIONS,
|
||||
crc_type,
|
||||
(r==0) ? ulsch_harq->F : 0,
|
||||
@@ -640,7 +590,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
|
||||
|
||||
int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) {
|
||||
|
||||
unsigned int r,r_offset=0,Kr,Kr_bytes,iind;
|
||||
unsigned int r,r_offset=0,Kr,Kr_bytes;
|
||||
uint8_t crc_type;
|
||||
int offset = 0;
|
||||
int ret = 1;
|
||||
@@ -650,7 +600,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
|
||||
int G = ulsch_harq->G;
|
||||
unsigned int E;
|
||||
decoder_if_t tc;
|
||||
decoder_if_t *tc;
|
||||
|
||||
if (llr8_flag == 0)
|
||||
tc = *decoder16;
|
||||
@@ -669,23 +619,6 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
LOG_E(PHY,"ulsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? ulsch_harq->F : 0);
|
||||
#endif
|
||||
|
||||
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
|
||||
ulsch_harq->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
|
||||
(uint8_t*)&dummy_w[r][0],
|
||||
@@ -742,8 +675,6 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
ulsch_harq->c[r],
|
||||
NULL,
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
ulsch->max_turbo_iterations,//MAX_TURBO_ITERATIONS,
|
||||
crc_type,
|
||||
(r==0) ? ulsch_harq->F : 0,
|
||||
|
||||
@@ -176,7 +176,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
uint32_t A,E;
|
||||
uint32_t G;
|
||||
uint32_t ret,offset;
|
||||
uint16_t iind;
|
||||
// uint8_t dummy_channel_output[(3*8*block_length)+12];
|
||||
short dummy_w[MAX_NUM_DLSCH_SEGMENTS][3*(6144+64)];
|
||||
uint32_t r,r_offset=0,Kr,Kr_bytes,err_flag=0;
|
||||
@@ -184,7 +183,30 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
uint16_t i;
|
||||
#endif
|
||||
decoder_if_t tc;
|
||||
//#ifdef __AVX2__
|
||||
#if 0
|
||||
int Kr_last,skipped_last=0;
|
||||
uint8_t (*tc_2cw)(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *,
|
||||
uint8_t *,
|
||||
uint16_t,
|
||||
uint16_t,
|
||||
uint16_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *);
|
||||
|
||||
#endif
|
||||
decoder_if_t *tc;
|
||||
|
||||
|
||||
if (!dlsch_llr) {
|
||||
printf("dlsch_decoding.c: NULL dlsch_llr pointer\n");
|
||||
@@ -314,23 +336,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? harq_process->F : 0);
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_rate_unmatching_stats);
|
||||
#endif
|
||||
@@ -451,8 +456,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
harq_process->c[r],
|
||||
NULL,
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
@@ -479,8 +482,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
(&harq_process->d[r][96],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
@@ -522,8 +523,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
harq_process->c[r-1],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
@@ -539,8 +538,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
(&harq_process->d[r-1][96],
|
||||
harq_process->c[r-1],
|
||||
Kr_last,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
@@ -565,8 +562,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
(&harq_process->d[r-1][96],
|
||||
harq_process->c[r-1],
|
||||
Kr_last,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
@@ -587,8 +582,6 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
(&harq_process->d[r][96],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
@@ -731,7 +724,6 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue,
|
||||
|
||||
unsigned int G;
|
||||
unsigned int crc=1;
|
||||
unsigned short iind;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
unsigned char harq_pid = ue->dlsch[subframe&2][0][0]->rnti;
|
||||
@@ -801,21 +793,6 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue,
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// 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)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||
// generate codewords
|
||||
@@ -827,16 +804,11 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue,
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
||||
#endif
|
||||
start_meas(te_stats);
|
||||
encoder(dlsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&dlsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36121-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14)
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
|
||||
@@ -191,7 +191,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
// uint16_t offset;
|
||||
uint32_t crc=1;
|
||||
uint16_t iind;
|
||||
uint32_t A;
|
||||
uint8_t Q_m=0;
|
||||
uint32_t Kr=0,Kr_bytes,r,r_offset=0;
|
||||
@@ -335,22 +334,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// 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)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
LOG_E(PHY,"ulsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||
// generate codewords
|
||||
@@ -364,16 +347,11 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
// offset=0;
|
||||
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
||||
#endif
|
||||
start_meas(te_stats);
|
||||
encoder(ulsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&ulsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? ulsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36212-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36212-820, page 14)
|
||||
(r==0) ? ulsch->harq_processes[harq_pid]->F : 0
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
|
||||
@@ -957,13 +957,11 @@ extern int sync_var;
|
||||
#define DECODE_NUM_FPTR 13
|
||||
|
||||
|
||||
typedef uint8_t(*decoder_if_t)(int16_t *y,
|
||||
typedef uint8_t(decoder_if_t)(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint16_t f1,
|
||||
uint16_t f2,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
@@ -975,12 +973,10 @@ typedef uint8_t(*decoder_if_t)(int16_t *y,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats);
|
||||
|
||||
typedef uint8_t(*encoder_if_t)(uint8_t *input,
|
||||
typedef uint8_t(encoder_if_t)(uint8_t *input,
|
||||
uint16_t input_length_bytes,
|
||||
uint8_t *output,
|
||||
uint8_t F,
|
||||
uint16_t interleaver_f1,
|
||||
uint16_t interleaver_f2);
|
||||
uint8_t F);
|
||||
|
||||
|
||||
static inline void wait_sync(char *thread_name) {
|
||||
|
||||
@@ -38,7 +38,6 @@ int16_t *primary_synch1_time;
|
||||
int16_t *primary_synch2_time;
|
||||
|
||||
|
||||
#include "PHY/CODING/coding_vars.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ int16_t *primary_synch1_time;
|
||||
int16_t *primary_synch2_time;
|
||||
|
||||
|
||||
#include "PHY/CODING/coding_vars.h"
|
||||
|
||||
//PHY_VARS *PHY_vars;
|
||||
#ifndef OCP_FRAMEWORK
|
||||
|
||||
Reference in New Issue
Block a user