annotate qdm2data.h @ 4070:ee762ee26dc2 libavcodec

set v_edge_pos correctly for field picture mpeg2
author michael
date Tue, 24 Oct 2006 07:33:39 +0000
parents c8c591fe26f8
children 4394344397d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
1 /*
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
2 * QDM2 compatible decoder
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
3 * Copyright (c) 2003 Ewald Snel
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
4 * Copyright (c) 2005 Benjamin Larsson
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
5 * Copyright (c) 2005 Alex Beregszaszi
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
6 * Copyright (c) 2005 Roberto Togni
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
7 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3411
diff changeset
8 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3411
diff changeset
9 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3411
diff changeset
10 * FFmpeg is free software; you can redistribute it and/or
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
11 * modify it under the terms of the GNU Lesser General Public
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
12 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3411
diff changeset
13 * version 2.1 of the License, or (at your option) any later version.
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
14 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3411
diff changeset
15 * FFmpeg is distributed in the hope that it will be useful,
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
18 * Lesser General Public License for more details.
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
19 *
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
20 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3411
diff changeset
21 * License along with FFmpeg; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2967
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
23 *
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
24 */
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2914
diff changeset
25
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
26 /**
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
27 * @file qdm2data.h
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
28 * Various QDM2 tables.
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
29 */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
30
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
31 #ifndef QDM2DATA_H
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
32 #define QDM2DATA_H
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
33
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
34 /** VLC TABLES **/
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
35
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
36 /* values in this table range from -1..23; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
37 static const uint16_t vlc_tab_level_huffcodes[24] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
38 0x037c, 0x0004, 0x003c, 0x004c, 0x003a, 0x002c, 0x001c, 0x001a,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
39 0x0024, 0x0014, 0x0001, 0x0002, 0x0000, 0x0003, 0x0007, 0x0005,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
40 0x0006, 0x0008, 0x0009, 0x000a, 0x000c, 0x00fc, 0x007c, 0x017c
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
41 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
42
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
43 static const uint8_t vlc_tab_level_huffbits[24] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
44 10, 6, 7, 7, 6, 6, 6, 6, 6, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 7, 8, 9, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
45 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
46
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
47 /* values in this table range from -1..36; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
48 static const uint16_t vlc_tab_diff_huffcodes[37] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
49 0x1c57, 0x0004, 0x0000, 0x0001, 0x0003, 0x0002, 0x000f, 0x000e,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
50 0x0007, 0x0016, 0x0037, 0x0027, 0x0026, 0x0066, 0x0006, 0x0097,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
51 0x0046, 0x01c6, 0x0017, 0x0786, 0x0086, 0x0257, 0x00d7, 0x0357,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
52 0x00c6, 0x0386, 0x0186, 0x0000, 0x0157, 0x0c57, 0x0057, 0x0000,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
53 0x0b86, 0x0000, 0x1457, 0x0000, 0x0457
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
54 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
55
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
56 static const uint8_t vlc_tab_diff_huffbits[37] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
57 13, 3, 3, 2, 3, 3, 4, 4, 6, 5, 6, 6, 7, 7, 8, 8,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
58 8, 9, 8, 11, 9, 10, 8, 10, 9, 12, 10, 0, 10, 13, 11, 0,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
59 12, 0, 13, 0, 13
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
60 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
61
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
62 /* values in this table range from -1..5; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
63 static const uint8_t vlc_tab_run_huffcodes[6] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
64 0x1f, 0x00, 0x01, 0x03, 0x07, 0x0f
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
65 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
66
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
67 static const uint8_t vlc_tab_run_huffbits[6] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
68 5, 1, 2, 3, 4, 5
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
69 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
70
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
71 /* values in this table range from -1..19; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
72 static const uint16_t vlc_tab_tone_level_idx_hi1_huffcodes[20] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
73 0x5714, 0x000c, 0x0002, 0x0001, 0x0000, 0x0004, 0x0034, 0x0054,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
74 0x0094, 0x0014, 0x0114, 0x0214, 0x0314, 0x0614, 0x0e14, 0x0f14,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
75 0x2714, 0x0714, 0x1714, 0x3714
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
76 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
77
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
78 static const uint8_t vlc_tab_tone_level_idx_hi1_huffbits[20] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
79 15, 4, 2, 1, 3, 5, 6, 7, 8, 10, 10, 11, 11, 12, 12, 12, 14, 14, 15, 14
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
80 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
81
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
82 /* values in this table range from -1..23; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
83 static const uint16_t vlc_tab_tone_level_idx_mid_huffcodes[24] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
84 0x0fea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
85 0x0000, 0x0000, 0x0000, 0x0000, 0x03ea, 0x00ea, 0x002a, 0x001a,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
86 0x0006, 0x0001, 0x0000, 0x0002, 0x000a, 0x006a, 0x01ea, 0x07ea
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
87 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
88
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
89 static const uint8_t vlc_tab_tone_level_idx_mid_huffbits[24] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
90 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
91 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
92
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
93 /* values in this table range from -1..23; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
94 static const uint16_t vlc_tab_tone_level_idx_hi2_huffcodes[24] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
95 0x0664, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0064, 0x00e4,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
96 0x00a4, 0x0068, 0x0004, 0x0008, 0x0014, 0x0018, 0x0000, 0x0001,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
97 0x0002, 0x0003, 0x000c, 0x0028, 0x0024, 0x0164, 0x0000, 0x0264
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
98 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
99
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
100 static const uint8_t vlc_tab_tone_level_idx_hi2_huffbits[24] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
101 11, 0, 0, 0, 0, 0, 10, 8, 8, 7, 6, 6, 5, 5, 4, 2, 2, 2, 4, 7, 8, 9, 0, 11
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
102 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
103
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
104 /* values in this table range from -1..8; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
105 static const uint8_t vlc_tab_type30_huffcodes[9] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
106 0x3c, 0x06, 0x00, 0x01, 0x03, 0x02, 0x04, 0x0c, 0x1c
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
107 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
108
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
109 static const uint8_t vlc_tab_type30_huffbits[9] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
110 6, 3, 3, 2, 2, 3, 4, 5, 6
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
111 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
112
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
113 /* values in this table range from -1..9; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
114 static const uint8_t vlc_tab_type34_huffcodes[10] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
115 0x18, 0x00, 0x01, 0x04, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
116 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
117
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
118 static const uint8_t vlc_tab_type34_huffbits[10] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
119 5, 4, 3, 3, 3, 3, 3, 3, 3, 5
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
120 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
121
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
122 /* values in this table range from -1..22; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
123 static const uint16_t vlc_tab_fft_tone_offset_0_huffcodes[23] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
124 0x038e, 0x0001, 0x0000, 0x0022, 0x000a, 0x0006, 0x0012, 0x0002,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
125 0x001e, 0x003e, 0x0056, 0x0016, 0x000e, 0x0032, 0x0072, 0x0042,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
126 0x008e, 0x004e, 0x00f2, 0x002e, 0x0036, 0x00c2, 0x018e
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
127 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
128
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
129 static const uint8_t vlc_tab_fft_tone_offset_0_huffbits[23] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
130 10, 1, 2, 6, 4, 5, 6, 7, 6, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 6, 6, 8, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
131 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
132
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
133 /* values in this table range from -1..27; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
134 static const uint16_t vlc_tab_fft_tone_offset_1_huffcodes[28] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
135 0x07a4, 0x0001, 0x0020, 0x0012, 0x001c, 0x0008, 0x0006, 0x0010,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
136 0x0000, 0x0014, 0x0004, 0x0032, 0x0070, 0x000c, 0x0002, 0x003a,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
137 0x001a, 0x002c, 0x002a, 0x0022, 0x0024, 0x000a, 0x0064, 0x0030,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
138 0x0062, 0x00a4, 0x01a4, 0x03a4
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
139 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
140
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
141 static const uint8_t vlc_tab_fft_tone_offset_1_huffbits[28] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
142 11, 1, 6, 6, 5, 4, 3, 6, 6, 5, 6, 6, 7, 6, 6, 6,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
143 6, 6, 6, 7, 8, 6, 7, 7, 7, 9, 10, 11
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
144 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
145
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
146 /* values in this table range from -1..31; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
147 static const uint16_t vlc_tab_fft_tone_offset_2_huffcodes[32] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
148 0x1760, 0x0001, 0x0000, 0x0082, 0x000c, 0x0006, 0x0003, 0x0007,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
149 0x0008, 0x0004, 0x0010, 0x0012, 0x0022, 0x001a, 0x0000, 0x0020,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
150 0x000a, 0x0040, 0x004a, 0x006a, 0x002a, 0x0042, 0x0002, 0x0060,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
151 0x00aa, 0x00e0, 0x00c2, 0x01c2, 0x0160, 0x0360, 0x0760, 0x0f60
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
152 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
153
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
154 static const uint8_t vlc_tab_fft_tone_offset_2_huffbits[32] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
155 13, 2, 0, 8, 4, 3, 3, 3, 4, 4, 5, 5, 6, 5, 7, 7,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
156 7, 7, 7, 7, 8, 8, 8, 9, 8, 8, 9, 9, 10, 11, 13, 12
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
157 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
158
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
159 /* values in this table range from -1..34; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
160 static const uint16_t vlc_tab_fft_tone_offset_3_huffcodes[35] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
161 0x33ea, 0x0005, 0x0000, 0x000c, 0x0000, 0x0006, 0x0003, 0x0008,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
162 0x0002, 0x0001, 0x0004, 0x0007, 0x001a, 0x000f, 0x001c, 0x002c,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
163 0x000a, 0x001d, 0x002d, 0x002a, 0x000d, 0x004c, 0x008c, 0x006a,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
164 0x00cd, 0x004d, 0x00ea, 0x020c, 0x030c, 0x010c, 0x01ea, 0x07ea,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
165 0x0bea, 0x03ea, 0x13ea
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
166 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
167
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
168 static const uint8_t vlc_tab_fft_tone_offset_3_huffbits[35] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
169 14, 4, 0, 10, 4, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
170 6, 5, 6, 7, 7, 7, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
171 12, 13, 14
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
172 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
173
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
174 /* values in this table range from -1..37; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
175 static const uint16_t vlc_tab_fft_tone_offset_4_huffcodes[38] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
176 0x5282, 0x0016, 0x0000, 0x0136, 0x0004, 0x0000, 0x0007, 0x000a,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
177 0x000e, 0x0003, 0x0001, 0x000d, 0x0006, 0x0009, 0x0012, 0x0005,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
178 0x0025, 0x0022, 0x0015, 0x0002, 0x0076, 0x0035, 0x0042, 0x00c2,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
179 0x0182, 0x00b6, 0x0036, 0x03c2, 0x0482, 0x01c2, 0x0682, 0x0882,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
180 0x0a82, 0x0082, 0x0282, 0x1282, 0x3282, 0x2282
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
181 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
182
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
183 static const uint8_t vlc_tab_fft_tone_offset_4_huffbits[38] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
184 15, 6, 0, 9, 3, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
185 6, 6, 6, 8, 7, 6, 8, 9, 9, 8, 9, 10, 11, 10, 11, 12,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
186 12, 12, 14, 15, 14, 14
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
187 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
188
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
189 /** FFT TABLES **/
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
190
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
191 /* values in this table range from -1..27; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
192 static const uint16_t fft_level_exp_alt_huffcodes[28] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
193 0x1ec6, 0x0006, 0x00c2, 0x0142, 0x0242, 0x0246, 0x00c6, 0x0046,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
194 0x0042, 0x0146, 0x00a2, 0x0062, 0x0026, 0x0016, 0x000e, 0x0005,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
195 0x0004, 0x0003, 0x0000, 0x0001, 0x000a, 0x0012, 0x0002, 0x0022,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
196 0x01c6, 0x02c6, 0x06c6, 0x0ec6
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
197 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
198
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
199 static const uint8_t fft_level_exp_alt_huffbits[28] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
200 13, 7, 8, 9, 10, 10, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
201 3, 2, 3, 3, 4, 5, 7, 8, 9, 11, 12, 13
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
202 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
203
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
204 /* values in this table range from -1..19; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
205 static const uint16_t fft_level_exp_huffcodes[20] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
206 0x0f24, 0x0001, 0x0002, 0x0000, 0x0006, 0x0005, 0x0007, 0x000c,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
207 0x000b, 0x0014, 0x0013, 0x0004, 0x0003, 0x0023, 0x0064, 0x00a4,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
208 0x0024, 0x0124, 0x0324, 0x0724
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
209 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
210
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
211 static const uint8_t fft_level_exp_huffbits[20] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
212 12, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 12
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
213 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
214
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
215 /* values in this table range from -1..6; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
216 static const uint8_t fft_stereo_exp_huffcodes[7] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
217 0x3e, 0x01, 0x00, 0x02, 0x06, 0x0e, 0x1e
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
218 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
219
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
220 static const uint8_t fft_stereo_exp_huffbits[7] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
221 6, 1, 2, 3, 4, 5, 6
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
222 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
223
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
224 /* values in this table range from -1..8; adjust retrieved value by -1 */
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
225 static const uint8_t fft_stereo_phase_huffcodes[9] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
226 0x35, 0x02, 0x00, 0x01, 0x0d, 0x15, 0x05, 0x09, 0x03
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
227 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
228
3411
5d17415fb535 Mark read-only data as const. Patch by stefan huehner org.
banan
parents: 3036
diff changeset
229 static const uint8_t fft_stereo_phase_huffbits[9] = {
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
230 6, 2, 2, 4, 4, 6, 5, 4, 2
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
231 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
232
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
233 static const int fft_cutoff_index_table[4][2] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
234 { 1, 2 }, {-1, 0 }, {-1,-2 }, { 0, 0 }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
235 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
236
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
237 static const int16_t fft_level_index_table[256] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
238 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
240 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
241 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
242 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
243 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
244 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
245 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
246 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
247 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
248 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
249 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
250 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
251 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
252 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
253 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
254 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
255
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
256 static uint8_t last_coeff[3] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
257 4, 7, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
258 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
259
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
260 static uint8_t coeff_per_sb_for_avg[3][30] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
261 { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
262 { 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
263 { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9 }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
264 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
265
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
266 static uint32_t dequant_table[3][10][30] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
267 { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
268 { 0, 256, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
269 { 0, 0, 0, 51, 102, 154, 205, 256, 238, 219, 201, 183, 165, 146, 128, 110, 91, 73, 55, 37, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
270 { 0, 0, 0, 0, 0, 0, 0, 0, 18, 37, 55, 73, 91, 110, 128, 146, 165, 183, 201, 219, 238, 256, 228, 199, 171, 142, 114, 85, 57, 28 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
271 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
272 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
273 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
274 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
275 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
276 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
277 { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
278 { 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
279 { 0, 0, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
280 { 0, 0, 0, 85, 171, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
281 { 0, 0, 0, 0, 0, 0, 85, 171, 256, 219, 183, 146, 110, 73, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
282 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 73, 110, 146, 183, 219, 256, 228, 199, 171, 142, 114, 85, 57, 28, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
283 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 57, 85, 114, 142, 171, 199, 228, 256, 213, 171, 128, 85, 43 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
284 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
285 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
286 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
287 { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
288 { 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
289 { 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
290 { 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
291 { 0, 0, 0, 0, 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
292 { 0, 0, 0, 0, 0, 0, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
293 { 0, 0, 0, 0, 0, 0, 0, 85, 171, 256, 192, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
294 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 128, 192, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
295 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 102, 154, 205, 256, 213, 171, 128, 85, 43, 0, 0, 0, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
296 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 85, 128, 171, 213, 256, 213, 171, 128, 85, 43 } }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
297 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
298
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
299 static uint8_t coeff_per_sb_for_dequant[3][30] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
300 { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
301 { 0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
302 { 0, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9 }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
303 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
304
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
305 /* first index is subband, 2nd index is 0, 1 or 3 (2 is unused) */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
306 static int8_t tone_level_idx_offset_table[30][4] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
307 { -50, -50, 0, -50 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
308 { -50, -50, 0, -50 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
309 { -50, -9, 0, -19 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
310 { -16, -6, 0, -12 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
311 { -11, -4, 0, -8 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
312 { -8, -3, 0, -6 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
313 { -7, -3, 0, -5 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
314 { -6, -2, 0, -4 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
315 { -5, -2, 0, -3 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
316 { -4, -1, 0, -3 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
317 { -4, -1, 0, -2 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
318 { -3, -1, 0, -2 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
319 { -3, -1, 0, -2 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
320 { -3, -1, 0, -2 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
321 { -2, -1, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
322 { -2, -1, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
323 { -2, -1, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
324 { -2, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
325 { -2, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
326 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
327 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
328 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
329 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
330 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
331 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
332 { -1, 0, 0, -1 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
333 { -1, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
334 { -1, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
335 { -1, 0, 0, 0 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
336 { -1, 0, 0, 0 }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
337 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
338
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
339 /* all my samples have 1st index 0 or 1 */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
340 /* second index is subband, only indexes 0-29 seem to be used */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
341 static int8_t coding_method_table[5][30] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
342 { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
343 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
344 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
345 { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
346 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
347 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
348 { 34, 30, 30, 30, 24, 24, 16, 16, 16, 16, 16, 16, 10, 10, 10,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
349 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
350 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
351 { 34, 34, 30, 30, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
352 16, 16, 16, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, 10
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
353 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
354 { 34, 34, 30, 30, 30, 30, 30, 30, 24, 24, 24, 24, 24, 24, 24,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
355 24, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
356 },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
357 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
358
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
359 static const int vlc_stage3_values[60] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
360 0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 20, 24,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
361 28, 36, 44, 52, 60, 76, 92, 108, 124, 156, 188, 220,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
362 252, 316, 380, 444, 508, 636, 764, 892, 1020, 1276, 1532, 1788,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
363 2044, 2556, 3068, 3580, 4092, 5116, 6140, 7164, 8188, 10236, 12284, 14332,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
364 16380, 20476, 24572, 28668, 32764, 40956, 49148, 57340, 65532, 81916, 98300,114684
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
365 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
366
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
367 static const float fft_tone_sample_table[4][16][5] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
368 { { .0100000000f,-.0037037037f,-.0020000000f,-.0069444444f,-.0018416207f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
369 { .0416666667f, .0000000000f, .0000000000f,-.0208333333f,-.0123456791f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
370 { .1250000000f, .0558035709f, .0330687836f,-.0164473690f,-.0097465888f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
371 { .1562500000f, .0625000000f, .0370370370f,-.0062500000f,-.0037037037f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
372 { .1996007860f, .0781250000f, .0462962948f, .0022727272f, .0013468013f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
373 { .2000000000f, .0625000000f, .0370370373f, .0208333333f, .0074074073f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
374 { .2127659619f, .0555555556f, .0329218097f, .0208333333f, .0123456791f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
375 { .2173913121f, .0473484844f, .0280583613f, .0347222239f, .0205761325f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
376 { .2173913121f, .0347222239f, .0205761325f, .0473484844f, .0280583613f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
377 { .2127659619f, .0208333333f, .0123456791f, .0555555556f, .0329218097f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
378 { .2000000000f, .0208333333f, .0074074073f, .0625000000f, .0370370370f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
379 { .1996007860f, .0022727272f, .0013468013f, .0781250000f, .0462962948f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
380 { .1562500000f,-.0062500000f,-.0037037037f, .0625000000f, .0370370370f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
381 { .1250000000f,-.0164473690f,-.0097465888f, .0558035709f, .0330687836f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
382 { .0416666667f,-.0208333333f,-.0123456791f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
383 { .0100000000f,-.0069444444f,-.0018416207f,-.0037037037f,-.0020000000f } },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2914
diff changeset
384
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
385 { { .0050000000f,-.0200000000f, .0125000000f,-.3030303030f, .0020000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
386 { .1041666642f, .0400000000f,-.0250000000f, .0333333333f,-.0200000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
387 { .1250000000f, .0100000000f, .0142857144f,-.0500000007f,-.0200000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
388 { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
389 { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
390 { .1250000000f,-.0500000000f,-.0200000000f, .0100000000f, .0142857144f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
391 { .1041666667f, .0333333333f,-.0200000000f, .0400000000f,-.0250000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
392 { .0050000000f,-.3030303030f, .0020000001f,-.0200000000f, .0125000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
393 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
394 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
395 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
396 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
397 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
398 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
399 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
400 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2914
diff changeset
401
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
402 { { .1428571492f, .1250000000f,-.0285714287f,-.0357142873f, .0208333333f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
403 { .1818181818f, .0588235296f, .0333333333f, .0212765951f, .0100000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
404 { .1818181818f, .0212765951f, .0100000000f, .0588235296f, .0333333333f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
405 { .1428571492f,-.0357142873f, .0208333333f, .1250000000f,-.0285714287f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
406 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
407 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
408 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
409 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
410 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
411 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
412 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
413 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
414 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
415 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
416 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
417 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2914
diff changeset
418
2914
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
419 { { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
420 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
421 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
422 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
423 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
424 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
425 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
426 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
427 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
428 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
429 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
430 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
431 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
432 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
433 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
434 { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
435 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
436
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
437 static const float fft_tone_level_table[2][64] = { {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
438 /* pow ~ (i > 46) ? 0 : (((((i & 1) ? 431 : 304) << (i >> 1))) / 1024.0); */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
439 0.17677669f, 0.42677650f, 0.60355347f, 0.85355347f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
440 1.20710683f, 1.68359375f, 2.37500000f, 3.36718750f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
441 4.75000000f, 6.73437500f, 9.50000000f, 13.4687500f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
442 19.0000000f, 26.9375000f, 38.0000000f, 53.8750000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
443 76.0000000f, 107.750000f, 152.000000f, 215.500000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
444 304.000000f, 431.000000f, 608.000000f, 862.000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
445 1216.00000f, 1724.00000f, 2432.00000f, 3448.00000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
446 4864.00000f, 6896.00000f, 9728.00000f, 13792.0000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
447 19456.0000f, 27584.0000f, 38912.0000f, 55168.0000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
448 77824.0000f, 110336.000f, 155648.000f, 220672.000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
449 311296.000f, 441344.000f, 622592.000f, 882688.000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
450 1245184.00f, 1765376.00f, 2490368.00f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
451 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
452 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
453 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
454 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
455 }, {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
456 /* pow = (i > 45) ? 0 : ((((i & 1) ? 431 : 304) << (i >> 1)) / 512.0); */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
457 0.59375000f, 0.84179688f, 1.18750000f, 1.68359375f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
458 2.37500000f, 3.36718750f, 4.75000000f, 6.73437500f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
459 9.50000000f, 13.4687500f, 19.0000000f, 26.9375000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
460 38.0000000f, 53.8750000f, 76.0000000f, 107.750000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
461 152.000000f, 215.500000f, 304.000000f, 431.000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
462 608.000000f, 862.000000f, 1216.00000f, 1724.00000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
463 2432.00000f, 3448.00000f, 4864.00000f, 6896.00000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
464 9728.00000f, 13792.0000f, 19456.0000f, 27584.0000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
465 38912.0000f, 55168.0000f, 77824.0000f, 110336.000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
466 155648.000f, 220672.000f, 311296.000f, 441344.000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
467 622592.000f, 882688.000f, 1245184.00f, 1765376.00f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
468 2490368.00f, 3530752.00f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
469 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
470 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
471 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
472 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
473 } };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
474
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
475 static const float fft_tone_envelope_table[4][31] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
476 { .009607375f, .038060248f, .084265202f, .146446645f, .222214907f, .308658302f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
477 .402454883f, .500000060f, .597545207f, .691341758f, .777785182f, .853553414f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
478 .915734828f, .961939812f, .990392685f, 1.00000000f, .990392625f, .961939752f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
479 .915734768f, .853553295f, .777785063f, .691341639f, .597545087f, .500000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
480 .402454853f, .308658272f, .222214878f, .146446615f, .084265172f, .038060218f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
481 .009607345f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
482 { .038060248f, .146446645f, .308658302f, .500000060f, .691341758f, .853553414f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
483 .961939812f, 1.00000000f, .961939752f, .853553295f, .691341639f, .500000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
484 .308658272f, .146446615f, .038060218f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
485 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
486 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
487 .000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
488 { .146446645f, .500000060f, .853553414f, 1.00000000f, .853553295f, .500000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
489 .146446615f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
490 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
491 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
492 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
493 .000000000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
494 { .500000060f, 1.00000000f, .500000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
495 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
496 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
497 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
498 .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
499 .000000000f }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
500 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
501
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
502 static const float sb_noise_attenuation[32] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
503 0.0f, 0.0f, 0.3f, 0.4f, 0.5f, 0.7f, 1.0f, 1.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
504 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
505 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
506 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
507 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
508
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
509 static const uint8_t fft_subpackets[32] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
510 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
511 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
512 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
513
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
514 /* first index is joined_stereo, second index is 0 or 2 (1 is unused) */
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
515 static float dequant_1bit[2][3] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
516 {-0.920000f, 0.000000f, 0.920000f },
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
517 {-0.890000f, 0.000000f, 0.890000f }
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
518 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
519
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
520 static const float type30_dequant[8] = {
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
521 -1.0f,-0.625f,-0.291666656732559f,0.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
522 0.25f,0.5f,0.75f,1.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
523 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
524
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
525 static const float type34_delta[10] = { // FIXME: covers 8 entries..
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
526 -1.0f,-0.60947573184967f,-0.333333343267441f,-0.138071194291115f,0.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
527 0.138071194291115f,0.333333343267441f,0.60947573184967f,1.0f,0.0f,
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
528 };
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
529
4a52affac0e0 QDM2 compatible decoder
rtognimp
parents:
diff changeset
530 #endif /* QDM2DATA_H */