?? slotbits.c
字號:
/***********************************************************************************/
/* IS54 Baseband Simulation Software */
/* */
/* File Description : IS54 Slot Formatting Utility Routines */
/* File Name : slotbits.c */
/* Date : 12/30/93 */
/* : July, 20001 - Modified for TMS320C55x project */
/* */
/* This module contains slot construction and decomposition */
/* utility routines for use in the IS54 baseband simulation program. */
/* */
/* The six routines and 5 tables used in this module may be */
/* associated by functionality in the following manner: */
/* */
/* vselp[] <-> cl1[], cl2[] Conversions: */
/* */
/* Tables: cl1_vselp_table[] */
/* cl2_vselp_table[] */
/* */
/* Functions : get_cl1_cl2() */
/* get_vselp() */
/* */
/* slot_data[] <-> cc0[], cc1[], cl2[] Conversions: */
/* */
/* Tables: cc0_table[] */
/* cc1_table[] */
/* cl2_table[] */
/* */
/* Functions: build_slot_data() */
/* extract_slot_bits() */
/* */
/* slot[] <-> slot_data[] Conversions: */
/* */
/* Tables : NONE */
/* */
/* Functions: build_slot() */
/* get_slot_data() */
/* */
/* Functions: */
/* */
/* get_cl1_cl2() : This function extracts class bits (cl1[], cl2[]) */
/* from VSELP parameters (vselp[]) using the */
/* conversion tables: cl1_vselp_table[] and */
/* cl2_vselp_table[]. */
/* */
/* get_vselp() : This function extracts VSELP parameters */
/* (vselp[]) from class bits (cl1[], cl2[]) using */
/* the conversion tables: cl1_vselp_table[] and */
/* cl2_vselp_table[]. */
/* */
/* build_slot_data() : This function generates 260-bit slot data from */
/* the class 2 bits (cl2[]) and the cc0[] and cc1[] */
/* bitarrays using the conversion tables: */
/* cc0_table[], cc1_table[] and cl2_table[]. */
/* */
/* extract_slot_bits() : This function extracts the class 2 bits (cl2[]) */
/* and the cc0[] and cc1[] bit arrays from 260-bit */
/* slot data using the conversion tables: */
/* cc0_table[], cc1_table[] and cl2_table[]. */
/* */
/* build_slot() : This function formats a 324-bit slot from */
/* 260-bit slot data and the sync word for slot #1. */
/* */
/* get_slot_data() : This function extracts 260-bit slot data from a */
/* 324-bit slot. */
/* */
/* Tables: */
/* */
/* cl1_vselp_table[] : This table is used for vselp[] <-> cl1[] */
/* conversions. Each cl1[] bit has an associated */
/* two-element entry in this table. The 1st entry */
/* identifies the VSELP parameter associated with */
/* this bit, while the second entry identifies the */
/* specific bit in the VSELP parameter associated */
/* with this bit. */
/* */
/* cl2_vselp_table[] : This table is used for vselp[] <-> cl2[] */
/* conversions. Each cl2[] bit has an associated */
/* two-element entry in this table. The 1st entry */
/* identifies the VSELP parameter associated with */
/* this bit, while the second entry identifies the */
/* specific bit in the VSELP parameter associated */
/* with this bit. */
/* */
/* cc0_table[] : This table is used for slot_data[] <-> cc0[] */
/* conversions. Each cc0[] bit has a 1-element */
/* entry in this table which identifies the */
/* associated slot data bit index (0-259). */
/* */
/* cc1_table[] : This table is used for slot_data[] <-> cc1[] */
/* conversions. Each cc1[] bit has a 1-element */
/* entry in this table which identifies the */
/* associated slot data bit index (0-259). */
/* */
/* cl2_table[] : This table is used for slot_data[] <-> cl2[] */
/* conversions. Each cl2[] bit has a 1-element */
/* entry in this table which identifies the */
/* associated slot data bit index (0-259). */
/* */
/***********************************************************************************/
/* Include Files */
#include "vselp.h"
/* Defines */
#define BIT0 0x0001
#define BIT1 0x0002
#define BIT2 0x0004
#define BIT3 0x0008
#define BIT4 0x0010
#define BIT5 0x0020
#define BIT6 0x0040
#define BIT7 0x0080
/* Function Prototypes */
void get_cl1_cl2( unsigned*, unsigned*, unsigned* );
void get_vselp( unsigned*, unsigned*, unsigned* );
void build_slot_data( unsigned*, unsigned*, unsigned*, unsigned* );
void extract_slot_bits( unsigned*, unsigned*, unsigned*, unsigned* );
void build_slot( unsigned*, unsigned* );
void get_slot_data( unsigned*, unsigned* );
/* External Function Prototypes */
/* Data */
unsigned cl1_vselp_table[89*2] = {
VSELP_CRC, BIT6, /* 0 */
VSELP_CRC, BIT4,
VSELP_CRC, BIT2,
VSELP_CRC, BIT0,
VSELP_R0, BIT3,
VSELP_R0, BIT2,
VSELP_LPC3, BIT4,
VSELP_LPC4, BIT3,
VSELP_LPC1, BIT3,
VSELP_LPC5, BIT3,
VSELP_LAG_2, BIT6, /* 10 */
VSELP_LAG_4, BIT6,
VSELP_LAG_2, BIT5,
VSELP_LAG_4, BIT5,
VSELP_LAG_2, BIT4,
VSELP_LAG_4, BIT4,
VSELP_LAG_2, BIT3,
VSELP_LAG_4, BIT3,
VSELP_GSPO_2, BIT7,
VSELP_GSPO_4, BIT7,
VSELP_LAG_2, BIT2, /* 20 */
VSELP_LAG_4, BIT2,
VSELP_LAG_2, BIT1,
VSELP_LAG_4, BIT1,
VSELP_LAG_2, BIT0,
VSELP_LAG_4, BIT0,
VSELP_GSPO_1, BIT6,
VSELP_GSPO_3, BIT6,
VSELP_R0, BIT1,
VSELP_GSPO_1, BIT5,
VSELP_GSPO_3, BIT5, /* 30 */
VSELP_LPC1, BIT2,
VSELP_LPC3, BIT2,
VSELP_GSPO_2, BIT4,
VSELP_GSPO_4, BIT4,
VSELP_GSPO_2, BIT3,
VSELP_GSPO_4, BIT3,
VSELP_GSPO_2, BIT2,
VSELP_GSPO_4, BIT2,
VSELP_GSPO_2, BIT1,
VSELP_GSPO_4, BIT1, /* 40 */
VSELP_GSPO_2, BIT0,
VSELP_GSPO_3, BIT0,
VSELP_GSPO_1, BIT0,
VSELP_GSPO_3, BIT1,
VSELP_GSPO_1, BIT1,
VSELP_GSPO_3, BIT2,
VSELP_GSPO_1, BIT2,
VSELP_GSPO_3, BIT3,
VSELP_GSPO_1, BIT3,
VSELP_GSPO_3, BIT4, /* 50 */
VSELP_GSPO_1, BIT4,
VSELP_LPC2, BIT2,
VSELP_GSPO_4, BIT5,
VSELP_GSPO_2, BIT5,
VSELP_LPC4, BIT2,
VSELP_GSPO_4, BIT6,
VSELP_GSPO_2, BIT6,
VSELP_GSPO_4, BIT0,
VSELP_LAG_3, BIT0,
VSELP_LAG_1, BIT0, /* 60 */
VSELP_LAG_3, BIT1,
VSELP_LAG_1, BIT1,
VSELP_LAG_3, BIT2,
VSELP_LAG_1, BIT2,
VSELP_GSPO_3, BIT7,
VSELP_GSPO_1, BIT7,
VSELP_LAG_3, BIT3,
VSELP_LAG_1, BIT3,
VSELP_LAG_3, BIT4,
VSELP_LAG_1, BIT4, /* 70 */
VSELP_LAG_3, BIT5,
VSELP_LAG_1, BIT5,
VSELP_LAG_3, BIT6,
VSELP_LAG_1, BIT6,
VSELP_LPC3, BIT3,
VSELP_LPC2, BIT3,
VSELP_LPC1, BIT4,
VSELP_LPC2, BIT4,
VSELP_LPC1, BIT5,
VSELP_R0, BIT4, /* 80 */
VSELP_CRC, BIT1,
VSELP_CRC, BIT3,
VSELP_CRC, BIT5,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0 /* 88 */
};
unsigned cl2_vselp_table[82*2] = {
VSELP_CODE2_4, BIT0, /* 0 */
VSELP_CODE2_4, BIT1,
VSELP_CODE2_4, BIT2,
VSELP_CODE2_4, BIT3,
VSELP_CODE2_4, BIT4,
VSELP_CODE2_4, BIT5,
VSELP_CODE2_4, BIT6,
VSELP_CODE1_4, BIT0,
VSELP_CODE1_4, BIT1,
VSELP_CODE1_4, BIT2,
VSELP_CODE1_4, BIT3, /* 10 */
VSELP_CODE1_4, BIT4,
VSELP_CODE1_4, BIT5,
VSELP_CODE1_4, BIT6,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -