FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/bitno.c @ 287:f00925b533b7
gsmfr-encode: convert to libgsmfr2
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Apr 2024 06:16:47 +0000 |
parents | f931e704adc5 |
children | 9beb01439a90 |
rev | line source |
---|---|
254
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module holds the bitno[] table (intermodule linkage) |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * and the set of static per-mode tables referenced from it, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * originally in bitno.tab in 3GPP reference source. |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include "typedef.h" |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include "namespace.h" |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include "int_defs.h" |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 /* parameter sizes (# of bits), one table per mode */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 static const Word16 bitno_MR475[PRMNO_MR475] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 8, 8, 7, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 8, 7, 2, 8, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 4, 7, 2, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 4, 7, 2, 8, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 4, 7, 2, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 static const Word16 bitno_MR515[PRMNO_MR515] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 8, 8, 7, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 8, 7, 2, 6, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 4, 7, 2, 6, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 4, 7, 2, 6, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 4, 7, 2, 6, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 static const Word16 bitno_MR59[PRMNO_MR59] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 8, 9, 9, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 8, 9, 2, 6, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 4, 9, 2, 6, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 8, 9, 2, 6, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 4, 9, 2, 6, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 static const Word16 bitno_MR67[PRMNO_MR67] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 8, 9, 9, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 8, 11, 3, 7, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 4, 11, 3, 7, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 8, 11, 3, 7, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 4, 11, 3, 7, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 static const Word16 bitno_MR74[PRMNO_MR74] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 8, 9, 9, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 8, 13, 4, 7, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 5, 13, 4, 7, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 8, 13, 4, 7, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 5, 13, 4, 7, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 static const Word16 bitno_MR795[PRMNO_MR795] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 9, 9, 9, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 8, 13, 4, 4, 5, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 6, 13, 4, 4, 5, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 8, 13, 4, 4, 5, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 6, 13, 4, 4, 5, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 static const Word16 bitno_MR102[PRMNO_MR102] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 8, 9, 9, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 8, 1, 1, 1, 1, 10, 10, 7, 7, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 5, 1, 1, 1, 1, 10, 10, 7, 7, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 8, 1, 1, 1, 1, 10, 10, 7, 7, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 5, 1, 1, 1, 1, 10, 10, 7, 7, /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 static const Word16 bitno_MR122[PRMNO_MR122] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 7, 8, 9, 8, 6, /* LSP VQ */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* first subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* second subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* third subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5 /* fourth subframe */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 static const Word16 bitno_MRDTX[PRMNO_MRDTX] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 3, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 8, 9, 9, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 6 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 }; |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 /* overall table with all parameter sizes for all modes */ |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 const Word16 *bitno[9] = { |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 bitno_MR475, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 bitno_MR515, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 bitno_MR59, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 bitno_MR67, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 bitno_MR74, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 bitno_MR795, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 bitno_MR102, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 bitno_MR122, |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 bitno_MRDTX |
f931e704adc5
libtwamr: bits and parameter packing
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 }; |