📄 slotbits.c
字号:
VSELP_CODE2_3, BIT0,
VSELP_CODE2_3, BIT1,
VSELP_CODE2_3, BIT2,
VSELP_CODE2_3, BIT3,
VSELP_CODE2_3, BIT4,
VSELP_CODE2_3, BIT5,
VSELP_CODE2_3, BIT6, /* 20 */
VSELP_CODE1_3, BIT0,
VSELP_CODE1_3, BIT1,
VSELP_CODE1_3, BIT2,
VSELP_CODE1_3, BIT3,
VSELP_CODE1_3, BIT4,
VSELP_CODE1_3, BIT5,
VSELP_CODE1_3, BIT6,
VSELP_LPC6, BIT2,
VSELP_LPC10, BIT0,
VSELP_LPC10, BIT1, /* 30 */
VSELP_LPC9, BIT0,
VSELP_LPC9, BIT1,
VSELP_LPC9, BIT2,
VSELP_LPC8, BIT0,
VSELP_LPC8, BIT1,
VSELP_LPC8, BIT2,
VSELP_LPC7, BIT0,
VSELP_LPC7, BIT1,
VSELP_LPC7, BIT2,
VSELP_LPC6, BIT0, /* 40 */
VSELP_LPC6, BIT1,
VSELP_LPC5, BIT0,
VSELP_LPC5, BIT1,
VSELP_LPC5, BIT2,
VSELP_LPC4, BIT0,
VSELP_LPC4, BIT1,
VSELP_LPC3, BIT0,
VSELP_LPC3, BIT1,
VSELP_LPC2, BIT0,
VSELP_LPC2, BIT1, /* 50 */
VSELP_LPC1, BIT0,
VSELP_LPC1, BIT1,
VSELP_R0, BIT0,
VSELP_CODE2_2, BIT0,
VSELP_CODE2_2, BIT1,
VSELP_CODE2_2, BIT2,
VSELP_CODE2_2, BIT3,
VSELP_CODE2_2, BIT4,
VSELP_CODE2_2, BIT5,
VSELP_CODE2_2, BIT6, /* 60 */
VSELP_CODE1_2, BIT0,
VSELP_CODE1_2, BIT1,
VSELP_CODE1_2, BIT2,
VSELP_CODE1_2, BIT3,
VSELP_CODE1_2, BIT4,
VSELP_CODE1_2, BIT5,
VSELP_CODE1_2, BIT6,
VSELP_CODE2_1, BIT0,
VSELP_CODE2_1, BIT1,
VSELP_CODE2_1, BIT2, /* 70 */
VSELP_CODE2_1, BIT3,
VSELP_CODE2_1, BIT4,
VSELP_CODE2_1, BIT5,
VSELP_CODE2_1, BIT6,
VSELP_CODE1_1, BIT0,
VSELP_CODE1_1, BIT1,
VSELP_CODE1_1, BIT2,
VSELP_CODE1_1, BIT3,
VSELP_CODE1_1, BIT4,
VSELP_CODE1_1, BIT5, /* 80 */
VSELP_CODE1_1, BIT6 /* 81 */
};
unsigned cc0_table[89] = {
1, 3, 5, 7, 9, 11, 13, 15, 17, 19,
21, 23, 25, 28, 30, 32, 34, 36, 38, 40,
42, 44, 46, 48, 50, 53, 55, 57, 59, 61,
63, 65, 67, 69, 71, 73, 75, 77, 80, 82,
84, 86, 88, 90, 92, 132, 134, 136, 138, 140,
142, 144, 146, 148, 150, 152, 154, 157, 159, 161,
163, 165, 167, 169, 171, 173, 175, 177, 179, 181,
184, 186, 188, 190, 192, 194, 196, 198, 200, 202,
204, 206, 209, 211, 213, 215, 217, 219, 221
};
unsigned cc1_table[89] = {
2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
22, 24, 27, 29, 31, 33, 35, 37, 39, 41,
43, 45, 47, 49, 51, 54, 56, 58, 60, 62,
64, 66, 68, 70, 72, 74, 76, 79, 81, 83,
85, 87, 89, 91, 131, 133, 135, 137, 139, 141,
143, 145, 147, 149, 151, 153, 155, 158, 160, 162,
164, 166, 168, 170, 172, 174, 176, 178, 180, 183,
185, 187, 189, 191, 193, 195, 197, 199, 201, 203,
205, 207, 210, 212, 214, 216, 218, 220, 222
};
unsigned cl2_table[82] = {
0, 26, 52, 78, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
129, 130, 156, 182, 208, 223, 224, 225, 226, 227,
228, 229, 230, 231, 232, 233, 234, 235, 236, 237,
238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
248, 249, 250, 251, 252, 253, 254, 255, 256, 257,
258, 259
};
/* External Data */
/* Code */
/************************************************************************/
/* */
/* Function : get_cl1_cl2() */
/* */
/* Procedure : This routine extracts the class 1 and class 2 bits */
/* (cl1[] and cl2[]) from VSELP parameters (vselp[]) */
/* using the cl1_vselp_table[] and the cl2_vselp_table[] */
/* conversion tables. */
/* */
/* Inputs : */
/* [PARAMETERS] */
/* vselp : Pointer to VSELP parameter array (see vselp.h) */
/* */
/* [GLOBALS/TABLES] */
/* cl1_vselp_table[] : vselp[] <-> cl1[] conversion table. */
/* cl2_vselp_table[] : vselp[] <-> cl2[] conversion table. */
/* */
/* Outputs : */
/* cl1 : Pointer to 89-element class-1 (cl1[]) bit array. */
/* Each element of this array will be assigned */
/* a value (0 or 1) depending on the current states */
/* of the VSELP parameters. */
/* */
/* cl2 : Pointer to 82-element class-2 (cl2[]) bit array. */
/* Each element of this array will be assigned */
/* a value (0 or 1) depending on the current states */
/* of the VSELP parameters. */
/* */
/* Return Value : */
/* NONE */
/* */
/************************************************************************/
void get_cl1_cl2( unsigned *cl1, unsigned *cl2, unsigned *vselp )
{
unsigned *table_ptr;
int i;
/* vselp[] -> cl1[] Conversion */
table_ptr = cl1_vselp_table; /* Point to Conversion Table */
for( i = 0; i < 89; i++ )
{
if( vselp[ *(table_ptr++) ] & ( *(table_ptr++) ) ) *(cl1++) = 1;
else *(cl1++) = 0;
}
/* vselp[] -> cl2[] Conversion */
table_ptr = cl2_vselp_table; /* Point to Conversion Table */
for( i = 0; i < 82; i++ )
{
if( vselp[ *(table_ptr++) ] & ( *(table_ptr++) ) ) *(cl2++) = 1;
else *(cl2++) = 0;
}
return;
}
/************************************************************************/
/* */
/* Function : get_vselp() */
/* */
/* Procedure : This routine extracts the VSELP parameters (vselp[]) */
/* from the class 1 and class 2 bits (cl1[] and cl2[]) */
/* using the cl1_vselp_table[] and the cl2_vselp_table[] */
/* conversion tables. */
/* */
/* Inputs : */
/* [PARAMETERS] */
/* cl1 : Pointer to 89-element class-1 (cl1[]) bit array. */
/* Each element of this array should contain a */
/* binary value (0 or 1). */
/* */
/* cl2 : Pointer to 82-element class-2 (cl2[]) bit array. */
/* Each element of this array should contain a */
/* binary value (0 or 1). */
/* */
/* [GLOBALS/TABLES] */
/* cl1_vselp_table[] : vselp[] <-> cl1[] conversion table. */
/* cl2_vselp_table[] : vselp[] <-> cl2[] conversion table. */
/* */
/* Outputs : */
/* vselp : Pointer to VSELP parameter array (see vselp.h) */
/* All parameters are initially cleared, and then */
/* depending on the states of each cl1[] and cl2[] */
/* bit, the associated VSELP parameter and bit shall */
/* be set or cleared. */
/* */
/* Return Value : */
/* NONE */
/* */
/************************************************************************/
void get_vselp( unsigned *cl1, unsigned *cl2, unsigned *vselp )
{
unsigned *table_ptr;
int i, vselp_index;
/* Clear all VSELP parameters */
for( i = 0; i < VSELP_SIZE; i++ ) vselp[i] = 0;
/* Assign all VSELP bits associated with class-1 (cl1[]) bits */
table_ptr = cl1_vselp_table; /* Pointer to table */
for( i = 0; i < 89; i++ )
{
vselp_index = *(table_ptr++); /* Vselp Parameter Index */
if( *(cl1++) ) vselp[ vselp_index ] |= *table_ptr; /* if cl1[] bit set, set VSELP bit */
table_ptr++;
}
/* Assign all VSELP bits associated with class-2 (cl2[]) bits */
table_ptr = cl2_vselp_table; /* Pointer to table */
for( i = 0; i < 82; i++ )
{
vselp_index = *(table_ptr++); /* Vselp Parameter Index */
if( *(cl2++) ) vselp[ vselp_index ] |= *table_ptr; /* if cl2[] bit set, set VSELP bit */
table_ptr++;
}
return;
}
/************************************************************************/
/* */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -