annotate ac3tab.h @ 3278:93110d5554ab libavcodec

Enable AMR_NB decoder/encoder when either AMR_NB or AMR_NB_FIXED is defined.
author diego
date Thu, 27 Apr 2006 11:49:15 +0000
parents c925a46f7594
children 894ef0dba687
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
1 /**
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
2 * @file ac3tab.h
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
3 * tables taken directly from AC3 spec.
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
4 */
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
5
782
dd7d5748d064 preparing integration of new AC3 decoder
bellard
parents: 0
diff changeset
6 /* possible frequencies */
2097
dd81e5be0c7a make the tables static
alex
parents: 1106
diff changeset
7 static const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
782
dd7d5748d064 preparing integration of new AC3 decoder
bellard
parents: 0
diff changeset
8
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
9 /* possible bitrates */
2097
dd81e5be0c7a make the tables static
alex
parents: 1106
diff changeset
10 static const uint16_t ac3_bitratetab[19] = {
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
11 32, 40, 48, 56, 64, 80, 96, 112, 128,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
12 160, 192, 224, 256, 320, 384, 448, 512, 576, 640
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
13 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
14
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
15 static uint8_t masktab[253];
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
16
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
17 static const uint8_t latab[260]= {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
18 0x0040,0x003f,0x003e,0x003d,0x003c,0x003b,0x003a,0x0039,0x0038,0x0037,
986e461dc072 Initial revision
glantau
parents:
diff changeset
19 0x0036,0x0035,0x0034,0x0034,0x0033,0x0032,0x0031,0x0030,0x002f,0x002f,
986e461dc072 Initial revision
glantau
parents:
diff changeset
20 0x002e,0x002d,0x002c,0x002c,0x002b,0x002a,0x0029,0x0029,0x0028,0x0027,
986e461dc072 Initial revision
glantau
parents:
diff changeset
21 0x0026,0x0026,0x0025,0x0024,0x0024,0x0023,0x0023,0x0022,0x0021,0x0021,
986e461dc072 Initial revision
glantau
parents:
diff changeset
22 0x0020,0x0020,0x001f,0x001e,0x001e,0x001d,0x001d,0x001c,0x001c,0x001b,
986e461dc072 Initial revision
glantau
parents:
diff changeset
23 0x001b,0x001a,0x001a,0x0019,0x0019,0x0018,0x0018,0x0017,0x0017,0x0016,
986e461dc072 Initial revision
glantau
parents:
diff changeset
24 0x0016,0x0015,0x0015,0x0015,0x0014,0x0014,0x0013,0x0013,0x0013,0x0012,
986e461dc072 Initial revision
glantau
parents:
diff changeset
25 0x0012,0x0012,0x0011,0x0011,0x0011,0x0010,0x0010,0x0010,0x000f,0x000f,
986e461dc072 Initial revision
glantau
parents:
diff changeset
26 0x000f,0x000e,0x000e,0x000e,0x000d,0x000d,0x000d,0x000d,0x000c,0x000c,
986e461dc072 Initial revision
glantau
parents:
diff changeset
27 0x000c,0x000c,0x000b,0x000b,0x000b,0x000b,0x000a,0x000a,0x000a,0x000a,
986e461dc072 Initial revision
glantau
parents:
diff changeset
28 0x000a,0x0009,0x0009,0x0009,0x0009,0x0009,0x0008,0x0008,0x0008,0x0008,
986e461dc072 Initial revision
glantau
parents:
diff changeset
29 0x0008,0x0008,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0006,0x0006,
986e461dc072 Initial revision
glantau
parents:
diff changeset
30 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0005,0x0005,0x0005,0x0005,
986e461dc072 Initial revision
glantau
parents:
diff changeset
31 0x0005,0x0005,0x0005,0x0005,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
986e461dc072 Initial revision
glantau
parents:
diff changeset
32 0x0004,0x0004,0x0004,0x0004,0x0004,0x0003,0x0003,0x0003,0x0003,0x0003,
986e461dc072 Initial revision
glantau
parents:
diff changeset
33 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0002,
986e461dc072 Initial revision
glantau
parents:
diff changeset
34 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
986e461dc072 Initial revision
glantau
parents:
diff changeset
35 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0001,0x0001,
986e461dc072 Initial revision
glantau
parents:
diff changeset
36 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
986e461dc072 Initial revision
glantau
parents:
diff changeset
37 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
986e461dc072 Initial revision
glantau
parents:
diff changeset
38 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
986e461dc072 Initial revision
glantau
parents:
diff changeset
39 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
986e461dc072 Initial revision
glantau
parents:
diff changeset
40 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
986e461dc072 Initial revision
glantau
parents:
diff changeset
41 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
986e461dc072 Initial revision
glantau
parents:
diff changeset
42 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
986e461dc072 Initial revision
glantau
parents:
diff changeset
43 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
986e461dc072 Initial revision
glantau
parents:
diff changeset
44 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
45
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
46 static const uint16_t hth[50][3]= {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
47 { 0x04d0,0x04f0,0x0580 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
48 { 0x04d0,0x04f0,0x0580 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
49 { 0x0440,0x0460,0x04b0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
50 { 0x0400,0x0410,0x0450 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
51 { 0x03e0,0x03e0,0x0420 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
52 { 0x03c0,0x03d0,0x03f0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
53 { 0x03b0,0x03c0,0x03e0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
54 { 0x03b0,0x03b0,0x03d0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
55 { 0x03a0,0x03b0,0x03c0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
56 { 0x03a0,0x03a0,0x03b0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
57 { 0x03a0,0x03a0,0x03b0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
58 { 0x03a0,0x03a0,0x03b0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
59 { 0x03a0,0x03a0,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
60 { 0x0390,0x03a0,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
61 { 0x0390,0x0390,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
62 { 0x0390,0x0390,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
63 { 0x0380,0x0390,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
64 { 0x0380,0x0380,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
65 { 0x0370,0x0380,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
66 { 0x0370,0x0380,0x03a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
67 { 0x0360,0x0370,0x0390 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
68 { 0x0360,0x0370,0x0390 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
69 { 0x0350,0x0360,0x0390 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
70 { 0x0350,0x0360,0x0390 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
71 { 0x0340,0x0350,0x0380 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
72 { 0x0340,0x0350,0x0380 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
73 { 0x0330,0x0340,0x0380 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
74 { 0x0320,0x0340,0x0370 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
75 { 0x0310,0x0320,0x0360 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
76 { 0x0300,0x0310,0x0350 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
77 { 0x02f0,0x0300,0x0340 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
78 { 0x02f0,0x02f0,0x0330 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
79 { 0x02f0,0x02f0,0x0320 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
80 { 0x02f0,0x02f0,0x0310 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
81 { 0x0300,0x02f0,0x0300 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
82 { 0x0310,0x0300,0x02f0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
83 { 0x0340,0x0320,0x02f0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
84 { 0x0390,0x0350,0x02f0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
85 { 0x03e0,0x0390,0x0300 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
86 { 0x0420,0x03e0,0x0310 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
87 { 0x0460,0x0420,0x0330 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
88 { 0x0490,0x0450,0x0350 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
89 { 0x04a0,0x04a0,0x03c0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
90 { 0x0460,0x0490,0x0410 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
91 { 0x0440,0x0460,0x0470 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
92 { 0x0440,0x0440,0x04a0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
93 { 0x0520,0x0480,0x0460 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
94 { 0x0800,0x0630,0x0440 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
95 { 0x0840,0x0840,0x0450 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
96 { 0x0840,0x0840,0x04e0 },
986e461dc072 Initial revision
glantau
parents:
diff changeset
97 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
98
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
99 static const uint8_t baptab[64]= {
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
100 0, 1, 1, 1, 1, 1, 2, 2, 3, 3,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
101 3, 4, 4, 5, 5, 6, 6, 6, 6, 7,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
102 7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
103 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
104 12, 12, 12, 13, 13, 13, 13, 14, 14, 14,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
105 14, 14, 14, 14, 14, 15, 15, 15, 15, 15,
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
106 15, 15, 15, 15,
986e461dc072 Initial revision
glantau
parents:
diff changeset
107 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
108
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
109 static const uint8_t sdecaytab[4]={
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
110 0x0f, 0x11, 0x13, 0x15,
986e461dc072 Initial revision
glantau
parents:
diff changeset
111 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
112
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
113 static const uint8_t fdecaytab[4]={
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
114 0x3f, 0x53, 0x67, 0x7b,
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
115 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
116
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
117 static const uint16_t sgaintab[4]= {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
118 0x540, 0x4d8, 0x478, 0x410,
986e461dc072 Initial revision
glantau
parents:
diff changeset
119 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
120
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
121 static const uint16_t dbkneetab[4]= {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
122 0x000, 0x700, 0x900, 0xb00,
986e461dc072 Initial revision
glantau
parents:
diff changeset
123 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
124
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
125 static const uint16_t floortab[8]= {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
126 0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
986e461dc072 Initial revision
glantau
parents:
diff changeset
127 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
128
2097
dd81e5be0c7a make the tables static
alex
parents: 1106
diff changeset
129 static const uint16_t fgaintab[8]= {
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
130 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
986e461dc072 Initial revision
glantau
parents:
diff changeset
131 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
132
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
133 static const uint8_t bndsz[50]={
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
134 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
135 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
136 3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
137 };
986e461dc072 Initial revision
glantau
parents:
diff changeset
138
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2097
diff changeset
139 static uint8_t bndtab[51];
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
140
3269
c925a46f7594 Patch to generate the ac3 window, based on code by Justin Ruggles.
banan
parents: 3170
diff changeset
141 /* AC3 MDCT window */
c925a46f7594 Patch to generate the ac3 window, based on code by Justin Ruggles.
banan
parents: 3170
diff changeset
142 static int16_t ac3_window[256];
c925a46f7594 Patch to generate the ac3 window, based on code by Justin Ruggles.
banan
parents: 3170
diff changeset
143
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
144 /* fft & mdct sin cos tables */
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
145 static int16_t costab[64];
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
146 static int16_t sintab[64];
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
147 static int16_t fft_rev[512];
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
148 static int16_t xcos1[128];
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 782
diff changeset
149 static int16_t xsin1[128];