FreeCalypso > hg > gsm-codec-lib
annotate libgsmhr1/sp_rom.h @ 506:2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 19 Jun 2024 01:55:54 +0000 |
parents | |
children | 06578223a752 |
rev | line source |
---|---|
506
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /*************************************************************************** |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * Purpose: Define the structure of the Global Constants |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 **************************************************************************/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #ifndef ___ROM |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #define ___ROM |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include "typedefs.h" |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include "mathhalf.h" |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include "mathdp31.h" |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 /*_________________________________________________________________________ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 | | |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 | Data Types | |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |_________________________________________________________________________| |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 /* gsp0 vector quantizer */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 /*-----------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #define GSP0_NUM_OF_TABLES 4 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #define GSP0_NUM 32 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #define GSP0_VECTOR_SIZE 5 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 extern ShortwordRom pppsrGsp0 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 [GSP0_NUM_OF_TABLES][GSP0_NUM][GSP0_VECTOR_SIZE]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 /* unvoiced code vectors */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 /*-----------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #define UVCODEVEC_NUM_OF_CODE_BOOKS 2 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #define UVCODEVEC_NUM_OF_CODE_BITS 7 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 extern ShortwordRom pppsrUvCodeVec |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 [UVCODEVEC_NUM_OF_CODE_BOOKS][UVCODEVEC_NUM_OF_CODE_BITS][S_LEN]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 /* voiced code vectors */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 /*---------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #define VCDCODEVEC_NUM_OF_CODE_BOOKS 1 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #define VCDCODEVEC_NUM_OF_CODE_BITS 9 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 extern ShortwordRom pppsrVcdCodeVec |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 [VCDCODEVEC_NUM_OF_CODE_BOOKS][VCDCODEVEC_NUM_OF_CODE_BITS][S_LEN]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 /* vector quantizer tables */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 /*-------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #define QUANT_NUM_OF_TABLES 3 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 #define QUANT1_NUM_OF_BITS 11 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #define QUANT1_NUM_OF_ROWS (1 << QUANT1_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 #define QUANT1_NUM_OF_STAGES 3 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #define QUANT1_NUM_OF_WORDS (QUANT1_NUM_OF_ROWS*QUANT1_NUM_OF_STAGES/2) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #define QUANT2_NUM_OF_BITS 9 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #define QUANT2_NUM_OF_ROWS (1 << QUANT2_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 #define QUANT2_NUM_OF_STAGES 3 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 #define QUANT2_NUM_OF_WORDS (QUANT2_NUM_OF_ROWS*QUANT2_NUM_OF_STAGES/2) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #define QUANT3_NUM_OF_BITS 8 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #define QUANT3_NUM_OF_ROWS (1 << QUANT3_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 #define QUANT3_NUM_OF_STAGES 4 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #define QUANT3_NUM_OF_WORDS (QUANT3_NUM_OF_ROWS*QUANT3_NUM_OF_STAGES/2) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 extern ShortwordRom psrQuant1[QUANT1_NUM_OF_WORDS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 extern ShortwordRom psrQuant2[QUANT2_NUM_OF_WORDS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 extern ShortwordRom psrQuant3[QUANT3_NUM_OF_WORDS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 /* lpc pre-quantizer */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 /*-------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 #define PREQ1_NUM_OF_BITS 6 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 #define PREQ1_NUM_OF_ROWS (1 << PREQ1_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 #define PREQ1_NUM_OF_STAGES 3 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 #define PREQ1_NUM_OF_WORDS (PREQ1_NUM_OF_ROWS*PREQ1_NUM_OF_STAGES/2) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 #define PREQ2_NUM_OF_BITS 5 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 #define PREQ2_NUM_OF_ROWS (1 << PREQ2_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 #define PREQ2_NUM_OF_STAGES 3 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 #define PREQ2_NUM_OF_WORDS (PREQ2_NUM_OF_ROWS*PREQ2_NUM_OF_STAGES/2) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 #define PREQ3_NUM_OF_BITS 4 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 #define PREQ3_NUM_OF_ROWS (1 << PREQ3_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 #define PREQ3_NUM_OF_STAGES 4 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 #define PREQ3_NUM_OF_WORDS (PREQ3_NUM_OF_ROWS*PREQ3_NUM_OF_STAGES/2) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 extern ShortwordRom psrPreQ1[PREQ1_NUM_OF_WORDS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 extern ShortwordRom psrPreQ2[PREQ2_NUM_OF_WORDS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 extern ShortwordRom psrPreQ3[PREQ3_NUM_OF_WORDS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 /* size of the vq subset in the kth segment */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 /*------------------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 extern ShortwordRom psrQuantSz[QUANT_NUM_OF_TABLES]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 /* pre-quantizer size */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 /*--------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 extern ShortwordRom psrPreQSz[QUANT_NUM_OF_TABLES]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 /* reflection coeff scalar quantizer */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 /*-----------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 #define SQUANT_NUM_OF_BITS 8 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 #define SQUANT_NUM_OF_ROWS (1 << SQUANT_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 extern ShortwordRom psrSQuant[SQUANT_NUM_OF_ROWS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 /* index structure for LPC Vector Quantizer */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 /*------------------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 struct IsubLHn |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 { /* index structure for LPC Vector |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 * Quantizer */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 ShortwordRom l; /* lowest index index range |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 * from 1..NP */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 ShortwordRom h; /* highest index */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 ShortwordRom len; /* h-l+1 */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 }; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 extern struct IsubLHn psvqIndex[QUANT_NUM_OF_TABLES]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 /* square root of p0 table */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 /*-------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 #define SQRTP0_NUM_OF_BITS 5 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 #define SQRTP0_NUM_OF_ROWS (1 << SQRTP0_NUM_OF_BITS) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 #define SQRTP0_NUM_OF_MODES 3 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 extern ShortwordRom ppsrSqrtP0[SQRTP0_NUM_OF_MODES][SQRTP0_NUM_OF_ROWS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 /* interpolation filter used for C and G */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 /*---------------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 #define CGINTFILT_MACS 6 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 extern ShortwordRom ppsrCGIntFilt[CGINTFILT_MACS][OS_FCTR]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 /* interpolation filter used pitch */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 /*---------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 #define PVECINTFILT_MACS 10 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 extern ShortwordRom ppsrPVecIntFilt[PVECINTFILT_MACS][OS_FCTR]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 /* fractional pitch lag table lag*OS_FCTR */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 /*----------------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 #define LAGTBL_NUM_OF_ROWS 256 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 extern ShortwordRom psrLagTbl[LAGTBL_NUM_OF_ROWS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 /* R0 decision value table defines range (not the levels themselves */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 /*------------------------------------------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 #define R0DECTBL_NUM_OF_R0BITS 5 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 #define R0DECTBL_NUM_OF_ROWS ((1 << R0DECTBL_NUM_OF_R0BITS)*2 - 1) |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 extern ShortwordRom psrR0DecTbl[R0DECTBL_NUM_OF_ROWS]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 /* high pass filter coefficients */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 /*-------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 #define HPFCOEFS_NUM_OF_CODES 10 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 extern ShortwordRom psrHPFCoefs[HPFCOEFS_NUM_OF_CODES]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 /* spectral smoothing coefficients */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 /*---------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 #define NWCOEFS_NUM_OF_CODES 20 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 extern ShortwordRom psrNWCoefs[NWCOEFS_NUM_OF_CODES]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 /* spectral smoothing coefficients for FLAT */ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 /*------------------------------------------*/ |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 #define FLATSSTCOEFS_NUM_OF_CODES 10 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 extern LongwordRom pL_rFlatSstCoefs[FLATSSTCOEFS_NUM_OF_CODES]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 extern ShortwordRom psrOldCont[4]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 extern ShortwordRom psrNewCont[4]; |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 |
2d6da062c452
libgsmhr1/sp_rom.[ch]: import original
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 #endif |