/* default transmittion parameters */ #define DEFAULT_TFC 6 #define DEFAULT_SLOTNUM 16 #define DEFAULT_LONGTB0 320 #define DEFAULT_LONGTB1 148 #define DEFAULT_TTI 1 #define DEFAULT_TTI2 4 #define UPLINK 0 /* uplink=0 means acting as downlink */ #define FLEXIBLE 1 #define MAX_TRCH 2 #define MAX_TFC 10 #define MAX_TF 5 #define NOF_SLOTS 15 #define LONG_CODEBLOCK_TURBO MAX_LONG_CB #define LONG_CODEBLOCK_CONV 540 #define MIN_CODEBLOCK_TURBO 40 #define CODE_NO 0 #define CODE_TURBO 1 #define CODE_CONV 2 #define LOG 4 #define LIN 3 #define CONS 2 #define MAX 1 #define TAIL 3 #define ESCALA 100 #define NMOSTRESGAUSS 1000 #define DESVGAUSS 500 #define MAX_TRCH 2 #define MAX_TFC 10 #define MAX_TF 5 #define MAX_DPCCH_LONG 8 #define NOF_SLOTS 15 #define MAX_PHCH 1 #define MAX_BITSXCH NOF_SLOTS*1280 #define MAXBITSTTI 20480 // maxima velocitat de 2Mbps, nom�s a efectes de mem�ria #define MAX_LONG_CB 5114 #define MAX_CB 4 #define MAX_LONG_CODED (TURBO_RATE*MAX_LONG_CB+12) #define NUMREGISTRES_CONV 8 #define NUMREGISTRES_TURBO 3 #define TURBO_RATE 3 #define MAX_RATE 3 #define MAX_LONG_TB 2500 #define MAX_TB 8 #define MAX_LONG_CRC 64 typedef struct { int F[MAX_TRCH]; } TransFormatComb; typedef struct { unsigned short Long_TransportBlock_CRC; unsigned short Long_TransportBlock; unsigned short Num_TransportBlocks; unsigned short N_tti; unsigned short N_out_rm; unsigned short Long_CodeBlock; unsigned short Num_CodeBlocks; unsigned short Num_Bits_Fill; } DynTransFormat; typedef struct { unsigned short TTI; unsigned short Code_Type; unsigned short Code_Rate; unsigned short RM; unsigned short Long_CRC; DynTransFormat TF[MAX_TF]; unsigned short NumTF; } TrCh; typedef struct { int NumTrCH; int NumTFC; TransFormatComb TFS[MAX_TFC]; } TL3Control; typedef struct { int Ndata; unsigned char flexible; // 1 si es flexible 0 si es fixe } PhCh; struct uplink_dpdch_t { int bitrate; int symbrate; int sf; int bitsxframe; int bitsxslot; int ndata; }; struct uplink_dpcch_t { int npilot; int ntpc; int ntfci; int nfbi; }; struct downlink_dpch_t { int bitrate; int symbrate; int sf; int bitsxslot; int ndata1; int ndata2; int ntpc; int ntfci; int npilot; }; typedef struct { int F[MAX_TRCH]; } TransFormatComb_t; typedef struct { unsigned short Long_TransportBlock_CRC; unsigned short Long_TransportBlock; unsigned short Num_TransportBlocks; unsigned short N_tti; unsigned short N_out_rm; unsigned short Long_CodeBlock; unsigned short Long_out_CodeBlock; unsigned short Num_CodeBlocks; unsigned short Num_Bits_Fill; } DynTransFormat_t; typedef struct { unsigned short TTI; unsigned short Code_Type; unsigned short Code_Rate; unsigned short RM; unsigned short Long_CRC; DynTransFormat_t TF[MAX_TF]; unsigned short NumTF; } TrCh_t; typedef struct { int uplink_maxphch; int uplink_minsf; int NumTrCH; int NumTFC; TransFormatComb_t TFS[MAX_TFC]; } TL3Control_t; typedef struct { int slot_format_number; int Ndata; int fixed; /* 1yes 0no */ } Downlink_PhCh_t; typedef struct { int Ndata[MAX_TFC]; int dpdch_slotformat; int num_dpdch; } Uplink_PhCh_t; typedef struct { int deltaNtti[MAX_TRCH][MAX_TF]; int Nmax[MAX_TRCH]; int N[MAX_TRCH][MAX_TFC]; float RF[MAX_TRCH]; } TRM_control_t; struct ratem_params_t { int deltaNtti[MAX_TRCH][MAX_TF]; int deltaN[MAX_TFC][MAX_TRCH]; }; void Compute_RM_downlink_flexible(TrCh_t *TR, Downlink_PhCh_t *PH, struct ratem_params_t *control,TL3Control_t *L3Control); void Compute_RM_downlink_fixed(TrCh_t *TR, Downlink_PhCh_t *PH, struct ratem_params_t *control,TL3Control_t *L3Control); void Compute_RM_uplink(TrCh_t *TR, Uplink_PhCh_t *PH, struct ratem_params_t *control,TL3Control_t *L3Control,struct uplink_dpdch_t *up_dpdch_table); void Compute_Block_Size(TrCh_t *TR, TL3Control_t *Control); int Align_CodeBlocks(int tf, TrCh_t *TR);